cnhis-design-vue 3.1.34-beta.3 → 3.1.34-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2076,6 +2076,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2076
2076
  onActiveCellChangeStart?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeStartEventParams) => void) | undefined;
2077
2077
  onActiveCellChangeEnd?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeEndEventParams) => void) | undefined;
2078
2078
  uuid?: string | undefined;
2079
+ isTree?: 0 | 2 | 1 | 3 | undefined;
2079
2080
  showSeq?: boolean | undefined;
2080
2081
  selectType?: "checkbox" | "radio" | null | undefined;
2081
2082
  rowGroupSetting?: {
@@ -4464,6 +4465,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
4464
4465
  } | undefined;
4465
4466
  params?: any;
4466
4467
  uuid?: string | undefined;
4468
+ isTree?: 0 | 2 | 1 | 3 | undefined;
4467
4469
  showSeq?: boolean | undefined;
4468
4470
  selectType?: "checkbox" | "radio" | null | undefined;
4469
4471
  rowGroupSetting?: {
@@ -2075,6 +2075,7 @@ declare const _default: import("vue").DefineComponent<{
2075
2075
  onActiveCellChangeStart?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeStartEventParams) => void) | undefined;
2076
2076
  onActiveCellChangeEnd?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeEndEventParams) => void) | undefined;
2077
2077
  uuid?: string | undefined;
2078
+ isTree?: 0 | 2 | 1 | 3 | undefined;
2078
2079
  showSeq?: boolean | undefined;
2079
2080
  selectType?: "checkbox" | "radio" | null | undefined;
2080
2081
  rowGroupSetting?: {
@@ -4463,6 +4464,7 @@ declare const _default: import("vue").DefineComponent<{
4463
4464
  } | undefined;
4464
4465
  params?: any;
4465
4466
  uuid?: string | undefined;
4467
+ isTree?: 0 | 2 | 1 | 3 | undefined;
4466
4468
  showSeq?: boolean | undefined;
4467
4469
  selectType?: "checkbox" | "radio" | null | undefined;
4468
4470
  rowGroupSetting?: {
@@ -57,6 +57,12 @@ export declare enum IHO_TABLE_STRING_STATUS {
57
57
  NEGATIVE = "0",
58
58
  POSITIVE = "1"
59
59
  }
60
+ export declare enum IHO_TABLE_TREE_TYPE {
61
+ NOT_TREE = 0,
62
+ UNKNOWN = 1,
63
+ UNKNOWN2 = 2,
64
+ TRANSFORM_TREE_TYPE = 3
65
+ }
60
66
  export declare const IhoTableCustomEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard"];
61
67
  export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", ...("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd")[]];
62
68
  export declare const InjectionIhoTableConfig: InjectionKey<Ref<IhoTableConfig>>;
@@ -128,12 +128,14 @@ var IHO_TABLE_STRING_STATUS = /* @__PURE__ */ ((IHO_TABLE_STRING_STATUS2) => {
128
128
  IHO_TABLE_STRING_STATUS2["POSITIVE"] = "1";
129
129
  return IHO_TABLE_STRING_STATUS2;
130
130
  })(IHO_TABLE_STRING_STATUS || {});
131
- const IhoTableCustomEventNameTuple = [
132
- "formChange",
133
- "settingClick",
134
- "formClick",
135
- "keyboard"
136
- ];
131
+ var IHO_TABLE_TREE_TYPE = /* @__PURE__ */ ((IHO_TABLE_TREE_TYPE2) => {
132
+ IHO_TABLE_TREE_TYPE2[IHO_TABLE_TREE_TYPE2["NOT_TREE"] = 0] = "NOT_TREE";
133
+ IHO_TABLE_TREE_TYPE2[IHO_TABLE_TREE_TYPE2["UNKNOWN"] = 1] = "UNKNOWN";
134
+ IHO_TABLE_TREE_TYPE2[IHO_TABLE_TREE_TYPE2["UNKNOWN2"] = 2] = "UNKNOWN2";
135
+ IHO_TABLE_TREE_TYPE2[IHO_TABLE_TREE_TYPE2["TRANSFORM_TREE_TYPE"] = 3] = "TRANSFORM_TREE_TYPE";
136
+ return IHO_TABLE_TREE_TYPE2;
137
+ })(IHO_TABLE_TREE_TYPE || {});
138
+ const IhoTableCustomEventNameTuple = ["formChange", "settingClick", "formClick", "keyboard"];
137
139
  const IhoTableEventNameTuple = [...IhoTableCustomEventNameTuple, ...VxeTableEventNameList];
138
140
  const InjectionIhoTableConfig = Symbol("injectionIhoTableConfig");
139
141
  const InjectionIhoTableFieldList = Symbol("injectionIhoTableFieldList");
@@ -145,4 +147,4 @@ const InjectionIhoTableEventListener = Symbol(
145
147
  "InjectionIhoTableEventListener"
146
148
  );
147
149
 
148
- export { EDITABLE_WIDGET_TYPE, HIGHEST_PRIORITY, IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS, IhoTableCustomEventNameTuple, IhoTableEventNameTuple, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, InjectionIhoTableEventListener, InjectionIhoTableFieldList, InjectionIhoTableHandler, InjectionIhoTableInstance, InjectionIhoTableUUID, VxeEventListenerNameList, VxeTableEventNameList, WIDGET_TYPE };
150
+ export { EDITABLE_WIDGET_TYPE, HIGHEST_PRIORITY, IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS, IHO_TABLE_TREE_TYPE, IhoTableCustomEventNameTuple, IhoTableEventNameTuple, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, InjectionIhoTableEventListener, InjectionIhoTableFieldList, InjectionIhoTableHandler, InjectionIhoTableInstance, InjectionIhoTableUUID, VxeEventListenerNameList, VxeTableEventNameList, WIDGET_TYPE };
@@ -1,5 +1,5 @@
1
1
  import { mergeWith } from 'lodash-es';
2
- import { HIGHEST_PRIORITY } from '../../constants/index.js';
2
+ import { HIGHEST_PRIORITY, IHO_TABLE_TREE_TYPE } from '../../constants/index.js';
3
3
  import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
4
4
 
5
5
  function defaultConfigPlugin() {
@@ -8,7 +8,7 @@ function defaultConfigPlugin() {
8
8
  name: pluginName,
9
9
  apply(hooks) {
10
10
  hooks.configHooks.config.tap({ name: pluginName, stage: HIGHEST_PRIORITY }, (config) => {
11
- return mergeWith(
11
+ const result = mergeWith(
12
12
  {
13
13
  height: "100%",
14
14
  border: true,
@@ -28,6 +28,10 @@ function defaultConfigPlugin() {
28
28
  },
29
29
  config
30
30
  );
31
+ if (config.isTree === IHO_TABLE_TREE_TYPE.TRANSFORM_TREE_TYPE) {
32
+ result.treeConfig = { ...config.treeConfig, transform: true };
33
+ }
34
+ return result;
31
35
  });
32
36
  }
33
37
  });
@@ -1,4 +1,4 @@
1
- import { defineComponent, inject, ref, onDeactivated, watch, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle } from 'vue';
1
+ import { defineComponent, inject, ref, onDeactivated, watch, computed, openBlock, createElementBlock, createElementVNode, renderSlot, createVNode, unref, withCtx, createTextVNode, toDisplayString, normalizeClass, Fragment, renderList, normalizeStyle } from 'vue';
2
2
  import { widthAppend } from '../../../../../shared/utils/index.js';
3
3
  import { FunnelSharp } from '@vicons/ionicons5';
4
4
  import { useVModel, useVirtualList } from '@vueuse/core';
@@ -7,9 +7,10 @@ import { InjectionIhoTableUUID } from '../../constants/index.js';
7
7
  import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
8
8
 
9
9
  const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
10
- const _hoisted_2 = { class: "iho-table__filterWrapper" };
11
- const _hoisted_3 = ["onClick"];
12
- const _hoisted_4 = { class: "iho-table__filterFooter" };
10
+ const _hoisted_2 = { style: { "max-width": "calc(100% - 22px)" } };
11
+ const _hoisted_3 = { class: "iho-table__filterWrapper" };
12
+ const _hoisted_4 = ["onClick"];
13
+ const _hoisted_5 = { class: "iho-table__filterFooter" };
13
14
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
15
  __name: "filter",
15
16
  props: {
@@ -77,12 +78,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
78
  });
78
79
  return (_ctx, _cache) => {
79
80
  return openBlock(), createElementBlock("section", _hoisted_1, [
80
- createVNode(unref(NEllipsis), { style: { "max-width": "calc(100% - 22px)" } }, {
81
- default: withCtx(() => [
82
- createTextVNode(toDisplayString(__props.payload.column.title), 1)
83
- ]),
84
- _: 1
85
- }),
81
+ createElementVNode("section", _hoisted_2, [
82
+ renderSlot(_ctx.$slots, "header", {}, () => [
83
+ createVNode(unref(NEllipsis), null, {
84
+ default: withCtx(() => [
85
+ createTextVNode(toDisplayString(__props.payload.column.title), 1)
86
+ ]),
87
+ _: 1
88
+ })
89
+ ])
90
+ ]),
86
91
  createVNode(unref(NPopover), {
87
92
  to: `#${unref(uuid)}`,
88
93
  show: filterVisible.value
@@ -95,13 +100,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
100
  }, null, 8, ["class", "component"])
96
101
  ]),
97
102
  default: withCtx(() => [
98
- createElementVNode("section", _hoisted_2, [
103
+ createElementVNode("section", _hoisted_3, [
99
104
  (openBlock(), createElementBlock(Fragment, null, renderList(sortStatusList, (item) => {
100
105
  return createElementVNode("div", {
101
106
  key: item.status,
102
107
  class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(sortStatusRef) === item.status }]),
103
108
  onClick: ($event) => setSort(item.status)
104
- }, toDisplayString(item.text), 11, _hoisted_3);
109
+ }, toDisplayString(item.text), 11, _hoisted_4);
105
110
  }), 64)),
106
111
  createVNode(unref(NInput), {
107
112
  value: searchFilterText.value,
@@ -137,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
137
142
  ]),
138
143
  _: 1
139
144
  }, 8, ["value"]),
140
- createElementVNode("footer", _hoisted_4, [
145
+ createElementVNode("footer", _hoisted_5, [
141
146
  createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${checkedCacheRef.value.length}\u9879`), 1),
142
147
  createVNode(unref(NButtonGroup), { size: "tiny" }, {
143
148
  default: withCtx(() => [
@@ -1,4 +1,5 @@
1
1
  import { computed, createVNode, onBeforeUnmount, reactive } from 'vue';
2
+ import { jsonParse } from '../../../../../shared/utils/index.js';
2
3
  import { isObject, isArray } from 'lodash-es';
3
4
  import '../../../index.js';
4
5
  import { IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS } from '../../constants/index.js';
@@ -121,62 +122,59 @@ function filterPlugin() {
121
122
  const lowCodeField = (_a = fieldItem.editRender) == null ? void 0 : _a.props;
122
123
  if (!isObject(lowCodeField))
123
124
  return;
124
- try {
125
- const fieldSetting = JSON.parse(lowCodeField.fieldSetting || "");
126
- if (!isFieldSetting(fieldSetting) || !showFilter(fieldSetting))
127
- return;
128
- let options = (_d = (_c = (_b = fieldSetting.mapping) == null ? void 0 : _b.mappingFiled) == null ? void 0 : _c.map((item) => item.value[0])) != null ? _d : [];
129
- if (isCompatibleColumn(lowCodeField)) {
130
- options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({
131
- ...option,
132
- key: option.label
133
- }))) != null ? _f : [];
134
- }
135
- const {
136
- filterState,
137
- setChecked,
138
- setSort
139
- } = initFilterState(uuid, fieldItem.field, lowCodeField.filterDefaultValue);
140
- filterState.options = options;
141
- const oldHeader = (_g = fieldItem.slots) == null ? void 0 : _g.header;
142
- const sortStatusRef = computed({
143
- get: () => {
144
- return filterState.sortStatus;
145
- },
146
- set: (value) => setSort({
147
- field: fieldItem.field,
148
- value,
149
- $table: $table.value,
150
- emits
151
- })
152
- });
153
- const checkedRef = computed({
154
- get: () => filterState.checked,
155
- set: (value) => setChecked({
156
- field: fieldItem.field,
157
- value,
158
- $table: $table.value,
159
- emits
160
- })
161
- });
162
- const optionsRef = computed(() => filterState.options);
163
- fieldItem.slots = {
164
- ...fieldItem.slots,
165
- header(payload) {
166
- return createVNode(FilterComponent, {
167
- "payload": payload,
168
- "options": optionsRef.value,
169
- "checked": checkedRef.value,
170
- "onUpdate:checked": ($event) => checkedRef.value = $event,
171
- "sortStatus": sortStatusRef.value,
172
- "onUpdate:sortStatus": ($event) => sortStatusRef.value = $event
173
- }, {
174
- header: oldHeader
175
- });
176
- }
177
- };
178
- } catch (e) {
125
+ const fieldSetting = jsonParse(lowCodeField.fieldSetting || "");
126
+ if (!isFieldSetting(fieldSetting) || !showFilter(fieldSetting))
127
+ return;
128
+ let options = (_d = (_c = (_b = fieldSetting.mapping) == null ? void 0 : _b.mappingFiled) == null ? void 0 : _c.map((item) => item.value[0])) != null ? _d : [];
129
+ if (isCompatibleColumn(lowCodeField)) {
130
+ options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({
131
+ ...option,
132
+ key: option.label
133
+ }))) != null ? _f : [];
179
134
  }
135
+ const {
136
+ filterState,
137
+ setChecked,
138
+ setSort
139
+ } = initFilterState(uuid, fieldItem.field, lowCodeField.filterDefaultValue);
140
+ filterState.options = options;
141
+ const oldHeader = (_g = fieldItem.slots) == null ? void 0 : _g.header;
142
+ const sortStatusRef = computed({
143
+ get: () => {
144
+ return filterState.sortStatus;
145
+ },
146
+ set: (value) => setSort({
147
+ field: fieldItem.field,
148
+ value,
149
+ $table: $table.value,
150
+ emits
151
+ })
152
+ });
153
+ const checkedRef = computed({
154
+ get: () => filterState.checked,
155
+ set: (value) => setChecked({
156
+ field: fieldItem.field,
157
+ value,
158
+ $table: $table.value,
159
+ emits
160
+ })
161
+ });
162
+ const optionsRef = computed(() => filterState.options);
163
+ fieldItem.slots = {
164
+ ...fieldItem.slots,
165
+ header(payload) {
166
+ return createVNode(FilterComponent, {
167
+ "payload": payload,
168
+ "options": optionsRef.value,
169
+ "checked": checkedRef.value,
170
+ "onUpdate:checked": ($event) => checkedRef.value = $event,
171
+ "sortStatus": sortStatusRef.value,
172
+ "onUpdate:sortStatus": ($event) => sortStatusRef.value = $event
173
+ }, {
174
+ header: oldHeader
175
+ });
176
+ }
177
+ };
180
178
  });
181
179
  return fieldList;
182
180
  });
@@ -36,6 +36,8 @@ function settingObjAdaptor(fieldItem, lowCodeField, config) {
36
36
  props
37
37
  };
38
38
  fieldItem.editRender.enabled = !Reflect.get(WIDGET_TYPE, fieldItem.editRender.name);
39
+ if (!lowCodeField.settingObj)
40
+ return;
39
41
  fieldItem.visible = ((_a = lowCodeField.settingObj) == null ? void 0 : _a.isHide) !== IHO_TABLE_STRING_STATUS.POSITIVE;
40
42
  }
41
43
 
@@ -41,12 +41,19 @@ function virtualTreePlugin() {
41
41
  hooks.fieldHooks.fieldList.tap(pluginName, (fieldList, config) => {
42
42
  const { transform } = config.treeConfig || DMZ;
43
43
  if (transform && config.uuid) {
44
- const treeNodeColumnIndex = fieldList.findIndex((field) => field.treeNode);
44
+ let treeNodeColumnIndex = fieldList.findIndex((field) => field.treeNode);
45
+ if (!~treeNodeColumnIndex) {
46
+ fieldList.some((field, index) => {
47
+ if (field.type)
48
+ return;
49
+ treeNodeColumnIndex = index;
50
+ return field.treeNode = true;
51
+ });
52
+ }
45
53
  treeNodeColumnIndexMap.set(config.uuid, {
46
- index: ~treeNodeColumnIndex ? treeNodeColumnIndex : 0,
54
+ index: treeNodeColumnIndex,
47
55
  length: fieldList.length
48
56
  });
49
- !~treeNodeColumnIndex && Reflect.set(fieldList[0], "treeNode", true);
50
57
  }
51
58
  return fieldList;
52
59
  });
@@ -13,6 +13,7 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
13
13
  [K in typeof VxeEventListenerNameList[number]]: (...payload: IhoTableEmitPayload<EventListenerToEventName<K>>) => void;
14
14
  }> & Partial<{
15
15
  uuid: string;
16
+ isTree: 0 | 1 | 2 | 3;
16
17
  showSeq: boolean;
17
18
  selectType: Exclude<VxeTableDefines.ColumnInfo['type'], 'seq' | 'expand' | 'html'>;
18
19
  rowGroupSetting: Partial<Record<TupleToUnion<typeof IhoTableRowGroupSequence>, IhoTableRowGroupItem[]>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.34-beta.3",
3
+ "version": "3.1.34-beta.4",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "468e5a0562680804ee4abd3a5be59568c24835a5"
64
+ "gitHead": "bb84ad766b4ccadc69da5beb8979c3fa1b2816b3"
65
65
  }