cnhis-design-vue 3.2.9-beta.9 → 3.2.9-release.3

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 (110) hide show
  1. package/es/components/base-search/index.d.ts +2 -0
  2. package/es/components/base-search/src/index.vue.d.ts +2 -0
  3. package/es/components/button-print/index.d.ts +30 -0
  4. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
  5. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  6. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
  7. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  8. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  9. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  10. package/es/components/button-print/src/utils/print.d.ts +6 -5
  11. package/es/components/button-print/src/utils/print.js +1 -1
  12. package/es/components/classification/index.d.ts +87 -0
  13. package/es/components/classification/src/components/search-filter/index.vue.d.ts +87 -0
  14. package/es/components/classification/src/components/set-classification/index.vue.d.ts +87 -0
  15. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  16. package/es/components/classification/src/index.vue.d.ts +87 -0
  17. package/es/components/date-picker/index.d.ts +29 -0
  18. package/es/components/date-picker/src/DatePicker.vue.d.ts +30 -1
  19. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  22. package/es/components/field-set/index.d.ts +8 -1
  23. package/es/components/field-set/src/FieldColor.vue.d.ts +90 -7
  24. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  25. package/es/components/field-set/src/FieldFilter.vue.d.ts +32 -7
  26. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  27. package/es/components/field-set/src/FieldSet.vue.d.ts +74 -31
  28. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  29. package/es/components/field-set/src/Index.vue.d.ts +8 -1
  30. package/es/components/field-set/src/Index.vue2.js +1 -1
  31. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  32. package/es/components/field-set/src/components/condition.vue.d.ts +29 -0
  33. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +58 -0
  34. package/es/components/field-set/src/components/edit-filter.vue.d.ts +29 -0
  35. package/es/components/field-set/src/components/table-row.vue.d.ts +29 -2
  36. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  37. package/es/components/field-set/src/types/index.d.ts +4 -3
  38. package/es/components/field-set/src/utils/index.js +1 -1
  39. package/es/components/field-set/style/index.css +1 -1
  40. package/es/components/form-render/src/components/renderer/select.d.ts +2 -1
  41. package/es/components/form-render/src/components/renderer/select.js +1 -1
  42. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  43. package/es/components/iho-chat/index.d.ts +316 -6
  44. package/es/components/iho-chat/src/Index.vue.d.ts +316 -6
  45. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  46. package/es/components/iho-chat/src/api/index.js +1 -1
  47. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +5 -0
  48. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  49. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +121 -1
  50. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  51. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +6 -0
  52. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  53. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +160 -2
  54. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +122 -0
  55. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  56. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +29 -0
  57. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  58. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +6 -1
  59. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  60. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  61. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +5 -0
  62. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  63. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -3
  64. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  65. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  66. package/es/components/iho-chat/src/constants/index.js +1 -1
  67. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  68. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  69. package/es/components/iho-chat/src/hooks/useState.d.ts +6 -0
  70. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  71. package/es/components/iho-chat/src/types/index.d.ts +3 -1
  72. package/es/components/iho-chat/src/types/index.js +1 -1
  73. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  74. package/es/components/iho-chat/style/index.css +1 -1
  75. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +29 -0
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +29 -0
  77. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  78. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.d.ts +2 -0
  79. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowHeight.js +1 -0
  80. package/es/components/iho-table/src/types/index.d.ts +3 -0
  81. package/es/components/iho-table/style/index.css +1 -1
  82. package/es/components/index.css +1 -1
  83. package/es/components/quick-search/index.d.ts +3 -0
  84. package/es/components/quick-search/src/index.vue.d.ts +3 -0
  85. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  86. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +29 -0
  87. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +29 -0
  88. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +29 -0
  89. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +29 -0
  90. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +58 -0
  91. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +29 -0
  92. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +29 -0
  93. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +58 -0
  94. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +58 -0
  95. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +29 -0
  96. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +29 -0
  97. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +29 -0
  98. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +29 -0
  99. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
  100. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
  101. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
  102. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  103. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  104. package/es/components/table-filter/src/types/index.d.ts +2 -0
  105. package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
  106. package/es/env.d.ts +25 -25
  107. package/es/shared/package.json.js +1 -1
  108. package/es/shared/utils/index.d.ts +1 -0
  109. package/es/shared/utils/index.js +1 -1
  110. package/package.json +2 -2
@@ -1 +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 x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/table-row.vue.js";import k from"./components/edit-dialog.vue.js";import{cloneDeep as _,omit as w}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 L=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:L,emit:M}){const R=e,U=l(!1),Y=l(null),H=l([]),I=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"}]),N=t({columns:I,data:H,onEdit:function(e){Y.value=_(e),U.value=!0},isHighlightRow:!R.isFieldColor});function T(){M("save")}function $(){M("close")}function q(){Y.value=null,U.value=!0}function z(e){if(C(e),Y.value){const l=H.value.findIndex((l=>l.uuid===e.uuid));H.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");H.value.push({...e,createDate:l,uuid:j()})}}return I.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&R.isFieldColor||"title"===e.field&&!R.isFieldColor)}(e)})),H.value=R.defaultList.concat(H.value),H.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),L({getTableFields:function(){return H.value.map((e=>{const l=_(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),o("div",D,[a("div",S,[(i(!0),o(s,null,r(I.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(x),{modelValue:H.value,"onUpdate:modelValue":t[0]||(t[0]=e=>H.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(g,m(N,{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),U.value?(i(),b(k,{key:1,visible:U.value,"onUpdate:visible":t[1]||(t[1]=e=>U.value=e),"is-field-color":e.isFieldColor,row:Y.value,onConfirm:z},null,8,["visible","is-field-color","row"])):f("v-if",!0)]))}});export{L as default};
1
+ import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as a,createElementVNode as o,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as c,createVNode as f,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 x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/table-row.vue.js";import _ from"./components/edit-dialog.vue.js";import{cloneDeep as k,omit as w}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"},V={class:"main-wrapper__table-header"},B={class:"main-wrapper__table-body",ref:"tableBodyRef"},E=["tabindex"],L={key:0,class:"main-wrapper__table-footer"};var M=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:M,emit:R}){const U=e,Y=l(!1),H=l(null),I=l([]),N=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"}]),T=t({columns:N,data:I,onEdit:function(e){H.value=k(e),Y.value=!0},isHighlightRow:!U.isFieldColor});function $(){R("save")}function q(){R("close")}function z(){H.value=null,Y.value=!0}function G(e){if(C(e),H.value){const l=I.value.findIndex((l=>l.uuid===e.uuid));I.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");I.value.push({...e,createDate:l,uuid:j()})}}return N.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&U.isFieldColor||"title"===e.field&&!U.isFieldColor)}(e)})),I.value=U.defaultList.concat(I.value),I.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),M({getTableFields:function(){return I.value.map((e=>{const l=k(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),a("div",D,[o("div",S,[o("div",V,[(i(!0),a(s,null,r(N.value,((e,l)=>(i(),a(s,{key:l},[e.isShow?(i(),a("span",{key:0,class:"table-cell",style:u(d(F)(e,l))},[o("span",null,n(e.title),1)],4)):c("v-if",!0)],64)))),128))]),o("div",B,[f(d(x),{modelValue:I.value,"onUpdate:modelValue":t[0]||(t[0]=e=>I.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?c("v-if",!0):(i(),a("div",{key:0,class:"item",tabindex:l},[f(g,m(T,{element:e,index:l}),null,16,["element","index"])],8,E))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(i(),a("div",L,[c(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[f(d(h),{style:{"margin-right":"8px"},onClick:q},{default:p((()=>[y("取消")])),_:1}),f(d(h),{style:{"margin-right":"8px"},onClick:z},{default:p((()=>[y("新增")])),_:1}),f(d(h),{type:"primary",onClick:$},{default:p((()=>[y("保存")])),_:1})]))])):c("v-if",!0),Y.value?(i(),b(_,{key:1,visible:Y.value,"onUpdate:visible":t[1]||(t[1]=e=>Y.value=e),"is-field-color":e.isFieldColor,row:H.value,onConfirm:G},null,8,["visible","is-field-color","row"])):c("v-if",!0)]))}});export{M as default};
@@ -37,9 +37,8 @@ declare const _default: import("vue").DefineComponent<{
37
37
  disabledAll?: boolean | undefined;
38
38
  isHeadCheckHide?: boolean | undefined;
39
39
  isShow?: boolean | undefined;
40
- contentRender?: ((column: AnyObject, row: AnyObject) => String | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
41
- [key: string]: any;
42
- }>) | undefined;
40
+ contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
41
+ hide?: boolean | undefined;
43
42
  }[]>;
44
43
  data: import("vue").Ref<{
45
44
  [x: string]: any;
@@ -64,9 +63,8 @@ declare const _default: import("vue").DefineComponent<{
64
63
  disabledAll?: boolean | undefined;
65
64
  isHeadCheckHide?: boolean | undefined;
66
65
  isShow?: boolean | undefined;
67
- contentRender?: ((column: AnyObject, row: AnyObject) => String | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
68
- [key: string]: any;
69
- }>) | undefined;
66
+ contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
67
+ hide?: boolean | undefined;
70
68
  }[];
71
69
  data: {
72
70
  [x: string]: any;
@@ -257,6 +255,13 @@ declare const _default: import("vue").DefineComponent<{
257
255
  type: PropType<AnyObject[]>;
258
256
  default: () => never[];
259
257
  };
258
+ primaryKey: {
259
+ type: StringConstructor;
260
+ default: string;
261
+ };
262
+ titleRender: {
263
+ type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
264
+ };
260
265
  }, {
261
266
  fixedWayOptions: {
262
267
  label: string;
@@ -355,6 +360,13 @@ declare const _default: import("vue").DefineComponent<{
355
360
  type: PropType<AnyObject[]>;
356
361
  default: () => never[];
357
362
  };
363
+ primaryKey: {
364
+ type: StringConstructor;
365
+ default: string;
366
+ };
367
+ titleRender: {
368
+ type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
369
+ };
358
370
  }>> & {
359
371
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
360
372
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -368,10 +380,12 @@ declare const _default: import("vue").DefineComponent<{
368
380
  isMultiple: (field: string) => boolean;
369
381
  isRender: (field: string) => boolean;
370
382
  isShow: (field: string) => any;
383
+ showRelation: (field: string) => boolean;
371
384
  getSortPriorityOptions: () => {
372
385
  label: string;
373
386
  value: number;
374
387
  }[];
388
+ getSelectText: (field: string) => "密码无需设置" | "主键不可设置" | "不支持脱敏设置" | undefined;
375
389
  selectProps: (field: string) => {
376
390
  valueField: string;
377
391
  labelField: string;
@@ -389,12 +403,15 @@ declare const _default: import("vue").DefineComponent<{
389
403
  NIcon: any;
390
404
  NColorPicker: any;
391
405
  NPopconfirm: any;
406
+ NPopover: any;
407
+ NSpace: any;
392
408
  setStyle: typeof setStyle;
393
409
  setColorInfo: typeof import("./utils").setColorInfo;
394
410
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
395
411
  TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
396
412
  CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
397
413
  HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
414
+ CaretDownOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
398
415
  isFunction: (value: any) => value is (...args: any[]) => any;
399
416
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
400
417
  element: {
@@ -480,6 +497,13 @@ declare const _default: import("vue").DefineComponent<{
480
497
  type: PropType<AnyObject[]>;
481
498
  default: () => never[];
482
499
  };
500
+ primaryKey: {
501
+ type: StringConstructor;
502
+ default: string;
503
+ };
504
+ titleRender: {
505
+ type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
506
+ };
483
507
  }>> & {
484
508
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
485
509
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -502,6 +526,7 @@ declare const _default: import("vue").DefineComponent<{
502
526
  requiredDisable: boolean;
503
527
  hide: boolean;
504
528
  }>[];
529
+ primaryKey: string;
505
530
  index: number;
506
531
  columns: FieldSetColumnItem[];
507
532
  element: Partial<{
@@ -524,9 +549,9 @@ declare const _default: import("vue").DefineComponent<{
524
549
  }>;
525
550
  developMode: boolean;
526
551
  draggable: boolean;
552
+ isHighlightRow: boolean;
527
553
  idx: number;
528
554
  isHighlight: boolean;
529
- isHighlightRow: boolean;
530
555
  isFieldSet: boolean;
531
556
  fieldDescribeMode: "column" | "tooltip";
532
557
  hideExpressionOption: AnyObject[];
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as c,renderList as o,normalizeStyle as s,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/table-row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as j}from"./utils/index.js";import{COLUMNLIST_MAP as C}from"./constants/filter.js";const R={class:"main-wrapper"},q={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},H=["tabindex"],S={key:0,class:"main-wrapper__table-footer"};var U=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:E}){const L=e,B=t([]),O=t([]),T=i({columns:B,data:O,onUpdateChecked:function({checked:e,column:t}){const i=!e||z(t.field);t.checkedAll=!i}}),D=()=>{E("save")},N=()=>{E("close")};function P(){O.value=A(L.defaultList),$(),E("reset")}function $(){B.value=Object.entries(C).map((([e,t])=>{const i=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),l={isShow:!0,title:t,type:i,field:e};return"checkbox"===i&&Object.assign(l,{checkedAll:!z(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),l}))}function z(e){return O.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return l((()=>L.defaultList),(e=>{e.length>0&&(O.value=A(e),$())}),{immediate:!0,deep:!0}),U({getTableFields:()=>O.value}),(t,i)=>(a(),d("div",R,[r("div",q,[(a(!0),d(c,null,o(B.value,((e,t)=>(a(),d(c,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:s(n(j)(e,t))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(c,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return i=t,l=e.field,void O.value.forEach((e=>{("explicitRequired"!==l||"explicitRequired"===l&&F(e))&&(e[l]=i)}));var i,l}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))],4)):h("v-if",!0)],64)))),128))]),r("div",V,[v(n(_),{modelValue:O.value,"onUpdate:modelValue":i[0]||(i[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(T,{element:e,idx:t+1}),null,16,["element","idx"])],8,H))])),_:1},8,["modelValue"])],512),e.footerFlag?(a(),d("div",S,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:P},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:N},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:D},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{U as default};
1
+ import{defineComponent as e,ref as t,reactive as l,watch as i,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as s,renderList as c,normalizeStyle as o,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/table-row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as j}from"./utils/index.js";import{COLUMNLIST_MAP as C}from"./constants/filter.js";const R={class:"main-wrapper"},q={class:"main-wrapper__table"},V={class:"main-wrapper__table-header"},H={class:"main-wrapper__table-body",ref:"tableBodyRef"},S=["tabindex"],U={key:0,class:"main-wrapper__table-footer"};var E=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:E,emit:L}){const B=e,O=t([]),T=t([]),D=l({columns:O,data:T,onUpdateChecked:function({checked:e,column:t}){const l=!e||G(t.field);t.checkedAll=!l}}),N=()=>{L("save")},P=()=>{L("close")};function $(){T.value=A(B.defaultList),z(),L("reset")}function z(){O.value=Object.entries(C).map((([e,t])=>{const l=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),i={isShow:!0,title:t,type:l,field:e};return"checkbox"===l&&Object.assign(i,{checkedAll:!G(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),i}))}function G(e){return T.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return i((()=>B.defaultList),(e=>{e.length>0&&(T.value=A(e),z())}),{immediate:!0,deep:!0}),E({getTableFields:()=>T.value}),(t,l)=>(a(),d("div",R,[r("div",q,[r("div",V,[(a(!0),d(s,null,c(O.value,((e,t)=>(a(),d(s,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:o(n(j)(e,t))},[r("span",null,["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(s,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return l=t,i=e.field,void T.value.forEach((e=>{("explicitRequired"!==i||"explicitRequired"===i&&F(e))&&(e[i]=l)}));var l,i}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))])],4)):h("v-if",!0)],64)))),128))]),r("div",H,[v(n(_),{modelValue:T.value,"onUpdate:modelValue":l[0]||(l[0]=e=>T.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(D,{element:e,idx:t+1}),null,16,["element","idx"])],8,S))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(a(),d("div",U,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:$},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:P},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:N},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{E as default};
@@ -1,4 +1,4 @@
1
- import { PropType } from 'vue';
1
+ import { PropType, VNodeChild } from 'vue';
2
2
  import { setStyle, isDraggableItem } from './utils';
3
3
  import { FieldSetItem, FieldSetColumnName, FieldSetColumnItem } from '../../../components/field-set/src/types';
4
4
  import { AnyObject } from '../../../shared/types';
@@ -79,18 +79,21 @@ declare const _default: import("vue").DefineComponent<{
79
79
  columnWidthProps: {
80
80
  type: ObjectConstructor;
81
81
  };
82
- showHideExpression: {
83
- type: BooleanConstructor;
82
+ hideExpressionConfig: {
83
+ type: PropType<{
84
+ show: boolean;
85
+ option: AnyObject[];
86
+ }>;
84
87
  };
85
- hideExpressionOption: {
86
- type: PropType<AnyObject[]>;
87
- default: () => never[];
88
+ primaryKey: {
89
+ type: StringConstructor;
90
+ default: string;
91
+ };
92
+ titleRender: {
93
+ type: PropType<(row: FieldSetItem) => VNodeChild>;
88
94
  };
89
95
  }, {
90
96
  fieldsMapping: Record<string, string>;
91
- attrs: {
92
- [x: string]: unknown;
93
- };
94
97
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
95
98
  fields: {
96
99
  type: PropType<Partial<{
@@ -168,12 +171,18 @@ declare const _default: import("vue").DefineComponent<{
168
171
  columnWidthProps: {
169
172
  type: ObjectConstructor;
170
173
  };
171
- showHideExpression: {
172
- type: BooleanConstructor;
174
+ hideExpressionConfig: {
175
+ type: PropType<{
176
+ show: boolean;
177
+ option: AnyObject[];
178
+ }>;
173
179
  };
174
- hideExpressionOption: {
175
- type: PropType<AnyObject[]>;
176
- default: () => never[];
180
+ primaryKey: {
181
+ type: StringConstructor;
182
+ default: string;
183
+ };
184
+ titleRender: {
185
+ type: PropType<(row: FieldSetItem) => VNodeChild>;
177
186
  };
178
187
  }>> & {
179
188
  onSave?: ((...args: any[]) => any) | undefined;
@@ -184,6 +193,7 @@ declare const _default: import("vue").DefineComponent<{
184
193
  resetKey: import("vue").Ref<number>;
185
194
  keyword: import("vue").Ref<string>;
186
195
  tableBodyRef: import("vue").Ref<HTMLDivElement | undefined>;
196
+ tableRef: import("vue").Ref<any>;
187
197
  newFields: import("vue").Ref<AnyObject[]>;
188
198
  defaultColumns: FieldSetColumnItem[];
189
199
  columns: import("vue").Ref<{
@@ -195,10 +205,10 @@ declare const _default: import("vue").DefineComponent<{
195
205
  disabledAll?: boolean | undefined;
196
206
  isHeadCheckHide?: boolean | undefined;
197
207
  isShow?: boolean | undefined;
198
- contentRender?: ((column: AnyObject, row: AnyObject) => String | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
199
- [key: string]: any;
200
- }>) | undefined;
208
+ contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
209
+ hide?: boolean | undefined;
201
210
  }[]>;
211
+ itemWidth: import("vue").ComputedRef<string>;
202
212
  fieldList: import("vue").ComputedRef<AnyObject[]>;
203
213
  hasFieldDescribe: import("vue").ComputedRef<boolean>;
204
214
  rowProps: {
@@ -211,9 +221,8 @@ declare const _default: import("vue").DefineComponent<{
211
221
  disabledAll?: boolean | undefined;
212
222
  isHeadCheckHide?: boolean | undefined;
213
223
  isShow?: boolean | undefined;
214
- contentRender?: ((column: AnyObject, row: AnyObject) => String | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
215
- [key: string]: any;
216
- }>) | undefined;
224
+ contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
225
+ hide?: boolean | undefined;
217
226
  }[];
218
227
  data: AnyObject[];
219
228
  onUpdateChecked: ({ checked, column }: {
@@ -225,7 +234,9 @@ declare const _default: import("vue").DefineComponent<{
225
234
  fieldDescribeMode: "column" | "tooltip";
226
235
  developMode: boolean;
227
236
  columnWidthProps: Record<string, any> | undefined;
228
- hideExpressionOption: AnyObject[];
237
+ hideExpressionOption: AnyObject[] | never[];
238
+ primaryKey: string;
239
+ titleRender: ((row: FieldSetItem) => VNodeChild) | undefined;
229
240
  };
230
241
  searchData: {
231
242
  keyword: string;
@@ -412,6 +423,13 @@ declare const _default: import("vue").DefineComponent<{
412
423
  type: PropType<AnyObject[]>;
413
424
  default: () => never[];
414
425
  };
426
+ primaryKey: {
427
+ type: StringConstructor;
428
+ default: string;
429
+ };
430
+ titleRender: {
431
+ type: PropType<(row: AnyObject) => VNodeChild>;
432
+ };
415
433
  }, {
416
434
  fixedWayOptions: {
417
435
  label: string;
@@ -510,6 +528,13 @@ declare const _default: import("vue").DefineComponent<{
510
528
  type: PropType<AnyObject[]>;
511
529
  default: () => never[];
512
530
  };
531
+ primaryKey: {
532
+ type: StringConstructor;
533
+ default: string;
534
+ };
535
+ titleRender: {
536
+ type: PropType<(row: AnyObject) => VNodeChild>;
537
+ };
513
538
  }>> & {
514
539
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
515
540
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -523,10 +548,12 @@ declare const _default: import("vue").DefineComponent<{
523
548
  isMultiple: (field: string) => boolean;
524
549
  isRender: (field: string) => boolean;
525
550
  isShow: (field: string) => any;
551
+ showRelation: (field: string) => boolean;
526
552
  getSortPriorityOptions: () => {
527
553
  label: string;
528
554
  value: number;
529
555
  }[];
556
+ getSelectText: (field: string) => "密码无需设置" | "主键不可设置" | "不支持脱敏设置" | undefined;
530
557
  selectProps: (field: string) => {
531
558
  valueField: string;
532
559
  labelField: string;
@@ -544,12 +571,15 @@ declare const _default: import("vue").DefineComponent<{
544
571
  NIcon: any;
545
572
  NColorPicker: any;
546
573
  NPopconfirm: any;
574
+ NPopover: any;
575
+ NSpace: any;
547
576
  setStyle: typeof setStyle;
548
577
  setColorInfo: typeof import("./utils").setColorInfo;
549
578
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
550
579
  TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
551
580
  CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
552
581
  HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
582
+ CaretDownOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
553
583
  isFunction: (value: any) => value is (...args: any[]) => any;
554
584
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
555
585
  element: {
@@ -635,6 +665,13 @@ declare const _default: import("vue").DefineComponent<{
635
665
  type: PropType<AnyObject[]>;
636
666
  default: () => never[];
637
667
  };
668
+ primaryKey: {
669
+ type: StringConstructor;
670
+ default: string;
671
+ };
672
+ titleRender: {
673
+ type: PropType<(row: AnyObject) => VNodeChild>;
674
+ };
638
675
  }>> & {
639
676
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
640
677
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -657,6 +694,7 @@ declare const _default: import("vue").DefineComponent<{
657
694
  requiredDisable: boolean;
658
695
  hide: boolean;
659
696
  }>[];
697
+ primaryKey: string;
660
698
  index: number;
661
699
  columns: FieldSetColumnItem[];
662
700
  element: Partial<{
@@ -679,9 +717,9 @@ declare const _default: import("vue").DefineComponent<{
679
717
  }>;
680
718
  developMode: boolean;
681
719
  draggable: boolean;
720
+ isHighlightRow: boolean;
682
721
  idx: number;
683
722
  isHighlight: boolean;
684
- isHighlightRow: boolean;
685
723
  isFieldSet: boolean;
686
724
  fieldDescribeMode: "column" | "tooltip";
687
725
  hideExpressionOption: AnyObject[];
@@ -770,20 +808,26 @@ declare const _default: import("vue").DefineComponent<{
770
808
  columnWidthProps: {
771
809
  type: ObjectConstructor;
772
810
  };
773
- showHideExpression: {
774
- type: BooleanConstructor;
811
+ hideExpressionConfig: {
812
+ type: PropType<{
813
+ show: boolean;
814
+ option: AnyObject[];
815
+ }>;
775
816
  };
776
- hideExpressionOption: {
777
- type: PropType<AnyObject[]>;
778
- default: () => never[];
817
+ primaryKey: {
818
+ type: StringConstructor;
819
+ default: string;
820
+ };
821
+ titleRender: {
822
+ type: PropType<(row: FieldSetItem) => VNodeChild>;
779
823
  };
780
824
  }>> & {
781
825
  onSave?: ((...args: any[]) => any) | undefined;
782
826
  onClose?: ((...args: any[]) => any) | undefined;
783
827
  onReset?: ((...args: any[]) => any) | undefined;
784
828
  }, {
829
+ primaryKey: string;
785
830
  type: string;
786
- isEdit: boolean;
787
831
  fields: Partial<{
788
832
  [key: string]: any;
789
833
  id: string;
@@ -802,16 +846,15 @@ declare const _default: import("vue").DefineComponent<{
802
846
  requiredDisable: boolean;
803
847
  hide: boolean;
804
848
  }>[];
849
+ showSearch: boolean;
850
+ isEdit: boolean;
805
851
  rowDraggable: boolean;
806
852
  showSeq: boolean;
807
853
  developMode: boolean;
808
854
  footerFlag: boolean;
809
855
  fieldDescribeMode: "column" | "tooltip";
810
- hideExpressionOption: AnyObject[];
811
- showSearch: boolean;
812
856
  customColumns: FieldSetColumnItem[];
813
857
  showSortPriority: boolean;
814
858
  showHeadFilter: boolean;
815
- showHideExpression: boolean;
816
859
  }>;
817
860
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,toRef as d,watch as a,openBlock as r,createElementBlock as s,createBlock as n,unref as u,withKeys as c,withModifiers as f,createCommentVNode as p,createElementVNode as h,Fragment as m,renderList as y,normalizeStyle as v,withCtx as b,createTextVNode as x,toDisplayString as g,createVNode as k,normalizeClass as w,mergeProps as S,renderSlot as A}from"vue";import{NInput as _,NCheckbox as W,NTooltip as E,NIcon as C,NPopconfirm as D,NButton as F}from"naive-ui";import M from"../../../shared/components/VueDraggable/src/vuedraggable.js";import H from"./components/table-row.vue.js";import{isArray as P,cloneDeep as B,isString as N,omit as j}from"lodash-es";import{isDisable as O,setStyle as V,isDraggableItem as R,isDraggable as q,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as U}from"../../../shared/utils/index.js";import{HelpCircleSharp as T}from"@vicons/ionicons5";const K={class:"main-wrapper"},G={class:"main-wrapper__table-header"},L=h("span",null,"数值越小,优先级越高",-1),$=["tabindex"],z={key:1,class:"main-wrapper__table-footer"};var J=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},showHideExpression:{type:Boolean},hideExpressionOption:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:J,emit:Q}){const X=e,Y={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"};l();const Z=t(Date.now()),ee=t(""),le=t(),te=t([]),ie=[{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!X.fieldShowMaxValue,field:"show",fieldShowMaxValue:X.fieldShowMaxValue},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:"脱敏配置",type:"select",field:"hideExpression"}],oe=t([]),de=i((()=>te.value.flat())),ae=i((()=>de.value.some((e=>e.feildDescribe)))),re=o({columns:oe,data:de,onUpdateChecked:function({checked:e,column:l}){const t=!e||ye(l.field);l.checkedAll=!t},draggable:X.rowDraggable,isFieldSet:!0,fieldDescribeMode:X.fieldDescribeMode,developMode:X.developMode,columnWidthProps:X.columnWidthProps,hideExpressionOption:d(X,"hideExpressionOption")}),se={keyword:ee.value,idx:0,startIdx:0},ne=()=>{Q("save")},ue=()=>{Q("close")};function ce(){te.value=fe(),me(),Z.value=Date.now(),Q("reset")}function fe(){const e=B(X.fields).map((e=>({...e,uuid:U()})));return Object.keys(Y).forEach((l=>{e.forEach((e=>{"old"==X.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[Y[l]]=1==e[l]:e[Y[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=!!q(e)}))})),function(e){if(X.groupSetting){return I(X.groupSetting,e).reduce(((t,i)=>{const o=N(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 pe(){const e=se.keyword!==ee.value;let l=ee.value?de.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(ee.value))return!!e||t>se.idx})):0;-1!==l||e||(l=se.startIdx),le.value.scrollTop=52*l,Object.assign(se,{keyword:ee.value,idx:l},e?{startIdx:l}:{})}function he(e){var l;return!!ee.value&&(null==(l=e.title)?void 0:l.includes(ee.value))}function me(){var e,l;oe.value=B(ie),(null==(e=X.showColumnNames)?void 0:e.length)&&(oe.value=ie.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=X.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=X.customColumns)?void 0:l.length)&&oe.value.push(...X.customColumns),"column"===X.fieldDescribeMode&&ae.value&&oe.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),X.showSeq&&oe.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),oe.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!X.isEdit||"sortPriority"===e.field&&!X.showSortPriority||"isShowHeaderFilter"===e.field&&!X.showHeadFilter||"hideExpression"===e.field&&!X.showHideExpression)}(e),"checkbox"===e.type){const l=te.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!ye(e.field)&&!l}}))}function ye(e){return te.value.flat().some((l=>!O(l,e)&&!l[e]&&"0001"!=l.id))}function ve(e){return!!R(e.relatedContext.element)}return a([()=>X.fields,()=>{var e;return null==(e=X.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(te.value=fe(),me())}),{immediate:!0,deep:!0}),J({getTableFields:function(){let e=[];return e="old"==X.type?de.value.map(((e,l)=>j({...e,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth},["name","show","sort","alias","fixedWay","columnWidth"]))):de.value,e.map((e=>j(e,["uuid"])))}}),(l,t)=>(r(),s("div",K,[e.showSearch?(r(),n(u(_),{key:0,class:"main-wrapper__search-wrapper",value:ee.value,"onUpdate:value":t[0]||(t[0]=e=>ee.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:c(f(pe,["prevent"]),["enter"])},null,8,["value","onKeydown"])):p("v-if",!0),h("div",G,[(r(!0),s(m,null,y(oe.value,((l,t)=>(r(),s(m,{key:t},[l.isShow?(r(),s("span",{key:0,class:"table-cell",style:v(u(V)(l,t,e.columnWidthProps))},["checkbox"!==l.type||l.isHeadCheckHide?(r(),s(m,{key:1},[x(g(l.title),1)],64)):(r(),n(u(W),{key:0,checked:l.checkedAll,"onUpdate:checked":[e=>l.checkedAll=e,e=>{return t=e,i=l.field,void de.value.forEach((e=>{O(e,i)||(e[i]=t)}));var t,i}],disabled:l.disabledAll},{default:b((()=>[x(g(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(r(),n(u(E),{key:2,trigger:"hover"},{trigger:b((()=>[k(u(C),{component:u(T),style:{top:"2px"}},null,8,["component"])])),default:b((()=>[L])),_:1})):p("v-if",!0)],4)):p("v-if",!0)],64)))),128))]),h("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:le},[(r(),n(u(M),{modelValue:te.value,"onUpdate:modelValue":t[1]||(t[1]=e=>te.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:ve,disabled:!e.rowDraggable,key:Z.value},{item:b((({element:e,index:l})=>[e.hide?p("v-if",!0):(r(),s("div",{key:0,class:w(["item",u(R)(e)?"":"disabled"]),tabindex:l},[u(P)(e)?(r(!0),s(m,{key:0},y(e,((e,t)=>(r(),n(H,S(re,{key:t,element:e,idx:l+1,"is-highlight":he(e)}),null,16,["element","idx","is-highlight"])))),128)):(r(),n(H,S({key:1},re,{element:e,idx:l+1,"is-highlight":he(e)}),null,16,["element","idx","is-highlight"]))],10,$))])),_:1},8,["modelValue","disabled"]))],512),e.footerFlag?(r(),s("div",z,[p(" 底部按钮插槽 "),A(l.$slots,"footer",{},(()=>[k(u(D),{onPositiveClick:ce},{trigger:b((()=>[k(u(F),{style:{"margin-right":"8px"}},{default:b((()=>[x("恢复默认设置")])),_:1})])),default:b((()=>[x(" 确认要恢复系统默认设置吗? ")])),_:1}),k(u(F),{style:{"margin-right":"8px"},onClick:ue},{default:b((()=>[x("取消")])),_:1}),k(u(F),{type:"primary",onClick:ne},{default:b((()=>[x("保存")])),_:1})]))])):p("v-if",!0)]))}});export{J as default};
1
+ import{defineComponent as e,ref as l,computed as i,reactive as t,toRef as o,watch as d,openBlock as a,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as h,createElementVNode as f,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as x,normalizeClass as k,mergeProps as w,renderSlot as S}from"vue";import{NInput as C,NCheckbox as _,NTooltip as A,NIcon as W,NPopconfirm as E,NButton as H}from"naive-ui";import D from"../../../shared/components/VueDraggable/src/vuedraggable.js";import F from"./components/table-row.vue.js";import{isArray as M,cloneDeep as P,isString as R,omit as N}from"lodash-es";import{isDisable as j,setStyle as B,isDraggableItem as V,isDraggable as O,getGroupTree as q}from"./utils/index.js";import{uuidGenerator as I}from"../../../shared/utils/index.js";import{HelpCircleSharp as K}from"@vicons/ionicons5";const U={class:"main-wrapper"},T={class:"main-wrapper__table-header"},L=f("span",null,"数值越小,优先级越高",-1),G=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionConfig:{type:Object},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},Y=l(Date.now()),Z=l(""),ee=l(),le=l(),ie=l([]),te=[{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!Q.fieldShowMaxValue,field:"show",fieldShowMaxValue:Q.fieldShowMaxValue},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:"搜索",type:"checkbox",isHeadCheckHide:!0,field:"isSearch",hide:!0},{title:"求和",type:"checkbox",isHeadCheckHide:!0,field:"isSum",hide:!0},{title:"平均值",type:"checkbox",isHeadCheckHide:!0,field:"isAvg",hide:!0},{title:"脱敏配置",type:"select",field:"hideExpression",hide:!0}],oe=l([]),de=i((()=>{var e;return(null==(e=le.value)?void 0:e.scrollWidth)?le.value.scrollWidth+"px":"auto"})),ae=i((()=>ie.value.flat())),re=i((()=>ae.value.some((e=>e.feildDescribe)))),se=t({columns:oe,data:ae,onUpdateChecked:function({checked:e,column:l}){const i=!e||ve(l.field);l.checkedAll=!i},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode,developMode:Q.developMode,columnWidthProps:Q.columnWidthProps,hideExpressionOption:o(Q.hideExpressionConfig||{option:[]},"option"),primaryKey:o(Q,"primaryKey"),titleRender:Q.titleRender}),ne={keyword:Z.value,idx:0,startIdx:0},ue=()=>{J("save")},ce=()=>{J("close")};function he(){ie.value=fe(),ye(),Y.value=Date.now(),J("reset")}function fe(){const e=P(Q.fields).map((e=>({...e,uuid:I()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{var i;"old"==Q.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[X[l]]=1==e[l]:e[X[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!O(e),M(null==(i=e.relation)?void 0:i.fieldList)&&e.relation.fieldList.forEach((e=>{1==e.isSearch&&(e.checked=!0)}))}))})),function(e){if(Q.groupSetting){return q(Q.groupSetting,e).reduce(((i,t)=>{const o=R(t)?e.find((e=>e.name===t)):l(t.children);return o&&i.push(o),i}),[])}return e;function l(i){const t=[];return i.forEach((i=>{if(i.children)t.push(...l(i.children));else{const l=e.find((e=>e.name===i));l&&t.push(l)}})),t}}(e)}function pe(){const e=ne.keyword!==Z.value;let l=Z.value?ae.value.findIndex(((l,i)=>{var t;if(null==(t=l.title)?void 0:t.includes(Z.value))return!!e||i>ne.idx})):0;-1!==l||e||(l=ne.startIdx),ee.value.scrollTop=52*l,Object.assign(ne,{keyword:Z.value,idx:l},e?{startIdx:l}:{})}function me(e){var l;return!!Z.value&&(null==(l=e.title)?void 0:l.includes(Z.value))}function ye(){var e,l;oe.value=P(te),(null==(e=Q.showColumnNames)?void 0:e.length)&&(oe.value=te.filter((e=>{var l,i;return"title"===e.field||(null==(i=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:i.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&oe.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&re.value&&oe.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.showSeq&&oe.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),oe.value.forEach((e=>{if(e.isShow=function(e){var l,i;if(!(null==(l=Q.showColumnNames)?void 0:l.length))return!(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter||"hideExpression"===e.field&&!(null==(i=Q.hideExpressionConfig)?void 0:i.show)||e.hide);return!0}(e),"checkbox"===e.type){const l=ie.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!ve(e.field)&&!l}}))}function ve(e){return ie.value.flat().some((l=>!j(l,e)&&!l[e]&&"0001"!=l.id))}function be(e){return!!V(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ie.value=fe(),ye())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?ae.value.map(((e,l)=>N({...e,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth},["name","show","sort","alias","fixedWay","columnWidth"]))):ae.value,e.map((e=>N(e,["uuid"])))}}),(l,i)=>(a(),r("div",U,[e.showSearch?(a(),s(n(C),{key:0,class:"main-wrapper__search-wrapper",value:Z.value,"onUpdate:value":i[0]||(i[0]=e=>Z.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(pe,["prevent"]),["enter"])},null,8,["value","onKeydown"])):h("v-if",!0),f("div",{class:"main-wrapper__table",ref_key:"tableRef",ref:le},[f("div",T,[(a(!0),r(p,null,m(oe.value,((l,i)=>(a(),r(p,{key:i},[l.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(n(B)(l,i,e.columnWidthProps))},[f("span",null,["checkbox"!==l.type||l.isHeadCheckHide?(a(),r(p,{key:1},[b(g(l.title),1)],64)):(a(),s(n(_),{key:0,checked:l.checkedAll,"onUpdate:checked":[e=>l.checkedAll=e,e=>{return i=e,t=l.field,void ae.value.forEach((e=>{j(e,t)||(e[t]=i)}));var i,t}],disabled:l.disabledAll},{default:v((()=>[b(g(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(a(),s(n(A),{key:2,trigger:"hover"},{trigger:v((()=>[x(n(W),{component:n(K),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[L])),_:1})):h("v-if",!0)])],4)):h("v-if",!0)],64)))),128))]),f("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ee},[(a(),s(n(D),{modelValue:ie.value,"onUpdate:modelValue":i[1]||(i[1]=e=>ie.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:be,disabled:!e.rowDraggable,key:Y.value},{item:v((({element:e,index:l})=>[e.hide?h("v-if",!0):(a(),r("div",{key:0,class:k(["item",n(V)(e)?"":"disabled"]),tabindex:l,style:y({width:n(de)})},[n(M)(e)?(a(!0),r(p,{key:0},m(e,((e,i)=>(a(),s(F,w(se,{key:i,element:e,idx:l+1,"is-highlight":me(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),s(F,w({key:1},se,{element:e,idx:l+1,"is-highlight":me(e)}),null,16,["element","idx","is-highlight"]))],14,G))])),_:1},8,["modelValue","disabled"]))],512)],512),e.footerFlag?(a(),r("div",$,[h(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[x(n(E),{onPositiveClick:he},{trigger:v((()=>[x(n(H),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),x(n(H),{style:{"margin-right":"8px"},onClick:ce},{default:v((()=>[b("取消")])),_:1}),x(n(H),{type:"primary",onClick:ue},{default:v((()=>[b("保存")])),_:1})]))])):h("v-if",!0)]))}});export{z as default};
@@ -61,8 +61,15 @@ declare const _default: import("vue").DefineComponent<{
61
61
  }>>;
62
62
  emit: (event: "save", ...args: any[]) => void;
63
63
  setRefs: AnyObject;
64
+ fieldSetRef: import("vue").Ref<any>;
64
65
  primaryColor: import("vue").Ref<string>;
65
- rowHeight: import("vue").ComputedRef<"52px" | "auto">;
66
+ fieldSetHeight: import("vue").Ref<number>;
67
+ dataLength: import("vue").ComputedRef<number>;
68
+ style: import("vue").ComputedRef<{
69
+ '--row-height': string;
70
+ '--primary-color': string;
71
+ '--main-height': any;
72
+ }>;
66
73
  tabList: import("vue").ComputedRef<{
67
74
  name: FieldSetTab;
68
75
  tab: string;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as l,provide as t,reactive as i,ref as a,computed as r,openBlock as o,createElementBlock as s,normalizeStyle as d,unref as n,createBlock as f,withCtx as m,Fragment as u,renderList as b,resolveDynamicComponent as h,mergeProps as y,createSlots as p,renderSlot as v,h as F}from"vue";import{useThemeVars as g,NTabs as c,NTabPane as w}from"naive-ui";import C from"./FieldSet.vue.js";import L from"./FieldColor.vue.js";import T from"./TableStyle.vue.js";import S from"./FieldFilter.vue.js";import{InjectionFieldList as _,InjectionQueryWordbookData as j}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},fieldFilterList:{type:Array,default:()=>[]}},emits:["save"],setup(e,{expose:$,emit:k}){const x=e,R=l();t(_,x.fieldList),t(j,x.queryWordbookData);const A=i({}),q=a(g().value.primaryColor),D=r((()=>"showSearch"in R&&!1!==R.showSearch||"show-search"in R&&!1!==R["show-search"]?"52px":"auto")),N=r((()=>[{name:"field",tab:"字段设置",render:()=>F(C)},{name:"fieldColor",tab:"字段颜色",render:()=>F(L,{isFieldColor:!0,defaultList:x.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>F(L,{isFieldColor:!1,defaultList:x.highlightRowColorList})},{name:"tableStyle",tab:"表格样式",render:()=>F(T)},{name:"fieldFilter",tab:"高级筛选",render:()=>F(S,{defaultList:x.fieldFilterList})}].filter((e=>x.showTabNames.includes(e.name)))));function W(){var e,l,t,i,a;k("save",{tableFields:null==(e=A.field)?void 0:e.getTableFields(),tableFieldColors:null==(l=A.fieldColor)?void 0:l.getTableFields(),tableHighlightRows:null==(t=A.highlightRow)?void 0:t.getTableFields(),tableStyle:null==(i=A.tableStyle)?void 0:i.getTableFields(),tableFilters:null==(a=A.fieldFilter)?void 0:a.getTableFields()})}function H(e,l){A[l]=e}return $({getTableFields:function(e){var l;return null==(l=A[e||"field"])?void 0:l.getTableFields()}}),(e,l)=>(o(),s("div",{class:"c-field-set",style:d({"--row-height":n(D),"--primary-color":q.value})},[n(N).length>1?(o(),f(n(c),{key:0,type:"line",naimated:""},{default:m((()=>[(o(!0),s(u,null,b(n(N),(l=>(o(),f(n(w),{key:l.name,name:l.name,tab:l.tab,"display-directive":"show"},{default:m((()=>[(o(),f(h(l.render()),y(e.$attrs,{ref_for:!0,ref:e=>H(e,l.name),onSave:W}),p({_:2},[b(e.$slots,((l,t)=>({name:t,fn:m((()=>[v(e.$slots,t)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(o(),f(h(n(N)[0].render()),y({key:1},e.$attrs,{ref:e=>H(e,n(N)[0].name),onSave:W}),p({_:2},[b(e.$slots,((l,t)=>({name:t,fn:m((()=>[v(e.$slots,t)]))})))]),1040))],4))}});export{$ as default};
1
+ import{defineComponent as e,useAttrs as l,provide as t,reactive as i,ref as r,computed as a,unref as o,openBlock as s,createElementBlock as d,normalizeStyle as n,createBlock as f,withCtx as u,Fragment as m,renderList as h,resolveDynamicComponent as v,mergeProps as b,createSlots as p,renderSlot as y,createCommentVNode as g,h as F}from"vue";import{useThemeVars as c,NTabs as w,NTabPane as L}from"naive-ui";import C from"./FieldSet.vue.js";import T from"./FieldColor.vue.js";import S from"./TableStyle.vue.js";import _ from"./FieldFilter.vue.js";import{InjectionFieldList as k,InjectionQueryWordbookData as x}from"./constants/index.js";import{useElementSize as $}from"@vueuse/core";import{isArray as j}from"lodash-es";var R=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function},fieldFilterList:{type:Array,default:()=>[]}},emits:["save"],setup(e,{expose:R,emit:A}){const N=e,q=l();t(k,N.fieldList),t(x,N.queryWordbookData);const D=i({}),W=r(),H=r(c().value.primaryColor),{height:I}=$(W),O=a((()=>{const e=N.showTabNames[0];return"field"===e?j(q.fields)?q.fields.length:0:"fieldFilter"===e?j(N.fieldFilterList)?N.fieldFilterList.length:0:1})),z=a((()=>{var e;const l="showSearch"in q&&!1!==q.showSearch||"show-search"in q&&!1!==q["show-search"]?"52px":"auto";let t=(null==(e=q.style)?void 0:e.height)||"100%";if(B.value.length>1){t=`calc(${"100%"===t&&(null==I?void 0:I.value)?I.value+"px":t} - 54px)`}return{"--row-height":l,"--primary-color":H.value,"--main-height":t}})),B=a((()=>[{name:"field",tab:"字段设置",render:()=>F(C)},{name:"fieldColor",tab:"字段颜色",render:()=>F(T,{isFieldColor:!0,defaultList:N.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>F(T,{isFieldColor:!1,defaultList:N.highlightRowColorList})},{name:"tableStyle",tab:"表格样式",render:()=>F(S)},{name:"fieldFilter",tab:"高级筛选",render:()=>F(_,{defaultList:N.fieldFilterList})}].filter((e=>N.showTabNames.includes(e.name)))));function E(){var e,l,t,i,r;A("save",{tableFields:null==(e=D.field)?void 0:e.getTableFields(),tableFieldColors:null==(l=D.fieldColor)?void 0:l.getTableFields(),tableHighlightRows:null==(t=D.highlightRow)?void 0:t.getTableFields(),tableStyle:null==(i=D.tableStyle)?void 0:i.getTableFields(),tableFilters:null==(r=D.fieldFilter)?void 0:r.getTableFields()})}function G(e,l){D[l]=e}return R({getTableFields:function(e){var l;return null==(l=D[e||"field"])?void 0:l.getTableFields()}}),(e,l)=>o(O)>0?(s(),d("div",{key:0,class:"c-field-set",style:n(o(z)),ref_key:"fieldSetRef",ref:W},[o(B).length>1?(s(),f(o(w),{key:0,type:"line",naimated:""},{default:u((()=>[(s(!0),d(m,null,h(o(B),(l=>(s(),f(o(L),{key:l.name,name:l.name,tab:l.tab,"display-directive":"show"},{default:u((()=>[(s(),f(v(l.render()),b(e.$attrs,{ref_for:!0,ref:e=>G(e,l.name),onSave:E}),p({_:2},[h(e.$slots,((l,t)=>({name:t,fn:u((()=>[y(e.$slots,t)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(s(),f(v(o(B)[0].render()),b({key:1},e.$attrs,{ref:e=>G(e,o(B)[0].name),onSave:E}),p({_:2},[h(e.$slots,((l,t)=>({name:t,fn:u((()=>[y(e.$slots,t)]))})))]),1040))],4)):g("v-if",!0)}});export{R as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,reactive as r,watch as l,openBlock as s,createElementBlock as a,createElementVNode as i,createVNode as o,unref as n,Fragment as p,renderList as d,toDisplayString as m,normalizeClass as b,withDirectives as c,vShow as u,withCtx as v,createTextVNode as f}from"vue";import{NSwitch as g,NIcon as y,NButton as _}from"naive-ui";import{CheckmarkCircle as C}from"@vicons/ionicons5";import h from"../../../shared/assets/img/table_style_1.png.js";import j from"../../../shared/assets/img/table_style_2.png.js";import k from"../../../shared/assets/img/table_style_3.png.js";import x from"../../../shared/assets/img/table_style_4.png.js";const S={class:"main-wrapper"},w={class:"set-item"},z=i("span",{style:{"margin-right":"20px"}},"开启斑马线",-1),T={class:"set-item table-item"},F=["onClickCapture"],O={class:"table-bg"},U=["src"],q={class:"table-style__desc"},A={class:"circle"},B={class:"main-wrapper__table-footer"};var D=e({__name:"TableStyle",props:{tableStyleConfig:{type:Object,default:()=>({stripe:!1,border:!0})}},emits:["save","close"],setup(e,{expose:D,emit:E}){const G=e,H=t([{title:"样式一",label:"无列分割线",border:!1},{title:"样式二",label:"列分割线",border:!0}]),I=r(G.tableStyleConfig);function J(){E("close")}function K(){E("save")}return l((()=>G.tableStyleConfig),(e=>{const{stripe:t=!1,border:r=!0}=e;I.stripe=t,I.border=r}),{immediate:!0,deep:!0}),D({getTableFields:function(){return I}}),(e,t)=>(s(),a("div",S,[i("div",w,[z,o(n(g),{value:I.stripe,"onUpdate:value":t[0]||(t[0]=e=>I.stripe=e),size:"small"},null,8,["value"])]),i("div",T,[(s(!0),a(p,null,d(H.value,((e,t)=>{return s(),a(p,{key:t},[i("h4",null,m(e.title),1),i("div",{class:b(["table-style",{active:e.border===I.border}]),onClickCapture:()=>{return t=e.border,void(I.border=t);var t}},[i("div",O,[i("img",{src:(r=e.border,I.stripe?r?h:k:r?j:x),alt:""},null,8,U)]),i("div",q,[c(o(n(y),{size:20,component:n(C)},null,8,["component"]),[[u,e.border===I.border]]),c(i("i",A,null,512),[[u,e.border!==I.border]]),i("span",null,m(e.label),1)])],42,F)],64);var r})),128))]),i("div",B,[o(n(_),{style:{"margin-right":"8px"},onClick:J},{default:v((()=>[f("取消")])),_:1}),o(n(_),{type:"primary",onClick:K},{default:v((()=>[f("保存")])),_:1})])]))}});export{D as default};
1
+ import{defineComponent as e,ref as t,reactive as r,watch as l,openBlock as s,createElementBlock as a,createElementVNode as i,createVNode as o,unref as n,Fragment as p,renderList as d,toDisplayString as m,normalizeClass as b,withDirectives as c,vShow as u,withCtx as v,createTextVNode as f}from"vue";import{NSwitch as g,NIcon as y,NButton as _}from"naive-ui";import{CheckmarkCircle as C}from"@vicons/ionicons5";import h from"../../../shared/assets/img/table_style_1.png.js";import j from"../../../shared/assets/img/table_style_2.png.js";import k from"../../../shared/assets/img/table_style_3.png.js";import x from"../../../shared/assets/img/table_style_4.png.js";const S={class:"main-wrapper",style:{"overflow-y":"auto"}},w={class:"set-item"},z=i("span",{style:{"margin-right":"20px"}},"开启斑马线",-1),T={class:"set-item table-item"},F=["onClickCapture"],O={class:"table-bg"},U=["src"],q={class:"table-style__desc"},A={class:"circle"},B={class:"main-wrapper__table-footer"};var D=e({__name:"TableStyle",props:{tableStyleConfig:{type:Object,default:()=>({stripe:!1,border:!0})}},emits:["save","close"],setup(e,{expose:D,emit:E}){const G=e,H=t([{title:"样式一",label:"无列分割线",border:!1},{title:"样式二",label:"列分割线",border:!0}]),I=r(G.tableStyleConfig);function J(){E("close")}function K(){E("save")}return l((()=>G.tableStyleConfig),(e=>{const{stripe:t=!1,border:r=!0}=e;I.stripe=t,I.border=r}),{immediate:!0,deep:!0}),D({getTableFields:function(){return I}}),(e,t)=>(s(),a("div",S,[i("div",w,[z,o(n(g),{value:I.stripe,"onUpdate:value":t[0]||(t[0]=e=>I.stripe=e),size:"small"},null,8,["value"])]),i("div",T,[(s(!0),a(p,null,d(H.value,((e,t)=>{return s(),a(p,{key:t},[i("h4",null,m(e.title),1),i("div",{class:b(["table-style",{active:e.border===I.border}]),onClickCapture:()=>{return t=e.border,void(I.border=t);var t}},[i("div",O,[i("img",{src:(r=e.border,I.stripe?r?h:k:r?j:x),alt:""},null,8,U)]),i("div",q,[c(o(n(y),{size:20,component:n(C)},null,8,["component"]),[[u,e.border===I.border]]),c(i("i",A,null,512),[[u,e.border!==I.border]]),i("span",null,m(e.label),1)])],42,F)],64);var r})),128))]),i("div",B,[o(n(_),{style:{"margin-right":"8px"},onClick:J},{default:v((()=>[f("取消")])),_:1}),o(n(_),{type:"primary",onClick:K},{default:v((()=>[f("保存")])),_:1})])]))}});export{D as default};
@@ -106,6 +106,14 @@ declare const _default: import("vue").DefineComponent<{
106
106
  type: PropType<string | false | HTMLElement>;
107
107
  default: string;
108
108
  };
109
+ holidays: {
110
+ type: PropType<Date[]>;
111
+ default: () => never[];
112
+ };
113
+ type: {
114
+ type: StringConstructor;
115
+ default: string;
116
+ };
109
117
  }, {
110
118
  attrs: {
111
119
  [x: string]: unknown;
@@ -130,6 +138,14 @@ declare const _default: import("vue").DefineComponent<{
130
138
  type: PropType<string | false | HTMLElement>;
131
139
  default: string;
132
140
  };
141
+ holidays: {
142
+ type: PropType<Date[]>;
143
+ default: () => never[];
144
+ };
145
+ type: {
146
+ type: StringConstructor;
147
+ default: string;
148
+ };
133
149
  }>> & {
134
150
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
135
151
  }>>;
@@ -146,6 +162,9 @@ declare const _default: import("vue").DefineComponent<{
146
162
  blur: () => any;
147
163
  handleConfirm: (target: HTMLInputElement) => void;
148
164
  onUpdateShow: (show: boolean) => Promise<void>;
165
+ watchers: import("../../../../shared/types").AnyFn[];
166
+ stopWatcher: () => void;
167
+ setHoliday: (show: boolean) => Promise<void>;
149
168
  onConfirm: (...args: any[]) => Promise<void>;
150
169
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
151
170
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -170,11 +189,21 @@ declare const _default: import("vue").DefineComponent<{
170
189
  type: PropType<string | false | HTMLElement>;
171
190
  default: string;
172
191
  };
192
+ holidays: {
193
+ type: PropType<Date[]>;
194
+ default: () => never[];
195
+ };
196
+ type: {
197
+ type: StringConstructor;
198
+ default: string;
199
+ };
173
200
  }>> & {
174
201
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
175
202
  }, {
203
+ type: string;
176
204
  updateUnchangedValue: boolean;
177
205
  to: string | false | HTMLElement;
206
+ holidays: Date[];
178
207
  }>>;
179
208
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
180
209
  data: {