cnhis-design-vue 3.1.14-beta.7.1 → 3.1.14-beta.8

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,23 +1,23 @@
1
- # Vue 3 + Typescript + Vite
2
-
3
- This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
-
5
- ## Recommended IDE Setup
6
-
7
- - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8
-
9
- ## Type Support For `.vue` Imports in TS
10
-
11
- Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
12
-
13
- ## 使用
14
- ```JavaScript
15
- import { createApp } from "vue";
16
- import App from "./App.vue";
17
- import cui from "cnhis-design-vue";
18
- import "cnhis-design-vue/es/index.css";
19
-
20
- const app = createApp(App);
21
- app.use(cui);
22
- app.mount("#app");
1
+ # Vue 3 + Typescript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8
+
9
+ ## Type Support For `.vue` Imports in TS
10
+
11
+ Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
12
+
13
+ ## 使用
14
+ ```JavaScript
15
+ import { createApp } from "vue";
16
+ import App from "./App.vue";
17
+ import cui from "cnhis-design-vue";
18
+ import "cnhis-design-vue/es/index.css";
19
+
20
+ const app = createApp(App);
21
+ app.use(cui);
22
+ app.mount("#app");
23
23
  ```
@@ -1094,7 +1094,9 @@ declare const _default: import("vue").DefineComponent<{
1094
1094
  textColorGhostDisabledSuccess: string;
1095
1095
  borderSuccess: string;
1096
1096
  borderHoverSuccess: string;
1097
- borderPressedSuccess: string;
1097
+ borderPressedSuccess: string; /**
1098
+ * 删除选中scan数据
1099
+ */
1098
1100
  borderFocusSuccess: string;
1099
1101
  borderDisabledSuccess: string;
1100
1102
  rippleColorSuccess: string;
@@ -1187,7 +1189,10 @@ declare const _default: import("vue").DefineComponent<{
1187
1189
  opacityDisabled: string;
1188
1190
  colorOpacitySecondary: string;
1189
1191
  colorOpacitySecondaryHover: string;
1190
- colorOpacitySecondaryPressed: string;
1192
+ colorOpacitySecondaryPressed: string; /**
1193
+ * 单个form提交成功数据
1194
+ * @param {*} obj formData
1195
+ */
1191
1196
  colorSecondary: string;
1192
1197
  colorSecondaryHover: string;
1193
1198
  colorSecondaryPressed: string;
@@ -1209,7 +1214,10 @@ declare const _default: import("vue").DefineComponent<{
1209
1214
  textColorFocus: string;
1210
1215
  textColorDisabled: string;
1211
1216
  textColorText: string;
1212
- textColorTextHover: string;
1217
+ textColorTextHover: string; /**
1218
+ * 避免每次点击都查询
1219
+ * 初始化查一次 行编辑 表单search用
1220
+ */
1213
1221
  textColorTextPressed: string;
1214
1222
  textColorTextFocus: string;
1215
1223
  textColorTextDisabled: string;
@@ -1305,7 +1313,7 @@ declare const _default: import("vue").DefineComponent<{
1305
1313
  colorWarning: string;
1306
1314
  colorHoverWarning: string;
1307
1315
  colorPressedWarning: string;
1308
- colorFocusWarning: string; /** string */
1316
+ colorFocusWarning: string;
1309
1317
  colorDisabledWarning: string;
1310
1318
  textColorWarning: string;
1311
1319
  textColorHoverWarning: string;
@@ -1668,22 +1676,7 @@ declare const _default: import("vue").DefineComponent<{
1668
1676
  onBlur: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: FocusEvent) => void>>;
1669
1677
  onClick: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
1670
1678
  onChange: import("vue").PropType<import("naive-ui/es/input/src/interface").OnUpdateValue>;
1671
- onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>; /**
1672
- * 针对 bigTable 的设置列
1673
- * type: 列的类型
1674
- * field: 列字段名(注:属性层级越深,渲染性能将直线下降)
1675
- * title: 列标题(支持开启国际化)
1676
- * width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
1677
- * minWidth: 最小列宽度;会自动将剩余空间按比例分配
1678
- * resizable: 列是否允许拖动列宽调整大小
1679
- * visible: 列是否显示
1680
- * fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
1681
- * align: 列对齐方式
1682
- * headerAlign: 表头列的对齐方式
1683
- * footerAlign: 表尾列的对齐方式
1684
- * formatter: 格式化显示内容 Function({cellValue, row, column})
1685
- * sortable: 是否允许列排序
1686
- */
1679
+ onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
1687
1680
  status: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
1688
1681
  'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
1689
1682
  onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
@@ -252,6 +252,9 @@ var script = /* @__PURE__ */ defineComponent({
252
252
  } = useSeparateRow(() => {
253
253
  var _a, _b;
254
254
  return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) != null ? _b : [];
255
+ }, (columnName) => {
256
+ var _a, _b;
257
+ return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) == null ? void 0 : _b.find((field) => field.columnName === columnName);
255
258
  }, xGrid);
256
259
  const onResizableChange = (payload) => {
257
260
  onColumnResize(payload);
@@ -1293,6 +1296,9 @@ var script = /* @__PURE__ */ defineComponent({
1293
1296
  updateAddCheckedRows(row);
1294
1297
  };
1295
1298
  const handlerClickRow = (data) => {
1299
+ var _a;
1300
+ if (((_a = attr.checkboxConfig) == null ? void 0 : _a.trigger) === "default")
1301
+ return false;
1296
1302
  if (isScanMultiTable.value || props.isInlineOperating)
1297
1303
  return false;
1298
1304
  if (vexutils.has(data == null ? void 0 : data.row, GROUP_TITLE_KEY))
@@ -31,16 +31,38 @@ declare const _default: import("vue").DefineComponent<{
31
31
  }>> & {
32
32
  onFormChange?: ((...args: any[]) => any) | undefined;
33
33
  }>>;
34
+ popoverRef: import("vue").Ref<any>;
34
35
  emit: (event: "formChange", ...args: any[]) => void;
36
+ editContent: import("vue").Ref<any>;
35
37
  getRowData: (row: AnyObject) => {
36
38
  separateData: Record<string, string>;
37
39
  index: number;
38
40
  rawRow: AnyObject;
39
41
  row: AnyObject;
40
42
  } | undefined;
41
- editContent: import("vue").Ref<string>;
42
43
  updateShow: (show: boolean) => void;
43
44
  style: CSSProperties;
45
+ SlotRender: import("vue").DefineComponent<{
46
+ functional: BooleanConstructor;
47
+ renderer: {
48
+ type: (StringConstructor | FunctionConstructor)[];
49
+ required: true;
50
+ };
51
+ rootSlots: {
52
+ type: PropType<Record<string, import("../../../../../../es/src/types").Func<any[], any>>>;
53
+ };
54
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
55
+ functional: BooleanConstructor;
56
+ renderer: {
57
+ type: (StringConstructor | FunctionConstructor)[];
58
+ required: true;
59
+ };
60
+ rootSlots: {
61
+ type: PropType<Record<string, import("../../../../../../es/src/types").Func<any[], any>>>;
62
+ };
63
+ }>>, {
64
+ functional: boolean;
65
+ }>;
44
66
  NPopover: import("vue").DefineComponent<{
45
67
  internalOnAfterLeave: PropType<() => void>;
46
68
  internalRenderBody: PropType<import("naive-ui/es/popover/src/interface").InternalRenderBody>;
@@ -1,4 +1,6 @@
1
- import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode } from 'vue';
1
+ import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, withModifiers } from 'vue';
2
+ import SlotRender from '../../../../../src/components/SlotRender';
3
+ import { cloneDeep, isObject, isArray } from 'lodash-es';
2
4
  import { NPopover, NInput } from 'naive-ui';
3
5
  import { useSeparateMap } from '../../../../../packages/big-table/src/hooks/useSeparateRow';
4
6
  import '../separate.js';
@@ -14,19 +16,24 @@ var script = /* @__PURE__ */ defineComponent({
14
16
  emits: ["formChange"],
15
17
  setup(__props, { emit }) {
16
18
  const props = __props;
19
+ const popoverRef = ref();
20
+ const editContent = ref();
17
21
  const { getRowData } = useSeparateMap();
18
- const editContent = ref("");
19
22
  function updateShow(show) {
20
23
  const target = getRowData(props.row);
21
24
  if (!target)
22
25
  return;
23
26
  if (show) {
24
- editContent.value = target.row[props.col.field];
27
+ editContent.value = cloneDeep(target.row[props.col.field]);
25
28
  return;
26
29
  }
27
30
  const old = target.row[props.col.field];
28
- if (old === editContent.value || !target)
31
+ if (!target)
29
32
  return;
33
+ if (!isObject(editContent.value) && !isArray(editContent.value)) {
34
+ if (old === editContent.value)
35
+ return;
36
+ }
30
37
  target.rawRow[props.col.field] = editContent.value;
31
38
  emit("formChange", {
32
39
  value: editContent.value,
@@ -43,25 +50,39 @@ var script = /* @__PURE__ */ defineComponent({
43
50
  };
44
51
  return (_ctx, _cache) => {
45
52
  return openBlock(), createBlock(unref(NPopover), {
53
+ ref_key: "popoverRef",
54
+ ref: popoverRef,
55
+ trigger: "click",
46
56
  "show-arrow": false,
47
57
  "onUpdate:show": updateShow
48
58
  }, {
49
59
  trigger: withCtx(() => [
50
60
  createVNode(script$1, {
61
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
62
+ }, ["stop"])),
51
63
  style,
52
64
  col: __props.col,
53
65
  row: __props.row
54
66
  }, null, 8, ["col", "row"])
55
67
  ]),
56
68
  default: withCtx(() => [
57
- createVNode(unref(NInput), {
69
+ __props.col.separateSlot ? (openBlock(), createBlock(unref(SlotRender), {
70
+ key: 0,
71
+ functional: "",
72
+ renderer: __props.col.separateSlot,
73
+ value: editContent.value,
74
+ "onUpdate:value": _cache[1] || (_cache[1] = ($event) => editContent.value = $event),
75
+ col: __props.col,
76
+ row: __props.row
77
+ }, null, 8, ["renderer", "value", "col", "row"])) : (openBlock(), createBlock(unref(NInput), {
78
+ key: 1,
58
79
  value: editContent.value,
59
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => editContent.value = $event),
80
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => editContent.value = $event),
60
81
  type: "textarea"
61
- }, null, 8, ["value"])
82
+ }, null, 8, ["value"]))
62
83
  ]),
63
84
  _: 1
64
- });
85
+ }, 512);
65
86
  };
66
87
  }
67
88
  });
@@ -180,16 +180,38 @@ export declare const comps: {
180
180
  }>> & {
181
181
  onFormChange?: ((...args: any[]) => any) | undefined;
182
182
  }>>;
183
+ popoverRef: import("vue").Ref<any>;
183
184
  emit: (event: "formChange", ...args: any[]) => void;
185
+ editContent: import("vue").Ref<any>;
184
186
  getRowData: (row: import("../../../../src/types").AnyObject) => {
185
187
  separateData: Record<string, string>;
186
188
  index: number;
187
189
  rawRow: import("../../../../src/types").AnyObject;
188
190
  row: import("../../../../src/types").AnyObject;
189
191
  } | undefined;
190
- editContent: import("vue").Ref<string>;
191
192
  updateShow: (show: boolean) => void;
192
193
  style: import("vue").CSSProperties;
194
+ SlotRender: import("vue").DefineComponent<{
195
+ functional: BooleanConstructor;
196
+ renderer: {
197
+ type: (StringConstructor | FunctionConstructor)[];
198
+ required: true;
199
+ };
200
+ rootSlots: {
201
+ type: import("vue").PropType<Record<string, import("../../../../src/types").Func<any[], any>>>;
202
+ };
203
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
204
+ functional: BooleanConstructor;
205
+ renderer: {
206
+ type: (StringConstructor | FunctionConstructor)[];
207
+ required: true;
208
+ };
209
+ rootSlots: {
210
+ type: import("vue").PropType<Record<string, import("../../../../src/types").Func<any[], any>>>;
211
+ };
212
+ }>>, {
213
+ functional: boolean;
214
+ }>;
193
215
  NPopover: import("vue").DefineComponent<{
194
216
  internalOnAfterLeave: import("vue").PropType<() => void>;
195
217
  internalRenderBody: import("vue").PropType<import("naive-ui/es/popover/src/interface").InternalRenderBody>;
@@ -22,7 +22,7 @@ export declare function useSeparateMap(): {
22
22
  row: AnyObject;
23
23
  } | undefined;
24
24
  };
25
- export declare function useSeparateRow(getColumnConfig: () => AnyObject[], $VXETable: Ref<undefined | VxeTableInstance>): {
25
+ export declare function useSeparateRow(getColumnConfig: () => AnyObject[], getFieldItem: (columnName: string) => AnyObject, $VXETable: Ref<undefined | VxeTableInstance>): {
26
26
  onColumnResize: VxeTableEvents.ResizableChange;
27
27
  needSeparateColumn: import("vue").ComputedRef<AnyObject[]>;
28
28
  separate: (data: AnyObject[], rawData: AnyObject[]) => Promise<AnyObject[]>;
@@ -1,5 +1,5 @@
1
1
  import { useMemoize } from '@vueuse/core';
2
- import { isNumber, isString } from 'lodash-es';
2
+ import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
3
3
  import { ref, computed, provide, watch, nextTick } from 'vue';
4
4
  import { InjectionSeparateHandle } from '../../../../packages/big-table/src/constants';
5
5
 
@@ -17,7 +17,6 @@ class SeparateHandle {
17
17
  this.callbacks.clear();
18
18
  }
19
19
  trigger() {
20
- console.log("trigger");
21
20
  this.callbacks.forEach((cb) => cb());
22
21
  }
23
22
  }
@@ -68,7 +67,7 @@ function useSeparateMap() {
68
67
  }
69
68
  return { separateDataMap, getRowData };
70
69
  }
71
- function useSeparateRow(getColumnConfig, $VXETable) {
70
+ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
72
71
  const needSeparateColumn = computed(() => {
73
72
  return getColumnConfig().filter((column) => column.formType === "separate");
74
73
  });
@@ -77,11 +76,11 @@ function useSeparateRow(getColumnConfig, $VXETable) {
77
76
  return data;
78
77
  }
79
78
  return data.reduce(async (res, row, dataIndex) => {
80
- let parsedRowData = [];
79
+ const parsedRowData = [];
81
80
  for (const column of needSeparateColumn.value) {
82
81
  parsedRowData.push({
83
82
  columnName: column.columnName,
84
- data: contentSeparate(row[column.columnName], await getColumnRenderWidth(column))
83
+ data: contentSeparate(row[column.columnName], column.columnName, await getColumnRenderWidth(column))
85
84
  });
86
85
  }
87
86
  (await res).push(...Array.from({ length: getColumnInfoMaxLength(parsedRowData) }).map((_, index) => {
@@ -129,7 +128,12 @@ function useSeparateRow(getColumnConfig, $VXETable) {
129
128
  }
130
129
  }
131
130
  }
132
- function contentSeparate(value, width) {
131
+ function contentSeparate(value, columnName, width) {
132
+ if (isArray(value))
133
+ return value.map((row) => {
134
+ var _a, _b, _c;
135
+ return (_c = (_b = (_a = getFieldItem(columnName)) == null ? void 0 : _a.separateFormatter) == null ? void 0 : _b.call(_a, cloneDeep(row))) != null ? _c : row;
136
+ });
133
137
  if (!isString(value) || !isNumber(width))
134
138
  return [value];
135
139
  width -= 20;
@@ -2,10 +2,13 @@ import { SFCWithInstall } from '../../../es/src/types';
2
2
  declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
3
3
  type: {
4
4
  type: StringConstructor;
5
+ required: false;
5
6
  default: string;
6
7
  };
7
8
  }, {
8
- asyncInstance: import("vue").Ref<any>;
9
+ props: {
10
+ type: string;
11
+ };
9
12
  OldFieldSet: import("vue").DefineComponent<{
10
13
  fields: {
11
14
  type: import("vue").PropType<any[]>;
@@ -81,16 +84,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
81
84
  isMiddleAndAdmin: import("vue").ComputedRef<boolean>;
82
85
  showCheckBox: (key: string) => boolean;
83
86
  hideTab: () => void;
84
- getTableFields: () => {
85
- id: string;
86
- field: string;
87
- visible: boolean;
88
- sequence: number;
89
- sortable: boolean;
90
- title: string;
91
- fixed: string;
92
- minWidth: number;
93
- }[];
94
87
  handleFieldSave: () => void;
95
88
  onCancle: () => void;
96
89
  onChangeShow: (e: boolean, ele: {
@@ -115,6 +108,17 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
115
108
  isFixed: number;
116
109
  colWidth: number;
117
110
  }) => void;
111
+ onButtonChecked: (e: boolean, itemButton: {
112
+ [key: string]: any;
113
+ sid: string;
114
+ columnName: string;
115
+ isShow: number;
116
+ isSort: number;
117
+ title: string;
118
+ alias: string;
119
+ isFixed: number;
120
+ colWidth: number;
121
+ }) => void;
118
122
  calculateCheck: (key: string) => boolean;
119
123
  handleAllCheck: (e: boolean, key: string) => void;
120
124
  handleFieldClick: (item: {
@@ -2736,17 +2740,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
2736
2740
  isMiddleAndAdmin: import("vue").ComputedRef<boolean>;
2737
2741
  showCheckBox: (key: string) => boolean;
2738
2742
  hideTab: () => void;
2739
- getTableFields: () => {
2740
- [key: string]: any;
2741
- id: string;
2742
- name: string;
2743
- show: boolean;
2744
- sort: boolean;
2745
- alias: string;
2746
- fixedShow: boolean;
2747
- fixedWay: "NONE" | "LEFT" | "RIGHT";
2748
- columnWidth: number;
2749
- }[];
2750
2743
  handleFieldSave: () => void;
2751
2744
  onCancle: () => void;
2752
2745
  calculateCheck: (key: string) => boolean;
@@ -5298,6 +5291,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
5298
5291
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
5299
5292
  type: {
5300
5293
  type: StringConstructor;
5294
+ required: false;
5301
5295
  default: string;
5302
5296
  };
5303
5297
  }>>, {