cnhis-design-vue 3.1.57-beta.4 → 3.1.57-beta.6
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/button-print/index.d.ts +8 -8
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -8
- package/es/components/button-print/src/components/EditFormat.vue.d.ts +3 -3
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +7 -7
- package/es/components/callback/src/components/render/popupMaps.d.ts +3 -3
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +3 -0
- package/es/components/expand-field/index.d.ts +3 -3
- package/es/components/expand-field/src/components/form.vue.d.ts +3 -3
- package/es/components/expand-field/src/index.vue.d.ts +3 -3
- package/es/components/fabric-chart/index.d.ts +2 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
- package/es/components/fabric-chart/src/interface.d.ts +1 -3
- package/es/components/field-set/index.d.ts +107 -616
- package/es/components/field-set/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1680 -0
- package/es/components/field-set/src/FieldColor.vue.js +1 -0
- package/es/components/field-set/src/FieldColor.vue2.js +1 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +58 -16
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue.d.ts +141 -0
- package/es/components/field-set/src/Index.vue.js +1 -0
- package/es/components/field-set/src/Index.vue2.js +1 -0
- package/es/components/field-set/src/components/Row.vue.d.ts +50 -9
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +172 -0
- package/es/components/field-set/src/components/condition.vue.js +1 -0
- package/es/components/field-set/src/components/condition.vue2.js +1 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1194 -0
- package/es/components/field-set/src/components/edit-dialog.vue.js +1 -0
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +286 -0
- package/es/components/field-set/src/components/edit-filter.vue.js +1 -0
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -0
- package/es/components/field-set/src/constants/index.d.ts +55 -0
- package/es/components/field-set/src/constants/index.js +1 -0
- package/es/components/field-set/src/types/index.d.ts +31 -1
- package/es/components/field-set/src/utils/index.d.ts +2 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +6 -6
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -6
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/index.d.ts +3 -3
- package/es/components/form-render/src/FormRender.vue.d.ts +3 -3
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -3
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +8 -8
- package/es/components/info-header/src/InfoHeader.vue.d.ts +8 -8
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -3
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -3
- package/es/components/keyboard/index.d.ts +1 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
- package/es/components/quick-search/index.d.ts +3 -3
- package/es/components/quick-search/src/index.vue.d.ts +3 -3
- package/es/components/recommend-search/index.d.ts +6 -6
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +6 -6
- package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
- package/es/components/scale-view/index.d.ts +3 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -3
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
- package/es/components/select-label/index.d.ts +2 -2
- package/es/components/select-label/src/LabelFormContent.vue.d.ts +1 -1
- package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
- package/es/components/select-label/src/index.vue.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +3 -3
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -3
- package/es/components/table-export-field/index.d.ts +3 -3
- package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +3 -3
- package/es/components/table-export-field/src/index.vue.d.ts +3 -3
- package/es/components/time-line/index.d.ts +7 -7
- package/es/components/time-line/src/TimeLine.vue.d.ts +3 -3
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./FieldColor.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","FieldColor.vue"]]);export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as f,createVNode as c,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import g from"../../../shared/components/VueDraggable/src/vuedraggable.js";import x from"./components/Row.vue.js";import k from"./components/edit-dialog.vue.js";import{cloneDeep as w,omit as _}from"lodash-es";import{setColorInfo as C,setStyle as F}from"./utils/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import{format as A}from"date-fns";const D={class:"main-wrapper"},S={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},B=["tabindex"],E={key:0,class:"main-wrapper__table-footer"};var R=e({__name:"FieldColor",props:{rowHeight:{type:Number,default:52},footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:R,emit:H}){const L=e,M=l(!1),N=l(null),U=l([]),Y=l([{title:"名称",type:"text",field:"name"},{title:"字段",type:"text",field:"title"},{title:"创建时间",type:"text",field:"createDate"},{title:"效果",type:"text",field:"result"},{title:"颜色",type:"color",field:"color"},{title:"颜色应用于",type:"select",checkedAll:!1,disabledAll:!1,field:"colorScope"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"status"},{title:"操作",type:"custom",field:"opt"}]),I=t({columns:Y,data:U,onEdit:function(e){N.value=w(e),M.value=!0},isHighlightRow:!L.isFieldColor});function T(){H("save")}function $(){H("close")}function q(){N.value=null,M.value=!0}function z(e){if(C(e),N.value){const l=U.value.findIndex((l=>l.uuid===e.uuid));U.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");U.value.push({...e,createDate:l,uuid:j()})}}return Y.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&L.isFieldColor||"title"===e.field&&!L.isFieldColor)}(e)})),U.value=L.defaultList.concat(U.value),U.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),R({getTableFields:function(){return U.value.map((e=>{const l=w(e);return l.status=l.status?"Y":"N",_(l,["uuid","style","result"])}))}}),(l,t)=>(i(),o("div",D,[a("div",S,[(i(!0),o(s,null,r(Y.value,((e,l)=>(i(),o(s,{key:l},[e.isShow?(i(),o("span",{key:0,class:"table-cell",style:u(d(F)(e,l))},n(e.title),5)):f("v-if",!0)],64)))),128))]),a("div",V,[c(d(g),{modelValue:U.value,"onUpdate:modelValue":t[0]||(t[0]=e=>U.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?f("v-if",!0):(i(),o("div",{key:0,class:"item",tabindex:l},[c(x,m(I,{element:e,index:l}),null,16,["element","index"])],8,B))])),_:1},8,["modelValue"])],512),e.footerFlag?(i(),o("div",E,[f(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[c(d(h),{style:{"margin-right":"8px"},onClick:$},{default:p((()=>[y("取消")])),_:1}),c(d(h),{style:{"margin-right":"8px"},onClick:q},{default:p((()=>[y("新增")])),_:1}),c(d(h),{type:"primary",onClick:T},{default:p((()=>[y("保存")])),_:1})]))])):f("v-if",!0),M.value?(i(),b(k,{key:1,visible:M.value,"onUpdate:visible":t[1]||(t[1]=e=>M.value=e),"is-field-color":e.isFieldColor,row:N.value,onConfirm:z},null,8,["visible","is-field-color","row"])):f("v-if",!0)]))}});export{R as default};
|
|
@@ -68,6 +68,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
68
|
};
|
|
69
69
|
}, {
|
|
70
70
|
fieldsMapping: Record<string, string>;
|
|
71
|
+
attrs: {
|
|
72
|
+
[x: string]: unknown;
|
|
73
|
+
};
|
|
71
74
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
72
75
|
fields: {
|
|
73
76
|
type: PropType<Partial<{
|
|
@@ -133,19 +136,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
136
|
};
|
|
134
137
|
}>> & {
|
|
135
138
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
136
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
137
139
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
140
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
138
141
|
}>>;
|
|
139
142
|
emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
|
|
140
|
-
primaryColor: import("vue").Ref<string>;
|
|
141
|
-
rowHeight: number;
|
|
142
143
|
keyword: import("vue").Ref<string>;
|
|
143
144
|
tableBodyRef: import("vue").Ref<HTMLDivElement | undefined>;
|
|
144
145
|
newFields: import("vue").Ref<AnyObject[]>;
|
|
145
146
|
columns: import("vue").Ref<{
|
|
146
147
|
[x: string]: any;
|
|
147
148
|
title: string;
|
|
148
|
-
type: "
|
|
149
|
+
type: "color" | "checkbox" | "text" | "input" | "select" | "custom" | "inputNumber";
|
|
149
150
|
field: string;
|
|
150
151
|
checkedAll?: boolean | undefined;
|
|
151
152
|
disabledAll?: boolean | undefined;
|
|
@@ -160,7 +161,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
160
161
|
columns: {
|
|
161
162
|
[x: string]: any;
|
|
162
163
|
title: string;
|
|
163
|
-
type: "
|
|
164
|
+
type: "color" | "checkbox" | "text" | "input" | "select" | "custom" | "inputNumber";
|
|
164
165
|
field: string;
|
|
165
166
|
checkedAll?: boolean | undefined;
|
|
166
167
|
disabledAll?: boolean | undefined;
|
|
@@ -170,7 +171,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
170
171
|
[key: string]: any;
|
|
171
172
|
}>) | undefined;
|
|
172
173
|
}[];
|
|
173
|
-
|
|
174
|
+
data: AnyObject[];
|
|
174
175
|
onUpdateChecked: ({ checked, column }: {
|
|
175
176
|
checked: boolean;
|
|
176
177
|
column: AnyObject;
|
|
@@ -307,7 +308,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
307
308
|
type: NumberConstructor;
|
|
308
309
|
default: number;
|
|
309
310
|
};
|
|
310
|
-
|
|
311
|
+
data: {
|
|
311
312
|
type: PropType<Partial<{
|
|
312
313
|
[key: string]: any;
|
|
313
314
|
id: string;
|
|
@@ -331,6 +332,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
331
332
|
isHighlight: {
|
|
332
333
|
type: BooleanConstructor;
|
|
333
334
|
};
|
|
335
|
+
index: {
|
|
336
|
+
type: NumberConstructor;
|
|
337
|
+
default: number;
|
|
338
|
+
};
|
|
339
|
+
isHighlightRow: {
|
|
340
|
+
type: BooleanConstructor;
|
|
341
|
+
default: boolean;
|
|
342
|
+
};
|
|
334
343
|
}, {
|
|
335
344
|
fixedWayOptions: {
|
|
336
345
|
label: string;
|
|
@@ -340,6 +349,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
340
349
|
label: string;
|
|
341
350
|
value: string;
|
|
342
351
|
}[];
|
|
352
|
+
colorScopeOptions: {
|
|
353
|
+
label: string;
|
|
354
|
+
value: string;
|
|
355
|
+
}[];
|
|
356
|
+
swatches: string[];
|
|
343
357
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
344
358
|
element: {
|
|
345
359
|
type: PropType<Partial<{
|
|
@@ -370,7 +384,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
370
384
|
type: NumberConstructor;
|
|
371
385
|
default: number;
|
|
372
386
|
};
|
|
373
|
-
|
|
387
|
+
data: {
|
|
374
388
|
type: PropType<Partial<{
|
|
375
389
|
[key: string]: any;
|
|
376
390
|
id: string;
|
|
@@ -394,10 +408,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
394
408
|
isHighlight: {
|
|
395
409
|
type: BooleanConstructor;
|
|
396
410
|
};
|
|
411
|
+
index: {
|
|
412
|
+
type: NumberConstructor;
|
|
413
|
+
default: number;
|
|
414
|
+
};
|
|
415
|
+
isHighlightRow: {
|
|
416
|
+
type: BooleanConstructor;
|
|
417
|
+
default: boolean;
|
|
418
|
+
};
|
|
397
419
|
}>> & {
|
|
398
420
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
421
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
|
399
422
|
}>>;
|
|
400
|
-
emit: (event: "updateChecked", ...args: any[]) => void;
|
|
423
|
+
emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
|
|
424
|
+
onRemove: () => void;
|
|
425
|
+
onEdit: () => void;
|
|
401
426
|
isCheckboxShow: (item: Partial<{
|
|
402
427
|
[key: string]: any;
|
|
403
428
|
id: string;
|
|
@@ -428,6 +453,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
428
453
|
value: number;
|
|
429
454
|
}[];
|
|
430
455
|
setDisabled: (column: AnyObject) => any;
|
|
456
|
+
getStyle: (column: AnyObject) => import("vue").CSSProperties;
|
|
431
457
|
onUpdateChecked: (checked: boolean, column: AnyObject) => void;
|
|
432
458
|
handleUpdateSelect: (value: string, column: AnyObject) => void;
|
|
433
459
|
NCheckbox: any;
|
|
@@ -436,10 +462,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
436
462
|
NInputNumber: any;
|
|
437
463
|
NTooltip: any;
|
|
438
464
|
NIcon: any;
|
|
465
|
+
NColorPicker: any;
|
|
466
|
+
NPopconfirm: any;
|
|
439
467
|
setStyle: typeof setStyle;
|
|
468
|
+
setColorInfo: typeof import("./utils").setColorInfo;
|
|
440
469
|
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<{}>>, {}>;
|
|
470
|
+
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<{}>>, {}>;
|
|
471
|
+
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<{}>>, {}>;
|
|
441
472
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
|
442
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "updateChecked"[], "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
473
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
443
474
|
element: {
|
|
444
475
|
type: PropType<Partial<{
|
|
445
476
|
[key: string]: any;
|
|
@@ -469,7 +500,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
469
500
|
type: NumberConstructor;
|
|
470
501
|
default: number;
|
|
471
502
|
};
|
|
472
|
-
|
|
503
|
+
data: {
|
|
473
504
|
type: PropType<Partial<{
|
|
474
505
|
[key: string]: any;
|
|
475
506
|
id: string;
|
|
@@ -493,11 +524,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
493
524
|
isHighlight: {
|
|
494
525
|
type: BooleanConstructor;
|
|
495
526
|
};
|
|
527
|
+
index: {
|
|
528
|
+
type: NumberConstructor;
|
|
529
|
+
default: number;
|
|
530
|
+
};
|
|
531
|
+
isHighlightRow: {
|
|
532
|
+
type: BooleanConstructor;
|
|
533
|
+
default: boolean;
|
|
534
|
+
};
|
|
496
535
|
}>> & {
|
|
497
536
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
537
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
|
498
538
|
}, {
|
|
499
|
-
|
|
500
|
-
fieldList: Partial<{
|
|
539
|
+
data: Partial<{
|
|
501
540
|
[key: string]: any;
|
|
502
541
|
id: string;
|
|
503
542
|
name: string;
|
|
@@ -515,6 +554,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
515
554
|
requiredDisable: boolean;
|
|
516
555
|
hide: boolean;
|
|
517
556
|
}>[];
|
|
557
|
+
columns: FieldSetColumnItem[];
|
|
558
|
+
index: number;
|
|
518
559
|
element: Partial<{
|
|
519
560
|
[key: string]: any;
|
|
520
561
|
id: string;
|
|
@@ -533,6 +574,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
533
574
|
requiredDisable: boolean;
|
|
534
575
|
hide: boolean;
|
|
535
576
|
}>;
|
|
577
|
+
isHighlightRow: boolean;
|
|
536
578
|
idx: number;
|
|
537
579
|
isHighlight: boolean;
|
|
538
580
|
}>;
|
|
@@ -608,11 +650,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
608
650
|
};
|
|
609
651
|
}>> & {
|
|
610
652
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
611
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
612
653
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
654
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
613
655
|
}, {
|
|
614
656
|
type: string;
|
|
615
|
-
showSeq: boolean;
|
|
616
657
|
fields: Partial<{
|
|
617
658
|
[key: string]: any;
|
|
618
659
|
id: string;
|
|
@@ -631,8 +672,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
631
672
|
requiredDisable: boolean;
|
|
632
673
|
hide: boolean;
|
|
633
674
|
}>[];
|
|
634
|
-
footerFlag: boolean;
|
|
635
675
|
isEdit: boolean;
|
|
676
|
+
showSeq: boolean;
|
|
677
|
+
footerFlag: boolean;
|
|
636
678
|
customColumns: FieldSetColumnItem[];
|
|
637
679
|
showSearch: boolean;
|
|
638
680
|
showSortPriority: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive 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 k,createVNode as x,normalizeClass as g,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as C,NIcon as F,NPopconfirm as W,NButton as E}from"naive-ui";import H from"../../../shared/components/VueDraggable/src/vuedraggable.js";import N from"./components/Row.vue.js";import{isArray as P,cloneDeep as q,isString as R,omit as V}from"lodash-es";import{isDisable as j,setStyle as B,isDraggableItem as I,isDraggable as M,getGroupTree as U}from"./utils/index.js";import{uuidGenerator as D}from"../../../shared/utils/index.js";import{HelpCircleSharp as O}from"@vicons/ionicons5";const T={class:"main-wrapper"},K={class:"main-wrapper__table-header"},G=h("span",null,"数值越小,优先级越高",-1),L=["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}},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(),Z=t(""),ee=t(),le=t([]),te=t([{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"}]),ie=i((()=>le.value.flat())),oe=o({columns:te,data:ie,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t}}),de={keyword:Z.value,idx:0,startIdx:0},ae=()=>{J("save")},re=()=>{J("close")};function ne(){le.value=se(),fe(),J("reset")}function se(){const e=q(Q.fields).map((e=>({...e,uuid:D()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{"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=!!M(e)}))})),function(e){if(Q.groupSetting){return U(Q.groupSetting,e).reduce(((t,i)=>{const o=R(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}function ue(){const e=de.keyword!==Z.value;let l=Z.value?ie.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Z.value))return!!e||t>de.idx})):0;-1!==l||e||(l=de.startIdx),ee.value.scrollTop=Y.rowHeight*l,Object.assign(de,{keyword:Z.value,idx:l},e?{startIdx:l}:{})}function ce(e){var l;return!!Z.value&&(null==(l=e.title)?void 0:l.includes(Z.value))}function fe(){var e,l;(null==(e=Q.showColumnNames)?void 0:e.length)&&(te.value=te.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&te.value.push(...Q.customColumns),Q.showSeq&&te.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),te.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter)}(e),"checkbox"===e.type){const l=le.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!he(e.field)&&!l}}))}function he(e){return le.value.flat().some((l=>!j(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!I(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=se(),fe())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?ie.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,sortPriority:e.sortPriority,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):ie.value,e.map((e=>V(e,["uuid"])))}}),(l,t)=>(a(),r("div",T,[e.showSearch?(a(),n(s(A),{key:0,class:"main-wrapper__search-wrapper",value:Z.value,"onUpdate:value":t[0]||(t[0]=e=>Z.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(ue,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",K,[(a(!0),r(p,null,m(te.value,((e,l)=>(a(),r(p,{key:l},[e.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(s(B)(e,l))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),r(p,{key:1},[b(k(e.title),1)],64)):(a(),n(s(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void ie.value.forEach((e=>{j(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:v((()=>[b(k(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(a(),n(s(C),{key:2,trigger:"hover"},{trigger:v((()=>[x(s(F),{component:s(O),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ee},[x(s(H),{modelValue:le.value,"onUpdate:modelValue":t[1]||(t[1]=e=>le.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:g(["item",s(I)(e)?"":"disabled"]),tabindex:l},[s(P)(e)?(a(!0),r(p,{key:0},m(e,((e,t)=>(a(),n(N,w(oe,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),n(N,w({key:1},oe,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue"])],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[x(s(W),{onPositiveClick:ne},{trigger:v((()=>[x(s(E),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),x(s(E),{style:{"margin-right":"8px"},onClick:re},{default:v((()=>[b("取消")])),_:1}),x(s(E),{type:"primary",onClick:ae},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ColorSetItem, FieldSetTab, ColorSetWordbook } from '../../../components/field-set/src/types';
|
|
3
|
+
import { AnyObject } from '../../../shared/types';
|
|
4
|
+
declare type WordbookOption = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<{
|
|
10
|
+
showTabNames: {
|
|
11
|
+
type: PropType<FieldSetTab[]>;
|
|
12
|
+
default: () => string[];
|
|
13
|
+
};
|
|
14
|
+
fieldColorList: {
|
|
15
|
+
type: PropType<ColorSetItem[]>;
|
|
16
|
+
default: () => never[];
|
|
17
|
+
};
|
|
18
|
+
highlightRowColorList: {
|
|
19
|
+
type: PropType<ColorSetItem[]>;
|
|
20
|
+
default: () => never[];
|
|
21
|
+
};
|
|
22
|
+
fieldList: {
|
|
23
|
+
type: PropType<AnyObject[]>;
|
|
24
|
+
};
|
|
25
|
+
queryWordbookData: {
|
|
26
|
+
type: PropType<(params: ColorSetWordbook) => Promise<WordbookOption[]>>;
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
showTabNames: {
|
|
31
|
+
type: PropType<FieldSetTab[]>;
|
|
32
|
+
default: () => string[];
|
|
33
|
+
};
|
|
34
|
+
fieldColorList: {
|
|
35
|
+
type: PropType<ColorSetItem[]>;
|
|
36
|
+
default: () => never[];
|
|
37
|
+
};
|
|
38
|
+
highlightRowColorList: {
|
|
39
|
+
type: PropType<ColorSetItem[]>;
|
|
40
|
+
default: () => never[];
|
|
41
|
+
};
|
|
42
|
+
fieldList: {
|
|
43
|
+
type: PropType<AnyObject[]>;
|
|
44
|
+
};
|
|
45
|
+
queryWordbookData: {
|
|
46
|
+
type: PropType<(params: ColorSetWordbook) => Promise<WordbookOption[]>>;
|
|
47
|
+
};
|
|
48
|
+
}>> & {
|
|
49
|
+
onSave?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
}>>;
|
|
51
|
+
emit: (event: "save", ...args: any[]) => void;
|
|
52
|
+
setRefs: AnyObject;
|
|
53
|
+
primaryColor: import("vue").Ref<string>;
|
|
54
|
+
rowHeight: number;
|
|
55
|
+
tabList: import("vue").ComputedRef<{
|
|
56
|
+
name: FieldSetTab;
|
|
57
|
+
tab: string;
|
|
58
|
+
render: Function;
|
|
59
|
+
}[]>;
|
|
60
|
+
onSave: () => void;
|
|
61
|
+
setRef: (e: any, id: string) => void;
|
|
62
|
+
getTableFields: (type?: 'field' | 'fieldColor' | 'highlightRow') => any;
|
|
63
|
+
NTabs: any;
|
|
64
|
+
NTabPane: import("vue").DefineComponent<{
|
|
65
|
+
readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}> | (() => import("vue").VNodeChild)>;
|
|
68
|
+
readonly name: {
|
|
69
|
+
readonly type: PropType<string | number>;
|
|
70
|
+
readonly required: true;
|
|
71
|
+
};
|
|
72
|
+
readonly disabled: BooleanConstructor;
|
|
73
|
+
readonly displayDirective: {
|
|
74
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
75
|
+
readonly default: "if";
|
|
76
|
+
};
|
|
77
|
+
readonly closable: {
|
|
78
|
+
readonly type: PropType<boolean | undefined>;
|
|
79
|
+
readonly default: undefined;
|
|
80
|
+
};
|
|
81
|
+
readonly tabProps: PropType<import("vue").HTMLAttributes>;
|
|
82
|
+
readonly label: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
}> | (() => import("vue").VNodeChild)>;
|
|
85
|
+
}, {
|
|
86
|
+
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
87
|
+
class: import("vue").Ref<string | undefined>;
|
|
88
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
89
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
90
|
+
readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
}> | (() => import("vue").VNodeChild)>;
|
|
93
|
+
readonly name: {
|
|
94
|
+
readonly type: PropType<string | number>;
|
|
95
|
+
readonly required: true;
|
|
96
|
+
};
|
|
97
|
+
readonly disabled: BooleanConstructor;
|
|
98
|
+
readonly displayDirective: {
|
|
99
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
100
|
+
readonly default: "if";
|
|
101
|
+
};
|
|
102
|
+
readonly closable: {
|
|
103
|
+
readonly type: PropType<boolean | undefined>;
|
|
104
|
+
readonly default: undefined;
|
|
105
|
+
};
|
|
106
|
+
readonly tabProps: PropType<import("vue").HTMLAttributes>;
|
|
107
|
+
readonly label: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
108
|
+
[key: string]: any;
|
|
109
|
+
}> | (() => import("vue").VNodeChild)>;
|
|
110
|
+
}>>, {
|
|
111
|
+
readonly disabled: boolean;
|
|
112
|
+
readonly closable: boolean | undefined;
|
|
113
|
+
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
114
|
+
}>;
|
|
115
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "save"[], "save", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
116
|
+
showTabNames: {
|
|
117
|
+
type: PropType<FieldSetTab[]>;
|
|
118
|
+
default: () => string[];
|
|
119
|
+
};
|
|
120
|
+
fieldColorList: {
|
|
121
|
+
type: PropType<ColorSetItem[]>;
|
|
122
|
+
default: () => never[];
|
|
123
|
+
};
|
|
124
|
+
highlightRowColorList: {
|
|
125
|
+
type: PropType<ColorSetItem[]>;
|
|
126
|
+
default: () => never[];
|
|
127
|
+
};
|
|
128
|
+
fieldList: {
|
|
129
|
+
type: PropType<AnyObject[]>;
|
|
130
|
+
};
|
|
131
|
+
queryWordbookData: {
|
|
132
|
+
type: PropType<(params: ColorSetWordbook) => Promise<WordbookOption[]>>;
|
|
133
|
+
};
|
|
134
|
+
}>> & {
|
|
135
|
+
onSave?: ((...args: any[]) => any) | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
showTabNames: FieldSetTab[];
|
|
138
|
+
fieldColorList: ColorSetItem[];
|
|
139
|
+
highlightRowColorList: ColorSetItem[];
|
|
140
|
+
}>;
|
|
141
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./Index.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","Index.vue"]]);export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,provide as t,reactive as l,ref as i,computed as o,openBlock as a,createElementBlock as r,normalizeStyle as s,unref as d,createBlock as n,withCtx as f,Fragment as m,renderList as u,resolveDynamicComponent as h,mergeProps as p,createSlots as b,renderSlot as g,h as v}from"vue";import{useThemeVars as y,NTabs as c,NTabPane as F}from"naive-ui";import C from"./FieldSet.vue.js";import w from"./FieldColor.vue.js";import{InjectionFieldList as L,InjectionQueryWordbookData as T}from"./constants/index.js";var _=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function}},emits:["save"],setup(e,{expose:_,emit:$}){const k=e;t(L,k.fieldList),t(T,k.queryWordbookData);const x=l({}),R=i(y().value.primaryColor),j=o((()=>[{name:"field",tab:"字段设置",render:()=>v(C,{rowHeight:52})},{name:"fieldColor",tab:"字段颜色",render:()=>v(w,{isFieldColor:!0,defaultList:k.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>v(w,{isFieldColor:!1,defaultList:k.highlightRowColorList})}].filter((e=>k.showTabNames.includes(e.name)))));function A(){var e,t,l;$("save",{tableFields:null==(e=x.field)?void 0:e.getTableFields(),tableFieldColors:null==(t=x.fieldColor)?void 0:t.getTableFields(),tableHighlightRows:null==(l=x.highlightRow)?void 0:l.getTableFields()})}function q(e,t){x[t]=e}return _({getTableFields:function(e){var t;return null==(t=x[e||"field"])?void 0:t.getTableFields()}}),(e,t)=>(a(),r("div",{class:"c-field-set",style:s({"--row-height":"52px","--primary-color":R.value})},[d(j).length>1?(a(),n(d(c),{key:0,type:"line",naimated:""},{default:f((()=>[(a(!0),r(m,null,u(d(j),(t=>(a(),n(d(F),{key:t.name,name:t.name,tab:t.tab,"display-directive":"show"},{default:f((()=>[(a(),n(h(t.render()),p(e.$attrs,{ref_for:!0,ref:e=>q(e,t.name),onSave:A}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[g(e.$slots,l)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(a(),n(h(d(j)[0].render()),p({key:1},e.$attrs,{ref:e=>q(e,d(j)[0].name)}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[g(e.$slots,l)]))})))]),1040))],4))}});export{_ as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, CSSProperties } from 'vue';
|
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
|
3
3
|
import { FieldSetItem, FieldSetColumnItem } from '../../../../components/field-set';
|
|
4
|
-
import { setStyle } from '../utils';
|
|
4
|
+
import { setStyle, setColorInfo } from '../utils';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
element: {
|
|
7
7
|
type: PropType<Partial<{
|
|
@@ -32,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
32
|
type: NumberConstructor;
|
|
33
33
|
default: number;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
data: {
|
|
36
36
|
type: PropType<Partial<{
|
|
37
37
|
[key: string]: any;
|
|
38
38
|
id: string;
|
|
@@ -56,6 +56,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
isHighlight: {
|
|
57
57
|
type: BooleanConstructor;
|
|
58
58
|
};
|
|
59
|
+
index: {
|
|
60
|
+
type: NumberConstructor;
|
|
61
|
+
default: number;
|
|
62
|
+
};
|
|
63
|
+
isHighlightRow: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
59
67
|
}, {
|
|
60
68
|
fixedWayOptions: {
|
|
61
69
|
label: string;
|
|
@@ -65,6 +73,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
73
|
label: string;
|
|
66
74
|
value: string;
|
|
67
75
|
}[];
|
|
76
|
+
colorScopeOptions: {
|
|
77
|
+
label: string;
|
|
78
|
+
value: string;
|
|
79
|
+
}[];
|
|
80
|
+
swatches: string[];
|
|
68
81
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
69
82
|
element: {
|
|
70
83
|
type: PropType<Partial<{
|
|
@@ -95,7 +108,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
95
108
|
type: NumberConstructor;
|
|
96
109
|
default: number;
|
|
97
110
|
};
|
|
98
|
-
|
|
111
|
+
data: {
|
|
99
112
|
type: PropType<Partial<{
|
|
100
113
|
[key: string]: any;
|
|
101
114
|
id: string;
|
|
@@ -119,10 +132,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
132
|
isHighlight: {
|
|
120
133
|
type: BooleanConstructor;
|
|
121
134
|
};
|
|
135
|
+
index: {
|
|
136
|
+
type: NumberConstructor;
|
|
137
|
+
default: number;
|
|
138
|
+
};
|
|
139
|
+
isHighlightRow: {
|
|
140
|
+
type: BooleanConstructor;
|
|
141
|
+
default: boolean;
|
|
142
|
+
};
|
|
122
143
|
}>> & {
|
|
123
144
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
145
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
|
124
146
|
}>>;
|
|
125
|
-
emit: (event: "updateChecked", ...args: any[]) => void;
|
|
147
|
+
emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
|
|
148
|
+
onRemove: () => void;
|
|
149
|
+
onEdit: () => void;
|
|
126
150
|
isCheckboxShow: (item: FieldSetItem, key: string) => any;
|
|
127
151
|
getSortPriorityOptions: () => {
|
|
128
152
|
label: string;
|
|
@@ -136,6 +160,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
136
160
|
value: number;
|
|
137
161
|
}[];
|
|
138
162
|
setDisabled: (column: AnyObject) => any;
|
|
163
|
+
getStyle: (column: AnyObject) => CSSProperties;
|
|
139
164
|
onUpdateChecked: (checked: boolean, column: AnyObject) => void;
|
|
140
165
|
handleUpdateSelect: (value: string, column: AnyObject) => void;
|
|
141
166
|
NCheckbox: any;
|
|
@@ -144,10 +169,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
144
169
|
NInputNumber: any;
|
|
145
170
|
NTooltip: any;
|
|
146
171
|
NIcon: any;
|
|
172
|
+
NColorPicker: any;
|
|
173
|
+
NPopconfirm: any;
|
|
147
174
|
setStyle: typeof setStyle;
|
|
175
|
+
setColorInfo: typeof setColorInfo;
|
|
148
176
|
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<{}>>, {}>;
|
|
177
|
+
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<{}>>, {}>;
|
|
178
|
+
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<{}>>, {}>;
|
|
149
179
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
|
150
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "updateChecked"[], "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
180
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
151
181
|
element: {
|
|
152
182
|
type: PropType<Partial<{
|
|
153
183
|
[key: string]: any;
|
|
@@ -177,7 +207,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
177
207
|
type: NumberConstructor;
|
|
178
208
|
default: number;
|
|
179
209
|
};
|
|
180
|
-
|
|
210
|
+
data: {
|
|
181
211
|
type: PropType<Partial<{
|
|
182
212
|
[key: string]: any;
|
|
183
213
|
id: string;
|
|
@@ -201,11 +231,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
201
231
|
isHighlight: {
|
|
202
232
|
type: BooleanConstructor;
|
|
203
233
|
};
|
|
234
|
+
index: {
|
|
235
|
+
type: NumberConstructor;
|
|
236
|
+
default: number;
|
|
237
|
+
};
|
|
238
|
+
isHighlightRow: {
|
|
239
|
+
type: BooleanConstructor;
|
|
240
|
+
default: boolean;
|
|
241
|
+
};
|
|
204
242
|
}>> & {
|
|
205
243
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
244
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
|
206
245
|
}, {
|
|
207
|
-
|
|
208
|
-
fieldList: Partial<{
|
|
246
|
+
data: Partial<{
|
|
209
247
|
[key: string]: any;
|
|
210
248
|
id: string;
|
|
211
249
|
name: string;
|
|
@@ -223,6 +261,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
223
261
|
requiredDisable: boolean;
|
|
224
262
|
hide: boolean;
|
|
225
263
|
}>[];
|
|
264
|
+
columns: FieldSetColumnItem[];
|
|
265
|
+
index: number;
|
|
226
266
|
element: Partial<{
|
|
227
267
|
[key: string]: any;
|
|
228
268
|
id: string;
|
|
@@ -241,6 +281,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
241
281
|
requiredDisable: boolean;
|
|
242
282
|
hide: boolean;
|
|
243
283
|
}>;
|
|
284
|
+
isHighlightRow: boolean;
|
|
244
285
|
idx: number;
|
|
245
286
|
isHighlight: boolean;
|
|
246
287
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as a,unref as
|
|
1
|
+
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as a,unref as o,createBlock as r,withCtx as d,createVNode as u,createCommentVNode as c,createElementVNode as s,normalizeClass as f,toDisplayString as m,withDirectives as p,vShow as v,resolveDynamicComponent as y,createTextVNode as h}from"vue";import{NTooltip as g,NIcon as b,NCheckbox as k,NSelect as x,NColorPicker as w,NInput as N,NInputNumber as U,NPopconfirm as S}from"naive-ui";import{setStyle as _,setColorInfo as C,isDisable as H}from"../utils/index.js";import{ReorderTwoOutline as E,CreateOutline as O,TrashOutline as P}from"@vicons/ionicons5";import{isFunction as R,range as j}from"lodash-es";import{COLOR_MAP as D}from"../constants/index.js";const M={class:"row"},A=["title"],F=s("span",null,"拖拽调整顺序",-1);var B=e({__name:"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}},emits:["updateChecked","edit"],setup(e,{emit:B}){const T=e,V=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],W=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],q=[{label:"字体",value:"font"},{label:"背景",value:"background"}],G=Object.entries(D).map((([e])=>e));function I(){T.data.splice(T.index,1)}function L(){B("edit",T.element)}function z(e){switch(e.field){case"fixedWay":return V;case"sortDirection":return W;case"sortPriority":return function(){const e=j(1,T.data.length+1).map((e=>({label:e.toString(),value:e}))),l=T.data.filter((e=>!!e.sortPriority&&e.uuid!==T.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();case"colorScope":return q;default:return[]}}function J(e){var l;if(1==T.element.defaultMark||"color"===e.type&&T.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!T.element[e.field]&&(null==(l=T.data.filter((l=>l[e.field])))?void 0:l.length)===e.fieldShowMaxValue:H(T.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:t}=T.element;return!t||"NONE"===t}function K(e){return["title","result"].includes(e.field)&&T.element.style||{}}return(H,j)=>(l(),t("div",M,[(l(!0),t(i,null,n(e.columns,((n,H)=>{return l(),t(i,{key:H},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(o(_)(n,H))},["text"===n.type?(l(),t(i,{key:0},[0===H?(l(),r(o(g),{key:0,trigger:"hover"},{trigger:d((()=>[u(o(b),{style:{"margin-right":"5px",top:"2px"},component:o(E)},null,8,["component"])])),default:d((()=>[F])),_:1})):c("v-if",!0),s("span",{class:f([e.isHighlight&&"title"===n.field?"highlight":""]),style:a(K(n))},m("seq"===n.field?e.idx:e.element[n.field]),7)],64)):c("v-if",!0),"checkbox"===n.type?p((l(),r(o(k),{key:1,disabled:J(n),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){B("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,(D=e.element,M=n.field,"isShowHeaderFilter"===M?D.isConfiguredHeaderFilter&&"0001"!=T.element.id:"0001"!=T.element.id)]]):c("v-if",!0),"select"===n.type?p((l(),r(o(x),{key:2,clearable:"",disabled:J(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(T.element.sortPriority=null),"colorScope"===l.field&&C(T.element)}(e,n)],options:z(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):c("v-if",!0),"color"===n.type?(l(),r(o(w),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:J(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,j[0]||(j[0]=l=>o(C)(e.element))],"show-preview":"",modes:["hex"],swatches:o(G)},null,8,["disabled","value","onUpdate:value","swatches"])):c("v-if",!0),"input"===n.type?p((l(),r(o(N),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):c("v-if",!0),"inputNumber"===n.type?(l(),r(o(U),{key:5,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):c("v-if",!0),"custom"===n.type&&o(R)(n.contentRender)?(l(),r(y((()=>n.contentRender(n,e.element))),{key:6})):c("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(l(),t(i,{key:7},[u(o(g),{trigger:"hover"},{trigger:d((()=>[u(o(b),{component:o(O),onClick:L},null,8,["component"])])),default:d((()=>[h(" 编辑 ")])),_:1}),u(o(S),{onPositiveClick:I},{trigger:d((()=>[u(o(g),{trigger:"hover"},{trigger:d((()=>[u(o(b),{component:o(P)},null,8,["component"])])),default:d((()=>[h(" 删除 ")])),_:1})])),default:d((()=>[h(" 是否确认删除? ")])),_:1})],64)):c("v-if",!0)],12,A)):c("v-if",!0)],64);var D,M})),128))]))}});export{B as default};
|