cnhis-design-vue 3.1.50 → 3.1.51-beta.1

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 (123) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +13 -8
  3. package/es/components/base-search/src/index.vue.d.ts +13 -8
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/classification/index.d.ts +57 -15
  6. package/es/components/classification/src/components/search-filter/index.vue.d.ts +57 -15
  7. package/es/components/classification/src/components/set-classification/index.vue.d.ts +57 -15
  8. package/es/components/classification/src/index.vue.d.ts +57 -15
  9. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  10. package/es/components/expand-field/src/index.vue2.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -0
  24. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  25. package/es/components/field-set/index.d.ts +1 -1
  26. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  27. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  28. package/es/components/form-config/index.d.ts +174 -25
  29. package/es/components/form-config/src/FormConfig.vue.d.ts +175 -26
  30. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  31. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
  32. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -10
  33. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +121 -0
  34. package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
  35. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
  36. package/es/components/form-config/src/constants/index.d.ts +19 -1
  37. package/es/components/form-config/src/constants/index.js +1 -1
  38. package/es/components/form-config/src/hooks/useDataNormalize.d.ts +1 -1
  39. package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
  40. package/es/components/form-config/src/types/index.d.ts +7 -3
  41. package/es/components/form-config/style/index.css +1 -1
  42. package/es/components/form-render/index.d.ts +4 -4
  43. package/es/components/form-render/src/FormRender.vue.d.ts +2 -2
  44. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
  45. package/es/components/form-render/src/components/renderer/select.d.ts +10 -1
  46. package/es/components/form-render/src/components/renderer/select.js +1 -1
  47. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  48. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  49. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  50. package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
  51. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  52. package/es/components/form-render/src/types/index.d.ts +1 -19
  53. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  54. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +1 -1
  55. package/es/components/iho-table/src/types/index.d.ts +2 -1
  56. package/es/components/index.css +1 -1
  57. package/es/components/info-header/index.d.ts +13 -13
  58. package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -13
  59. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
  60. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
  61. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +5 -5
  62. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -4
  63. package/es/components/quick-search/index.d.ts +13 -8
  64. package/es/components/quick-search/src/index.vue.d.ts +13 -8
  65. package/es/components/quick-search/src/index.vue2.js +1 -1
  66. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  67. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  68. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  69. package/es/components/shortcut-setter/index.d.ts +6 -5
  70. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -5
  71. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  72. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +52 -7
  73. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  74. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
  75. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
  76. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.d.ts +34 -2
  77. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
  78. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +36 -4
  79. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -6
  80. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  81. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +57 -15
  82. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  83. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.d.ts +58 -0
  84. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue.js +1 -0
  85. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -0
  86. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +56 -1
  87. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  88. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +4 -1
  89. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  90. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +55 -1
  91. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  92. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -0
  93. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  94. package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -7
  95. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  96. package/es/components/table-filter/src/tool/transformData.d.ts +1 -6
  97. package/es/components/table-filter/src/tool/transformData.js +1 -1
  98. package/es/components/table-filter/src/types/index.d.ts +16 -1
  99. package/es/env.d.ts +25 -25
  100. package/es/shared/assets/img/failure.png.js +1 -1
  101. package/es/shared/assets/img/no-permission.png.js +1 -1
  102. package/es/shared/assets/img/nodata.png.js +1 -1
  103. package/es/shared/assets/img/notfound.png.js +1 -1
  104. package/es/shared/assets/img/qr.png.js +1 -1
  105. package/es/shared/assets/img/success.png.js +1 -1
  106. package/es/shared/assets/img/video.png.js +1 -1
  107. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  108. package/es/shared/assets/img/xb_big.png.js +1 -1
  109. package/es/shared/assets/img/xb_small.png.js +1 -1
  110. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +19 -1
  111. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  112. package/es/shared/package.json.js +1 -1
  113. package/es/shared/types/business.d.ts +20 -0
  114. package/es/shared/utils/business.d.ts +1 -2
  115. package/es/shared/utils/index.d.ts +3 -3
  116. package/package.json +2 -2
  117. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  118. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  119. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  120. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  121. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  122. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  123. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -67,10 +67,12 @@ declare const _default: import("vue").DefineComponent<{
67
67
  className: string;
68
68
  displayCategory: string;
69
69
  filterConditions: {
70
- value: string;
71
- key: string;
72
70
  condition: string;
71
+ key: string;
73
72
  presetVal: string;
73
+ value: string;
74
+ isAccurateSearch?: boolean | undefined;
75
+ accurateSearchKey?: string | undefined;
74
76
  }[];
75
77
  };
76
78
  loading: import("vue").Ref<boolean>;
@@ -98,12 +100,7 @@ declare const _default: import("vue").DefineComponent<{
98
100
  updateCondition: (index: number, val: any) => void;
99
101
  getParamCfg: (key: string) => any;
100
102
  initFilterConditions: (tableId: string, rawConditions: import("../../../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
101
- getRawFilterConditions: () => {
102
- field_key: any;
103
- con: any;
104
- value: any;
105
- unit: any;
106
- }[];
103
+ getRawFilterConditions: () => any[];
107
104
  findConditionByDisplayCategory: (sid: string) => unknown;
108
105
  handleDisplayCategorySelectProxy: (item: ICategoryItemType) => void;
109
106
  clearFormData: () => void;
@@ -134,6 +131,9 @@ declare const _default: import("vue").DefineComponent<{
134
131
  type: StringConstructor;
135
132
  default: null;
136
133
  };
134
+ isAccurate: {
135
+ type: BooleanConstructor;
136
+ };
137
137
  }, {
138
138
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
139
139
  paramCfg: {
@@ -148,13 +148,18 @@ declare const _default: import("vue").DefineComponent<{
148
148
  type: StringConstructor;
149
149
  default: null;
150
150
  };
151
+ isAccurate: {
152
+ type: BooleanConstructor;
153
+ };
151
154
  }>> & {
152
155
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
156
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
153
157
  "onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
154
158
  }>>;
155
- emit: (event: "update:modelValue" | "update:presetVal", ...args: any[]) => void;
159
+ emit: (event: "update:modelValue" | "update:isAccurate" | "update:presetVal", ...args: any[]) => void;
156
160
  valueCp: import("vue").WritableComputedRef<any>;
157
161
  presetValCp: import("vue").WritableComputedRef<string>;
162
+ isAccurateCp: import("vue").WritableComputedRef<boolean>;
158
163
  widgetType: import("vue").ComputedRef<any>;
159
164
  Date: import("vue").DefineComponent<{
160
165
  componentCfg: {
@@ -304,35 +309,67 @@ declare const _default: import("vue").DefineComponent<{
304
309
  "onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
305
310
  }, {
306
311
  modelValue: string | number | unknown[];
307
- presetVal: string;
308
312
  paramCfg: Record<string, any>;
313
+ presetVal: string;
309
314
  }>;
310
315
  InputFilter: import("vue").DefineComponent<{
316
+ paramCfg: {
317
+ type: ObjectConstructor;
318
+ default: null;
319
+ };
311
320
  modelValue: {
312
321
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
313
322
  default: null;
314
323
  };
324
+ isAccurateFilter: {
325
+ type: BooleanConstructor;
326
+ };
315
327
  }, {
316
328
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
329
+ paramCfg: {
330
+ type: ObjectConstructor;
331
+ default: null;
332
+ };
317
333
  modelValue: {
318
334
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
319
335
  default: null;
320
336
  };
337
+ isAccurateFilter: {
338
+ type: BooleanConstructor;
339
+ };
321
340
  }>> & {
322
341
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
342
+ "onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
323
343
  }>>;
324
- emit: (event: "update:modelValue", ...args: any[]) => void;
344
+ emit: (event: "update:modelValue" | "update:isAccurateFilter", ...args: any[]) => void;
345
+ optionList: import("vue").Ref<{
346
+ label: string;
347
+ value: number;
348
+ }[]>;
325
349
  valueCp: import("vue").WritableComputedRef<any>;
350
+ isAccurateFilterCp: import("vue").WritableComputedRef<number>;
351
+ isShowSearch: import("vue").ComputedRef<any>;
326
352
  NInput: any;
327
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
353
+ NSelect: any;
354
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurateFilter")[], "update:modelValue" | "update:isAccurateFilter", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
355
+ paramCfg: {
356
+ type: ObjectConstructor;
357
+ default: null;
358
+ };
328
359
  modelValue: {
329
360
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
330
361
  default: null;
331
362
  };
363
+ isAccurateFilter: {
364
+ type: BooleanConstructor;
365
+ };
332
366
  }>> & {
333
367
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
368
+ "onUpdate:isAccurateFilter"?: ((...args: any[]) => any) | undefined;
334
369
  }, {
335
370
  modelValue: string | number | unknown[];
371
+ paramCfg: Record<string, any>;
372
+ isAccurateFilter: boolean;
336
373
  }>;
337
374
  InputNumber: import("vue").DefineComponent<{
338
375
  modelValue: {
@@ -861,8 +898,8 @@ declare const _default: import("vue").DefineComponent<{
861
898
  "onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
862
899
  }, {
863
900
  modelValue: string | number | unknown[];
864
- presetVal: string;
865
901
  paramCfg: Record<string, any>;
902
+ presetVal: string;
866
903
  }>;
867
904
  SelectLabel: import("vue").DefineComponent<{
868
905
  paramCfg: {
@@ -928,7 +965,7 @@ declare const _default: import("vue").DefineComponent<{
928
965
  SELECTLABEL: string;
929
966
  SELECTDYNAMIC: string;
930
967
  };
931
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:presetVal")[], "update:modelValue" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
968
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:isAccurate" | "update:presetVal")[], "update:modelValue" | "update:isAccurate" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
932
969
  paramCfg: {
933
970
  type: ObjectConstructor;
934
971
  default: null;
@@ -941,13 +978,18 @@ declare const _default: import("vue").DefineComponent<{
941
978
  type: StringConstructor;
942
979
  default: null;
943
980
  };
981
+ isAccurate: {
982
+ type: BooleanConstructor;
983
+ };
944
984
  }>> & {
945
985
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
986
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
946
987
  "onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
947
988
  }, {
948
989
  modelValue: string | number | unknown[];
949
- presetVal: string;
950
990
  paramCfg: Record<string, any>;
991
+ presetVal: string;
992
+ isAccurate: boolean;
951
993
  }>;
952
994
  ConditionEnums: {
953
995
  NULL: string;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as a,reactive as i,ref as t,provide as l,toRef as n,openBlock as o,createElementBlock as s,createVNode as d,unref as r,withCtx as c,createElementVNode as p,createCommentVNode as u,Fragment as y,renderList as m,normalizeClass as v,toDisplayString as f,createBlock as C,withDirectives as g,createTextVNode as h,vShow as k}from"vue";import{useMessage as b,NSpin as A,NInput as L,NIcon as w,NButton as _,NSelect as U,NTooltip as N}from"naive-ui";import{CloseOutline as V,AddOutline as x,AddCircleSharp as D}from"@vicons/ionicons5";import B from"./ValueCfg.vue.js";import{DataTypeEnums as I,ConditionEnums as j}from"../../types/enums.js";import{useDisplayCategory as S}from"./hooks/useDisplayCategory.js";import{useFilterConditions as F}from"./hooks/useFilterConditions.js";import{conditionOptions as z}from"./helpers/options.js";import{InjectionClassifyFilterList as O}from"../../constants/index.js";const P={class:"searchConditionByApi_wrapper"},q={class:"class-filter-content"},E={key:0,class:"item-name"},R=p("span",{class:"label"},"筛选分类名称:",-1),J={key:1,class:"quickSearch-content"},K=p("span",{class:"label"},"父类名称:",-1),M=["onDblclick","onClick"],Q={key:0,class:"s-content"},G={key:2,class:"item-name"},H=p("span",{class:"label"}," 过滤条件: ",-1),T=p("span",null,"添加",-1),W={class:"select-item-list"},X={class:"index-span"},Y=["onClick"];var Z=e({__name:"index",props:{actionList_prop:{type:Object,default:()=>({})},conditionList:{type:Array,default:()=>[]},tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},showItemName:{type:Boolean,default:!0},hideAddBtn:{type:Boolean,default:!1}},emits:["saveAdd","cancelSaveAdd"],setup(e,{expose:Z,emit:$}){const ee=e,ae=b(),ie={class:"classify-fieldkey-popover"},te=a(),le=i({className:"",displayCategory:"",filterConditions:[]}),ne=t(!1);l(O,n(le,"filterConditions"));const{State:oe,isEnableAddDisplayCategory:se,editDisplayCategory:de,handleDisplayCategorySelect:re,handleDisplayCategoryRemove:ce,handleDisplayCategoryAdd:pe,handlerBlur:ue,initDisplayCategories:ye}=S(n(le,"displayCategory"),{conditionList:ee.conditionList},ae),{State:me,paramOptions:ve,addFilterCondition:fe,delFilterCondition:Ce,updateKey:ge,updateCondition:he,getParamCfg:ke,initFilterConditions:be,getRawFilterConditions:Ae}=F(n(le,"filterConditions"),ee.searchFieldList,I.API);function Le(){le.className="",le.displayCategory="",le.filterConditions=[]}async function we(){var e;try{if(Le(),ne.value=!0,ye(te.displayCategoryList,ee.actionList_prop.displayCategory||void 0),ee.actionList_prop){le.className=ee.actionList_prop.name,await be(ee.tableId,null!=(e=ee.actionList_prop.conObj)?e:[]);le.filterConditions.length<1&&ve.value&&ve.value.length>0&&fe()}}finally{ne.value=!1}}return we(),Z({handleInitConditions:we,saveAdd:function(){new Promise((e=>{le.className||!ee.showItemName?0!==le.filterConditions.length?le.filterConditions.some((({key:e,condition:a,value:i,presetVal:t})=>!e||!a||a===j.EQUAL&&!i&&!t))?ae.warning("请补充完整条件内容"):e(!0):ae.warning("请至少添加一个条件"):ae.warning("请输入分类名称")})).then((()=>{let e;var a;"edit"===ee.actionList_prop.from&&(a=ee.actionList_prop.sid,e=null==ee?void 0:ee.conditionList.find((e=>e.sid===a)));const i={displayCategory:le.displayCategory,name:le.className||"",conObj:Ae()},t={id:e?e.sid:"",tableId:ee.tableId,setting:JSON.stringify(i)};$("saveAdd",t,!1)}))},cancelSaveAdd:function(){Le(),$("cancelSaveAdd")},addAction:fe,checkActionList:function(){return le.filterConditions.every((e=>!e.field_key))}}),(a,i)=>(o(),s("div",P,[d(r(A),{show:ne.value},{default:c((()=>[p("div",q,[e.showItemName?(o(),s("div",E,[R,d(r(L),{value:le.className,"onUpdate:value":i[0]||(i[0]=e=>le.className=e),placeholder:"请输入分类名称",style:{width:"250px"},maxlength:"10"},null,8,["value"])])):u("v-if",!0),e.showItemName?(o(),s("div",J,[K,(o(!0),s(y,null,m(r(oe).displayCategories,((e,a)=>(o(),s("div",{class:v(["edit-tag",{"edit-tag-select":e.value===le.displayCategory&&e.disabled}]),key:a,onDblclick:a=>r(de)(a,e),onClick:a=>function(e){re(e)}(e)},[e.disabled?(o(),s("div",Q,[p("span",null,f(e.value),1)])):(o(),C(r(L),{key:1,style:{width:"100px"},disabled:e.disabled,onBlur:()=>e.disabled=!0,value:e.value,"onUpdate:value":a=>e.value=a,maxlength:10},null,8,["disabled","onBlur","value","onUpdate:value"])),d(r(w),{component:r(V),class:"anticon-close",size:"20",onClick:i=>r(ce)(a,e)},null,8,["component","onClick"])],42,M)))),128)),r(se)?(o(),s(y,{key:0},[g(d(r(_),{class:"ant-btn",icon:"plus",dashed:"",onClick:r(pe)},{default:c((()=>[d(r(w),{component:r(x),size:"20"},null,8,["component"]),h(" "+f("添加父类"))])),_:1},8,["onClick"]),[[k,!r(oe).showAdd]]),g(d(r(L),{class:"edit-tag",value:r(oe).addDisplayCategory,"onUpdate:value":i[1]||(i[1]=e=>r(oe).addDisplayCategory=e),valueModifiers:{trim:!0},style:{width:"100px"},onBlur:r(ue),maxLength:10},null,8,["value","onBlur"]),[[k,r(oe).showAdd]])],64)):u("v-if",!0)])):u("v-if",!0),e.hideAddBtn?u("v-if",!0):(o(),s("div",G,[H,p("span",{class:"addAction",onClick:i[2]||(i[2]=(...e)=>r(fe)&&r(fe)(...e)),style:{cursor:"pointer"}},[d(r(w),{component:r(D),class:"blue",size:"18"},null,8,["component"]),T])])),p("ul",W,[(o(!0),s(y,null,m(le.filterConditions,((e,a)=>(o(),s("li",{key:a},[p("span",X,f(a+1)+"   ",1),u(" 选择 field_key "),d(r(U),{class:"form-item",placeholder:"请选择",value:e.key,"menu-props":ie,to:"body",filterable:"",options:r(ve),"onUpdate:value":e=>r(ge)(a,e)},null,8,["value","options","onUpdate:value"]),u(" 选择 关系 "),e.key?(o(),C(r(U),{key:0,class:"form-item",placeholder:"请选择",value:e.condition,to:"body",filterable:"",options:r(z),"onUpdate:value":e=>r(he)(a,e)},null,8,["value","options","onUpdate:value"])):u("v-if",!0),u(" 自定义 "),e.key&&e.condition&&e.condition!==r(j).NULL?(o(),C(B,{key:1,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a,presetVal:e.presetVal,"onUpdate:presetVal":a=>e.presetVal=a,"param-cfg":r(ke)(e.key)},null,8,["modelValue","onUpdate:modelValue","presetVal","onUpdate:presetVal","param-cfg"])):u("v-if",!0),d(r(N),{title:"删除",trigger:"hover"},{trigger:c((()=>[p("i",{onClick:e=>r(Ce)(a),class:"iconfont-table-filter delete-item-icon icon-table-filter-menzhenyishengzhananniuqingchu"},null,8,Y)])),default:c((()=>[h(" 删除 ")])),_:2},1024)])))),128))])])])),_:1},8,["show"])]))}});export{Z as default};
1
+ import{defineComponent as e,useAttrs as a,reactive as t,ref as i,provide as l,toRef as n,openBlock as o,createElementBlock as s,createVNode as d,unref as r,withCtx as c,createElementVNode as p,createCommentVNode as u,Fragment as y,renderList as m,normalizeClass as v,toDisplayString as f,createBlock as C,withDirectives as g,createTextVNode as h,vShow as k}from"vue";import{useMessage as b,NSpin as A,NInput as L,NIcon as w,NButton as U,NSelect as _,NTooltip as N}from"naive-ui";import{CloseOutline as V,AddOutline as x,AddCircleSharp as D}from"@vicons/ionicons5";import S from"./ValueCfg.vue.js";import{DataTypeEnums as B,ConditionEnums as I}from"../../types/enums.js";import{useDisplayCategory as j}from"./hooks/useDisplayCategory.js";import{useFilterConditions as F}from"./hooks/useFilterConditions.js";import{conditionOptions as z}from"./helpers/options.js";import{InjectionClassifyFilterList as O}from"../../constants/index.js";const P={class:"searchConditionByApi_wrapper"},q={class:"class-filter-content"},E={key:0,class:"item-name"},R=p("span",{class:"label"},"筛选分类名称:",-1),J={key:1,class:"quickSearch-content"},K=p("span",{class:"label"},"父类名称:",-1),M=["onDblclick","onClick"],Q={key:0,class:"s-content"},G={key:2,class:"item-name"},H=p("span",{class:"label"}," 过滤条件: ",-1),T=p("span",null,"添加",-1),W={class:"select-item-list"},X={class:"index-span"},Y=["onClick"];var Z=e({__name:"index",props:{actionList_prop:{type:Object,default:()=>({})},conditionList:{type:Array,default:()=>[]},tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},showItemName:{type:Boolean,default:!0},hideAddBtn:{type:Boolean,default:!1}},emits:["saveAdd","cancelSaveAdd"],setup(e,{expose:Z,emit:$}){const ee=e,ae=b(),te={class:"classify-fieldkey-popover"},ie=a(),le=t({className:"",displayCategory:"",filterConditions:[]}),ne=i(!1);l(O,n(le,"filterConditions"));const{State:oe,isEnableAddDisplayCategory:se,editDisplayCategory:de,handleDisplayCategorySelect:re,handleDisplayCategoryRemove:ce,handleDisplayCategoryAdd:pe,handlerBlur:ue,initDisplayCategories:ye}=j(n(le,"displayCategory"),{conditionList:ee.conditionList},ae),{State:me,paramOptions:ve,addFilterCondition:fe,delFilterCondition:Ce,updateKey:ge,updateCondition:he,getParamCfg:ke,initFilterConditions:be,getRawFilterConditions:Ae}=F(n(le,"filterConditions"),ee.searchFieldList,B.API);function Le(){le.className="",le.displayCategory="",le.filterConditions=[]}async function we(){var e;try{if(Le(),ne.value=!0,ye(ie.displayCategoryList,ee.actionList_prop.displayCategory||void 0),ee.actionList_prop){le.className=ee.actionList_prop.name,await be(ee.tableId,null!=(e=ee.actionList_prop.conObj)?e:[]);le.filterConditions.length<1&&ve.value&&ve.value.length>0&&fe()}}finally{ne.value=!1}}return we(),Z({handleInitConditions:we,saveAdd:function(){new Promise((e=>{le.className||!ee.showItemName?0!==le.filterConditions.length?le.filterConditions.some((({key:e,condition:a,value:t,presetVal:i})=>!e||!a||a===I.EQUAL&&!t&&!i))?ae.warning("请补充完整条件内容"):e(!0):ae.warning("请至少添加一个条件"):ae.warning("请输入分类名称")})).then((()=>{let e;var a;"edit"===ee.actionList_prop.from&&(a=ee.actionList_prop.sid,e=null==ee?void 0:ee.conditionList.find((e=>e.sid===a)));const t={displayCategory:le.displayCategory,name:le.className||"",conObj:Ae()},i={id:e?e.sid:"",tableId:ee.tableId,setting:JSON.stringify(t)};$("saveAdd",i,!1)}))},cancelSaveAdd:function(){Le(),$("cancelSaveAdd")},addAction:fe,checkActionList:function(){return le.filterConditions.every((e=>!e.field_key))}}),(a,t)=>(o(),s("div",P,[d(r(A),{show:ne.value},{default:c((()=>[p("div",q,[e.showItemName?(o(),s("div",E,[R,d(r(L),{value:le.className,"onUpdate:value":t[0]||(t[0]=e=>le.className=e),placeholder:"请输入分类名称",style:{width:"250px"},maxlength:"10"},null,8,["value"])])):u("v-if",!0),e.showItemName?(o(),s("div",J,[K,(o(!0),s(y,null,m(r(oe).displayCategories,((e,a)=>(o(),s("div",{class:v(["edit-tag",{"edit-tag-select":e.value===le.displayCategory&&e.disabled}]),key:a,onDblclick:a=>r(de)(a,e),onClick:a=>function(e){re(e)}(e)},[e.disabled?(o(),s("div",Q,[p("span",null,f(e.value),1)])):(o(),C(r(L),{key:1,style:{width:"100px"},disabled:e.disabled,onBlur:()=>e.disabled=!0,value:e.value,"onUpdate:value":a=>e.value=a,maxlength:10},null,8,["disabled","onBlur","value","onUpdate:value"])),d(r(w),{component:r(V),class:"anticon-close",size:"20",onClick:t=>r(ce)(a,e)},null,8,["component","onClick"])],42,M)))),128)),r(se)?(o(),s(y,{key:0},[g(d(r(U),{class:"ant-btn",icon:"plus",dashed:"",onClick:r(pe)},{default:c((()=>[d(r(w),{component:r(x),size:"20"},null,8,["component"]),h(" "+f("添加父类"))])),_:1},8,["onClick"]),[[k,!r(oe).showAdd]]),g(d(r(L),{class:"edit-tag",value:r(oe).addDisplayCategory,"onUpdate:value":t[1]||(t[1]=e=>r(oe).addDisplayCategory=e),valueModifiers:{trim:!0},style:{width:"100px"},onBlur:r(ue),maxLength:10},null,8,["value","onBlur"]),[[k,r(oe).showAdd]])],64)):u("v-if",!0)])):u("v-if",!0),e.hideAddBtn?u("v-if",!0):(o(),s("div",G,[H,p("span",{class:"addAction",onClick:t[2]||(t[2]=(...e)=>r(fe)&&r(fe)(...e)),style:{cursor:"pointer"}},[d(r(w),{component:r(D),class:"blue",size:"18"},null,8,["component"]),T])])),p("ul",W,[(o(!0),s(y,null,m(le.filterConditions,((e,a)=>(o(),s("li",{key:a},[p("span",X,f(a+1),1),u(" 选择 field_key "),d(r(_),{class:"form-item",placeholder:"请选择",value:e.key,"menu-props":te,to:"body",filterable:"",options:r(ve),"onUpdate:value":e=>r(ge)(a,e)},null,8,["value","options","onUpdate:value"]),u(" 选择 关系 "),e.key?(o(),C(r(_),{key:0,class:"form-item",placeholder:"请选择",value:e.condition,to:"body",filterable:"",options:r(z),"onUpdate:value":e=>r(he)(a,e)},null,8,["value","options","onUpdate:value"])):u("v-if",!0),u(" 自定义 "),e.key&&e.condition&&e.condition!==r(I).NULL?(o(),C(S,{key:1,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a,presetVal:e.presetVal,"onUpdate:presetVal":a=>e.presetVal=a,isAccurate:e.isAccurateSearch,"onUpdate:isAccurate":a=>e.isAccurateSearch=a,"param-cfg":r(ke)(e.key)},null,8,["modelValue","onUpdate:modelValue","presetVal","onUpdate:presetVal","isAccurate","onUpdate:isAccurate","param-cfg"])):u("v-if",!0),d(r(N),{title:"删除",trigger:"hover"},{trigger:c((()=>[p("i",{onClick:e=>r(Ce)(a),class:"iconfont-table-filter delete-item-icon icon-table-filter-menzhenyishengzhananniuqingchu"},null,8,Y)])),default:c((()=>[h(" 删除 ")])),_:2},1024)])))),128))])])])),_:1},8,["show"])]))}});export{Z as default};
@@ -0,0 +1,58 @@
1
+ import { PropType } from 'vue';
2
+ import { AnyObject } from '../../../../../../../es/shared/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ componentCfg: {
5
+ type: PropType<AnyObject>;
6
+ };
7
+ value: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ isAccurateSearchVal: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }, {
16
+ $attrs: any;
17
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
18
+ componentCfg: {
19
+ type: PropType<AnyObject>;
20
+ };
21
+ value: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ isAccurateSearchVal: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ }>> & {
30
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
31
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
32
+ }>>;
33
+ emit: (event: "update:isAccurate" | "update:value", ...args: any[]) => void;
34
+ valueCp: import("vue").WritableComputedRef<string>;
35
+ isAccurateSearchValCp: import("vue").WritableComputedRef<boolean>;
36
+ isShowSearch: import("vue").ComputedRef<any>;
37
+ NCheckbox: any;
38
+ NInput: any;
39
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:isAccurate" | "update:value")[], "update:isAccurate" | "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
40
+ componentCfg: {
41
+ type: PropType<AnyObject>;
42
+ };
43
+ value: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ isAccurateSearchVal: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ }>> & {
52
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
53
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
54
+ }, {
55
+ value: string;
56
+ isAccurateSearchVal: boolean;
57
+ }>;
58
+ export default _default;
@@ -0,0 +1 @@
1
+ import t from"./InputCustom.vue2.js";import u from"../../../../../../_virtual/_plugin-vue_export-helper.js";var e=u(t,[["__file","InputCustom.vue"]]);export{e as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,useAttrs as t,computed as a,openBlock as u,createBlock as l,unref as c,mergeProps as r,isRef as p,createSlots as i,withCtx as n,createVNode as o,createTextVNode as d}from"vue";import{NInput as v,NCheckbox as s}from"naive-ui";var f=e({__name:"InputCustom",props:{componentCfg:{type:Object},value:{type:String,default:""},isAccurateSearchVal:{type:Boolean,default:!1}},emits:["update:value","update:isAccurate"],setup(e,{emit:f}){const m=e,h=t(),y=a({set(e){f("update:value",e)},get:()=>m.value}),g=a({set(e){f("update:isAccurate",e)},get:()=>m.isAccurateSearchVal}),k=a((()=>{var e;return(null==(e=h.accurateSearch)?void 0:e.switchEnable)&&1===h.filterExplicit}));return(e,t)=>(u(),l(c(v),r(c(h),{value:c(y),"onUpdate:value":t[1]||(t[1]=e=>p(y)?y.value=e:null),type:"text"}),i({_:2},[c(k)?{name:"prefix",fn:n((()=>[o(c(s),{checked:c(g),"onUpdate:checked":t[0]||(t[0]=e=>p(g)?g.value=e:null)},{default:n((()=>[d("精确查询")])),_:1},8,["checked"])])),key:"0"}:void 0]),1040,["value"]))}});export{f as default};
@@ -1292,4 +1292,59 @@ declare const SelectDynamic: import("vue").DefineComponent<{
1292
1292
  }>> & {
1293
1293
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
1294
1294
  }, {}>;
1295
- export { CheckboxGroup, InputNumberGroup, DateInner, DateOut, DateRangeInner, DateRangeOut, LabelInner, LabelOut, Select, SelectDynamic };
1295
+ declare const InputCustom: import("vue").DefineComponent<{
1296
+ componentCfg: {
1297
+ type: import("vue").PropType<import("../../../../..").AnyObject>;
1298
+ };
1299
+ value: {
1300
+ type: StringConstructor;
1301
+ default: string;
1302
+ };
1303
+ isAccurateSearchVal: {
1304
+ type: BooleanConstructor;
1305
+ default: boolean;
1306
+ };
1307
+ }, {
1308
+ $attrs: any;
1309
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1310
+ componentCfg: {
1311
+ type: import("vue").PropType<import("../../../../..").AnyObject>;
1312
+ };
1313
+ value: {
1314
+ type: StringConstructor;
1315
+ default: string;
1316
+ };
1317
+ isAccurateSearchVal: {
1318
+ type: BooleanConstructor;
1319
+ default: boolean;
1320
+ };
1321
+ }>> & {
1322
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
1323
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
1324
+ }>>;
1325
+ emit: (event: "update:isAccurate" | "update:value", ...args: any[]) => void;
1326
+ valueCp: import("vue").WritableComputedRef<string>;
1327
+ isAccurateSearchValCp: import("vue").WritableComputedRef<boolean>;
1328
+ isShowSearch: import("vue").ComputedRef<any>;
1329
+ NCheckbox: any;
1330
+ NInput: any;
1331
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:isAccurate" | "update:value")[], "update:isAccurate" | "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1332
+ componentCfg: {
1333
+ type: import("vue").PropType<import("../../../../..").AnyObject>;
1334
+ };
1335
+ value: {
1336
+ type: StringConstructor;
1337
+ default: string;
1338
+ };
1339
+ isAccurateSearchVal: {
1340
+ type: BooleanConstructor;
1341
+ default: boolean;
1342
+ };
1343
+ }>> & {
1344
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
1345
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
1346
+ }, {
1347
+ value: string;
1348
+ isAccurateSearchVal: boolean;
1349
+ }>;
1350
+ export { CheckboxGroup, InputNumberGroup, DateInner, DateOut, DateRangeInner, DateRangeOut, LabelInner, LabelOut, Select, SelectDynamic, InputCustom };
@@ -1 +1 @@
1
- import{defineAsyncComponent as e}from"vue";const t=e((()=>import("./CheckboxGroup.vue.js"))),r=e((()=>import("./InputNumberGroup.vue.js"))),u=e((()=>import("./DateInner.vue.js"))),o=e((()=>import("./DateOut.vue.js"))),p=e((()=>import("./DateRangeInner.vue.js"))),m=e((()=>import("./DateRangeOut.vue.js"))),i=e((()=>import("./LabelInner.vue.js"))),n=e((()=>import("./LabelOut.vue.js"))),s=e((()=>import("./Select.vue.js"))),v=e((()=>import("./SelectDynamic.vue.js")));export{t as CheckboxGroup,u as DateInner,o as DateOut,p as DateRangeInner,m as DateRangeOut,r as InputNumberGroup,i as LabelInner,n as LabelOut,s as Select,v as SelectDynamic};
1
+ import{defineAsyncComponent as e}from"vue";const t=e((()=>import("./CheckboxGroup.vue.js"))),u=e((()=>import("./InputNumberGroup.vue.js"))),r=e((()=>import("./DateInner.vue.js"))),o=e((()=>import("./DateOut.vue.js"))),p=e((()=>import("./DateRangeInner.vue.js"))),m=e((()=>import("./DateRangeOut.vue.js"))),i=e((()=>import("./LabelInner.vue.js"))),s=e((()=>import("./LabelOut.vue.js"))),n=e((()=>import("./Select.vue.js"))),v=e((()=>import("./SelectDynamic.vue.js"))),j=e((()=>import("./InputCustom.vue.js")));export{t as CheckboxGroup,r as DateInner,o as DateOut,p as DateRangeInner,m as DateRangeOut,j as InputCustom,u as InputNumberGroup,i as LabelInner,s as LabelOut,n as Select,v as SelectDynamic};
@@ -11,6 +11,7 @@ declare const _default: import("vue").DefineComponent<{
11
11
  }, {
12
12
  valueCp(): any;
13
13
  unit(): any;
14
+ isAccurateSearchVal(): any;
14
15
  }, {
15
16
  search(): void;
16
17
  getEleWidth(cfg: any): {
@@ -22,7 +23,8 @@ declare const _default: import("vue").DefineComponent<{
22
23
  }> | null;
23
24
  handleUpdate(val: any): void;
24
25
  handleUpdateUnit(val: any): void;
25
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:unit" | "outFilterChange")[], "update:modelValue" | "update:unit" | "outFilterChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ handleUpdateAccurateSearch(val: any): void;
27
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:unit" | "update:isAccurate" | "outFilterChange")[], "update:modelValue" | "update:unit" | "update:isAccurate" | "outFilterChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
28
  cfg: {
27
29
  type: ObjectConstructor;
28
30
  required: true;
@@ -33,6 +35,7 @@ declare const _default: import("vue").DefineComponent<{
33
35
  }>> & {
34
36
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
35
37
  "onUpdate:unit"?: ((...args: any[]) => any) | undefined;
38
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
36
39
  onOutFilterChange?: ((...args: any[]) => any) | undefined;
37
40
  }, {}>;
38
41
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"../../types/enums.js";import{WidgetCfgMaps as n}from"./widgetCfgMaps.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";const a=[i.DATE,i.DATE_TIME,i.CHECKBOX_GROUP];var l=r(e({props:{cfg:{type:Object,required:!0},modelValue:{type:[Array,String,Number]}},emits:["update:modelValue","update:unit","outFilterChange"],computed:{valueCp(){return this.cfg.value},unit(){return this.cfg.unit}},data:()=>({initialProps:{}}),methods:{search(){this.$emit("outFilterChange")},getEleWidth(e){const{widgetType:t,widgetCfg:n,filterExplicit:r}=e;if(a.includes(t))return;const l=i.SELECT!==t&&i.SELECTLABEL!==t&&i.SELECTDYNAMIC!==t||!n.multiple?"100%":"200px";return{width:0===r?"100%":e.advanceColWidth?`${e.advanceColWidth}px`:l}},initComponentProps(e){const{widgetType:t,alias:i,title:r,placeholder:a,widgetCfg:l}=e,{props:s,handlerProps:p}=n.get(t);let u={...s};p&&(u=p(u,{...l,title:i||r})),a&&(u.placeholder=a),this.initialProps=u,u.value&&(this.valueCp=u.value)},generateWidget(e){const{widgetType:i}=e;if(!n.has(i))return null;const{value:r}=e,{component:a,style:l,eventsBySearch:s=[]}=n.get(i),p={...this.initialProps,value:r,componentCfg:e},u=s.reduce(((e,t)=>{const{name:i,handler:n}=t;let r=this.search;return n&&(r=e=>{n(e,this.search,p)}),{...e,[`on${i}`]:r}}),{});return t(a,{...l,...p,style:this.getEleWidth(e),value:this.valueCp,unit:this.unit,"onUpdate:value":e=>this.handleUpdate(e),"onUpdate:unit":e=>this.handleUpdateUnit(e),...u})},handleUpdate(e){this.$emit("update:modelValue",e)},handleUpdateUnit(e){this.$emit("update:unit",e)}},created(){this.initComponentProps(this.cfg)},render(){return this.generateWidget(this.cfg)}}),[["__file","index.vue"]]);export{l as default};
1
+ import{defineComponent as e,h as t}from"vue";import{WidgetTypeEnums as i}from"../../types/enums.js";import{WidgetCfgMaps as a}from"./widgetCfgMaps.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";const l=[i.DATE,i.DATE_TIME,i.CHECKBOX_GROUP];var s=r(e({props:{cfg:{type:Object,required:!0},modelValue:{type:[Array,String,Number]}},emits:["update:modelValue","update:unit","update:isAccurate","outFilterChange"],computed:{valueCp(){return this.cfg.widgetType==i.INPUT_NUMBER&&this.cfg.value?Number(this.cfg.value):this.cfg.value},unit(){return this.cfg.unit},isAccurateSearchVal(){return this.cfg.isAccurateSearchVal}},data:()=>({initialProps:{}}),methods:{search(){this.$emit("outFilterChange")},getEleWidth(e){const{widgetType:t,widgetCfg:a,filterExplicit:r}=e;if(l.includes(t))return;const s=i.SELECT!==t&&i.SELECTLABEL!==t&&i.SELECTDYNAMIC!==t||!a.multiple?"100%":"200px";return{width:0===r?"100%":e.advanceColWidth?`${e.advanceColWidth}px`:s}},initComponentProps(e){const{widgetType:t,alias:i,title:r,placeholder:l,widgetCfg:s,accurateSearch:n,filterExplicit:u}=e,{props:c,handlerProps:h}=a.get(t);let p={...c,accurateSearch:n,filterExplicit:u};h&&(p=h(p,{...s,title:i||r})),l&&(p.placeholder=l),this.initialProps=p,p.value&&(this.valueCp=p.value)},generateWidget(e){const{widgetType:i}=e;if(!a.has(i))return null;const{value:r}=e,{component:l,style:s,eventsBySearch:n=[]}=a.get(i),u={...this.initialProps,value:r,componentCfg:e},c=n.reduce(((e,t)=>{const{name:i,handler:a}=t;let r=this.search;return a&&(r=e=>{a(e,this.search,u)}),{...e,[`on${i}`]:r}}),{});return t(l,{...s,...u,style:this.getEleWidth(e),value:this.valueCp,unit:this.unit,isAccurateSearchVal:this.isAccurateSearchVal,"onUpdate:value":e=>this.handleUpdate(e),"onUpdate:unit":e=>this.handleUpdateUnit(e),"onUpdate:isAccurate":e=>this.handleUpdateAccurateSearch(e),...c})},handleUpdate(e){this.$emit("update:modelValue",e)},handleUpdateUnit(e){this.$emit("update:unit",e)},handleUpdateAccurateSearch(e){this.$emit("update:isAccurate",e)}},created(){this.initComponentProps(this.cfg)},render(){return this.generateWidget(this.cfg)}}),[["__file","index.vue"]]);export{s as default};
@@ -18,7 +18,61 @@ export declare const WidgetCfgMaps: Map<string, {
18
18
  setDefaultValue: (defaultValue: any) => any;
19
19
  style?: undefined;
20
20
  } | {
21
- component: any;
21
+ component: import("vue").DefineComponent<{
22
+ componentCfg: {
23
+ type: import("vue").PropType<import("../../../..").AnyObject>;
24
+ };
25
+ value: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ isAccurateSearchVal: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ }, {
34
+ $attrs: any;
35
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
36
+ componentCfg: {
37
+ type: import("vue").PropType<import("../../../..").AnyObject>;
38
+ };
39
+ value: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ isAccurateSearchVal: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
47
+ }>> & {
48
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
49
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
50
+ }>>;
51
+ emit: (event: "update:isAccurate" | "update:value", ...args: any[]) => void;
52
+ valueCp: import("vue").WritableComputedRef<string>;
53
+ isAccurateSearchValCp: import("vue").WritableComputedRef<boolean>;
54
+ isShowSearch: import("vue").ComputedRef<any>;
55
+ NCheckbox: any;
56
+ NInput: any;
57
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:isAccurate" | "update:value")[], "update:isAccurate" | "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
58
+ componentCfg: {
59
+ type: import("vue").PropType<import("../../../..").AnyObject>;
60
+ };
61
+ value: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
65
+ isAccurateSearchVal: {
66
+ type: BooleanConstructor;
67
+ default: boolean;
68
+ };
69
+ }>> & {
70
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
71
+ "onUpdate:isAccurate"?: ((...args: any[]) => any) | undefined;
72
+ }, {
73
+ value: string;
74
+ isAccurateSearchVal: boolean;
75
+ }>;
22
76
  props: {
23
77
  clearable: boolean;
24
78
  allowInput: (value: string) => boolean;
@@ -1 +1 @@
1
- import{WidgetTypeEnums as e,WidgetValEnums as l}from"../../types/enums.js";import{DatePresetValEnums as t,DateRangeOutDefEnums as r}from"./enums.js";import{NInputNumber as a,NInput as o}from"naive-ui";import{InputNumberGroup as n,Select as p,SelectDynamic as s,DateInner as i,DateOut as u,DateRangeInner as c,DateRangeOut as m,CheckboxGroup as d,LabelInner as y,LabelOut as h}from"./components/index.js";import{presetValToTimestamp as E,formatDateRangeInfo as f}from"./helpers/presetValToTimestamp.js";import{setSelectDynamicValue as M}from"./helpers/setDefaultValue.js";const D=e=>null==e?null:e,T=new Map([[e.INPUT_NUMBER,{component:a,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`输入${l}`}),setDefaultValue:D}],[e.INPUTNUMBER_RANGE,{component:n,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l,filterExplicit:t}={})=>({...e,startPlaceholder:1===t?`起始${l}`:"最小值",endPlaceholder:1===t?`截止${l}`:"最大值"}),setDefaultValue:D}],[e.INPUT,{component:o,props:{clearable:!0,allowInput:e=>!e.startsWith(" ")&&!e.endsWith(" ")},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`搜索${l}`}),setDefaultValue:D}],[e.SELECT,{component:p,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},eventsBySearch:[{name:"change",handler(e,l,t){const{multiple:r}=t;r&&l()}}],handlerProps(e,{multiple:l,title:t}={}){const r={...e,placeholder:`请选择${t}`};return l&&(r.multiple=!0),r},setDefaultValue:(e,t,r)=>t&&"boolean"==typeof(null==r?void 0:r.multiple)?r.multiple?[l.WHOLE]:l.WHOLE:e}],[e.SELECTDYNAMIC,{component:s,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},eventsBySearch:[{name:"change",handler(e,l,t){const{multiple:r}=t;r&&l()}}],handlerProps(e,l={}){const{multiple:t,title:r}=l,a={...e,placeholder:`请选择${r}`};return t&&(a.multiple=!0),a},setDefaultValue:async(e,l,t)=>l&&(null==t?void 0:t._cfg)?await M(null==t?void 0:t._cfg):e}],[e.DATE,{component:i,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:D}],[e.DATE_OUT,{component:u,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?E(l,"YYYY-MM-DD"):e}],[e.DATE_RANGE_INNER,{component:c,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:D}],[e.DATE_RANGE_OUT,{component:m,props:{type:"daterange",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:(e,l,t)=>l&&l!==r.CUSTOM&&(null==t?void 0:t.optSetting)?f(l,"YYYY-MM-DD",t.optSetting):e}],[e.DATE_TIME,{component:i,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:D}],[e.DATETIME_OUT,{component:u,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?E(l,"YYYY-MM-DD HH:mm:ss"):e}],[e.DATETIME_RANGE_INNER,{component:c,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:D}],[e.DATETIME_RANGE_OUT,{component:m,props:{type:"datetimerange",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:(e,l,r)=>l&&l!==t.CUSTOM&&(null==r?void 0:r.optSetting)?f(l,"YYYY-MM-DD HH:mm:ss",r.optSetting):e}],[e.CHECKBOX_GROUP,{component:d,props:{},style:{"line-height":"32px"},handlerProps(e,{valueList:l,multiple:t}={}){const r={...e,multiple:t};return Array.isArray(l)&&(r.options=l.map((({value:e,label:l})=>({value:e,label:l})))),r},setDefaultValue:D}],[e.LABEL,{component:y,props:{},handlerProps:e=>({...e}),setDefaultValue:e=>e&&Array.isArray(e)?e.join("|#|"):e}],[e.SELECTLABEL,{component:h,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},handlerProps(e,l={}){const{multiple:t,title:r}=l,a={...e,placeholder:`请选择${r}`};return t&&(a.multiple=!0),a},setDefaultValue:e=>e&&Array.isArray(e)?e.join("|#|"):e}]]);export{T as WidgetCfgMaps};
1
+ import{WidgetTypeEnums as e,WidgetValEnums as l}from"../../types/enums.js";import{DatePresetValEnums as t,DateRangeOutDefEnums as r}from"./enums.js";import{NInputNumber as a}from"naive-ui";import{InputNumberGroup as o,InputCustom as n,Select as p,SelectDynamic as s,DateInner as i,DateOut as u,DateRangeInner as c,DateRangeOut as m,CheckboxGroup as d,LabelInner as y,LabelOut as h}from"./components/index.js";import{presetValToTimestamp as E,formatDateRangeInfo as f}from"./helpers/presetValToTimestamp.js";import{setSelectDynamicValue as M}from"./helpers/setDefaultValue.js";const D=e=>null==e?null:e,T=new Map([[e.INPUT_NUMBER,{component:a,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`输入${l}`}),setDefaultValue:D}],[e.INPUTNUMBER_RANGE,{component:o,props:{clearable:!0},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l,filterExplicit:t}={})=>({...e,startPlaceholder:1===t?`起始${l}`:"最小值",endPlaceholder:1===t?`截止${l}`:"最大值"}),setDefaultValue:D}],[e.INPUT,{component:n,props:{clearable:!0,allowInput:e=>!e.startsWith(" ")&&!e.endsWith(" ")},eventsBySearch:[{name:"keydown",handler(e,l){"Enter"===e.key&&l()}}],handlerProps:(e,{title:l}={})=>({...e,placeholder:`搜索${l}`}),setDefaultValue:D}],[e.SELECT,{component:p,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},eventsBySearch:[{name:"change",handler(e,l,t){const{multiple:r}=t;r&&l()}}],handlerProps(e,{multiple:l,title:t}={}){const r={...e,placeholder:`请选择${t}`};return l&&(r.multiple=!0),r},setDefaultValue:(e,t,r)=>t&&"boolean"==typeof(null==r?void 0:r.multiple)?r.multiple?[l.WHOLE]:l.WHOLE:e}],[e.SELECTDYNAMIC,{component:s,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},eventsBySearch:[{name:"change",handler(e,l,t){const{multiple:r}=t;r&&l()}}],handlerProps(e,l={}){const{multiple:t,title:r}=l,a={...e,placeholder:`请选择${r}`};return t&&(a.multiple=!0),a},setDefaultValue:async(e,l,t)=>l&&(null==t?void 0:t._cfg)?await M(null==t?void 0:t._cfg):e}],[e.DATE,{component:i,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:D}],[e.DATE_OUT,{component:u,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?E(l,"YYYY-MM-DD"):e}],[e.DATE_RANGE_INNER,{component:c,props:{type:"date",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:D}],[e.DATE_RANGE_OUT,{component:m,props:{type:"daterange",clearable:!0,valueFormat:"yyyy-MM-dd"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:(e,l,t)=>l&&l!==r.CUSTOM&&(null==t?void 0:t.optSetting)?f(l,"YYYY-MM-DD",t.optSetting):e}],[e.DATE_TIME,{component:i,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:D}],[e.DATETIME_OUT,{component:u,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t}=l;return{...e,placeholder:`请选择${t}`}},setDefaultValue:(e,l)=>l&&l!==t.CUSTOM?E(l,"YYYY-MM-DD HH:mm:ss"):e}],[e.DATETIME_RANGE_INNER,{component:c,props:{type:"datetime",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:D}],[e.DATETIME_RANGE_OUT,{component:m,props:{type:"datetimerange",clearable:!0,valueFormat:"yyyy-MM-dd HH:mm:ss"},handlerProps(e,l={}){const{title:t,filterExplicit:r}=l;return{...e,filterExplicit:r,startPlaceholder:`起始${t}`,endPlaceholder:`截止${t}`}},setDefaultValue:(e,l,r)=>l&&l!==t.CUSTOM&&(null==r?void 0:r.optSetting)?f(l,"YYYY-MM-DD HH:mm:ss",r.optSetting):e}],[e.CHECKBOX_GROUP,{component:d,props:{},style:{"line-height":"32px"},handlerProps(e,{valueList:l,multiple:t}={}){const r={...e,multiple:t};return Array.isArray(l)&&(r.options=l.map((({value:e,label:l})=>({value:e,label:l})))),r},setDefaultValue:D}],[e.LABEL,{component:y,props:{},handlerProps:e=>({...e}),setDefaultValue:e=>e&&Array.isArray(e)?e.join("|#|"):e}],[e.SELECTLABEL,{component:h,props:{clearable:!0,filterable:!0,multiple:!1,maxTagCount:"responsive"},handlerProps(e,l={}){const{multiple:t,title:r}=l,a={...e,placeholder:`请选择${r}`};return t&&(a.multiple=!0),a},setDefaultValue:e=>e&&Array.isArray(e)?e.join("|#|"):e}]]);export{T as WidgetCfgMaps};
@@ -25,6 +25,7 @@ export default function useAdvanced(): {
25
25
  };
26
26
  rangeFilter: boolean | undefined;
27
27
  unit: any;
28
+ isAccurateSearchVal: boolean;
28
29
  _extendData: IExtendConfigurationType;
29
30
  title: string;
30
31
  alias: string | undefined;
@@ -34,6 +35,7 @@ export default function useAdvanced(): {
34
35
  advanceOptionSetting: string;
35
36
  placeholder: string | undefined;
36
37
  advanceColWidth: number | null | undefined;
38
+ accurateSearch: any;
37
39
  }[];
38
40
  getCacheDef: (item: ISearchType, cacheList: string[]) => string | string[];
39
41
  transformClassifyChild: (conObjList: any, searchFieldList: any[]) => {};
@@ -1 +1 @@
1
- import{WidgetOptionEnums as e,WidgetTypeEnums as i,WidgetValEnums as t}from"../types/enums.js";import{isString as n}from"lodash-es";import{formatDateRangeInfo as l,presetValToTimestamp as o}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as a}from"../components/render-widget/enums.js";const u={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function r(){return{transformData:function(t,n){return t.map((t=>{var l,o,a;const{optionInfo:r={list:[],manualMapping:!0,dynamicOptionInfo:{},showWholeOption:!1},type:E,defaultValue:s,optionType:p,filterExplicit:T,rangeFilter:d}=t,c={},m={title:(f=t).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?u[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width};var f;let g,v,y=E;T?(g=E===i.SELECT&&p===e.MULTIPLE?null==s?void 0:s.valueList:null==(l=null==s?void 0:s.valueList)?void 0:l[0],v=null==s?void 0:s.unit,E===i.LABEL&&(y="SELECTLABEL",g=null==s?void 0:s.valueList),E===i.DATE&&(y="DATE_OUT"),E===i.DATE_TIME&&(y="DATETIME_OUT")):E===i.SELECT&&(null==r?void 0:r.list)&&(null==r?void 0:r.list.length)<10&&(y="CHECKBOX_GROUP"),d&&(E===i.INPUT_NUMBER&&(y="INPUTNUMBER_RANGE"),E===i.DATE&&(y=T?"DATE_RANGE_OUT":"DATE_RANGE_INNER"),E===i.DATE_TIME&&(y=T?"DATETIME_RANGE_OUT":"DATETIME_RANGE_INNER")),E===i.SELECT&&!1===(null==r?void 0:r.manualMapping)&&(y=i.SELECTDYNAMIC);const L={isRender:!0,widgetType:y,originType:E,valueList:null==(o=null==r?void 0:r.list)?void 0:o.map((({name:e,value:i})=>({value:i,label:e}))),defaultValue:g,defValueUnit:v,optionSetting:p,multiple:p===e.MULTIPLE||y===i.SELECTLABEL,manualMapping:null==r?void 0:r.manualMapping,showWholeOption:null==r?void 0:r.showWholeOption,dynamicOptionInfo:null==r?void 0:r.dynamicOptionInfo,classifyStr:null==s?void 0:s.classifyStr,linkageFieldKeys:null!=(a=null==s?void 0:s.linkageFieldKeys)?a:[]};return{...m,fieldType:t.dataType,columnName:t.name,settingObj:c,setting:JSON.stringify(c),widgetCfg:L,rangeFilter:d,unit:null!=v?v:"",_extendData:null!=n?n:{}}}))},getCacheDef:function(e,t){const{widgetType:n,widgetCfg:l}=e;return[i.SELECT,i.CHECKBOX_GROUP,i.SELECTDYNAMIC].includes(n)&&l.multiple?t:t[0]},transformClassifyChild:function(e,t){const n={};return e&&e.length>0&&e.forEach((e=>{const u=e.field_key;n[u]="";const r=t.find((e=>e.name===u));if(r){const t=Array.isArray(e.value)&&r.type===i.SELECT?e.value:e.value.toString();if(n[u]=t,e.unit&&e.unit!==a.CUSTOM){let t="";r.type===i.DATE&&(t=r.rangeFilter?l(e.unit,"YYYY-MM-DD",r.optionType):o(e.unit,"YYYY-MM-DD")),r.type===i.DATE_TIME&&(t=r.rangeFilter?l(e.unit,"YYYY-MM-DD HH:mm:ss",r.optionType):o(e.unit,"YYYY-MM-DD HH:mm:ss")),n[u]=t}}})),n},transformParams:function(e){const l={},o=[i.SELECT,i.SELECTDYNAMIC,i.CHECKBOX_GROUP];return e&&e.length>0&&e.forEach((e=>{const i=e.field_key,a=o.includes(e.widgetType)||e.value&&e.value.length>1?e.value.map((e=>n(e)&&e.includes("&")?e.split("&")[1]:e)):e.value.toString();Array.isArray(a)&&a.length>0&&a.includes(t.WHOLE)||(l[i]=a)})),l}}}export{r as default};
1
+ import{WidgetOptionEnums as e,WidgetTypeEnums as t,WidgetValEnums as i}from"../types/enums.js";import{isString as n}from"lodash-es";import{formatDateRangeInfo as l,presetValToTimestamp as a}from"../components/render-widget/helpers/presetValToTimestamp.js";import{DatePresetValEnums as o}from"../components/render-widget/enums.js";const r={[e.RADIO]:"0",[e.MULTIPLE]:"1",[e.ALL]:"0",[e.SELECT_TIME]:"1",[e.PAST_TIME]:"2",[e.FUTURE_TIME]:"3"};function u(){return{transformData:function(i,n){return i.map((i=>{var l,a,o;const{optionInfo:u={list:[],manualMapping:!0,dynamicOptionInfo:{},showWholeOption:!1},type:s,defaultValue:E,optionType:c,filterExplicit:p,rangeFilter:T}=i,d={},m={title:(f=i).title,alias:f.customTitle,isShowSearch:f.isShowSearch?1:0,filterExplicit:f.filterExplicit?1:0,explicitRequired:f.explicitRequired?1:0,advanceOptionSetting:f.optionType?r[f.optionType]:"",placeholder:f.remark,advanceColWidth:f.width,accurateSearch:f.accurateSearch?f.accurateSearch:{}};var f;let g,y,A=s;p?(g=s===t.SELECT&&c===e.MULTIPLE?null==E?void 0:E.valueList:null==(l=null==E?void 0:E.valueList)?void 0:l[0],y=null==E?void 0:E.unit,s===t.LABEL&&(A="SELECTLABEL",g=null==E?void 0:E.valueList),s===t.DATE&&(A="DATE_OUT"),s===t.DATE_TIME&&(A="DATETIME_OUT")):s===t.SELECT&&(null==u?void 0:u.list)&&(null==u?void 0:u.list.length)<10&&(A="CHECKBOX_GROUP"),T&&(s===t.INPUT_NUMBER&&(A="INPUTNUMBER_RANGE"),s===t.DATE&&(A=p?"DATE_RANGE_OUT":"DATE_RANGE_INNER"),s===t.DATE_TIME&&(A=p?"DATETIME_RANGE_OUT":"DATETIME_RANGE_INNER")),s===t.SELECT&&!1===(null==u?void 0:u.manualMapping)&&(A=t.SELECTDYNAMIC);const v={isRender:!0,widgetType:A,originType:s,valueList:null==(a=null==u?void 0:u.list)?void 0:a.map((({name:e,value:t})=>({value:t,label:e}))),defaultValue:g,defValueUnit:y,optionSetting:c,multiple:c===e.MULTIPLE||A===t.SELECTLABEL,manualMapping:null==u?void 0:u.manualMapping,showWholeOption:null==u?void 0:u.showWholeOption,dynamicOptionInfo:null==u?void 0:u.dynamicOptionInfo,classifyStr:null==E?void 0:E.classifyStr,linkageFieldKeys:null!=(o=null==E?void 0:E.linkageFieldKeys)?o:[]};return{...m,fieldType:i.dataType,columnName:i.name,settingObj:d,setting:JSON.stringify(d),widgetCfg:v,rangeFilter:T,unit:null!=y?y:"",isAccurateSearchVal:!1,_extendData:null!=n?n:{}}}))},getCacheDef:function(e,i){const{widgetType:n,widgetCfg:l}=e;return[t.SELECT,t.CHECKBOX_GROUP,t.SELECTDYNAMIC].includes(n)&&l.multiple?i:i[0]},transformClassifyChild:function(e,i){const n={};return e&&e.length>0&&e.forEach((e=>{const r=e.field_key;n[r]="";const u=i.find((e=>e.name===r));if(u){const i=Array.isArray(e.value)&&u.type===t.SELECT?e.value:e.value.toString();if(n[r]=i,e.unit&&e.unit!==o.CUSTOM){let i="";u.type===t.DATE&&(i=u.rangeFilter?l(e.unit,"YYYY-MM-DD",u.optionType):a(e.unit,"YYYY-MM-DD")),u.type===t.DATE_TIME&&(i=u.rangeFilter?l(e.unit,"YYYY-MM-DD HH:mm:ss",u.optionType):a(e.unit,"YYYY-MM-DD HH:mm:ss")),n[r]=i}}})),n},transformParams:function(e){const l={},a=[t.SELECT,t.SELECTDYNAMIC,t.CHECKBOX_GROUP];return e&&e.length>0&&e.forEach((e=>{const t=e.field_key,o=a.includes(e.widgetType)||e.value&&e.value.length>1?e.value.map((e=>n(e)&&e.includes("&")?e.split("&")[1]:e)):e.value.toString();Array.isArray(o)&&o.length>0&&o.includes(i.WHOLE)||(Object.keys(e).includes("isAccurateSearch")&&(l[e.accurateSearchKey]=e.isAccurateSearch?1:0),l[t]=o)})),l}}}export{u as default};
@@ -3,13 +3,7 @@ export default function (): {
3
3
  isRender: (cfg: ISearchType) => any;
4
4
  getDefValByRenderWidget: (cfg: ISearchType) => Promise<any>;
5
5
  initRenderWidgetCfg: (cfg: ISearchType) => Promise<any>;
6
- getRenderSearchConObj: (cfg: ISearchType) => {
7
- widgetType: any;
8
- field_key: string;
9
- con: string | undefined;
10
- value: any[] | null;
11
- unit: string;
12
- } | null;
6
+ getRenderSearchConObj: (cfg: ISearchType) => any;
13
7
  getDefValByRenderConObj: (conObj: ISearchConfigType, cfg: ISearchType) => any;
14
8
  isExistDefValByRenderWidget: (cfg: ISearchType) => boolean;
15
9
  resetRenderWidgetValue: (cfg: ISearchType) => any;
@@ -1 +1 @@
1
- import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{WidgetTypeEnums as t,WidgetOptionEnums as n}from"../types/enums.js";const i=[t.CHECKBOX_GROUP,t.DATE,t.DATE_TIME,t.DATE_RANGE_INNER,t.DATETIME_RANGE_INNER,t.LABEL];function r(){function r(e){var t;return null==(t=e.widgetCfg)?void 0:t.isRender}async function u(t){const{widgetType:i,defaultValue:r,defValueUnit:u,optionSetting:l,multiple:o}=t.widgetCfg||{},a=e.get(i);let d;if(a){const{setDefaultValue:e}=a;e&&(d=await e(r,u,{optSetting:null!=l?l:n.ALL,multiple:o,_cfg:t}))}return d}return{isRender:r,getDefValByRenderWidget:u,initRenderWidgetCfg:async function(e){const t=r(e);if(!t)return t;const{widgetType:n}=e.widgetCfg||{};return e._frontId||(e._frontId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),e.isRender=t,e.widgetType=n,e.con="EQ",i.includes(n)&&(e._isBlock=!0),1==e.filterExplicit&&(e.value=await u(e)),t},getRenderSearchConObj:function(e){if(!r(e))return null;const{columnName:t,con:n,value:i,widgetType:u,unit:l=""}=e,o=Array.isArray(i)?i:i?[i]:[];return{widgetType:u,field_key:t,con:n,value:o.length>0?o:null,unit:l}},getDefValByRenderConObj:function(e,n){if(!r(n))return null;const{widgetType:i,multiple:u}=n.widgetCfg||{},{value:l}=e;return i!==t.SELECT&&i!==t.CHECKBOX_GROUP||!u?Array.isArray(l)?l[0]:l:Array.isArray(l)?l:l?[l]:[]},isExistDefValByRenderWidget:function(e){const{defaultValue:t,defValueUnit:n}=e.widgetCfg||{};return!(!t&&!n)},resetRenderWidgetValue:function(e){const t=r(e);return t?(e.value=null,t):t}}}export{r as default};
1
+ import{WidgetCfgMaps as e}from"../components/render-widget/widgetCfgMaps.js";import{WidgetTypeEnums as t,WidgetOptionEnums as n}from"../types/enums.js";const r=[t.CHECKBOX_GROUP,t.DATE,t.DATE_TIME,t.DATE_RANGE_INNER,t.DATETIME_RANGE_INNER,t.LABEL];function i(){function i(e){var t;return null==(t=e.widgetCfg)?void 0:t.isRender}async function a(t){const{widgetType:r,defaultValue:i,defValueUnit:a,optionSetting:u,multiple:c}=t.widgetCfg||{},l=e.get(r);let o;if(l){const{setDefaultValue:e}=l;e&&(o=await e(i,a,{optSetting:null!=u?u:n.ALL,multiple:c,_cfg:t}))}return o}return{isRender:i,getDefValByRenderWidget:a,initRenderWidgetCfg:async function(e){const t=i(e);if(!t)return t;const{widgetType:n}=e.widgetCfg||{};return e._frontId||(e._frontId="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),e.isRender=t,e.widgetType=n,e.con="EQ",r.includes(n)&&(e._isBlock=!0),1==e.filterExplicit&&(e.value=await a(e)),t},getRenderSearchConObj:function(e){if(!i(e))return null;const{columnName:t,con:n,value:r,widgetType:a,unit:u=""}=e,c=Array.isArray(r)?r:r?[r]:[],l={widgetType:a,field_key:t,con:n,value:c.length>0?c:null,unit:u};return e.accurateSearch.switchEnable&&(l.isAccurateSearch=e.isAccurateSearchVal,l.accurateSearchKey=e.accurateSearch.searchKey),l},getDefValByRenderConObj:function(e,n){if(!i(n))return null;const{widgetType:r,multiple:a}=n.widgetCfg||{},{value:u}=e;return r!==t.SELECT&&r!==t.CHECKBOX_GROUP||!a?Array.isArray(u)?u[0]:u:Array.isArray(u)?u:u?[u]:[]},isExistDefValByRenderWidget:function(e){const{defaultValue:t,defValueUnit:n}=e.widgetCfg||{};return!(!t&&!n)},resetRenderWidgetValue:function(e){const t=i(e);return t?(e.value=null,t):t}}}export{i as default};
@@ -48,9 +48,4 @@ export declare const transformDataToEnd: (data: IFilterConditionType[]) => ({
48
48
  remark: string | undefined;
49
49
  } | null)[];
50
50
  export declare const transformConditions: (rawConditions: any, params: any[]) => any;
51
- export declare const transformRawConditions: (conditions: any[]) => {
52
- field_key: any;
53
- con: any;
54
- value: any;
55
- unit: any;
56
- }[];
51
+ export declare const transformRawConditions: (conditions: any[]) => any[];
@@ -1 +1 @@
1
- import{DataTypeEnums as e,WidgetTypeEnums as l,WidgetOptionEnums as t}from"../types/enums.js";const i=(i,a=[])=>i===e.API?a.map((e=>{var a,n,u,p,o,r,d,y,v,E,m,f;const s=null!=(n=null==(a=e.optionInfo)?void 0:a.list)?n:[];let T=e.type;return e.type===l.LABEL&&(T=l.SELECTLABEL),e.type===l.SELECT&&!1===(null==(u=null==e?void 0:e.optionInfo)?void 0:u.manualMapping)&&(T=l.SELECTDYNAMIC),e.rangeFilter&&(e.type===l.INPUT_NUMBER&&(T=l.INPUTNUMBER_RANGE),e.type===l.DATE&&(T=l.DATE_RANGE_INNER),e.type===l.DATE_TIME&&(T=l.DATETIME_RANGE_INNER)),{dataType:i,p_name:e.name,p_type:e.dataType,title:e.title,customTitle:e.customTitle,type:T,optionSetting:e.optionType,openAdvancedFilter:e.isShowSearch,filterOutDisplay:e.filterExplicit,filterOutRequired:e.explicitRequired,width:e.width,defValCfg:{value:e.type===l.SELECT&&e.optionType===t.MULTIPLE?null!=(o=null==(p=e.defaultValue)?void 0:p.valueList)?o:[]:null!=(y=null==(d=null==(r=e.defaultValue)?void 0:r.valueList)?void 0:d[0])?y:null,presetVal:e.type===l.SELECT&&e.optionType===t.MULTIPLE?(null==(v=e.defaultValue)?void 0:v.unit)?[null==(E=e.defaultValue)?void 0:E.unit]:[]:null!=(f=null==(m=e.defaultValue)?void 0:m.unit)?f:null},mappingConfig:{mappingMethod:null,mapping:s.map((({name:e,value:l})=>({label:e,value:l})))},remark:e.remark,optionInfo:e.optionInfo,_rawData:e}})):[],a=l=>l.map((l=>{var t;const{title:i,customTitle:a,openAdvancedFilter:n,filterOutDisplay:u,filterOutRequired:p,width:o,optionSetting:r,defValCfg:d,mappingConfig:y,remark:v,_rawData:E}=l,{value:m,presetVal:f}=d,{mapping:s}=y;if(l.dataType===e.API){const{p_name:e,p_type:d,type:y}=l;return{...E,name:e,title:i,customTitle:a,type:y,dataType:d,isShowSearch:n,filterExplicit:u,explicitRequired:p,width:o,optionType:r,defaultValue:{valueList:Array.isArray(m)?m:m?[m]:[],unit:Array.isArray(f)?f[0]:f},optionInfo:{manualMapping:null==(t=null==E?void 0:E.optionInfo)?void 0:t.manualMapping,list:s.map((({label:e,value:l})=>({name:e,value:l})))},remark:v}}return null})).filter((e=>!!e)),n=(e,i)=>e.map((e=>{var a,n;const u=((e,l)=>l.find((l=>l.p_name===e)))(e.field_key,i);let p=e.value;p&&!Array.isArray(p)&&(p=[p]);const o=(null==u?void 0:u.type)!==l.SELECT&&(null==u?void 0:u.type)!==l.SELECTDYNAMIC||(null==u?void 0:u.optionSetting)!==t.MULTIPLE?null!=(a=null==p?void 0:p[0])?a:null:null!=p?p:[];return{key:e.field_key,condition:e.con,value:o,presetVal:null!=(n=e.unit)?n:null}})),u=e=>e.map((e=>({field_key:e.key,con:e.condition,value:Array.isArray(e.value)?e.value:e.value?[e.value]:[],unit:e.presetVal})));export{n as transformConditions,a as transformDataToEnd,i as transformDataToFront,u as transformRawConditions};
1
+ import{DataTypeEnums as e,WidgetTypeEnums as t,WidgetOptionEnums as l}from"../types/enums.js";const a=(a,i=[])=>a===e.API?i.map((e=>{var i,n,u,r,p,o,c,d,y,s,v,E;const m=null!=(n=null==(i=e.optionInfo)?void 0:i.list)?n:[];let f=e.type;return e.type===t.LABEL&&(f=t.SELECTLABEL),e.type===t.SELECT&&!1===(null==(u=null==e?void 0:e.optionInfo)?void 0:u.manualMapping)&&(f=t.SELECTDYNAMIC),e.rangeFilter&&(e.type===t.INPUT_NUMBER&&(f=t.INPUTNUMBER_RANGE),e.type===t.DATE&&(f=t.DATE_RANGE_INNER),e.type===t.DATE_TIME&&(f=t.DATETIME_RANGE_INNER)),{dataType:a,p_name:e.name,p_type:e.dataType,title:e.title,customTitle:e.customTitle,type:f,optionSetting:e.optionType,openAdvancedFilter:e.isShowSearch,filterOutDisplay:e.filterExplicit,filterOutRequired:e.explicitRequired,width:e.width,defValCfg:{value:e.type===t.SELECT&&e.optionType===l.MULTIPLE?null!=(p=null==(r=e.defaultValue)?void 0:r.valueList)?p:[]:null!=(d=null==(c=null==(o=e.defaultValue)?void 0:o.valueList)?void 0:c[0])?d:null,presetVal:e.type===t.SELECT&&e.optionType===l.MULTIPLE?(null==(y=e.defaultValue)?void 0:y.unit)?[null==(s=e.defaultValue)?void 0:s.unit]:[]:null!=(E=null==(v=e.defaultValue)?void 0:v.unit)?E:null},mappingConfig:{mappingMethod:null,mapping:m.map((({name:e,value:t})=>({label:e,value:t})))},remark:e.remark,optionInfo:e.optionInfo,_rawData:e}})):[],i=t=>t.map((t=>{var l;const{title:a,customTitle:i,openAdvancedFilter:n,filterOutDisplay:u,filterOutRequired:r,width:p,optionSetting:o,defValCfg:c,mappingConfig:d,remark:y,_rawData:s}=t,{value:v,presetVal:E}=c,{mapping:m}=d;if(t.dataType===e.API){const{p_name:e,p_type:c,type:d}=t;return{...s,name:e,title:a,customTitle:i,type:d,dataType:c,isShowSearch:n,filterExplicit:u,explicitRequired:r,width:p,optionType:o,defaultValue:{valueList:Array.isArray(v)?v:v?[v]:[],unit:Array.isArray(E)?E[0]:E},optionInfo:{manualMapping:null==(l=null==s?void 0:s.optionInfo)?void 0:l.manualMapping,list:m.map((({label:e,value:t})=>({name:e,value:t})))},remark:y}}return null})).filter((e=>!!e)),n=(e,a)=>e.map((e=>{var i,n;const u=((e,t)=>t.find((t=>t.p_name===e)))(e.field_key,a);let r=e.value;r&&!Array.isArray(r)&&(r=[r]);const p=(null==u?void 0:u.type)!==t.SELECT&&(null==u?void 0:u.type)!==t.SELECTDYNAMIC||(null==u?void 0:u.optionSetting)!==l.MULTIPLE?null!=(i=null==r?void 0:r[0])?i:null:null!=r?r:[],o={key:e.field_key,condition:e.con,value:p,presetVal:null!=(n=e.unit)?n:null};return Object.keys(e).includes("isAccurateSearch")&&(o.isAccurateSearch=e.isAccurateSearch,o.accurateSearchKey=e.accurateSearchKey),o})),u=e=>e.map((e=>{const t={field_key:e.key,con:e.condition,value:Array.isArray(e.value)?e.value:e.value?[e.value]:[],unit:e.presetVal};return Object.keys(e).includes("isAccurateSearch")&&(t.isAccurateSearch=e.isAccurateSearch,t.accurateSearchKey=e.accurateSearchKey),t}));export{n as transformConditions,i as transformDataToEnd,a as transformDataToFront,u as transformRawConditions};