cnhis-design-vue 3.2.9-beta.2 → 3.2.9-beta.22
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.
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/types/index.d.ts +8 -7
- package/es/components/base-search/index.d.ts +2 -0
- package/es/components/base-search/src/index.vue.d.ts +2 -0
- package/es/components/button-print/index.d.ts +7 -45
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +7 -45
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +6 -35
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +1 -5
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +5 -4
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/expand-field/index.d.ts +1 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +1 -1
- package/es/components/expand-field/src/index.vue.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +29 -6
- package/es/components/field-set/src/FieldFilter.vue.d.ts +29 -6
- package/es/components/field-set/src/FieldSet.vue.d.ts +68 -28
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +28 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +3 -3
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +269 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +269 -1
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +121 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +130 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +122 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +5 -0
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.d.ts +2 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +3 -0
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +2 -0
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.d.ts +1 -0
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
@@ -37,9 +37,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
37
37
|
disabledAll?: boolean | undefined;
|
38
38
|
isHeadCheckHide?: boolean | undefined;
|
39
39
|
isShow?: boolean | undefined;
|
40
|
-
contentRender?: ((column: AnyObject, row: AnyObject) =>
|
41
|
-
[key: string]: any;
|
42
|
-
}>) | undefined;
|
40
|
+
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
43
41
|
}[]>;
|
44
42
|
data: import("vue").Ref<{
|
45
43
|
[x: string]: any;
|
@@ -64,9 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
64
62
|
disabledAll?: boolean | undefined;
|
65
63
|
isHeadCheckHide?: boolean | undefined;
|
66
64
|
isShow?: boolean | undefined;
|
67
|
-
contentRender?: ((column: AnyObject, row: AnyObject) =>
|
68
|
-
[key: string]: any;
|
69
|
-
}>) | undefined;
|
65
|
+
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
70
66
|
}[];
|
71
67
|
data: {
|
72
68
|
[x: string]: any;
|
@@ -257,6 +253,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
257
253
|
type: PropType<AnyObject[]>;
|
258
254
|
default: () => never[];
|
259
255
|
};
|
256
|
+
primaryKey: {
|
257
|
+
type: StringConstructor;
|
258
|
+
default: string;
|
259
|
+
};
|
260
|
+
titleRender: {
|
261
|
+
type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
|
262
|
+
};
|
260
263
|
}, {
|
261
264
|
fixedWayOptions: {
|
262
265
|
label: string;
|
@@ -355,6 +358,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
355
358
|
type: PropType<AnyObject[]>;
|
356
359
|
default: () => never[];
|
357
360
|
};
|
361
|
+
primaryKey: {
|
362
|
+
type: StringConstructor;
|
363
|
+
default: string;
|
364
|
+
};
|
365
|
+
titleRender: {
|
366
|
+
type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
|
367
|
+
};
|
358
368
|
}>> & {
|
359
369
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
360
370
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -368,10 +378,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
368
378
|
isMultiple: (field: string) => boolean;
|
369
379
|
isRender: (field: string) => boolean;
|
370
380
|
isShow: (field: string) => any;
|
381
|
+
showRelation: (field: string) => boolean;
|
371
382
|
getSortPriorityOptions: () => {
|
372
383
|
label: string;
|
373
384
|
value: number;
|
374
385
|
}[];
|
386
|
+
getSelectText: (field: string) => "密码无需设置" | "主键不可设置" | "不支持脱敏设置" | undefined;
|
375
387
|
selectProps: (field: string) => {
|
376
388
|
valueField: string;
|
377
389
|
labelField: string;
|
@@ -389,12 +401,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
389
401
|
NIcon: any;
|
390
402
|
NColorPicker: any;
|
391
403
|
NPopconfirm: any;
|
404
|
+
NPopover: any;
|
405
|
+
NSpace: any;
|
392
406
|
setStyle: typeof setStyle;
|
393
407
|
setColorInfo: typeof import("./utils").setColorInfo;
|
394
408
|
ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
395
409
|
TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
396
410
|
CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
397
411
|
HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
412
|
+
CaretDownOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
398
413
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
399
414
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
400
415
|
element: {
|
@@ -480,6 +495,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
480
495
|
type: PropType<AnyObject[]>;
|
481
496
|
default: () => never[];
|
482
497
|
};
|
498
|
+
primaryKey: {
|
499
|
+
type: StringConstructor;
|
500
|
+
default: string;
|
501
|
+
};
|
502
|
+
titleRender: {
|
503
|
+
type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
|
504
|
+
};
|
483
505
|
}>> & {
|
484
506
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
485
507
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -502,6 +524,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
502
524
|
requiredDisable: boolean;
|
503
525
|
hide: boolean;
|
504
526
|
}>[];
|
527
|
+
primaryKey: string;
|
505
528
|
index: number;
|
506
529
|
columns: FieldSetColumnItem[];
|
507
530
|
element: Partial<{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PropType } from 'vue';
|
1
|
+
import { PropType, VNodeChild } from 'vue';
|
2
2
|
import { setStyle, isDraggableItem } from './utils';
|
3
3
|
import { FieldSetItem, FieldSetColumnName, FieldSetColumnItem } from '../../../components/field-set/src/types';
|
4
4
|
import { AnyObject } from '../../../shared/types';
|
@@ -79,18 +79,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
79
|
columnWidthProps: {
|
80
80
|
type: ObjectConstructor;
|
81
81
|
};
|
82
|
-
|
83
|
-
type:
|
82
|
+
hideExpressionConfig: {
|
83
|
+
type: PropType<{
|
84
|
+
show: boolean;
|
85
|
+
option: AnyObject[];
|
86
|
+
}>;
|
84
87
|
};
|
85
|
-
|
86
|
-
type:
|
87
|
-
default:
|
88
|
+
primaryKey: {
|
89
|
+
type: StringConstructor;
|
90
|
+
default: string;
|
91
|
+
};
|
92
|
+
titleRender: {
|
93
|
+
type: PropType<(row: FieldSetItem) => VNodeChild>;
|
88
94
|
};
|
89
95
|
}, {
|
90
96
|
fieldsMapping: Record<string, string>;
|
91
|
-
attrs: {
|
92
|
-
[x: string]: unknown;
|
93
|
-
};
|
94
97
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
95
98
|
fields: {
|
96
99
|
type: PropType<Partial<{
|
@@ -168,12 +171,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
168
171
|
columnWidthProps: {
|
169
172
|
type: ObjectConstructor;
|
170
173
|
};
|
171
|
-
|
172
|
-
type:
|
174
|
+
hideExpressionConfig: {
|
175
|
+
type: PropType<{
|
176
|
+
show: boolean;
|
177
|
+
option: AnyObject[];
|
178
|
+
}>;
|
173
179
|
};
|
174
|
-
|
175
|
-
type:
|
176
|
-
default:
|
180
|
+
primaryKey: {
|
181
|
+
type: StringConstructor;
|
182
|
+
default: string;
|
183
|
+
};
|
184
|
+
titleRender: {
|
185
|
+
type: PropType<(row: FieldSetItem) => VNodeChild>;
|
177
186
|
};
|
178
187
|
}>> & {
|
179
188
|
onSave?: ((...args: any[]) => any) | undefined;
|
@@ -186,6 +195,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
186
195
|
tableBodyRef: import("vue").Ref<HTMLDivElement | undefined>;
|
187
196
|
newFields: import("vue").Ref<AnyObject[]>;
|
188
197
|
defaultColumns: FieldSetColumnItem[];
|
198
|
+
otherColumns: FieldSetColumnItem[];
|
189
199
|
columns: import("vue").Ref<{
|
190
200
|
[x: string]: any;
|
191
201
|
title: string;
|
@@ -195,9 +205,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
195
205
|
disabledAll?: boolean | undefined;
|
196
206
|
isHeadCheckHide?: boolean | undefined;
|
197
207
|
isShow?: boolean | undefined;
|
198
|
-
contentRender?: ((column: AnyObject, row: AnyObject) =>
|
199
|
-
[key: string]: any;
|
200
|
-
}>) | undefined;
|
208
|
+
contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
|
201
209
|
}[]>;
|
202
210
|
fieldList: import("vue").ComputedRef<AnyObject[]>;
|
203
211
|
hasFieldDescribe: import("vue").ComputedRef<boolean>;
|
@@ -211,9 +219,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
211
219
|
disabledAll?: boolean | undefined;
|
212
220
|
isHeadCheckHide?: boolean | undefined;
|
213
221
|
isShow?: boolean | undefined;
|
214
|
-
contentRender?: ((column: AnyObject, row: AnyObject) =>
|
215
|
-
[key: string]: any;
|
216
|
-
}>) | undefined;
|
222
|
+
contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
|
217
223
|
}[];
|
218
224
|
data: AnyObject[];
|
219
225
|
onUpdateChecked: ({ checked, column }: {
|
@@ -225,7 +231,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
225
231
|
fieldDescribeMode: "column" | "tooltip";
|
226
232
|
developMode: boolean;
|
227
233
|
columnWidthProps: Record<string, any> | undefined;
|
228
|
-
hideExpressionOption: AnyObject[];
|
234
|
+
hideExpressionOption: AnyObject[] | never[];
|
235
|
+
primaryKey: string;
|
236
|
+
titleRender: ((row: FieldSetItem) => VNodeChild) | undefined;
|
229
237
|
};
|
230
238
|
searchData: {
|
231
239
|
keyword: string;
|
@@ -412,6 +420,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
412
420
|
type: PropType<AnyObject[]>;
|
413
421
|
default: () => never[];
|
414
422
|
};
|
423
|
+
primaryKey: {
|
424
|
+
type: StringConstructor;
|
425
|
+
default: string;
|
426
|
+
};
|
427
|
+
titleRender: {
|
428
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
429
|
+
};
|
415
430
|
}, {
|
416
431
|
fixedWayOptions: {
|
417
432
|
label: string;
|
@@ -510,6 +525,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
510
525
|
type: PropType<AnyObject[]>;
|
511
526
|
default: () => never[];
|
512
527
|
};
|
528
|
+
primaryKey: {
|
529
|
+
type: StringConstructor;
|
530
|
+
default: string;
|
531
|
+
};
|
532
|
+
titleRender: {
|
533
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
534
|
+
};
|
513
535
|
}>> & {
|
514
536
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
515
537
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -523,10 +545,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
523
545
|
isMultiple: (field: string) => boolean;
|
524
546
|
isRender: (field: string) => boolean;
|
525
547
|
isShow: (field: string) => any;
|
548
|
+
showRelation: (field: string) => boolean;
|
526
549
|
getSortPriorityOptions: () => {
|
527
550
|
label: string;
|
528
551
|
value: number;
|
529
552
|
}[];
|
553
|
+
getSelectText: (field: string) => "密码无需设置" | "主键不可设置" | "不支持脱敏设置" | undefined;
|
530
554
|
selectProps: (field: string) => {
|
531
555
|
valueField: string;
|
532
556
|
labelField: string;
|
@@ -544,12 +568,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
544
568
|
NIcon: any;
|
545
569
|
NColorPicker: any;
|
546
570
|
NPopconfirm: any;
|
571
|
+
NPopover: any;
|
572
|
+
NSpace: any;
|
547
573
|
setStyle: typeof setStyle;
|
548
574
|
setColorInfo: typeof import("./utils").setColorInfo;
|
549
575
|
ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
550
576
|
TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
551
577
|
CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
552
578
|
HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
579
|
+
CaretDownOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
553
580
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
554
581
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
555
582
|
element: {
|
@@ -635,6 +662,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
635
662
|
type: PropType<AnyObject[]>;
|
636
663
|
default: () => never[];
|
637
664
|
};
|
665
|
+
primaryKey: {
|
666
|
+
type: StringConstructor;
|
667
|
+
default: string;
|
668
|
+
};
|
669
|
+
titleRender: {
|
670
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
671
|
+
};
|
638
672
|
}>> & {
|
639
673
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
640
674
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -657,6 +691,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
657
691
|
requiredDisable: boolean;
|
658
692
|
hide: boolean;
|
659
693
|
}>[];
|
694
|
+
primaryKey: string;
|
660
695
|
index: number;
|
661
696
|
columns: FieldSetColumnItem[];
|
662
697
|
element: Partial<{
|
@@ -770,18 +805,25 @@ declare const _default: import("vue").DefineComponent<{
|
|
770
805
|
columnWidthProps: {
|
771
806
|
type: ObjectConstructor;
|
772
807
|
};
|
773
|
-
|
774
|
-
type:
|
808
|
+
hideExpressionConfig: {
|
809
|
+
type: PropType<{
|
810
|
+
show: boolean;
|
811
|
+
option: AnyObject[];
|
812
|
+
}>;
|
775
813
|
};
|
776
|
-
|
777
|
-
type:
|
778
|
-
default:
|
814
|
+
primaryKey: {
|
815
|
+
type: StringConstructor;
|
816
|
+
default: string;
|
817
|
+
};
|
818
|
+
titleRender: {
|
819
|
+
type: PropType<(row: FieldSetItem) => VNodeChild>;
|
779
820
|
};
|
780
821
|
}>> & {
|
781
822
|
onSave?: ((...args: any[]) => any) | undefined;
|
782
823
|
onClose?: ((...args: any[]) => any) | undefined;
|
783
824
|
onReset?: ((...args: any[]) => any) | undefined;
|
784
825
|
}, {
|
826
|
+
primaryKey: string;
|
785
827
|
type: string;
|
786
828
|
isEdit: boolean;
|
787
829
|
fields: Partial<{
|
@@ -807,11 +849,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
807
849
|
developMode: boolean;
|
808
850
|
footerFlag: boolean;
|
809
851
|
fieldDescribeMode: "column" | "tooltip";
|
810
|
-
hideExpressionOption: AnyObject[];
|
811
852
|
showSearch: boolean;
|
812
853
|
customColumns: FieldSetColumnItem[];
|
813
854
|
showSortPriority: boolean;
|
814
855
|
showHeadFilter: boolean;
|
815
|
-
showHideExpression: boolean;
|
816
856
|
}>;
|
817
857
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,
|
1
|
+
import{defineComponent as e,ref as l,computed as i,reactive as t,toRef as o,watch as d,openBlock as a,createElementBlock as r,createBlock as n,unref as s,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as x,normalizeClass as k,mergeProps as w,renderSlot as S}from"vue";import{NInput as C,NCheckbox as A,NTooltip as _,NIcon as W,NPopconfirm as E,NButton as H}from"naive-ui";import D from"../../../shared/components/VueDraggable/src/vuedraggable.js";import F from"./components/table-row.vue.js";import{isArray as M,cloneDeep as P,isString as N,omit as R}from"lodash-es";import{isDisable as j,setStyle as B,isDraggableItem as V,isDraggable as O,getGroupTree as q}from"./utils/index.js";import{uuidGenerator as I}from"../../../shared/utils/index.js";import{HelpCircleSharp as K}from"@vicons/ionicons5";const U={class:"main-wrapper"},T={class:"main-wrapper__table-header"},L=h("span",null,"数值越小,优先级越高",-1),G=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionConfig:{type:Object},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},Y=l(Date.now()),Z=l(""),ee=l(),le=l([]),ie=[{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!Q.fieldShowMaxValue,field:"show",fieldShowMaxValue:Q.fieldShowMaxValue},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:"脱敏配置",type:"select",field:"hideExpression"}],te=[{title:"搜索",type:"checkbox",isHeadCheckHide:!0,field:"isSearch"},{title:"求和",type:"checkbox",isHeadCheckHide:!0,field:"isSum"},{title:"平均值",type:"checkbox",isHeadCheckHide:!0,field:"isAvg"}],oe=l([]),de=i((()=>le.value.flat())),ae=i((()=>de.value.some((e=>e.feildDescribe)))),re=t({columns:oe,data:de,onUpdateChecked:function({checked:e,column:l}){const i=!e||ye(l.field);l.checkedAll=!i},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode,developMode:Q.developMode,columnWidthProps:Q.columnWidthProps,hideExpressionOption:o(Q.hideExpressionConfig||{option:[]},"option"),primaryKey:o(Q,"primaryKey"),titleRender:Q.titleRender}),ne={keyword:Z.value,idx:0,startIdx:0},se=()=>{J("save")},ue=()=>{J("close")};function ce(){le.value=fe(),me(),Y.value=Date.now(),J("reset")}function fe(){const e=P(Q.fields).map((e=>({...e,uuid:I()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{var i;"old"==Q.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[X[l]]=1==e[l]:e[X[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!O(e),M(null==(i=e.relation)?void 0:i.fieldList)&&e.relation.fieldList.forEach((e=>{1==e.isSearch&&(e.checked=!0)}))}))})),function(e){if(Q.groupSetting){return q(Q.groupSetting,e).reduce(((i,t)=>{const o=N(t)?e.find((e=>e.name===t)):l(t.children);return o&&i.push(o),i}),[])}return e;function l(i){const t=[];return i.forEach((i=>{if(i.children)t.push(...l(i.children));else{const l=e.find((e=>e.name===i));l&&t.push(l)}})),t}}(e)}function he(){const e=ne.keyword!==Z.value;let l=Z.value?de.value.findIndex(((l,i)=>{var t;if(null==(t=l.title)?void 0:t.includes(Z.value))return!!e||i>ne.idx})):0;-1!==l||e||(l=ne.startIdx),ee.value.scrollTop=52*l,Object.assign(ne,{keyword:Z.value,idx:l},e?{startIdx:l}:{})}function pe(e){var l;return!!Z.value&&(null==(l=e.title)?void 0:l.includes(Z.value))}function me(){var e,l;oe.value=P(ie),(null==(e=Q.showColumnNames)?void 0:e.length)&&(oe.value=ie.concat(te).filter((e=>{var l,i;return"title"===e.field||(null==(i=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:i.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&oe.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&ae.value&&oe.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.showSeq&&oe.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),oe.value.forEach((e=>{if(e.isShow=function(e){var l,i;if(!(null==(l=Q.showColumnNames)?void 0:l.length)&&(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter||"hideExpression"===e.field&&!(null==(i=Q.hideExpressionConfig)?void 0:i.show)))return!1;return!0}(e),"checkbox"===e.type){const l=le.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!ye(e.field)&&!l}}))}function ye(e){return le.value.flat().some((l=>!j(l,e)&&!l[e]&&"0001"!=l.id))}function ve(e){return!!V(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(le.value=fe(),me())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?de.value.map(((e,l)=>R({...e,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth},["name","show","sort","alias","fixedWay","columnWidth"]))):de.value,e.map((e=>R(e,["uuid"])))}}),(l,i)=>(a(),r("div",U,[e.showSearch?(a(),n(s(C),{key:0,class:"main-wrapper__search-wrapper",value:Z.value,"onUpdate:value":i[0]||(i[0]=e=>Z.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(he,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",T,[(a(!0),r(p,null,m(oe.value,((l,i)=>(a(),r(p,{key:i},[l.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(s(B)(l,i,e.columnWidthProps))},["checkbox"!==l.type||l.isHeadCheckHide?(a(),r(p,{key:1},[b(g(l.title),1)],64)):(a(),n(s(A),{key:0,checked:l.checkedAll,"onUpdate:checked":[e=>l.checkedAll=e,e=>{return i=e,t=l.field,void de.value.forEach((e=>{j(e,t)||(e[t]=i)}));var i,t}],disabled:l.disabledAll},{default:v((()=>[b(g(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(a(),n(s(_),{key:2,trigger:"hover"},{trigger:v((()=>[x(s(W),{component:s(K),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[L])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ee},[(a(),n(s(D),{modelValue:le.value,"onUpdate:modelValue":i[1]||(i[1]=e=>le.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:ve,disabled:!e.rowDraggable,key:Y.value},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:k(["item",s(V)(e)?"":"disabled"]),tabindex:l},[s(M)(e)?(a(!0),r(p,{key:0},m(e,((e,i)=>(a(),n(F,w(re,{key:i,element:e,idx:l+1,"is-highlight":pe(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),n(F,w({key:1},re,{element:e,idx:l+1,"is-highlight":pe(e)}),null,16,["element","idx","is-highlight"]))],10,G))])),_:1},8,["modelValue","disabled"]))],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[x(s(E),{onPositiveClick:ce},{trigger:v((()=>[x(s(H),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),x(s(H),{style:{"margin-right":"8px"},onClick:ue},{default:v((()=>[b("取消")])),_:1}),x(s(H),{type:"primary",onClick:se},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PropType, CSSProperties } from 'vue';
|
1
|
+
import { PropType, CSSProperties, VNodeChild } from 'vue';
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
3
|
import { FieldSetColumnItem } from '../../../../components/field-set';
|
4
4
|
import { setStyle, setColorInfo } from '../utils';
|
@@ -86,6 +86,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
86
86
|
type: PropType<AnyObject[]>;
|
87
87
|
default: () => never[];
|
88
88
|
};
|
89
|
+
primaryKey: {
|
90
|
+
type: StringConstructor;
|
91
|
+
default: string;
|
92
|
+
};
|
93
|
+
titleRender: {
|
94
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
95
|
+
};
|
89
96
|
}, {
|
90
97
|
fixedWayOptions: {
|
91
98
|
label: string;
|
@@ -184,6 +191,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
184
191
|
type: PropType<AnyObject[]>;
|
185
192
|
default: () => never[];
|
186
193
|
};
|
194
|
+
primaryKey: {
|
195
|
+
type: StringConstructor;
|
196
|
+
default: string;
|
197
|
+
};
|
198
|
+
titleRender: {
|
199
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
200
|
+
};
|
187
201
|
}>> & {
|
188
202
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
189
203
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -197,10 +211,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
197
211
|
isMultiple: (field: string) => boolean;
|
198
212
|
isRender: (field: string) => boolean;
|
199
213
|
isShow: (field: string) => any;
|
214
|
+
showRelation: (field: string) => boolean;
|
200
215
|
getSortPriorityOptions: () => {
|
201
216
|
label: string;
|
202
217
|
value: number;
|
203
218
|
}[];
|
219
|
+
getSelectText: (field: string) => "密码无需设置" | "主键不可设置" | "不支持脱敏设置" | undefined;
|
204
220
|
selectProps: (field: string) => {
|
205
221
|
valueField: string;
|
206
222
|
labelField: string;
|
@@ -218,12 +234,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
218
234
|
NIcon: any;
|
219
235
|
NColorPicker: any;
|
220
236
|
NPopconfirm: any;
|
237
|
+
NPopover: any;
|
238
|
+
NSpace: any;
|
221
239
|
setStyle: typeof setStyle;
|
222
240
|
setColorInfo: typeof setColorInfo;
|
223
241
|
ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
224
242
|
TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
225
243
|
CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
226
244
|
HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
245
|
+
CaretDownOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
227
246
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
228
247
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
229
248
|
element: {
|
@@ -309,6 +328,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
309
328
|
type: PropType<AnyObject[]>;
|
310
329
|
default: () => never[];
|
311
330
|
};
|
331
|
+
primaryKey: {
|
332
|
+
type: StringConstructor;
|
333
|
+
default: string;
|
334
|
+
};
|
335
|
+
titleRender: {
|
336
|
+
type: PropType<(row: AnyObject) => VNodeChild>;
|
337
|
+
};
|
312
338
|
}>> & {
|
313
339
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
314
340
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -331,6 +357,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
331
357
|
requiredDisable: boolean;
|
332
358
|
hide: boolean;
|
333
359
|
}>[];
|
360
|
+
primaryKey: string;
|
334
361
|
index: number;
|
335
362
|
columns: FieldSetColumnItem[];
|
336
363
|
element: Partial<{
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,openBlock as
|
1
|
+
import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as r,unref as a,createBlock as o,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as c,toDisplayString as f,resolveDynamicComponent as p,normalizeClass as m,withDirectives as v,vShow as y,mergeProps as h,createTextVNode as g}from"vue";import{NTooltip as b,NIcon as k,NCheckbox as x,NPopover as E,NSpace as S,NSelect as D,NColorPicker as w,NInput as T,NInputNumber as O,NPopconfirm as R}from"naive-ui";import{setStyle as M,setColorInfo as N,isShowExplicitRequired as U,isDisable as P}from"../utils/index.js";import{ReorderTwoOutline as _,HelpCircleOutline as j,CaretDownOutline as A,CreateOutline as C,TrashOutline as F}from"@vicons/ionicons5";import{isFunction as L,isArray as H,range as I}from"lodash-es";import{COLOR_MAP as B}from"../constants/index.js";import{WIDGET_TYPE as V,SELECT_MAP as W,WIDGET_MAP as q,SELECT_TYPE as K,SELECT_DEFAULT_MAP as $,DATE_MAP as z,DATETIME_MAP as G}from"../constants/filter.js";const J={class:"row"},Q=["title"],X=c("span",null,"拖拽调整顺序",-1),Y={key:0};var Z=e({__name:"table-row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionOption:{type:Array,default:()=>[]},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["updateChecked","edit"],setup(e,{emit:Z}){const ee=e,te=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],le=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],ie=[{label:"字体",value:"font"},{label:"背景",value:"background"}],ne=Object.entries(B).map((([e])=>e));function re(){ee.data.splice(ee.index,1)}function ae(){Z("edit",ee.element)}function oe(){var e;return ee.element.feildDescribe||(null==(e=ee.element.settingObj)?void 0:e.fieldDescDev)}function de(e){return"seq"===e?ee.idx:"optionType"===e?ee.element[e]&&ee.element.type===V.SELECT?W[ee.element[e]]:"":"type"===e?q[ee.element[e]]:ee.element[e]}function ue(e){if("defaultValue"===e){const{optionType:e}=ee.element;return e===K.SELECT_MULTIPLE}return!1}function se(e){if("0001"==ee.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:t}=ee.element;return"isShowHeaderFilter"===e?!!t:!(["explicitRequired","defaultValue"].includes(e)&&![V.DATE,V.DATETIME,V.SELECT].includes(ee.element.type)||["editable"].includes(e)&&ee.element[`${e}Hide`])}function ce(e){return["explicitRequired","defaultValue"].includes(e)?U(ee.element):!["isSum","isAvg"].includes(e)||"NUMBER"===ee.element.fieldType}function fe(e){const{relation:t}=ee.element;return"isSearch"===e&&H(null==t?void 0:t.fieldList)&&t.fieldList.length>0}function pe(e){if("hideExpression"===e)return"PASSWORD"===ee.element.attrType?"密码无需设置":ee.element.name===ee.primaryKey||ee.element.columnName===ee.primaryKey?"主键不可设置":ee.element.disableDesensitization||ee.element[`${e}Disabled`]?"不支持脱敏设置":void 0}function me(e){const t={valueField:"value",labelField:"label"};return"hideExpression"===e&&(t.valueField="ruleId",t.labelField="name"),t}function ve(e){var t;switch(e.field){case"fixedWay":return te;case"sortDirection":return le;case"sortPriority":return function(){const e=I(1,ee.data.length+1).map((e=>({label:e.toString(),value:e}))),t=ee.data.filter((e=>!!e.sortPriority&&e.uuid!==ee.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!t.includes(e.value)))}();case"colorScope":return ie;case"hideExpression":return null==(t=ee.hideExpressionOption)?void 0:t.map((e=>({...e,ruleId:`ruleId#${e.code}`})));case"defaultValue":{const{type:e,optionInfo:t}=ee.element;return e===V.SELECT?H(null==t?void 0:t.list)&&t.list.length>0?t.list.map((e=>({...e,label:e.name}))):Object.entries($).map((([e,t])=>({value:e,label:t}))):e===V.DATE?Object.entries(z).map((([e,t])=>({value:e,label:t}))):e===V.DATETIME?Object.entries(G).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function ye(e){var t;if(1==ee.element.defaultMark||"color"===e.type&&ee.isHighlightRow)return!0;if("checkbox"===e.type){if("show"===e.field&&e.fieldShowMaxValue)return!ee.element[e.field]&&(null==(t=ee.data.filter((t=>t[e.field])))?void 0:t.length)===e.fieldShowMaxValue;if(["isSearch","isSum","isAvg"].includes(e.field)){if(Reflect.has(ee.element,"isMerge"))return 1==ee.element.isMerge;if("isSearch"===e.field&&Reflect.has(ee.element,"notParticipatingSearch"))return 1==ee.element.notParticipatingSearch}return P(ee.element,e.field)}if("sortPriority"===e.field){const{sortDirection:e}=ee.element;return!e||"NONE"===e}return P(ee.element,e.field)}function he(e){return["title","result"].includes(e.field)&&ee.element.style||{}}return(U,P)=>(t(),l("div",J,[(t(!0),l(i,null,n(e.columns,((U,H)=>{return t(),l(i,{key:H},[U.isShow?(t(),l("span",{key:0,class:"table-cell",title:e.element[U.field],style:r(a(M)(U,H,e.columnWidthProps))},["text"===U.type?(t(),l(i,{key:0},[0===H?(t(),l(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(t(),o(a(b),{key:0,trigger:"hover"},{trigger:d((()=>[u(a(k),{style:{"margin-right":"5px",top:"2px"},component:a(_)},null,8,["component"])])),default:d((()=>[X])),_:1})):s("v-if",!0),(I=U.field,"title"===I&&("tooltip"===ee.fieldDescribeMode&&ee.element.feildDescribe||ee.developMode&&(null==(B=ee.element.settingObj)?void 0:B.fieldDescDev))?(t(),o(a(b),{key:1,trigger:"hover"},{trigger:d((()=>[u(a(k),{style:{"margin-right":"5px",top:"2px"},component:a(j)},null,8,["component"])])),default:d((()=>[c("span",null,f(oe()),1)])),_:1})):s("v-if",!0)),a(L)(e.titleRender)?(t(),o(p((()=>e.titleRender(e.element))),{key:2})):s("v-if",!0)],64)):s("v-if",!0),0===H&&a(L)(e.titleRender)?s("v-if",!0):(t(),l("span",{key:1,class:m([e.isHighlight&&"title"===U.field?"highlight":""]),style:r(he(U))},f(de(U.field)),7))],64)):s("v-if",!0),"checkbox"===U.type&&se(U.field)?(t(),l(i,{key:1},[v(u(a(x),{disabled:ye(U),checked:e.element[U.field],"onUpdate:checked":[t=>e.element[U.field]=t,e=>function(e,t){Z("updateChecked",{checked:e,column:t})}(e,U)]},null,8,["disabled","checked","onUpdate:checked"]),[[y,ce(U.field)]]),fe(U.field)?(t(),o(a(E),{key:0,placement:"right-start","show-arrow":!1},{trigger:d((()=>[u(a(k),{style:{"margin-left":"5px",top:"2px"},component:a(A)},null,8,["component"])])),default:d((()=>[c("div",null,[c("span",null,f(e.element.relation.tableName),1),u(a(S),{"wrap-item":!1,vertical:""},{default:d((()=>[(t(!0),l(i,null,n(e.element.relation.fieldList,(e=>v((t(),o(a(x),{key:e.id,checked:e.checked,"onUpdate:checked":t=>e.checked=t,label:e.title},null,8,["checked","onUpdate:checked","label"])),[[y,"0001"!==e.sid]]))),128))])),_:1})])])),_:1})):s("v-if",!0)],64)):s("v-if",!0),"select"===U.type&&se(U.field)?(t(),l(i,{key:2},[pe(U.field)?(t(),l("span",Y,f(pe(U.field)),1)):v((t(),o(a(D),h({key:1},me(U.field),{clearable:"",multiple:ue(U.field),disabled:ye(U),value:e.element[U.field],"onUpdate:value":[t=>e.element[U.field]=t,e=>function(e,t){"sortDirection"!==t.field||"NONE"!==e&&e||(ee.element.sortPriority=null),"colorScope"===t.field&&N(ee.element)}(e,U)],options:ve(U)}),null,16,["multiple","disabled","value","onUpdate:value","options"])),[[y,ce(U.field)]])],64)):s("v-if",!0),"color"===U.type?(t(),o(a(w),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:ye(U),value:e.element[U.field],"onUpdate:value":[t=>e.element[U.field]=t,P[0]||(P[0]=t=>a(N)(e.element))],"show-preview":"",modes:["hex"],swatches:a(ne)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===U.type?v((t(),o(a(T),{key:4,value:e.element[U.field],"onUpdate:value":t=>e.element[U.field]=t,clearable:""},null,8,["value","onUpdate:value"])),[[y,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===U.type?(t(),o(a(O),{key:5,value:e.element[U.field],"onUpdate:value":t=>e.element[U.field]=t},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===U.type&&a(L)(U.contentRender)?(t(),o(p((()=>U.contentRender(U,e.element))),{key:6})):s("v-if",!0),"custom"===U.type&&"opt"===U.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(k),{component:a(C),onClick:ae},null,8,["component"])])),default:d((()=>[g(" 编辑 ")])),_:1}),u(a(R),{onPositiveClick:re},{trigger:d((()=>[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(k),{component:a(F)},null,8,["component"])])),default:d((()=>[g(" 删除 ")])),_:1})])),default:d((()=>[g(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,Q)):s("v-if",!0)],64);var I,B})),128))]))}});export{Z as default};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AnyObject } from '../../../../shared/types';
|
2
|
-
import {
|
2
|
+
import { VNodeChild } from 'vue';
|
3
3
|
export type FieldSetItem = Partial<{
|
4
4
|
id: string;
|
5
5
|
name: string;
|
@@ -18,7 +18,7 @@ export type FieldSetItem = Partial<{
|
|
18
18
|
hide: boolean;
|
19
19
|
[key: string]: any;
|
20
20
|
}>;
|
21
|
-
export type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth' | 'hideExpression';
|
21
|
+
export type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth' | 'hideExpression' | 'isSearch' | 'isSum' | 'isAvg';
|
22
22
|
export type FieldSetColumnItem = {
|
23
23
|
title: string;
|
24
24
|
type: 'text' | 'checkbox' | 'select' | 'input' | 'inputNumber' | 'color' | 'custom';
|
@@ -27,7 +27,7 @@ export type FieldSetColumnItem = {
|
|
27
27
|
disabledAll?: boolean;
|
28
28
|
isHeadCheckHide?: boolean;
|
29
29
|
isShow?: boolean;
|
30
|
-
contentRender?: (column: AnyObject, row: AnyObject) =>
|
30
|
+
contentRender?: (column: AnyObject, row: AnyObject) => VNodeChild;
|
31
31
|
[key: string]: any;
|
32
32
|
};
|
33
33
|
export type FieldSetTab = 'field' | 'fieldColor' | 'highlightRow' | 'tableStyle' | 'fieldFilter';
|
@@ -1 +1 @@
|
|
1
|
-
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as
|
1
|
+
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as i}from"../../../iho-table/src/constants/index.js";import{COLOR_MAP as o}from"../constants/index.js";import{WIDGET_TYPE as n}from"../constants/filter.js";function r(e,t,i){const o={flex:"1 1 90px"};switch(e.type){case"text":0===t&&["title","name"].includes(e.field)&&Object.assign(o,{flex:"1 1 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(o.flex="1 1 40px");break;case"checkbox":o.flex="1 1 60px";break;case"select":o.flex="1 1 80px";break;case"input":o.flex="1 1 100px"}if(i){const t=Object.keys(i);t.length>0&&t.includes(e.field)&&i[e.field]&&(o.flex=`1 1 ${i[e.field]}px`)}return o}function l(e,t){return["editable","required","show","sortDirection","fixedWay","isSearch","isSum","isAvg"].includes(t)&&(e[`${t}Disable`]||e[`${t}Disabled`])||["sort"].includes(t)&&(1==e.notParticipatingSort||e.sortDisabled)}function s(o,n,r=(e=>e.name)){const l=n.map((e=>r(e)));return i.some((i=>{const n=o[i];if(!e(n))return!0;n.forEach((i=>{if(!e(i.list)||!i.list.length)return;const o=[];let n=null;i.list.forEach(((e,r)=>{const s=function(e,i,o){return i.findIndex((i=>i!==o&&(t(i)?i.fieldName:i)===e))}(e,l,n);~s&&(o.push(l[s]),0===r?l.splice(s,1,n={fieldName:i.title,children:o}):l.splice(s,1))}))}))})),l}function c(e){return void 0===e.draggable||e.draggable}function f(t){return e(t)?!t.some((e=>!e.draggable)):t.draggable}function a(e){e.style="font"===e.colorScope?{color:e.color}:{background:e.color,color:"#fff"},e.result=o[e.color]}function d(e){const{isShowSearch:t,filterExplicit:i,type:o}=e;return t&&i&&[n.DATE,n.DATETIME,n.SELECT].includes(o)}export{s as getGroupTree,l as isDisable,c as isDraggable,f as isDraggableItem,d as isShowExplicitRequired,a as setColorInfo,r as setStyle};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),g=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,v;const y=g(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(v=r(e.multi_select_value))?v:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=g(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=g(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=g(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=g(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=g(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=g(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=g(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=g(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=g(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=g(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=g(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:p(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return p(t)}return o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),g=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,v;const y=g(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(v=r(e.multi_select_value))?v:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=g(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=g(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=g(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=g(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=g(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=g(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=g(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=g(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=g(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=g(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=g(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=g(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:p(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return p(t)}return o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
|