cnhis-design-vue 3.2.8-release.0 → 3.2.8-release.2

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 (140) hide show
  1. package/README.md +87 -87
  2. package/es/components/ai-chat/index.d.ts +75 -0
  3. package/es/components/ai-chat/index.js +1 -0
  4. package/es/components/ai-chat/src/Index.vue.d.ts +77 -0
  5. package/es/components/ai-chat/src/Index.vue.js +1 -0
  6. package/es/components/ai-chat/src/Index.vue2.js +1 -0
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +14 -0
  8. package/es/components/ai-chat/src/components/ChatFooter.vue.js +1 -0
  9. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -0
  10. package/es/components/ai-chat/src/components/ChatMain.d.ts +8 -0
  11. package/es/components/ai-chat/src/components/ChatMain.js +1 -0
  12. package/es/components/ai-chat/src/types/index.d.ts +20 -0
  13. package/es/components/ai-chat/src/types/index.js +1 -0
  14. package/es/components/ai-chat/style/index.css +1 -0
  15. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  16. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  17. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  18. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  19. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  20. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  21. package/es/components/button-print/index.d.ts +38 -0
  22. package/es/components/button-print/src/ButtonPrint.vue.d.ts +38 -0
  23. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  24. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +17 -0
  25. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  26. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  27. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  28. package/es/components/button-print/src/utils/print.js +1 -1
  29. package/es/components/button-print/style/index.css +1 -1
  30. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  31. package/es/components/callback/src/components/render/popupMaps.d.ts +3 -2
  32. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  33. package/es/components/field-set/src/FieldColor.vue.d.ts +10 -1
  34. package/es/components/field-set/src/FieldFilter.vue.d.ts +10 -1
  35. package/es/components/field-set/src/FieldSet.vue.d.ts +21 -2
  36. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  37. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  38. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  39. package/es/components/field-set/src/components/table-row.vue.d.ts +10 -1
  40. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  41. package/es/components/field-set/src/utils/index.d.ts +1 -1
  42. package/es/components/field-set/src/utils/index.js +1 -1
  43. package/es/components/form-config/index.d.ts +6 -4
  44. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -4
  45. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  46. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -2
  47. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -2
  48. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  49. package/es/components/form-render/index.d.ts +3 -2
  50. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  51. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  52. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -2
  53. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  54. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  55. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  56. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  57. package/es/components/form-render/src/components/renderer/select.js +1 -1
  58. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  59. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  60. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  61. package/es/components/form-render/src/types/index.d.ts +1 -0
  62. package/es/components/guide/src/renderer.js +1 -1
  63. package/es/components/iho-chat/index.d.ts +3 -0
  64. package/es/components/iho-chat/src/Index.vue.d.ts +3 -0
  65. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  66. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  67. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  68. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +4 -0
  69. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  70. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  71. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  72. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  73. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  74. package/es/components/iho-chat/style/index.css +1 -1
  75. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  76. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  78. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  79. package/es/components/index.css +1 -1
  80. package/es/components/index.d.ts +2 -1
  81. package/es/components/index.js +1 -1
  82. package/es/components/info-header/index.d.ts +6 -4
  83. package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -4
  84. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  85. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -2
  86. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -2
  87. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  88. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  89. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  90. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  91. package/es/components/shortcut-setter/index.d.ts +3 -2
  92. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -2
  93. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  94. package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
  95. package/es/components/step-notice/src/hooks/useTheme.js +1 -1
  96. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  97. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  98. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  99. package/es/shared/assets/img/ai__avatar.png.js +1 -0
  100. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  101. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  102. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  103. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  104. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  105. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  106. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  107. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  108. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  109. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  110. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  111. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  112. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  113. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  114. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  115. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  116. package/es/shared/assets/img/failure.png.js +1 -1
  117. package/es/shared/assets/img/no-permission.png.js +1 -1
  118. package/es/shared/assets/img/nodata.png.js +1 -1
  119. package/es/shared/assets/img/notfound.png.js +1 -1
  120. package/es/shared/assets/img/qr.png.js +1 -1
  121. package/es/shared/assets/img/success.png.js +1 -1
  122. package/es/shared/assets/img/table_style_2.png.js +1 -1
  123. package/es/shared/assets/img/video.png.js +1 -1
  124. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  125. package/es/shared/assets/img/xb_big.png.js +1 -1
  126. package/es/shared/assets/img/xb_small.png.js +1 -1
  127. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  128. package/es/shared/hooks/index.d.ts +1 -0
  129. package/es/shared/hooks/index.js +1 -1
  130. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  131. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  132. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  133. package/es/shared/hooks/useFormRequest/index.js +1 -1
  134. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  135. package/es/shared/package.json.js +1 -1
  136. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  137. package/es/shared/utils/tapable/index.d.ts +139 -0
  138. package/package.json +2 -2
  139. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.d.ts +0 -0
  140. /package/es/{components/iho-chat/src → shared}/hooks/useScrollLoading.js +0 -0
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as n,openBlock as o,createBlock as u,unref as r,isRef as i,createSlots as s,renderList as d,withCtx as c,renderSlot as f,nextTick as m}from"vue";import{NDatePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as y}from"../../../shared/hooks/useDateTime.js";import{isArray as h,isEqual as g,isString as w}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{format as V,sub as k,startOfDay as R,endOfDay as D}from"date-fns";var S=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"}},emits:["update:formatted-value"],setup(e,{expose:S,emit:I}){const C=e,M=t(),_=a(null),b=a(null),$=a();let j="";const P=l({get:()=>T(C.formattedValue)?null:C.formattedValue,set(e){h(e)&&h(j)&&g(j,e)||j===e||(I("update:formatted-value",e,w(e)?Date.parse(e):h(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),j=e)}}),U=l((()=>{const e=Reflect.get(M,"type")||"";return["datetime","datetimerange"].includes(e)})),x=l((()=>{if(Reflect.get(M,"format"))return M.format;const e=M.type||"";return U.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),H=l((()=>U.value?x.value.split(" "):"")),{focus:q,blur:A,handleConfirm:B}=v(_,{formatRef:x,attrs:M,emit:I,allowedInvalidValue:C.allowedInvalidValue});async function F(e){e&&U.value&&(await m(),async function e(t=0){var a;t>2||(b.value=null==(a=_.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:H,attrs:M,isPanel:!0}):(await m(),e(++t)))}())}async function O(...e){var t,a,l,n,o,u;const r=Reflect.get(M,"type")||"",i=null==(n=null==(l=null==(a=null==(t=_.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(r.includes("range")?null==(o=C.onConfirm)||o.call(C,...e):(await m(),i.focus(),B(i),i.blur(),null==(u=C.onConfirm)||u.call(C,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!C.updateUnchangedValue||r.includes("range"))return;const s=i.value;y(i,V(new Date,x.value)),y(i,s)}function T(e){return C.allowedInvalidValue&&C.allowedInvalidValue===e}return n((()=>C.formattedValue),(e=>{$.value=T(e)?e:C.placeholder?C.placeholder:"选择日期时间",T(e)||(j=e)}),{immediate:!0}),S({$datePicker:_,focus:q,blur:A,setShortcutValue:async function(e){const t=Reflect.get(M,"type")||"";if(!t||!t.includes("range")||!_.value)return;const a=_.value.$el.querySelectorAll(".n-input__input-el");let l,n;const o=new Date;if("week"===e){const e=k(o,{weeks:1});l=V(R(e),x.value)}else{const e=k(o,{months:1});l=V(R(e),x.value)}n=V(D(o),x.value),y(a[0],l),await m(),y(a[1],n)}}),(t,a)=>(o(),u(r(p),{ref_key:"datePickerRef",ref:_,"onUpdate:show":F,onConfirm:O,placeholder:$.value,to:e.to,"formatted-value":r(P),"onUpdate:formatted-value":a[0]||(a[0]=e=>i(P)?P.value=e:null)},s({_:2},[d(t.$slots,((e,a)=>({name:a,fn:c((()=>[f(t.$slots,a)]))})))]),1032,["placeholder","to","formatted-value"]))}});export{S as default};
1
+ import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as o,openBlock as n,createBlock as u,unref as r,isRef as i,createSlots as s,renderList as d,withCtx as c,renderSlot as f,nextTick as m}from"vue";import{NDatePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as y}from"../../../shared/hooks/useDateTime.js";import{isArray as h,isEqual as g,isString as w}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as k,startOfDay as R,endOfDay as S}from"date-fns";var D=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"}},emits:["update:formatted-value"],setup(e,{expose:D,emit:I}){const C=e,M=t(),_=a(null),b=a(null),j=a();let $="";const P=l({get:()=>O(C.formattedValue)?null:C.formattedValue,set(e){h(e)&&h($)&&g($,e)||$===e||(I("update:formatted-value",e,w(e)?Date.parse(e):h(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),$=e)}}),U=l((()=>{const e=Reflect.get(M,"type")||"";return["datetime","datetimerange"].includes(e)})),x=l((()=>{if(Reflect.get(M,"format"))return M.format;const e=M.type||"";return U.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),H=l((()=>U.value?x.value.split(" "):"")),{focus:q,blur:A,handleConfirm:B}=v(_,{formatRef:x,attrs:M,emit:I,allowedInvalidValue:C.allowedInvalidValue});async function F(e){e&&U.value&&(await m(),async function e(t=0){var a;t>2||(b.value=null==(a=_.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:H,attrs:M,isPanel:!0}):(await m(),e(++t)))}())}async function L(...e){var t,a,l,o,n,u;const r=Reflect.get(M,"type")||"",i=null==(o=null==(l=null==(a=null==(t=_.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:o.call(l,"input");if(r.includes("range")?null==(n=C.onConfirm)||n.call(C,...e):(await m(),i.focus(),B(i),i.blur(),null==(u=C.onConfirm)||u.call(C,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!C.updateUnchangedValue||r.includes("range"))return;const s=i.value;y(i,V(new Date,x.value)),y(i,s)}function O(e){return C.allowedInvalidValue&&C.allowedInvalidValue===e}return o((()=>C.formattedValue),(e=>{j.value=O(e)?e:C.placeholder?C.placeholder:"选择日期时间",O(e)||($=e)}),{immediate:!0}),D({$datePicker:_,focus:q,blur:A,setShortcutValue:async function(e){const t=Reflect.get(M,"type")||"";if(!t||!t.includes("range")||!_.value)return;const a=_.value.$el.querySelectorAll(".n-input__input-el");let l,o;const n=new Date;if("week"===e){const e=k(n,{weeks:1});l=V(R(e),x.value)}else{const e=k(n,{months:1});l=V(R(e),x.value)}o=V(S(n),x.value),y(a[0],l),await m(),y(a[1],o)}}),(t,a)=>(n(),u(r(p),{ref_key:"datePickerRef",ref:_,"onUpdate:show":F,onConfirm:L,placeholder:j.value,to:e.to,"formatted-value":r(P),"onUpdate:formatted-value":a[0]||(a[0]=e=>i(P)?P.value=e:null)},s({_:2},[d(t.$slots,((e,a)=>({name:a,fn:c((()=>[f(t.$slots,a)]))})))]),1032,["placeholder","to","formatted-value"]))}});export{D as default};
@@ -228,6 +228,9 @@ declare const _default: import("vue").DefineComponent<{
228
228
  developMode: {
229
229
  type: BooleanConstructor;
230
230
  };
231
+ columnWidthProps: {
232
+ type: ObjectConstructor;
233
+ };
231
234
  }, {
232
235
  fixedWayOptions: {
233
236
  label: string;
@@ -319,6 +322,9 @@ declare const _default: import("vue").DefineComponent<{
319
322
  developMode: {
320
323
  type: BooleanConstructor;
321
324
  };
325
+ columnWidthProps: {
326
+ type: ObjectConstructor;
327
+ };
322
328
  }>> & {
323
329
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
324
330
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -433,6 +439,9 @@ declare const _default: import("vue").DefineComponent<{
433
439
  developMode: {
434
440
  type: BooleanConstructor;
435
441
  };
442
+ columnWidthProps: {
443
+ type: ObjectConstructor;
444
+ };
436
445
  }>> & {
437
446
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
438
447
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -477,9 +486,9 @@ declare const _default: import("vue").DefineComponent<{
477
486
  }>;
478
487
  developMode: boolean;
479
488
  draggable: boolean;
480
- isHighlightRow: boolean;
481
489
  idx: number;
482
490
  isHighlight: boolean;
491
+ isHighlightRow: boolean;
483
492
  isFieldSet: boolean;
484
493
  fieldDescribeMode: "column" | "tooltip";
485
494
  }>;
@@ -250,6 +250,9 @@ declare const _default: import("vue").DefineComponent<{
250
250
  developMode: {
251
251
  type: BooleanConstructor;
252
252
  };
253
+ columnWidthProps: {
254
+ type: ObjectConstructor;
255
+ };
253
256
  }, {
254
257
  fixedWayOptions: {
255
258
  label: string;
@@ -341,6 +344,9 @@ declare const _default: import("vue").DefineComponent<{
341
344
  developMode: {
342
345
  type: BooleanConstructor;
343
346
  };
347
+ columnWidthProps: {
348
+ type: ObjectConstructor;
349
+ };
344
350
  }>> & {
345
351
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
346
352
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -455,6 +461,9 @@ declare const _default: import("vue").DefineComponent<{
455
461
  developMode: {
456
462
  type: BooleanConstructor;
457
463
  };
464
+ columnWidthProps: {
465
+ type: ObjectConstructor;
466
+ };
458
467
  }>> & {
459
468
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
460
469
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -499,9 +508,9 @@ declare const _default: import("vue").DefineComponent<{
499
508
  }>;
500
509
  developMode: boolean;
501
510
  draggable: boolean;
502
- isHighlightRow: boolean;
503
511
  idx: number;
504
512
  isHighlight: boolean;
513
+ isHighlightRow: boolean;
505
514
  isFieldSet: boolean;
506
515
  fieldDescribeMode: "column" | "tooltip";
507
516
  }>;
@@ -76,6 +76,9 @@ declare const _default: import("vue").DefineComponent<{
76
76
  developMode: {
77
77
  type: BooleanConstructor;
78
78
  };
79
+ columnWidthProps: {
80
+ type: ObjectConstructor;
81
+ };
79
82
  }, {
80
83
  fieldsMapping: Record<string, string>;
81
84
  attrs: {
@@ -155,6 +158,9 @@ declare const _default: import("vue").DefineComponent<{
155
158
  developMode: {
156
159
  type: BooleanConstructor;
157
160
  };
161
+ columnWidthProps: {
162
+ type: ObjectConstructor;
163
+ };
158
164
  }>> & {
159
165
  onSave?: ((...args: any[]) => any) | undefined;
160
166
  onClose?: ((...args: any[]) => any) | undefined;
@@ -202,6 +208,7 @@ declare const _default: import("vue").DefineComponent<{
202
208
  isFieldSet: boolean;
203
209
  fieldDescribeMode: "column" | "tooltip";
204
210
  developMode: boolean;
211
+ columnWidthProps: Record<string, any> | undefined;
205
212
  };
206
213
  searchData: {
207
214
  keyword: string;
@@ -381,6 +388,9 @@ declare const _default: import("vue").DefineComponent<{
381
388
  developMode: {
382
389
  type: BooleanConstructor;
383
390
  };
391
+ columnWidthProps: {
392
+ type: ObjectConstructor;
393
+ };
384
394
  }, {
385
395
  fixedWayOptions: {
386
396
  label: string;
@@ -472,6 +482,9 @@ declare const _default: import("vue").DefineComponent<{
472
482
  developMode: {
473
483
  type: BooleanConstructor;
474
484
  };
485
+ columnWidthProps: {
486
+ type: ObjectConstructor;
487
+ };
475
488
  }>> & {
476
489
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
477
490
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -586,6 +599,9 @@ declare const _default: import("vue").DefineComponent<{
586
599
  developMode: {
587
600
  type: BooleanConstructor;
588
601
  };
602
+ columnWidthProps: {
603
+ type: ObjectConstructor;
604
+ };
589
605
  }>> & {
590
606
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
591
607
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -630,9 +646,9 @@ declare const _default: import("vue").DefineComponent<{
630
646
  }>;
631
647
  developMode: boolean;
632
648
  draggable: boolean;
633
- isHighlightRow: boolean;
634
649
  idx: number;
635
650
  isHighlight: boolean;
651
+ isHighlightRow: boolean;
636
652
  isFieldSet: boolean;
637
653
  fieldDescribeMode: "column" | "tooltip";
638
654
  }>;
@@ -717,6 +733,9 @@ declare const _default: import("vue").DefineComponent<{
717
733
  developMode: {
718
734
  type: BooleanConstructor;
719
735
  };
736
+ columnWidthProps: {
737
+ type: ObjectConstructor;
738
+ };
720
739
  }>> & {
721
740
  onSave?: ((...args: any[]) => any) | undefined;
722
741
  onClose?: ((...args: any[]) => any) | undefined;
@@ -747,8 +766,8 @@ declare const _default: import("vue").DefineComponent<{
747
766
  developMode: boolean;
748
767
  footerFlag: boolean;
749
768
  fieldDescribeMode: "column" | "tooltip";
750
- customColumns: FieldSetColumnItem[];
751
769
  showSearch: boolean;
770
+ customColumns: FieldSetColumnItem[];
752
771
  showSortPriority: boolean;
753
772
  showHeadFilter: boolean;
754
773
  }>;
@@ -1 +1 @@
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 s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as k,normalizeClass as x,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as C,NIcon as D,NPopconfirm as F,NButton as M}from"naive-ui";import W from"../../../shared/components/VueDraggable/src/vuedraggable.js";import E from"./components/table-row.vue.js";import{isArray as B,cloneDeep as H,isString as N,omit as P}from"lodash-es";import{isDisable as q,setStyle as V,isDraggableItem as j,isDraggable as R,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as U}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},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean}},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"};l();const Y=t(""),Z=t(),ee=t([]),le=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"}]),te=i((()=>ee.value.flat())),ie=i((()=>te.value.some((e=>e.feildDescribe)))),oe=o({columns:le,data:te,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode,developMode:Q.developMode}),de={keyword:Y.value,idx:0,startIdx:0},ae=()=>{J("save")},re=()=>{J("close")};function se(){ee.value=ne(),fe(),J("reset")}function ne(){const e=H(Q.fields).map((e=>({...e,uuid:U()})));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=!!R(e)}))})),function(e){if(Q.groupSetting){return I(Q.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 ue(){const e=de.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>de.idx})):0;-1!==l||e||(l=de.startIdx),Z.value.scrollTop=52*l,Object.assign(de,{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=Q.showColumnNames)?void 0:e.length)&&(le.value=le.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)&&le.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&ie.value&&le.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.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)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.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=>!q(l,e)&&!l[e]&&"0001"!=l.id))}function pe(e){return!!j(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ee.value=ne(),fe())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.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,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):te.value,e.map((e=>P(e,["uuid"])))}}),(l,t)=>(a(),r("div",T,[e.showSearch?(a(),s(n(A),{key:0,class:"main-wrapper__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",K,[(a(!0),r(p,null,m(le.value,((e,l)=>(a(),r(p,{key:l},[e.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(n(V)(e,l))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),r(p,{key:1},[b(g(e.title),1)],64)):(a(),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=>{q(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:v((()=>[b(g(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===e.field?(a(),s(n(C),{key:2,trigger:"hover"},{trigger:v((()=>[k(n(D),{component:n(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:Z},[k(n(W),{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ee.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe,disabled:!e.rowDraggable},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:x(["item",n(j)(e)?"":"disabled"]),tabindex:l},[n(B)(e)?(a(!0),r(p,{key:0},m(e,((e,t)=>(a(),s(E,w(oe,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),s(E,w({key:1},oe,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue","disabled"])],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[k(n(F),{onPositiveClick:se},{trigger:v((()=>[k(n(M),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(M),{style:{"margin-right":"8px"},onClick:re},{default:v((()=>[b("取消")])),_:1}),k(n(M),{type:"primary",onClick:ae},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z 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 s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as h,Fragment as p,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as g,createVNode as k,normalizeClass as x,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as W,NIcon as C,NPopconfirm as D,NButton as P}from"naive-ui";import F from"../../../shared/components/VueDraggable/src/vuedraggable.js";import M from"./components/table-row.vue.js";import{isArray as E,cloneDeep as B,isString as H,omit as N}from"lodash-es";import{isDisable as j,setStyle as q,isDraggableItem as V,isDraggable as R,getGroupTree as I}from"./utils/index.js";import{uuidGenerator as O}from"../../../shared/utils/index.js";import{HelpCircleSharp as U}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},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object}},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"};l();const Y=t(""),Z=t(),ee=t([]),le=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"}]),te=i((()=>ee.value.flat())),ie=i((()=>te.value.some((e=>e.feildDescribe)))),oe=o({columns:le,data:te,onUpdateChecked:function({checked:e,column:l}){const t=!e||he(l.field);l.checkedAll=!t},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode,developMode:Q.developMode,columnWidthProps:Q.columnWidthProps}),de={keyword:Y.value,idx:0,startIdx:0},ae=()=>{J("save")},re=()=>{J("close")};function se(){ee.value=ne(),fe(),J("reset")}function ne(){const e=B(Q.fields).map((e=>({...e,uuid:O()})));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=!!R(e)}))})),function(e){if(Q.groupSetting){return I(Q.groupSetting,e).reduce(((t,i)=>{const o=H(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!==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>de.idx})):0;-1!==l||e||(l=de.startIdx),Z.value.scrollTop=52*l,Object.assign(de,{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=Q.showColumnNames)?void 0:e.length)&&(le.value=le.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)&&le.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&ie.value&&le.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.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)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.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!!V(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ee.value=ne(),fe())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.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,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):te.value,e.map((e=>N(e,["uuid"])))}}),(l,t)=>(a(),r("div",T,[e.showSearch?(a(),s(n(A),{key:0,class:"main-wrapper__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",K,[(a(!0),r(p,null,m(le.value,((l,t)=>(a(),r(p,{key:t},[l.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(n(q)(l,t,e.columnWidthProps))},["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 t=e,i=l.field,void te.value.forEach((e=>{j(e,i)||(e[i]=t)}));var t,i}],disabled:l.disabledAll},{default:v((()=>[b(g(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(a(),s(n(W),{key:2,trigger:"hover"},{trigger:v((()=>[k(n(C),{component:n(U),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:Z},[k(n(F),{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ee.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:pe,disabled:!e.rowDraggable},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:x(["item",n(V)(e)?"":"disabled"]),tabindex:l},[n(E)(e)?(a(!0),r(p,{key:0},m(e,((e,t)=>(a(),s(M,w(oe,{key:t,element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),s(M,w({key:1},oe,{element:e,idx:l+1,"is-highlight":ce(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue","disabled"])],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[k(n(D),{onPositiveClick:se},{trigger:v((()=>[k(n(P),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),k(n(P),{style:{"margin-right":"8px"},onClick:re},{default:v((()=>[b("取消")])),_:1}),k(n(P),{type:"primary",onClick:ae},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,ref as n,unref as o,openBlock as t,createElementBlock as i,normalizeStyle as a,createElementVNode as u,createVNode as s,Fragment as c,renderList as d,toDisplayString as p,createCommentVNode as r,withDirectives as m,vShow as f}from"vue";import{NIcon as v,NSelect as _,NInput as T,NInputNumber as E}from"naive-ui";import{AddCircleSharp as N,RemoveCircle as O}from"@vicons/ionicons5";import{CUSTOM_INPUT_OPTIONS as U,InjectionFieldList as y,InjectionQueryWordbookData as h,BOOLEAN_OPTIONS as I,UNIT_OPTIONS as k,FIELD_TYPE_LIST as b,SHOWSETTING_OPTIONS as Q,WORDBOOK_OPTIONS as g}from"../constants/index.js";import S from"../../../date-picker/index.js";import{useTheme as V}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as L,isArray as x,isFunction as A}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";const D=u("span",{style:{"margin-left":"5px"}},"添加操作",-1),F={class:"condition-wrapper"},j={class:"item-index"},w={class:"sql-expression-wrapper"},R=u("span",null,"筛选器逻辑编辑,不设置默认为AND",-1),H=u("br",null,null,-1),C=u("span",null,"例子 (1 AND 2) OR 3",-1);var B=e({__name:"condition",props:{data:{type:Object,default:null}},setup(e,{expose:B}){const M=e,G=U[0].columnName,J=V(),P=L(l(y)),q=l(h),z=n([]),W=n("");function X(e,l=!1){var n,o;l||(e.compareFieldOptions=[],e.con="",Y(e));const{field_key:t}=e,i=P.find((e=>e.columnName===t));if(!i)return void(e.conOptions=[]);const{fieldType:a,settingObj:u={}}=i;e.fieldType=a;const s=L((null==(n=b.find((e=>e.name===a)))?void 0:n.conList)||[]),{showSetting:c,wordbook:d}=u;(null==c?void 0:c.length)&&s.unshift(...Q),(null==(o=Object.keys(d||{}))?void 0:o.length)&&s.unshift(...g),e.conOptions=s}async function K(e,l=!1){e.compareFieldOptions=[],l||Y(e);const{field_key:n,fieldType:o,con:t}=e,i=P.find((e=>e.columnName===n));if(!i)return void(e.conOptions=[]);const{settingObj:a={}}=i||{},{showSetting:u,wordbook:s}=a,c=[];if(["IN","NEQ","BIG","LESS","BIGEQ","LESSEQ","EQ"].includes(t)){c.push(...U),l||(e.compare_field=G);const t=P.filter((e=>e.fieldType===o&&e.columnName!==n));c.push(...t)}if(g.map((e=>e.name)).includes(t)&&A(q)){const l=await q(s);c.push(...(d=l,p="label",r="value",d.map((e=>({...e,title:e[p],columnName:e[r]}))))),e.multiple=!0}var d,p,r;if(Q.map((e=>e.name)).includes(t)&&(null==u?void 0:u.length)){const l=u.map((e=>({...e,title:e.change_text,columnName:JSON.stringify(e.filter||[])})));c.push(...l),e.multiple=!0}e.compareFieldOptions=c}function Y(e){e.multiple=!1,e.compare_field=null,e.value="",e.numberValue=null,e.dateValue=null,e.unit=null}function Z(e){const{con:l,fieldType:n}=e;return"BOOLEAN"===n&&l&&["EQ","NEQ"].includes(l)}function $(e){const{compare_field:l,con:n,fieldType:o}=e;return!(!n||["CONVERT","QUOTE","QUOTE_NOT"].includes(n))&&(!(!["TEXT","JSONB"].includes(o)||["NULL","NOT_NULL"].includes(n))&&(!["EQ","NEQ"].includes(n)||l===G))}function ee(e){if($(e))return!1;const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!(!n||["CONVERT","QUOTE","QUOTE_NOT"].includes(n))&&("NUMBER"===t?!["NULL","NOT_NULL"].includes(n)&&l===G:!!["DATE","DATETIME","TIME"].includes(t)&&["L_","N_","IN_THE_PAST","IN_THE_FUTURE","IN_THE_PAST_DI","IN_THE_FUTURE_DI"].includes(n))}function le(e){const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!!n&&(!!["DATE","DATETIME","TIME"].includes(t)&&["L_","N_","IN_THE_PAST","IN_THE_FUTURE","IN_THE_PAST_DI","IN_THE_FUTURE_DI"].includes(n))}function ne(e){const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!!n&&(!!["DATE","DATETIME","TIME"].includes(t)&&(["IN","NEQ","BIG","LESS","BIGEQ","LESSEQ"].includes(n)&&l===G))}function oe(e){return["IN","NEQ"].includes(e.con)?"datetimerange":"datetime"}function te(){const e={field_key:P[0].columnName,fieldType:"",con:"",conOptions:[],compare_field:"",compareFieldOptions:[],unit:"",numberValue:null,dateValue:null,multiple:!1};X(e),e.con="",z.value.push(e)}return function(){const{condition:e=[],sqlExpression:l=""}=M.data||{};e.length&&(z.value=e);l&&(W.value=l);z.value.forEach((e=>{X(e,!0),K(e,!0);const{con:l,value:n,start_val:o,end_val:t}=e;"CONVERT"===l&&(e.compare_field=x(n)?n.map((e=>JSON.stringify(e))):n),"QUOTE"!==l&&"QUOTE_NOT"!==l||(e.compare_field=n.split("|#|")),ee(e)&&(e.numberValue=+n),ne(e)&&(oe(e).endsWith("range")?e.dateValue=o&&t?[o,t]:null:e.dateValue=n)}))}(),B({getData:()=>({condition:z.value.map((e=>{const{field_key:l,con:n,value:o,compare_field:t,numberValue:i,dateValue:a,unit:u,fieldType:s,compareFieldOptions:c}=e;let d,p,r,m,f=o,v=t;return"CONVERT"===n&&(f=x(t)?t.map((e=>JSON.parse(e))):t,v=""),"QUOTE"!==n&&"QUOTE_NOT"!==n||(f=x(t)?t.join("|#|"):t,d=c.filter((e=>t.includes(e.columnName))),v=""),ee(e)&&(f=i,v=G),ne(e)&&(oe(e).endsWith("range")?(f="",r=x(a)?a[0]:"",m=x(a)?a[1]:""):f=a),le(e)&&(p=u),$(e)&&e.compareFieldOptions.length>0&&(v=G),{field_key:l,fieldType:s,con:n,value:f,compare_field:v,is_compare_field:!!v,start_val:r,end_val:m,wordbookValueList:d,unit:p}})),sqlExpression:o(W)})}),(e,l)=>(t(),i("div",{class:"c-field-set__condition",style:a(o(J))},[u("span",{class:"opt-btn",onClick:te},[s(o(v),{component:o(N),size:"20",color:"var(--c-primary-color)"},null,8,["component"]),D]),u("section",F,[(t(!0),i(c,null,d(z.value,((e,l)=>(t(),i("div",{class:"condition-wrapper__item",key:l},[u("span",j,p(l+1),1),r(" 选择 field_key "),s(o(_),{value:e.field_key,"onUpdate:value":[l=>e.field_key=l,l=>X(e)],placeholder:"请选择字段名","label-field":"title","value-field":"columnName",clearable:"",options:o(P)},null,8,["value","onUpdate:value","options"]),r(" 选择 关系 "),s(o(_),{value:e.con,"onUpdate:value":[l=>e.con=l,l=>K(e)],"label-field":"text","value-field":"name",options:e.conOptions},null,8,["value","onUpdate:value","options"]),r(" 下拉框展示本列表相同数据类型 "),m(s(o(_),{value:e.compare_field,"onUpdate:value":l=>e.compare_field=l,"label-field":"title","value-field":"columnName",clearable:"",multiple:e.multiple,options:e.compareFieldOptions},null,8,["value","onUpdate:value","multiple","options"]),[[f,e.compareFieldOptions.length>0]]),r(" 布尔值类型字段选择是否相等的值 "),m(s(o(_),{value:e.value,"onUpdate:value":l=>e.value=l,options:o(I)},null,8,["value","onUpdate:value","options"]),[[f,Z(e)]]),r(" 自定义内容 "),m(s(o(T),{value:e.value,"onUpdate:value":l=>e.value=l},null,8,["value","onUpdate:value"]),[[f,$(e)]]),r(" 自定义内容/数字框/日期 "),m(s(o(E),{value:e.numberValue,"onUpdate:value":l=>e.numberValue=l},null,8,["value","onUpdate:value"]),[[f,ee(e)]]),r(" 自定义日期的单位 "),m(s(o(_),{style:{width:"80px"},value:e.unit,"onUpdate:value":l=>e.unit=l,options:o(k)},null,8,["value","onUpdate:value","options"]),[[f,le(e)]]),m(s(o(S),{type:oe(e),"formatted-value":e.dateValue,"onUpdate:formatted-value":l=>e.dateValue=l},null,8,["type","formatted-value","onUpdate:formatted-value"]),[[f,ne(e)]]),s(o(v),{component:o(O),size:"20",color:"red",onClick:()=>function(e){z.value.splice(e,1)}(l)},null,8,["component","onClick"])])))),128))]),m(u("section",w,[R,H,C,s(o(T),{type:"textarea",value:W.value,"onUpdate:value":l[0]||(l[0]=e=>W.value=e)},null,8,["value"])],512),[[f,z.value.length>1]])],4))}});export{B as default};
1
+ import{defineComponent as e,inject as l,ref as n,unref as o,openBlock as t,createElementBlock as i,normalizeStyle as a,createElementVNode as u,createVNode as s,Fragment as c,renderList as d,toDisplayString as p,createCommentVNode as r,withDirectives as m,vShow as f}from"vue";import{NIcon as v,NSelect as _,NInput as T,NInputNumber as E}from"naive-ui";import{AddCircleSharp as N,RemoveCircle as O}from"@vicons/ionicons5";import{CUSTOM_INPUT_OPTIONS as U,InjectionFieldList as y,InjectionQueryWordbookData as h,BOOLEAN_OPTIONS as I,UNIT_OPTIONS as k,FIELD_TYPE_LIST as b,SHOWSETTING_OPTIONS as g,WORDBOOK_OPTIONS as Q}from"../constants/index.js";import S from"../../../date-picker/index.js";import{useTheme as L}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as V,isArray as x,isFunction as A}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";const D=u("span",{style:{"margin-left":"5px"}},"添加操作",-1),F={class:"condition-wrapper"},j={class:"item-index"},w={class:"sql-expression-wrapper"},R=u("span",null,"筛选器逻辑编辑,不设置默认为AND",-1),H=u("br",null,null,-1),C=u("span",null,"例子 (1 AND 2) OR 3",-1);var B=e({__name:"condition",props:{data:{type:Object,default:null}},setup(e,{expose:B}){const M=e,G=U[0].columnName,J=L(),P=V(l(y)),q=l(h),z=n([]),W=n("");function X(e,l=!1){var n,o;l||(e.compareFieldOptions=[],e.con="",Y(e));const{field_key:t}=e,i=P.find((e=>e.columnName===t));if(!i)return void(e.conOptions=[]);const{fieldType:a,settingObj:u={}}=i;e.fieldType=a;const s=V((null==(n=b.find((e=>e.name===a)))?void 0:n.conList)||[]),{showSetting:c,wordbook:d}=u;(null==c?void 0:c.length)&&s.unshift(...g),(null==(o=Object.keys(d||{}))?void 0:o.length)&&s.unshift(...Q),e.conOptions=s}async function K(e,l=!1){e.compareFieldOptions=[],l||Y(e);const{field_key:n,fieldType:o,con:t}=e,i=P.find((e=>e.columnName===n));if(!i)return void(e.conOptions=[]);const{settingObj:a={}}=i||{},{showSetting:u,wordbook:s}=a,c=[];if(["IN","NEQ","BIG","LESS","BIGEQ","LESSEQ","EQ"].includes(t)){c.push(...U),l||(e.compare_field=G);const t=P.filter((e=>e.fieldType===o&&e.columnName!==n));c.push(...t)}if(Q.map((e=>e.name)).includes(t)&&A(q)){const l=await q(s);c.push(...(d=l,p="label",r="value",d.map((e=>({...e,title:e[p],columnName:e[r]}))))),e.multiple=!0}var d,p,r;if(g.map((e=>e.name)).includes(t)&&(null==u?void 0:u.length)){const l=u.map((e=>({...e,title:e.change_text,columnName:JSON.stringify(e.filter||[])})));c.push(...l),e.multiple=!0}e.compareFieldOptions=c}function Y(e){e.multiple=!1,e.compare_field=null,e.value="",e.numberValue=null,e.dateValue=null,e.unit=null}function Z(e){const{con:l,fieldType:n}=e;return"BOOLEAN"===n&&l&&["EQ","NEQ"].includes(l)}function $(e){const{compare_field:l,con:n,fieldType:o}=e;return!(!n||["CONVERT","QUOTE","QUOTE_NOT"].includes(n))&&(!(!["TEXT","JSONB"].includes(o)||["NULL","NOT_NULL"].includes(n))&&(!["EQ","NEQ"].includes(n)||l===G))}function ee(e){if($(e))return!1;const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!(!n||["CONVERT","QUOTE","QUOTE_NOT"].includes(n))&&("NUMBER"===t?!["NULL","NOT_NULL"].includes(n)&&l===G:!!["DATE","DATETIME","TIME"].includes(t)&&["L_","N_","IN_THE_PAST","IN_THE_FUTURE","IN_THE_PAST_DI","IN_THE_FUTURE_DI"].includes(n))}function le(e){const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!!n&&(!!["DATE","DATETIME","TIME"].includes(t)&&["L_","N_","IN_THE_PAST","IN_THE_FUTURE","IN_THE_PAST_DI","IN_THE_FUTURE_DI"].includes(n))}function ne(e){const{compare_field:l,con:n,field_key:o,fieldType:t}=e;return!!n&&(!!["DATE","DATETIME","TIME"].includes(t)&&(["IN","NEQ","BIG","LESS","BIGEQ","LESSEQ"].includes(n)&&l===G))}function oe(e){return["IN","NEQ"].includes(e.con)?"datetimerange":"datetime"}function te(){const e={field_key:P[0].columnName,fieldType:"",con:"",conOptions:[],compare_field:"",compareFieldOptions:[],unit:"",numberValue:null,dateValue:null,multiple:!1};X(e),e.con="",z.value.push(e)}return function(){const{condition:e=[],sqlExpression:l=""}=M.data||{};e.length&&(z.value=e);l&&(W.value=l);z.value.forEach((e=>{X(e,!0),K(e,!0);const{con:l,value:n,start_val:o,end_val:t}=e;"CONVERT"===l&&(e.compare_field=x(n)?n.map((e=>JSON.stringify(e))):n),"QUOTE"!==l&&"QUOTE_NOT"!==l||(e.compare_field=n.split("|#|")),ee(e)&&(e.numberValue=+n),ne(e)&&(oe(e).endsWith("range")?e.dateValue=o&&t?[o,t]:null:e.dateValue=n)}))}(),B({getData:()=>({condition:z.value.map((e=>{const{field_key:l,con:n,value:o,compare_field:t,numberValue:i,dateValue:a,unit:u,fieldType:s,compareFieldOptions:c}=e;let d,p,r,m,f=o,v=t;return"CONVERT"===n&&(f=x(t)?t.map((e=>JSON.parse(e))):t,v=""),"QUOTE"!==n&&"QUOTE_NOT"!==n||(f=x(t)?t.join("|#|"):t,d=c.filter((e=>t.includes(e.columnName))),v=""),ee(e)&&(f=i,v=G),ne(e)&&(oe(e).endsWith("range")?(f="",r=x(a)?a[0]:"",m=x(a)?a[1]:""):f=a),le(e)&&(p=u),$(e)&&e.compareFieldOptions.length>0&&(v=G),{field_key:l,fieldType:s,con:n,value:f,compare_field:v,is_compare_field:!!v,start_val:r,end_val:m,wordbookValueList:d,unit:p}})),sqlExpression:o(W)})}),(e,l)=>(t(),i("div",{class:"c-field-set__condition",style:a(o(J))},[u("span",{class:"opt-btn",onClick:te},[s(o(v),{component:o(N),size:"20",color:"var(--c-primary-color)"},null,8,["component"]),D]),u("section",F,[(t(!0),i(c,null,d(z.value,((e,l)=>(t(),i("div",{class:"condition-wrapper__item",key:l},[u("span",j,p(l+1),1),r(" 选择 field_key "),s(o(_),{value:e.field_key,"onUpdate:value":[l=>e.field_key=l,l=>X(e)],placeholder:"请选择字段名","label-field":"title","value-field":"columnName",clearable:"",options:o(P)},null,8,["value","onUpdate:value","options"]),r(" 选择 关系 "),s(o(_),{value:e.con,"onUpdate:value":[l=>e.con=l,l=>K(e)],"label-field":"text","value-field":"name",options:e.conOptions},null,8,["value","onUpdate:value","options"]),r(" 下拉框展示本列表相同数据类型 "),m(s(o(_),{value:e.compare_field,"onUpdate:value":l=>e.compare_field=l,"label-field":"title","value-field":"columnName",clearable:"",multiple:e.multiple,options:e.compareFieldOptions},null,8,["value","onUpdate:value","multiple","options"]),[[f,e.compareFieldOptions.length>0]]),r(" 布尔值类型字段选择是否相等的值 "),m(s(o(_),{value:e.value,"onUpdate:value":l=>e.value=l,options:o(I)},null,8,["value","onUpdate:value","options"]),[[f,Z(e)]]),r(" 自定义内容 "),m(s(o(T),{value:e.value,"onUpdate:value":l=>e.value=l},null,8,["value","onUpdate:value"]),[[f,$(e)]]),r(" 自定义内容/数字框/日期 "),m(s(o(E),{value:e.numberValue,"onUpdate:value":l=>e.numberValue=l},null,8,["value","onUpdate:value"]),[[f,ee(e)]]),r(" 自定义日期的单位 "),m(s(o(_),{style:{width:"80px"},value:e.unit,"onUpdate:value":l=>e.unit=l,options:o(k)},null,8,["value","onUpdate:value","options"]),[[f,le(e)]]),m(s(o(S),{type:oe(e),"formatted-value":e.dateValue,"onUpdate:formatted-value":l=>e.dateValue=l},null,8,["type","formatted-value","onUpdate:formatted-value"]),[[f,ne(e)]]),s(o(v),{component:o(O),size:"20",color:"red",onClick:()=>function(e){z.value.splice(e,1)}(l)},null,8,["component","onClick"])])))),128))]),m(u("section",w,[R,H,C,s(o(T),{type:"textarea",value:W.value,"onUpdate:value":l[0]||(l[0]=e=>W.value=e)},null,8,["value"])],512),[[f,z.value.length>1]])],4))}});export{B as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,ref as o,computed as a,reactive as t,openBlock as i,createBlock as r,unref as s,withCtx as n,createVNode as u,normalizeStyle as c,createElementVNode as d,createCommentVNode as m}from"vue";import{useMessage as p,NModal as f,NForm as v,NFormItem as b,NInput as h,NColorPicker as g,NSelect as k,NCheckbox as _,NRadioGroup as w,NSpace as y,NRadio as C}from"naive-ui";import{useTheme as j}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import x from"./condition.vue.js";import F from"./edit-filter.vue.js";import{COLOR_MAP as N,InjectionFieldList as U}from"../constants/index.js";var O=e({__name:"edit-dialog",props:{visible:{type:Boolean,default:!1},isFieldColor:{type:Boolean,default:!0},row:{type:Object,default:null}},emits:["update:visible","confirm"],setup(e,{emit:O}){const q=e,S=j(),B=p(),E=Object.entries(N).map((([e,l])=>({label:l,value:e}))),R=Object.entries(N).map((([e])=>e)),D=l(U),H=o(),P=o(),T=o(!1),W=a((()=>q.row?q.isFieldColor?"修改":"过滤条件":"新增")),z=t({name:"",color:"",status:!0,columnName:"",colorScope:q.isFieldColor?"font":"background",condition:[],sqlExpression:""}),A=t({name:[{required:!0,message:"请输入名称",trigger:["blur"]}],color:[{required:!0,message:"请选择颜色",trigger:["blur"]}],columnName:[{required:!0,validator:(e,l)=>!(!l&&q.isFieldColor)||new Error("请选择字段"),trigger:["blur"]}]});function G(e){return u("span",{style:{"--color":e.value},class:"c-field-set__color-block"},[e.label])}function I(){var e;console.log(z),null==(e=H.value)||e.validate((async e=>{var l,o;if(e){const l=await e;B.warning(l[0][0].message)}else{if(q.isFieldColor||Object.assign(z,P.value.getData()),!(null==(l=z.condition)?void 0:l.length))return void B.warning("请配置过滤条件");const e=q.isFieldColor?{title:null==(o=D.find((e=>e.columnName===z.columnName)))?void 0:o.title}:{};O("confirm",{...z,...e}),J()}}))}function J(){O("update:visible",!1)}function K(e){Object.assign(z,e)}return function(){if(!q.row)return;Object.assign(z,q.row)}(),(l,o)=>(i(),r(s(f),{preset:"dialog",style:{width:"860px"},title:s(W),"close-on-esc":!1,"show-icon":!1,"mask-closable":!1,"positive-text":"确定","negative-text":"取消","trap-focus":!1,show:e.visible,onPositiveClick:I,onNegativeClick:J,onClose:J},{default:n((()=>[u(s(v),{ref_key:"formRef",ref:H,model:z,rules:A,"label-placement":"left","label-width":"auto","show-feedback":!1,"show-require-mark":!1,style:c({maxWidth:"500px",...s(S)})},{default:n((()=>[u(s(b),{label:"名称:",path:"name",style:{"margin-bottom":"10px"}},{default:n((()=>[u(s(h),{value:z.name,"onUpdate:value":o[0]||(o[0]=e=>z.name=e),placeholder:"请填写名称",clearable:""},null,8,["value"])])),_:1}),e.isFieldColor?(i(),r(s(b),{key:0,label:"颜色:",path:"color"},{default:n((()=>[u(s(g),{clearable:"",placeholder:"请选择颜色",value:z.color,"onUpdate:value":o[1]||(o[1]=e=>z.color=e),swatches:s(R),modes:["hex"],class:"c-field-set__color-picker"},null,8,["value","swatches"])])),_:1})):(i(),r(s(b),{key:1,label:"颜色:",path:"color"},{default:n((()=>[u(s(k),{value:z.color,"onUpdate:value":o[2]||(o[2]=e=>z.color=e),placeholder:"请选择颜色","render-label":G,options:s(E)},null,8,["value","options"])])),_:1})),u(s(b),{label:"显示:",path:"status"},{default:n((()=>[u(s(_),{checked:z.status,"onUpdate:checked":o[3]||(o[3]=e=>z.status=e)},null,8,["checked"])])),_:1}),u(s(b),{label:"颜色应用于:",path:"colorScope"},{default:n((()=>[u(s(w),{value:z.colorScope,"onUpdate:value":o[4]||(o[4]=e=>z.colorScope=e)},{default:n((()=>[u(s(y),null,{default:n((()=>[u(s(C),{label:"字体",value:"font"}),u(s(C),{label:"背景",value:"background"})])),_:1})])),_:1},8,["value"])])),_:1}),e.isFieldColor?(i(),r(s(b),{key:2,label:"字段:",path:"columnName",style:{"margin-bottom":"10px"}},{default:n((()=>[u(s(y),{class:"c-field-set__space",align:"center"},{default:n((()=>[u(s(k),{value:z.columnName,"onUpdate:value":o[5]||(o[5]=e=>z.columnName=e),placeholder:"请选择字段名","label-field":"title","value-field":"columnName",options:s(D)},null,8,["value","options"]),d("span",{class:"filter-btn",onClick:o[6]||(o[6]=()=>T.value=!0)},"筛选")])),_:1})])),_:1})):m("v-if",!0)])),_:1},8,["model","rules","style"]),e.isFieldColor?(i(),r(F,{key:1,visible:T.value,"onUpdate:visible":o[7]||(o[7]=e=>T.value=e),model:z,onConfirm:K},null,8,["visible","model"])):(i(),r(x,{key:0,ref_key:"conditionRef",ref:P,data:z},null,8,["data"]))])),_:1},8,["title","show"]))}});export{O as default};
1
+ import{defineComponent as e,inject as l,ref as o,computed as a,reactive as t,openBlock as i,createBlock as s,unref as r,withCtx as n,createVNode as u,normalizeStyle as c,createElementVNode as d,createCommentVNode as m}from"vue";import{useMessage as p,NModal as f,NForm as v,NFormItem as b,NInput as h,NColorPicker as g,NSelect as k,NCheckbox as _,NRadioGroup as w,NSpace as y,NRadio as C}from"naive-ui";import{useTheme as j}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import x from"./condition.vue.js";import F from"./edit-filter.vue.js";import{COLOR_MAP as N,InjectionFieldList as U}from"../constants/index.js";var O=e({__name:"edit-dialog",props:{visible:{type:Boolean,default:!1},isFieldColor:{type:Boolean,default:!0},row:{type:Object,default:null}},emits:["update:visible","confirm"],setup(e,{emit:O}){const S=e,q=j(),B=p(),E=Object.entries(N).map((([e,l])=>({label:l,value:e}))),R=Object.entries(N).map((([e])=>e)),D=l(U),H=o(),L=o(),P=o(!1),T=a((()=>S.row?S.isFieldColor?"修改":"过滤条件":"新增")),W=t({name:"",color:"",status:!0,columnName:"",colorScope:S.isFieldColor?"font":"background",condition:[],sqlExpression:""}),z=t({name:[{required:!0,message:"请输入名称",trigger:["blur"]}],color:[{required:!0,message:"请选择颜色",trigger:["blur"]}],columnName:[{required:!0,validator:(e,l)=>!(!l&&S.isFieldColor)||new Error("请选择字段"),trigger:["blur"]}]});function A(e){return u("span",{style:{"--color":e.value},class:"c-field-set__color-block"},[e.label])}function G(){var e;console.log(W),null==(e=H.value)||e.validate((async e=>{var l,o;if(e){const l=await e;B.warning(l[0][0].message)}else{if(S.isFieldColor||Object.assign(W,L.value.getData()),!(null==(l=W.condition)?void 0:l.length))return void B.warning("请配置过滤条件");const e=S.isFieldColor?{title:null==(o=D.find((e=>e.columnName===W.columnName)))?void 0:o.title}:{};O("confirm",{...W,...e}),I()}}))}function I(){O("update:visible",!1)}function J(e){Object.assign(W,e)}return function(){if(!S.row)return;Object.assign(W,S.row)}(),(l,o)=>(i(),s(r(f),{preset:"dialog",style:{width:"860px"},title:r(T),"close-on-esc":!1,"show-icon":!1,"mask-closable":!1,"positive-text":"确定","negative-text":"取消","trap-focus":!1,show:e.visible,onPositiveClick:G,onNegativeClick:I,onClose:I},{default:n((()=>[u(r(v),{ref_key:"formRef",ref:H,model:W,rules:z,"label-placement":"left","label-width":"auto","show-feedback":!1,"show-require-mark":!1,style:c({maxWidth:"500px",...r(q)})},{default:n((()=>[u(r(b),{label:"名称:",path:"name",style:{"margin-bottom":"10px"}},{default:n((()=>[u(r(h),{value:W.name,"onUpdate:value":o[0]||(o[0]=e=>W.name=e),placeholder:"请填写名称",clearable:""},null,8,["value"])])),_:1}),e.isFieldColor?(i(),s(r(b),{key:0,label:"颜色:",path:"color"},{default:n((()=>[u(r(g),{clearable:"",placeholder:"请选择颜色",value:W.color,"onUpdate:value":o[1]||(o[1]=e=>W.color=e),swatches:r(R),modes:["hex"],class:"c-field-set__color-picker"},null,8,["value","swatches"])])),_:1})):(i(),s(r(b),{key:1,label:"颜色:",path:"color"},{default:n((()=>[u(r(k),{value:W.color,"onUpdate:value":o[2]||(o[2]=e=>W.color=e),placeholder:"请选择颜色","render-label":A,options:r(E)},null,8,["value","options"])])),_:1})),u(r(b),{label:"显示:",path:"status"},{default:n((()=>[u(r(_),{checked:W.status,"onUpdate:checked":o[3]||(o[3]=e=>W.status=e)},null,8,["checked"])])),_:1}),u(r(b),{label:"颜色应用于:",path:"colorScope"},{default:n((()=>[u(r(w),{value:W.colorScope,"onUpdate:value":o[4]||(o[4]=e=>W.colorScope=e)},{default:n((()=>[u(r(y),null,{default:n((()=>[u(r(C),{label:"字体",value:"font"}),u(r(C),{label:"背景",value:"background"})])),_:1})])),_:1},8,["value"])])),_:1}),e.isFieldColor?(i(),s(r(b),{key:2,label:"字段:",path:"columnName",style:{"margin-bottom":"10px"}},{default:n((()=>[u(r(y),{class:"c-field-set__space",align:"center"},{default:n((()=>[u(r(k),{value:W.columnName,"onUpdate:value":o[5]||(o[5]=e=>W.columnName=e),placeholder:"请选择字段名","label-field":"title","value-field":"columnName",options:r(D)},null,8,["value","options"]),d("span",{class:"filter-btn",onClick:o[6]||(o[6]=()=>P.value=!0)},"筛选")])),_:1})])),_:1})):m("v-if",!0)])),_:1},8,["model","rules","style"]),e.isFieldColor?(i(),s(F,{key:1,visible:P.value,"onUpdate:visible":o[7]||(o[7]=e=>P.value=e),model:W,onConfirm:J},null,8,["visible","model"])):(i(),s(x,{key:0,ref_key:"conditionRef",ref:L,data:W},null,8,["data"]))])),_:1},8,["title","show"]))}});export{O as default};
@@ -79,6 +79,9 @@ declare const _default: import("vue").DefineComponent<{
79
79
  developMode: {
80
80
  type: BooleanConstructor;
81
81
  };
82
+ columnWidthProps: {
83
+ type: ObjectConstructor;
84
+ };
82
85
  }, {
83
86
  fixedWayOptions: {
84
87
  label: string;
@@ -170,6 +173,9 @@ declare const _default: import("vue").DefineComponent<{
170
173
  developMode: {
171
174
  type: BooleanConstructor;
172
175
  };
176
+ columnWidthProps: {
177
+ type: ObjectConstructor;
178
+ };
173
179
  }>> & {
174
180
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
175
181
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -284,6 +290,9 @@ declare const _default: import("vue").DefineComponent<{
284
290
  developMode: {
285
291
  type: BooleanConstructor;
286
292
  };
293
+ columnWidthProps: {
294
+ type: ObjectConstructor;
295
+ };
287
296
  }>> & {
288
297
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
289
298
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -328,9 +337,9 @@ declare const _default: import("vue").DefineComponent<{
328
337
  }>;
329
338
  developMode: boolean;
330
339
  draggable: boolean;
331
- isHighlightRow: boolean;
332
340
  idx: number;
333
341
  isHighlight: boolean;
342
+ isHighlightRow: boolean;
334
343
  isFieldSet: boolean;
335
344
  fieldDescribeMode: "column" | "tooltip";
336
345
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as o,unref as a,createBlock as r,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as c,toDisplayString as f,normalizeClass as p,withDirectives as m,vShow as v,resolveDynamicComponent as y,createTextVNode as g}from"vue";import{NTooltip as b,NIcon as h,NCheckbox as k,NSelect as x,NColorPicker as E,NInput as S,NInputNumber as D,NPopconfirm as T}from"naive-ui";import{setStyle as w,setColorInfo as C,isShowExplicitRequired as M,isDisable as N}from"../utils/index.js";import{ReorderTwoOutline as O,HelpCircleOutline as U,CreateOutline as j,TrashOutline as _}from"@vicons/ionicons5";import{isFunction as A,isArray as H,range as L}from"lodash-es";import{COLOR_MAP as P}from"../constants/index.js";import{WIDGET_TYPE as R,SELECT_MAP as F,WIDGET_MAP as V,SELECT_TYPE as B,SELECT_DEFAULT_MAP as I,DATE_MAP as q,DATETIME_MAP as W}from"../constants/filter.js";const G={class:"row"},z=["title"],J=c("span",null,"拖拽调整顺序",-1);var K=e({__name:"table-row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean}},emits:["updateChecked","edit"],setup(e,{emit:K}){const Q=e,X=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],Y=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],Z=[{label:"字体",value:"font"},{label:"背景",value:"background"}],$=Object.entries(P).map((([e])=>e));function ee(){Q.data.splice(Q.index,1)}function te(){K("edit",Q.element)}function le(){var e;return Q.element.feildDescribe||(null==(e=Q.element.settingObj)?void 0:e.fieldDescDev)}function ie(e){return"seq"===e?Q.idx:"optionType"===e?Q.element[e]&&Q.element.type===R.SELECT?F[Q.element[e]]:"":"type"===e?V[Q.element[e]]:Q.element[e]}function ne(e){if("defaultValue"===e){const{optionType:e}=Q.element;return e===B.SELECT_MULTIPLE}return!1}function oe(e){if("0001"==Q.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:t}=Q.element;return"isShowHeaderFilter"===e?!!t:!(["explicitRequired","defaultValue"].includes(e)&&![R.DATE,R.DATETIME,R.SELECT].includes(Q.element.type))}function ae(e){return!["explicitRequired","defaultValue"].includes(e)||M(Q.element)}function re(e){switch(e.field){case"fixedWay":return X;case"sortDirection":return Y;case"sortPriority":return function(){const e=L(1,Q.data.length+1).map((e=>({label:e.toString(),value:e}))),t=Q.data.filter((e=>!!e.sortPriority&&e.uuid!==Q.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!t.includes(e.value)))}();case"colorScope":return Z;case"defaultValue":{const{type:e,optionInfo:t}=Q.element;return e===R.SELECT?H(null==t?void 0:t.list)&&t.list.length>0?t.list.map((e=>({...e,label:e.name}))):Object.entries(I).map((([e,t])=>({value:e,label:t}))):e===R.DATE?Object.entries(q).map((([e,t])=>({value:e,label:t}))):e===R.DATETIME?Object.entries(W).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function de(e){var t;if(1==Q.element.defaultMark||"color"===e.type&&Q.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!Q.element[e.field]&&(null==(t=Q.data.filter((t=>t[e.field])))?void 0:t.length)===e.fieldShowMaxValue:N(Q.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:l}=Q.element;return!l||"NONE"===l}function ue(e){return["title","result"].includes(e.field)&&Q.element.style||{}}return(M,N)=>(t(),l("div",G,[(t(!0),l(i,null,n(e.columns,((n,M)=>{return t(),l(i,{key:M},[n.isShow?(t(),l("span",{key:0,class:"table-cell",title:e.element[n.field],style:o(a(w)(n,M))},["text"===n.type?(t(),l(i,{key:0},[0===M?(t(),l(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(t(),r(a(b),{key:0,trigger:"hover"},{trigger:d((()=>[u(a(h),{style:{"margin-right":"5px",top:"2px"},component:a(O)},null,8,["component"])])),default:d((()=>[J])),_:1})):s("v-if",!0),(H=n.field,"title"===H&&("tooltip"===Q.fieldDescribeMode&&Q.element.feildDescribe||Q.developMode&&(null==(L=Q.element.settingObj)?void 0:L.fieldDescDev))?(t(),r(a(b),{key:1,trigger:"hover"},{trigger:d((()=>[u(a(h),{style:{"margin-right":"5px",top:"2px"},component:a(U)},null,8,["component"])])),default:d((()=>[c("span",null,f(le()),1)])),_:1})):s("v-if",!0))],64)):s("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:o(ue(n))},f(ie(n.field)),7)],64)):s("v-if",!0),"checkbox"===n.type&&oe(n.field)?m((t(),r(a(k),{key:1,disabled:de(n),checked:e.element[n.field],"onUpdate:checked":[t=>e.element[n.field]=t,e=>function(e,t){K("updateChecked",{checked:e,column:t})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,ae(n.field)]]):s("v-if",!0),"select"===n.type&&oe(n.field)?m((t(),r(a(x),{key:2,clearable:"",multiple:ne(n.field),disabled:de(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,e=>function(e,t){"sortDirection"===t.field&&"NONE"===e&&(Q.element.sortPriority=null),"colorScope"===t.field&&C(Q.element)}(e,n)],options:re(n)},null,8,["multiple","disabled","value","onUpdate:value","options"])),[[v,ae(n.field)]]):s("v-if",!0),"color"===n.type?(t(),r(a(E),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:de(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,N[0]||(N[0]=t=>a(C)(e.element))],"show-preview":"",modes:["hex"],swatches:a($)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===n.type?m((t(),r(a(S),{key:4,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(t(),r(a(D),{key:5,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===n.type&&a(A)(n.contentRender)?(t(),r(y((()=>n.contentRender(n,e.element))),{key:6})):s("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(h),{component:a(j),onClick:te},null,8,["component"])])),default:d((()=>[g(" 编辑 ")])),_:1}),u(a(T),{onPositiveClick:ee},{trigger:d((()=>[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(h),{component:a(_)},null,8,["component"])])),default:d((()=>[g(" 删除 ")])),_:1})])),default:d((()=>[g(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,z)):s("v-if",!0)],64);var H,L})),128))]))}});export{K as default};
1
+ import{defineComponent as e,openBlock as t,createElementBlock as l,Fragment as i,renderList as n,normalizeStyle as o,unref as a,createBlock as r,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as c,toDisplayString as f,normalizeClass as p,withDirectives as m,vShow as v,resolveDynamicComponent as y,createTextVNode as g}from"vue";import{NTooltip as b,NIcon as h,NCheckbox as k,NSelect as x,NColorPicker as E,NInput as S,NInputNumber as D,NPopconfirm as T}from"naive-ui";import{setStyle as w,setColorInfo as O,isShowExplicitRequired as j,isDisable as C}from"../utils/index.js";import{ReorderTwoOutline as M,HelpCircleOutline as N,CreateOutline as U,TrashOutline as _}from"@vicons/ionicons5";import{isFunction as P,isArray as A,range as H}from"lodash-es";import{COLOR_MAP as L}from"../constants/index.js";import{WIDGET_TYPE as R,SELECT_MAP as F,WIDGET_MAP as V,SELECT_TYPE as B,SELECT_DEFAULT_MAP as I,DATE_MAP as W,DATETIME_MAP as q}from"../constants/filter.js";const G={class:"row"},z=["title"],J=c("span",null,"拖拽调整顺序",-1);var K=e({__name:"table-row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object}},emits:["updateChecked","edit"],setup(e,{emit:K}){const Q=e,X=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],Y=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],Z=[{label:"字体",value:"font"},{label:"背景",value:"background"}],$=Object.entries(L).map((([e])=>e));function ee(){Q.data.splice(Q.index,1)}function te(){K("edit",Q.element)}function le(){var e;return Q.element.feildDescribe||(null==(e=Q.element.settingObj)?void 0:e.fieldDescDev)}function ie(e){return"seq"===e?Q.idx:"optionType"===e?Q.element[e]&&Q.element.type===R.SELECT?F[Q.element[e]]:"":"type"===e?V[Q.element[e]]:Q.element[e]}function ne(e){if("defaultValue"===e){const{optionType:e}=Q.element;return e===B.SELECT_MULTIPLE}return!1}function oe(e){if("0001"==Q.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:t}=Q.element;return"isShowHeaderFilter"===e?!!t:!(["explicitRequired","defaultValue"].includes(e)&&![R.DATE,R.DATETIME,R.SELECT].includes(Q.element.type))}function ae(e){return!["explicitRequired","defaultValue"].includes(e)||j(Q.element)}function re(e){switch(e.field){case"fixedWay":return X;case"sortDirection":return Y;case"sortPriority":return function(){const e=H(1,Q.data.length+1).map((e=>({label:e.toString(),value:e}))),t=Q.data.filter((e=>!!e.sortPriority&&e.uuid!==Q.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!t.includes(e.value)))}();case"colorScope":return Z;case"defaultValue":{const{type:e,optionInfo:t}=Q.element;return e===R.SELECT?A(null==t?void 0:t.list)&&t.list.length>0?t.list.map((e=>({...e,label:e.name}))):Object.entries(I).map((([e,t])=>({value:e,label:t}))):e===R.DATE?Object.entries(W).map((([e,t])=>({value:e,label:t}))):e===R.DATETIME?Object.entries(q).map((([e,t])=>({value:e,label:t}))):[]}default:return[]}}function de(e){var t;if(1==Q.element.defaultMark||"color"===e.type&&Q.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!Q.element[e.field]&&(null==(t=Q.data.filter((t=>t[e.field])))?void 0:t.length)===e.fieldShowMaxValue:C(Q.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:l}=Q.element;return!l||"NONE"===l}function ue(e){return["title","result"].includes(e.field)&&Q.element.style||{}}return(j,C)=>(t(),l("div",G,[(t(!0),l(i,null,n(e.columns,((n,j)=>{return t(),l(i,{key:j},[n.isShow?(t(),l("span",{key:0,class:"table-cell",title:e.element[n.field],style:o(a(w)(n,j,e.columnWidthProps))},["text"===n.type?(t(),l(i,{key:0},[0===j?(t(),l(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(t(),r(a(b),{key:0,trigger:"hover"},{trigger:d((()=>[u(a(h),{style:{"margin-right":"5px",top:"2px"},component:a(M)},null,8,["component"])])),default:d((()=>[J])),_:1})):s("v-if",!0),(A=n.field,"title"===A&&("tooltip"===Q.fieldDescribeMode&&Q.element.feildDescribe||Q.developMode&&(null==(H=Q.element.settingObj)?void 0:H.fieldDescDev))?(t(),r(a(b),{key:1,trigger:"hover"},{trigger:d((()=>[u(a(h),{style:{"margin-right":"5px",top:"2px"},component:a(N)},null,8,["component"])])),default:d((()=>[c("span",null,f(le()),1)])),_:1})):s("v-if",!0))],64)):s("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:o(ue(n))},f(ie(n.field)),7)],64)):s("v-if",!0),"checkbox"===n.type&&oe(n.field)?m((t(),r(a(k),{key:1,disabled:de(n),checked:e.element[n.field],"onUpdate:checked":[t=>e.element[n.field]=t,e=>function(e,t){K("updateChecked",{checked:e,column:t})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,ae(n.field)]]):s("v-if",!0),"select"===n.type&&oe(n.field)?m((t(),r(a(x),{key:2,clearable:"",multiple:ne(n.field),disabled:de(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,e=>function(e,t){"sortDirection"===t.field&&"NONE"===e&&(Q.element.sortPriority=null),"colorScope"===t.field&&O(Q.element)}(e,n)],options:re(n)},null,8,["multiple","disabled","value","onUpdate:value","options"])),[[v,ae(n.field)]]):s("v-if",!0),"color"===n.type?(t(),r(a(E),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:de(n),value:e.element[n.field],"onUpdate:value":[t=>e.element[n.field]=t,C[0]||(C[0]=t=>a(O)(e.element))],"show-preview":"",modes:["hex"],swatches:a($)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===n.type?m((t(),r(a(S),{key:4,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(t(),r(a(D),{key:5,value:e.element[n.field],"onUpdate:value":t=>e.element[n.field]=t},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===n.type&&a(P)(n.contentRender)?(t(),r(y((()=>n.contentRender(n,e.element))),{key:6})):s("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(t(),l(i,{key:7},[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(h),{component:a(U),onClick:te},null,8,["component"])])),default:d((()=>[g(" 编辑 ")])),_:1}),u(a(T),{onPositiveClick:ee},{trigger:d((()=>[u(a(b),{trigger:"hover"},{trigger:d((()=>[u(a(h),{component:a(_)},null,8,["component"])])),default:d((()=>[g(" 删除 ")])),_:1})])),default:d((()=>[g(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,z)):s("v-if",!0)],64);var A,H})),128))]))}});export{K as default};
@@ -2,7 +2,7 @@ import { CSSProperties } from 'vue';
2
2
  import { AnyObject } from '../../../../shared/types';
3
3
  import { FieldSetItem } from '../../../../components/field-set';
4
4
  import { IhoTableConfig } from '../../../../components/iho-table';
5
- export declare function setStyle(column: AnyObject, index: number): CSSProperties;
5
+ export declare function setStyle(column: AnyObject, index: number, widthProps?: AnyObject): CSSProperties;
6
6
  export declare function isDisable(item: FieldSetItem, key: string): any;
7
7
  export declare function getGroupTree(rowGroupSetting: NonNullable<IhoTableConfig['rowGroupSetting']>, fieldList: FieldSetItem[], getKey?: (field: FieldSetItem) => string): Array<AnyObject | string>;
8
8
  export declare function isDraggable(fieldItem: AnyObject): any;
@@ -1 +1 @@
1
- import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as o}from"../../../iho-table/src/constants/index.js";import{COLOR_MAP as n}from"../constants/index.js";import{WIDGET_TYPE as r}from"../constants/filter.js";function i(e,t){const o={flex:"1 1 90px"};switch(e.type){case"text":0===t&&["title","name"].includes(e.field)&&Object.assign(o,{flex:"1 1 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(o.flex="1 1 40px");break;case"checkbox":o.flex="1 1 60px";break;case"select":o.flex="1 1 80px";break;case"input":o.flex="1 1 100px"}return o}function l(e,t){return["editable","required","show"].includes(t)&&(e[`${t}Disable`]||e[`${t}Disabled`])||["sort"].includes(t)&&(1==e.notParticipatingSort||e.sortDisabled)}function s(n,r,i=(e=>e.name)){const l=r.map((e=>i(e)));return o.some((o=>{const r=n[o];if(!e(r))return!0;r.forEach((o=>{if(!e(o.list)||!o.list.length)return;const n=[];let r=null;o.list.forEach(((e,i)=>{const s=function(e,o,n){return o.findIndex((o=>o!==n&&(t(o)?o.fieldName:o)===e))}(e,l,r);~s&&(n.push(l[s]),0===i?l.splice(s,1,r={fieldName:o.title,children:n}):l.splice(s,1))}))}))})),l}function c(e){return void 0===e.draggable||e.draggable}function a(t){return e(t)?!t.some((e=>!e.draggable)):t.draggable}function f(e){e.style="font"===e.colorScope?{color:e.color}:{background:e.color,color:"#fff"},e.result=n[e.color]}function u(e){const{isShowSearch:t,filterExplicit:o,type:n}=e;return t&&o&&[r.DATE,r.DATETIME,r.SELECT].includes(n)}export{s as getGroupTree,l as isDisable,c as isDraggable,a as isDraggableItem,u as isShowExplicitRequired,f as setColorInfo,i as setStyle};
1
+ import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as n}from"../../../iho-table/src/constants/index.js";import{COLOR_MAP as o}from"../constants/index.js";import{WIDGET_TYPE as i}from"../constants/filter.js";function l(e,t,n){const o={flex:"1 1 90px"};switch(e.type){case"text":0===t&&["title","name"].includes(e.field)&&Object.assign(o,{flex:"1 1 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),"seq"===e.field&&(o.flex="1 1 40px");break;case"checkbox":o.flex="1 1 60px";break;case"select":o.flex="1 1 80px";break;case"input":o.flex="1 1 100px"}if(n){const t=Object.keys(n);t.length>0&&t.includes(e.field)&&n[e.field]&&(o.flex=`1 1 ${n[e.field]}px`)}return o}function r(e,t){return["editable","required","show"].includes(t)&&(e[`${t}Disable`]||e[`${t}Disabled`])||["sort"].includes(t)&&(1==e.notParticipatingSort||e.sortDisabled)}function s(o,i,l=(e=>e.name)){const r=i.map((e=>l(e)));return n.some((n=>{const i=o[n];if(!e(i))return!0;i.forEach((n=>{if(!e(n.list)||!n.list.length)return;const o=[];let i=null;n.list.forEach(((e,l)=>{const s=function(e,n,o){return n.findIndex((n=>n!==o&&(t(n)?n.fieldName:n)===e))}(e,r,i);~s&&(o.push(r[s]),0===l?r.splice(s,1,i={fieldName:n.title,children:o}):r.splice(s,1))}))}))})),r}function c(e){return void 0===e.draggable||e.draggable}function f(t){return e(t)?!t.some((e=>!e.draggable)):t.draggable}function a(e){e.style="font"===e.colorScope?{color:e.color}:{background:e.color,color:"#fff"},e.result=o[e.color]}function d(e){const{isShowSearch:t,filterExplicit:n,type:o}=e;return t&&n&&[i.DATE,i.DATETIME,i.SELECT].includes(o)}export{s as getGroupTree,r as isDisable,c as isDraggable,f as isDraggableItem,d as isShowExplicitRequired,a as setColorInfo,l as setStyle};
@@ -408,7 +408,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
408
408
  formRenderRef: import("vue").Ref<import("..").FormRenderExpose | undefined>;
409
409
  key: import("vue").Ref<number>;
410
410
  reload: () => Promise<void>;
411
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
411
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited", "updateAnchor"];
412
412
  exposed: Partial<import("..").FormRenderExpose>;
413
413
  FormRender: import("vue").DefineComponent<{
414
414
  fieldList: {
@@ -841,6 +841,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
841
841
  index: number;
842
842
  }[]>;
843
843
  onScroll: (scrollEvent: Event) => void;
844
+ generateAnchorList: (formModel: import("@formily/core").Form<any>) => Promise<void>;
844
845
  callLifeCycle: <T_2 extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T_2, payload?: Parameters<Required<Partial<{
845
846
  onSetup(): void;
846
847
  beforeSetValue(fieldKey: string, value: unknown, payload: {
@@ -1155,7 +1156,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1155
1156
  startIncrementalRender: () => void;
1156
1157
  onKeydown: (event: KeyboardEvent) => Promise<void>;
1157
1158
  clearSpan: (uuid: string) => void;
1158
- exposeEvent: Omit<import("..").FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
1159
+ exposeEvent: Omit<import("..").FormRenderExpose, "updateAnchor" | "getFieldList" | "optionInited" | "formModel" | "reload">;
1159
1160
  useVersion: typeof import("../../shared/hooks").useVersion;
1160
1161
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1161
1162
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
@@ -2442,7 +2443,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2442
2443
  formRenderRef: import("vue").Ref<import("..").FormRenderExpose | undefined>;
2443
2444
  key: import("vue").Ref<number>;
2444
2445
  reload: () => Promise<void>;
2445
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
2446
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited", "updateAnchor"];
2446
2447
  exposed: Partial<import("..").FormRenderExpose>;
2447
2448
  FormRender: import("vue").DefineComponent<{
2448
2449
  fieldList: {
@@ -2875,6 +2876,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2875
2876
  index: number;
2876
2877
  }[]>;
2877
2878
  onScroll: (scrollEvent: Event) => void;
2879
+ generateAnchorList: (formModel: import("@formily/core").Form<any>) => Promise<void>;
2878
2880
  callLifeCycle: <T_2 extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T_2, payload?: Parameters<Required<Partial<{
2879
2881
  onSetup(): void;
2880
2882
  beforeSetValue(fieldKey: string, value: unknown, payload: {
@@ -3189,7 +3191,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3189
3191
  startIncrementalRender: () => void;
3190
3192
  onKeydown: (event: KeyboardEvent) => Promise<void>;
3191
3193
  clearSpan: (uuid: string) => void;
3192
- exposeEvent: Omit<import("..").FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
3194
+ exposeEvent: Omit<import("..").FormRenderExpose, "updateAnchor" | "getFieldList" | "optionInited" | "formModel" | "reload">;
3193
3195
  useVersion: typeof import("../../shared/hooks").useVersion;
3194
3196
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3195
3197
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
@@ -411,7 +411,7 @@ declare const _default: import("vue").DefineComponent<{
411
411
  formRenderRef: Ref<FormRenderExpose | undefined>;
412
412
  key: Ref<number>;
413
413
  reload: () => Promise<void>;
414
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
414
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited", "updateAnchor"];
415
415
  exposed: Partial<FormRenderExpose>;
416
416
  FormRender: import("vue").DefineComponent<{
417
417
  fieldList: {
@@ -844,6 +844,7 @@ declare const _default: import("vue").DefineComponent<{
844
844
  index: number;
845
845
  }[]>;
846
846
  onScroll: (scrollEvent: Event) => void;
847
+ generateAnchorList: (formModel: import("@formily/core").Form<any>) => Promise<void>;
847
848
  callLifeCycle: <T_2 extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T_2, payload?: Parameters<Required<Partial<{
848
849
  onSetup(): void;
849
850
  beforeSetValue(fieldKey: string, value: unknown, payload: {
@@ -1158,7 +1159,7 @@ declare const _default: import("vue").DefineComponent<{
1158
1159
  startIncrementalRender: () => void;
1159
1160
  onKeydown: (event: KeyboardEvent) => Promise<void>;
1160
1161
  clearSpan: (uuid: string) => void;
1161
- exposeEvent: Omit<FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
1162
+ exposeEvent: Omit<FormRenderExpose, "updateAnchor" | "getFieldList" | "optionInited" | "formModel" | "reload">;
1162
1163
  useVersion: typeof useVersion;
1163
1164
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1164
1165
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
@@ -2445,7 +2446,7 @@ declare const _default: import("vue").DefineComponent<{
2445
2446
  formRenderRef: Ref<FormRenderExpose | undefined>;
2446
2447
  key: Ref<number>;
2447
2448
  reload: () => Promise<void>;
2448
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
2449
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited", "updateAnchor"];
2449
2450
  exposed: Partial<FormRenderExpose>;
2450
2451
  FormRender: import("vue").DefineComponent<{
2451
2452
  fieldList: {
@@ -2878,6 +2879,7 @@ declare const _default: import("vue").DefineComponent<{
2878
2879
  index: number;
2879
2880
  }[]>;
2880
2881
  onScroll: (scrollEvent: Event) => void;
2882
+ generateAnchorList: (formModel: import("@formily/core").Form<any>) => Promise<void>;
2881
2883
  callLifeCycle: <T_2 extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T_2, payload?: Parameters<Required<Partial<{
2882
2884
  onSetup(): void;
2883
2885
  beforeSetValue(fieldKey: string, value: unknown, payload: {
@@ -3192,7 +3194,7 @@ declare const _default: import("vue").DefineComponent<{
3192
3194
  startIncrementalRender: () => void;
3193
3195
  onKeydown: (event: KeyboardEvent) => Promise<void>;
3194
3196
  clearSpan: (uuid: string) => void;
3195
- exposeEvent: Omit<FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
3197
+ exposeEvent: Omit<FormRenderExpose, "updateAnchor" | "getFieldList" | "optionInited" | "formModel" | "reload">;
3196
3198
  useVersion: typeof useVersion;
3197
3199
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3198
3200
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {
@@ -1 +1 @@
1
- import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,createVNode as u,isRef as f,withCtx as d,createBlock as c,createCommentVNode as p,createTextVNode as v}from"vue";import{useTheme as g}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as h,cloneDeep as _,isFunction as y}from"lodash-es";import"@vue/shared";import{uuidGenerator as x,traverse as j}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as C,NSpace as k}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import L from"../../../shared/components/VueDraggable/src/vuedraggable.js";import V from"./components/FormConfigCreator.vue.js";import b from"./components/FormConfigDragDisplay.vue.js";import w from"./components/FormConfigEdit.vue.js";import M from"./components/FormConfigEventSetting.vue.js";import R from"./components/FormConfigMaterialItem.js";import{useDataNormalize as D}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as E,InjectionFormConfigEmit as H,InjectionFieldList as S,InjectionMaterialList as I,InjectionLowCodeReactions as U,InjectionActiveFieldItem as O,FORM_CONFIG_GROUP as P}from"./constants/index.js";import{fieldItemNormalize as T}from"./utils/index.js";import{useSortableConfig as z}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const A=["id"],B={class:"form-config__material"},N=m("header",{class:"form-config__materialHeader"},"物料区",-1),W={class:"form-config__displayWrapper"},q={class:"form-config__displayHeader"},G={class:"form-config__config"},J=m("header",{class:"form-config__configHeader"},"配置区",-1),K={class:"form-config__configContent"};var Q=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},showLowCodeReactions:Boolean,formProps:{type:Object},beforeMove:{type:Function}},emits:["addItem","removeItem","reactionsValidateFailure"],setup(e,{expose:Q,emit:X}){const Y=e;o(E,Y),o(H,X);const Z=x(),$=g(),ee=t([]);o(S,ee);const oe=t([]);o(I,oe);const te=t([]);function re(e){ee.value.some((o=>o.key===e.key))||ee.value.push(e)}o(U,te);const ae=(e,o)=>y(Y.textFormatter)?Y.textFormatter(e,o):o,ie=t();o(O,ie);const se=t(),{transform:le,inverseTransform:ne}=D(Y),me=r({get:()=>null,set(e){if(!e)return;const o=fe.value.find((o=>o.key===e));o&&(o.__extra=!0,T(o),oe.value.push(o),X("addItem",o))}}),ue=t([]),fe=r((()=>{if(!h(ue.value))return[];const e=[];return j([...oe.value,...ee.value],(o=>e.push(o.key))),ue.value.filter((o=>!e.find((e=>e===o.key))))}));async function de(){Y.extraMaterialList&&!ue.value.length&&(ue.value=y(Y.extraMaterialList)?await Y.extraMaterialList():Y.extraMaterialList)}return Q({loadData({fieldList:e,lowCodeReactions:o=[]}){let t=[],r=[];e.forEach((e=>{return!1===(o=_(a(e))).show?r.push(o):t.push(o),void T(o);var o})),ee.value=le(t),oe.value=r,te.value=o,ie.value=void 0},validate(){var e;return null==(e=se.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:ne(_(a(ee.value)),e,{show:!0}),materialList:ne(_(a(oe.value)),e,{show:!1}),lowCodeReactions:_(a(te.value))}),clearExtraList(){ue.value=[]}}),(o,t)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n($)},id:n(Z)},n(F)()),[m("section",B,[N,u(n(L),l(z({fieldList:ee,materialList:oe,hooks:{beforeMove:Y.beforeMove}}),{class:"form-config__materialContent",modelValue:n(oe),"onUpdate:modelValue":t[0]||(t[0]=e=>f(oe)?oe.value=e:null)}),{item:d((({element:e})=>[u(n(R),{"form-config-item":e,"text-formatter":ae,"material-List":n(oe)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),c(n(C),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(me),"onUpdate:value":t[1]||(t[1]=e=>f(me)?me.value=e:null),placeholder:"请选择额外物料",options:n(fe),"label-field":"name","value-field":"key",onFocus:de},null,8,["value","options"])):p("v-if",!0)]),m("section",W,[m("header",q,[v(" 布局区 "),u(n(k),null,{default:d((()=>[e.showLowCodeReactions?(i(),c(M,{key:0,modelValue:te.value,"onUpdate:modelValue":t[2]||(t[2]=e=>te.value=e),onValidateFailure:t[3]||(t[3]=e=>X("reactionsValidateFailure",e))},null,8,["modelValue"])):p("v-if",!0),u(V,{onSubmit:re})])),_:1})]),u(b,{class:"form-config__displayContent",group:n(P),"text-formatter":ae,modelValue:n(ee),"onUpdate:modelValue":t[4]||(t[4]=e=>f(ee)?ee.value=e:null)},null,8,["group","modelValue"])]),m("section",G,[J,m("section",K,[u(w,{ref_key:"formConfigEditRef",ref:se,uuid:n(Z),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,A))}});export{Q as default};
1
+ import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,createVNode as u,isRef as f,withCtx as d,createBlock as c,createCommentVNode as p,createTextVNode as v}from"vue";import{useTheme as g}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as h,cloneDeep as _,isFunction as y}from"lodash-es";import"@vue/shared";import{uuidGenerator as x,traverse as j}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as k,NSpace as C}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import F from"../../../shared/components/VueDraggable/src/vuedraggable.js";import V from"./components/FormConfigCreator.vue.js";import b from"./components/FormConfigDragDisplay.vue.js";import w from"./components/FormConfigEdit.vue.js";import M from"./components/FormConfigEventSetting.vue.js";import R from"./components/FormConfigMaterialItem.js";import{useDataNormalize as D}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as E,InjectionFormConfigEmit as H,InjectionFieldList as S,InjectionMaterialList as I,InjectionLowCodeReactions as U,InjectionActiveFieldItem as O,FORM_CONFIG_GROUP as P}from"./constants/index.js";import{fieldItemNormalize as T}from"./utils/index.js";import{useSortableConfig as z}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const A=["id"],B={class:"form-config__material"},N=m("header",{class:"form-config__materialHeader"},"物料区",-1),W={class:"form-config__displayWrapper"},q={class:"form-config__displayHeader"},G={class:"form-config__config"},J=m("header",{class:"form-config__configHeader"},"配置区",-1),K={class:"form-config__configContent"};var Q=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},showLowCodeReactions:Boolean,formProps:{type:Object},beforeMove:{type:Function}},emits:["addItem","removeItem","reactionsValidateFailure"],setup(e,{expose:Q,emit:X}){const Y=e;o(E,Y),o(H,X);const Z=x(),$=g(),ee=t([]);o(S,ee);const oe=t([]);o(I,oe);const te=t([]);function re(e){ee.value.some((o=>o.key===e.key))||ee.value.push(e)}o(U,te);const ae=(e,o)=>y(Y.textFormatter)?Y.textFormatter(e,o):o,ie=t();o(O,ie);const se=t(),{transform:le,inverseTransform:ne}=D(Y),me=r({get:()=>null,set(e){if(!e)return;const o=fe.value.find((o=>o.key===e));o&&(o.__extra=!0,T(o),oe.value.push(o),X("addItem",o))}}),ue=t([]),fe=r((()=>{if(!h(ue.value))return[];const e=[];return j([...oe.value,...ee.value],(o=>e.push(o.key))),ue.value.filter((o=>!e.find((e=>e===o.key))))}));async function de(){Y.extraMaterialList&&!ue.value.length&&(ue.value=y(Y.extraMaterialList)?await Y.extraMaterialList():Y.extraMaterialList)}return Q({loadData({fieldList:e,lowCodeReactions:o=[]}){let t=[],r=[];e.forEach((e=>{return!1===(o=_(a(e))).show?r.push(o):t.push(o),void T(o);var o})),ee.value=le(t),oe.value=r,te.value=o,ie.value=void 0},validate(){var e;return null==(e=se.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:ne(_(a(ee.value)),e,{show:!0}),materialList:ne(_(a(oe.value)),e,{show:!1}),lowCodeReactions:_(a(te.value))}),clearExtraList(){ue.value=[]}}),(o,t)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n($)},id:n(Z)},n(L)()),[m("section",B,[N,u(n(F),l(z({fieldList:ee,materialList:oe,hooks:{beforeMove:Y.beforeMove}}),{class:"form-config__materialContent",modelValue:n(oe),"onUpdate:modelValue":t[0]||(t[0]=e=>f(oe)?oe.value=e:null)}),{item:d((({element:e})=>[u(n(R),{"form-config-item":e,"text-formatter":ae,"material-List":n(oe)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),c(n(k),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(me),"onUpdate:value":t[1]||(t[1]=e=>f(me)?me.value=e:null),placeholder:"请选择额外物料",options:n(fe),"label-field":"name","value-field":"key",onFocus:de},null,8,["value","options"])):p("v-if",!0)]),m("section",W,[m("header",q,[v(" 布局区 "),u(n(C),null,{default:d((()=>[e.showLowCodeReactions?(i(),c(M,{key:0,modelValue:te.value,"onUpdate:modelValue":t[2]||(t[2]=e=>te.value=e),onValidateFailure:t[3]||(t[3]=e=>X("reactionsValidateFailure",e))},null,8,["modelValue"])):p("v-if",!0),u(V,{onSubmit:re})])),_:1})]),u(b,{class:"form-config__displayContent",group:n(P),"text-formatter":ae,modelValue:n(ee),"onUpdate:modelValue":t[4]||(t[4]=e=>f(ee)?ee.value=e:null)},null,8,["group","modelValue"])]),m("section",G,[J,m("section",K,[u(w,{ref_key:"formConfigEditRef",ref:se,uuid:n(Z),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,A))}});export{Q as default};
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{}, {
18
18
  formRenderRef: import("vue").Ref<FormRenderExpose | undefined>;
19
19
  key: import("vue").Ref<number>;
20
20
  reload: () => Promise<void>;
21
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited"];
21
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting", "getTextFormValues", "optionInited", "updateAnchor"];
22
22
  exposed: Partial<FormRenderExpose>;
23
23
  FormRender: import("vue").DefineComponent<{
24
24
  fieldList: {
@@ -451,6 +451,7 @@ declare const _default: import("vue").DefineComponent<{}, {
451
451
  index: number;
452
452
  }[]>;
453
453
  onScroll: (scrollEvent: Event) => void;
454
+ generateAnchorList: (formModel: import("@formily/core").Form<any>) => Promise<void>;
454
455
  callLifeCycle: <T_2 extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T_2, payload?: Parameters<Required<Partial<{
455
456
  onSetup(): void;
456
457
  beforeSetValue(fieldKey: string, value: unknown, payload: {
@@ -765,7 +766,7 @@ declare const _default: import("vue").DefineComponent<{}, {
765
766
  startIncrementalRender: () => void;
766
767
  onKeydown: (event: KeyboardEvent) => Promise<void>;
767
768
  clearSpan: (uuid: string) => void;
768
- exposeEvent: Omit<FormRenderExpose, "getFieldList" | "optionInited" | "formModel" | "reload">;
769
+ exposeEvent: Omit<FormRenderExpose, "updateAnchor" | "getFieldList" | "optionInited" | "formModel" | "reload">;
769
770
  useVersion: typeof import("../../../../shared/hooks/useVersion").useVersion;
770
771
  FormConsumer: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
771
772
  FormProvider: import("vue").DefineComponent<Record<"form", any>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Record<"form", any>>>, {