cnhis-design-vue 3.1.57-beta.0 → 3.1.57-beta.10

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.
Files changed (121) hide show
  1. package/es/components/button-print/index.d.ts +8 -8
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -8
  3. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  4. package/es/components/button-print/src/components/EditFormat.vue.d.ts +3 -3
  5. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +7 -7
  6. package/es/components/button-print/style/index.css +1 -1
  7. package/es/components/callback/src/components/render/popupMaps.d.ts +17 -8
  8. package/es/components/expand-field/index.d.ts +98 -26
  9. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +95 -23
  10. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +95 -23
  11. package/es/components/expand-field/src/components/form.vue.d.ts +98 -26
  12. package/es/components/expand-field/src/index.vue.d.ts +98 -26
  13. package/es/components/fabric-chart/index.d.ts +2 -2
  14. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
  15. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  17. package/es/components/fabric-chart/src/interface.d.ts +2 -3
  18. package/es/components/field-set/index.d.ts +107 -616
  19. package/es/components/field-set/index.js +1 -1
  20. package/es/components/field-set/src/FieldColor.vue.d.ts +1680 -0
  21. package/es/components/field-set/src/FieldColor.vue.js +1 -0
  22. package/es/components/field-set/src/FieldColor.vue2.js +1 -0
  23. package/es/components/field-set/src/FieldSet.vue.d.ts +58 -16
  24. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  25. package/es/components/field-set/src/Index.vue.d.ts +141 -0
  26. package/es/components/field-set/src/Index.vue.js +1 -0
  27. package/es/components/field-set/src/Index.vue2.js +1 -0
  28. package/es/components/field-set/src/components/Row.vue.d.ts +50 -9
  29. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  30. package/es/components/field-set/src/components/condition.vue.d.ts +172 -0
  31. package/es/components/field-set/src/components/condition.vue.js +1 -0
  32. package/es/components/field-set/src/components/condition.vue2.js +1 -0
  33. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1194 -0
  34. package/es/components/field-set/src/components/edit-dialog.vue.js +1 -0
  35. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -0
  36. package/es/components/field-set/src/components/edit-filter.vue.d.ts +286 -0
  37. package/es/components/field-set/src/components/edit-filter.vue.js +1 -0
  38. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -0
  39. package/es/components/field-set/src/constants/index.d.ts +55 -0
  40. package/es/components/field-set/src/constants/index.js +1 -0
  41. package/es/components/field-set/src/types/index.d.ts +31 -1
  42. package/es/components/field-set/src/utils/index.d.ts +2 -1
  43. package/es/components/field-set/src/utils/index.js +1 -1
  44. package/es/components/field-set/style/index.css +1 -1
  45. package/es/components/form-config/index.d.ts +72 -42
  46. package/es/components/form-config/src/FormConfig.vue.d.ts +72 -42
  47. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  48. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +17 -8
  49. package/es/components/form-config/src/components/FormConfigDragDisplay.vue.d.ts +5 -2
  50. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
  51. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +20 -11
  52. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -8
  53. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +5 -2
  54. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  55. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  56. package/es/components/form-config/src/constants/index.d.ts +3 -2
  57. package/es/components/form-config/src/constants/index.js +1 -1
  58. package/es/components/form-config/src/hooks/useSortalbeConfig.d.ts +16 -12
  59. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  60. package/es/components/form-config/src/types/index.d.ts +14 -2
  61. package/es/components/form-render/index.d.ts +17 -8
  62. package/es/components/form-render/index.js +1 -1
  63. package/es/components/form-render/src/FormRender.vue.d.ts +17 -8
  64. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  65. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +17 -8
  66. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  67. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  68. package/es/components/form-render/src/hooks/index.js +1 -1
  69. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  70. package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
  71. package/es/components/form-render/src/hooks/useNewLowCodeReactions.d.ts +6 -0
  72. package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +1 -0
  73. package/es/components/form-render/src/types/index.d.ts +1 -1
  74. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  75. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  77. package/es/components/index.css +1 -1
  78. package/es/components/index.js +1 -1
  79. package/es/components/info-header/index.d.ts +41 -23
  80. package/es/components/info-header/src/InfoHeader.vue.d.ts +41 -23
  81. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
  82. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
  83. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +18 -9
  84. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +17 -8
  85. package/es/components/keyboard/index.d.ts +1 -1
  86. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  87. package/es/components/quick-search/index.d.ts +3 -3
  88. package/es/components/quick-search/src/index.vue.d.ts +3 -3
  89. package/es/components/recommend-search/index.d.ts +6 -6
  90. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +6 -6
  91. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  92. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  93. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
  94. package/es/components/scale-view/index.d.ts +3 -3
  95. package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -3
  96. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
  97. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
  98. package/es/components/select-label/index.d.ts +2 -2
  99. package/es/components/select-label/src/LabelFormContent.vue.d.ts +1 -1
  100. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
  101. package/es/components/select-label/src/index.vue.d.ts +1 -1
  102. package/es/components/select-person/index.d.ts +95 -23
  103. package/es/components/select-person/src/SelectPerson.vue.d.ts +84 -17
  104. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  105. package/es/components/select-person/src/types/enums.d.ts +9 -0
  106. package/es/components/select-person/src/types/enums.js +1 -1
  107. package/es/components/select-person/style/index.css +1 -1
  108. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  109. package/es/components/shortcut-setter/index.d.ts +17 -8
  110. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -8
  111. package/es/components/table-export-field/index.d.ts +3 -3
  112. package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +3 -3
  113. package/es/components/table-export-field/src/index.vue.d.ts +3 -3
  114. package/es/components/time-line/index.d.ts +7 -7
  115. package/es/components/time-line/src/TimeLine.vue.d.ts +3 -3
  116. package/es/shared/package.json.js +1 -1
  117. package/es/shared/types/business.d.ts +23 -3
  118. package/es/shared/utils/business.d.ts +2 -1
  119. package/es/shared/utils/business.js +1 -1
  120. package/es/shared/utils/index.js +1 -1
  121. 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: "custom" | "text" | "checkbox" | "select" | "input" | "inputNumber";
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: "custom" | "text" | "checkbox" | "select" | "input" | "inputNumber";
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
- fieldList: AnyObject[];
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
- fieldList: {
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
- fieldList: {
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
- fieldList: {
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
- columns: FieldSetColumnItem[];
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,ref as l,computed as t,reactive as i,watch as o,openBlock as d,createElementBlock as a,normalizeStyle as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,withCtx as y,createTextVNode as v,toDisplayString as b,createVNode as k,normalizeClass as x,mergeProps as g,renderSlot as w}from"vue";import{useThemeVars as S,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:"c-field-set__table-header"},K=h("span",null,"数值越小,优先级越高",-1),L=["tabindex"],G={key:1,class:"c-field-set__table-footer"};var $=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:$,emit:z}){const J=e,Q={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},X=l(S().value.primaryColor),Y=l(""),Z=l(),ee=l([]),le=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!J.fieldShowMaxValue,field:"show",fieldShowMaxValue:J.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"}]),te=t((()=>ee.value.flat())),ie=i({columns:le,fieldList:te,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t}}),oe={keyword:Y.value,idx:0,startIdx:0},de=()=>{z("save",{tableFields:ne()})},ae=()=>{z("close")};function re(){ee.value=se(),fe(),z("reset")}function se(){const e=q(J.fields).map((e=>({...e,uuid:D()})));return Object.keys(Q).forEach((l=>{e.forEach((e=>{"old"==J.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[Q[l]]=1==e[l]:e[Q[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(J.groupSetting){return U(J.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 ne(){let e=[];return e="old"==J.type?te.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,...J.isEdit?{required:e.required,editable:e.editable}:{}}))):te.value,e.map((e=>V(e,["uuid"])))}function ue(){const e=oe.keyword!==Y.value;let l=Y.value?te.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Y.value))return!!e||t>oe.idx})):0;-1!==l||e||(l=oe.startIdx),Z.value.scrollTop=52*l,Object.assign(oe,{keyword:Y.value,idx:l},e?{startIdx:l}:{})}function ce(e){var l;return!!Y.value&&(null==(l=e.title)?void 0:l.includes(Y.value))}function fe(){var e,l;(null==(e=J.showColumnNames)?void 0:e.length)&&(le.value=le.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=J.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=J.customColumns)?void 0:l.length)&&le.value.push(...J.customColumns),J.showSeq&&le.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),le.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!J.isEdit||"sortPriority"===e.field&&!J.showSortPriority||"isShowHeaderFilter"===e.field&&!J.showHeadFilter)}(e),"checkbox"===e.type){const l=ee.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!he(e.field)&&!l}}))}function he(e){return ee.value.flat().some((l=>!j(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!I(e.relatedContext.element)}return o([()=>J.fields,()=>{var e;return null==(e=J.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ee.value=se(),fe())}),{immediate:!0,deep:!0}),$({getTableFields:ne}),(l,t)=>(d(),a("div",{class:"c-field-set",style:r({"--row-height":"52px","--primary-color":X.value})},[e.showSearch?(d(),s(n(A),{key:0,class:"c-field-set__search-wrapper",value:Y.value,"onUpdate:value":t[0]||(t[0]=e=>Y.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(ue,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),h("div",T,[(d(!0),a(p,null,m(le.value,((e,l)=>(d(),a(p,{key:l},[e.isShow?(d(),a("span",{key:0,class:"table-cell",style:r(n(B)(e))},["checkbox"!==e.type||e.isHeadCheckHide?(d(),a(p,{key:1},[v(b(e.title),1)],64)):(d(),s(n(_),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void te.value.forEach((e=>{j(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:y((()=>[v(b(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(d(),s(n(C),{key:2,trigger:"hover"},{trigger:y((()=>[k(n(F),{component:n(O),style:{top:"2px"}},null,8,["component"])])),default:y((()=>[K])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),h("div",{class:"c-field-set__table-body",ref_key:"tableBodyRef",ref:Z},[k(n(H),{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ee.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe},{item:y((({element:e,index:l})=>[e.hide?f("v-if",!0):(d(),a("div",{key:0,class:x(["item",n(I)(e)?"":"disabled"]),tabindex:l},[n(P)(e)?(d(!0),a(p,{key:0},m(e,((e,t)=>(d(),s(N,g(ie,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(d(),s(N,g({key:1},ie,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue"])],512),e.footerFlag?(d(),a("div",G,[f(" 底部按钮插槽 "),w(l.$slots,"footer",{},(()=>[k(n(W),{onPositiveClick:re},{trigger:y((()=>[k(n(E),{style:{"margin-right":"8px"}},{default:y((()=>[v("恢复默认设置")])),_:1})])),default:y((()=>[v(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(E),{style:{"margin-right":"8px"},onClick:ae},{default:y((()=>[v("取消")])),_:1}),k(n(E),{type:"primary",onClick:de},{default:y((()=>[v("保存")])),_:1})]))])):f("v-if",!0)],4))}});export{$ as default};
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 v,h as g}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:()=>g(C,{rowHeight:52})},{name:"fieldColor",tab:"字段颜色",render:()=>g(w,{isFieldColor:!0,defaultList:k.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>g(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 S(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=>S(e,t.name),onSave:A}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[v(e.$slots,l)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(a(),n(h(d(j)[0].render()),p({key:1},e.$attrs,{ref:e=>S(e,d(j)[0].name),onSave:A}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[v(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
- fieldList: {
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
- fieldList: {
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
- fieldList: {
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
- columns: FieldSetColumnItem[];
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 r,createBlock as d,withCtx as o,createVNode as u,createCommentVNode as f,createElementVNode as s,normalizeClass as c,toDisplayString as m,withDirectives as p,vShow as v,resolveDynamicComponent as y}from"vue";import{NTooltip as h,NIcon as b,NCheckbox as k,NSelect as g,NInput as x,NInputNumber as N}from"naive-ui";import{setStyle as w,isDisable as U}from"../utils/index.js";import{ReorderTwoOutline as S}from"@vicons/ionicons5";import{isFunction as E,range as C}from"lodash-es";const H={class:"row"},L=["title"],O=s("span",null,"拖拽调整顺序",-1);var P=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},fieldList:{type:Array,default:()=>[]},isHighlight:{type:Boolean}},emits:["updateChecked"],setup(e,{emit:P}){const D=e,R=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],A=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function F(e){switch(e.field){case"fixedWay":return R;case"sortDirection":return A;case"sortPriority":return function(){const e=C(1,D.fieldList.length+1).map((e=>({label:e.toString(),value:e}))),l=D.fieldList.filter((e=>!!e.sortPriority&&e.uuid!==D.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();default:return[]}}function _(e){var l;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!D.element[e.field]&&(null==(l=D.fieldList.filter((l=>l[e.field])))?void 0:l.length)===e.fieldShowMaxValue:U(D.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:t}=D.element;return!t||"NONE"===t}return(U,C)=>(l(),t("div",H,[(l(!0),t(i,null,n(e.columns,((n,U)=>{return l(),t(i,{key:U},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(r(w)(n))},["text"===n.type?(l(),t(i,{key:0},[0===U?(l(),d(r(h),{key:0,trigger:"hover"},{trigger:o((()=>[u(r(b),{style:{"margin-right":"5px",top:"2px"},component:r(S)},null,8,["component"])])),default:o((()=>[O])),_:1})):f("v-if",!0),s("span",{class:c([e.isHighlight&&"title"===n.field?"highlight":""])},m("seq"===n.field?e.idx:e.element[n.field]),3)],64)):f("v-if",!0),"checkbox"===n.type?p((l(),d(r(k),{key:1,disabled:_(n),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){P("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,(C=e.element,H=n.field,"isShowHeaderFilter"===H?C.isConfiguredHeaderFilter&&"0001"!=D.element.id:"0001"!=D.element.id)]]):f("v-if",!0),"select"===n.type?p((l(),d(r(g),{key:2,clearable:"",disabled:_(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(D.element.sortPriority=null)}(e,n)],options:F(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):f("v-if",!0),"input"===n.type?p((l(),d(r(x),{key:3,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):f("v-if",!0),"inputNumber"===n.type?(l(),d(r(N),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):f("v-if",!0),"custom"===n.type&&r(E)(n.contentRender)?(l(),d(y((()=>n.contentRender(n,e.element))),{key:5})):f("v-if",!0)],12,L)):f("v-if",!0)],64);var C,H})),128))]))}});export{P as default};
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};