cnhis-design-vue 3.1.45 → 3.1.46-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/es/components/base-search/index.d.ts +11 -7
  2. package/es/components/base-search/src/index.vue.d.ts +11 -7
  3. package/es/components/base-search/src/index.vue2.js +1 -1
  4. package/es/components/base-search/style/index.css +1 -1
  5. package/es/components/button-print/src/utils/print.d.ts +1 -1
  6. package/es/components/button-print/src/utils/print.js +1 -1
  7. package/es/components/classification/index.d.ts +219 -18
  8. package/es/components/classification/src/components/search-filter/index.vue.d.ts +219 -18
  9. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  10. package/es/components/classification/src/components/set-classification/index.vue.d.ts +219 -18
  11. package/es/components/classification/src/index.vue.d.ts +219 -18
  12. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  13. package/es/components/field-set/style/index.css +1 -1
  14. package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +77 -0
  15. package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +93 -0
  16. package/es/components/form-render/src/components/renderer/select.js +1 -1
  17. package/es/components/form-render/style/index.css +1 -1
  18. package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +3 -0
  19. package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +3 -0
  20. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +3 -0
  21. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +3 -0
  22. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +3 -0
  23. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/dist/index.d.ts +3 -0
  24. package/es/components/iho-table/src/utils/dist/index.d.ts +44 -0
  25. package/es/components/index.css +1 -1
  26. package/es/components/quick-search/index.d.ts +14 -6
  27. package/es/components/quick-search/src/index.vue.d.ts +14 -6
  28. package/es/components/quick-search/src/index.vue2.js +1 -1
  29. package/es/components/quick-search/style/index.css +1 -1
  30. package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +36 -0
  31. package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +36 -0
  32. package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +82 -0
  33. package/es/components/search-cascader/index.d.ts +2 -0
  34. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +2 -0
  35. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  36. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  37. package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +57 -0
  38. package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +57 -0
  39. package/es/components/search-cascader/style/index.css +1 -1
  40. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +219 -17
  41. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  42. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +17 -1
  43. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  44. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +19 -0
  45. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  46. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +178 -11
  47. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  48. package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue.d.ts +1 -5
  49. package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue2.js +1 -1
  50. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue.d.ts +2 -1
  51. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue2.js +1 -1
  52. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +217 -17
  53. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  54. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +219 -17
  55. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  56. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +218 -0
  57. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.js +1 -0
  58. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -0
  59. package/es/components/table-filter/src/components/render-widget/components/{Date.vue.d.ts → DateOut.vue.d.ts} +21 -2
  60. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.js +1 -0
  61. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +1 -0
  62. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.d.ts +71 -0
  63. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.js +1 -0
  64. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue2.js +1 -0
  65. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +99 -5
  66. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  67. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -9
  68. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  69. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue.d.ts +8 -6
  70. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  71. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue.d.ts +7 -6
  72. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -1
  73. package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +19 -25
  74. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
  75. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +223 -0
  76. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.js +1 -0
  77. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -0
  78. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +158 -0
  79. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.js +1 -0
  80. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -0
  81. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +580 -33
  82. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  83. package/es/components/table-filter/src/components/render-widget/enums.d.ts +10 -3
  84. package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
  85. package/es/components/table-filter/src/components/render-widget/helpers/dateDisabled.d.ts +27 -0
  86. package/es/components/table-filter/src/components/render-widget/helpers/dateDisabled.js +1 -0
  87. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.d.ts +55 -0
  88. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -0
  89. package/es/components/table-filter/src/components/render-widget/helpers/enums.d.ts +56 -0
  90. package/es/components/table-filter/src/components/render-widget/helpers/enums.js +1 -0
  91. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +2 -6
  92. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -1
  93. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.d.ts +4 -0
  94. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -0
  95. package/es/components/table-filter/src/components/render-widget/helpers/setDefaultValue.d.ts +4 -0
  96. package/es/components/table-filter/src/components/render-widget/helpers/setDefaultValue.js +1 -0
  97. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +1 -3
  98. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  99. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +608 -32
  100. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  101. package/es/components/table-filter/src/constants/index.d.ts +3 -1
  102. package/es/components/table-filter/src/constants/index.js +1 -1
  103. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +8 -4
  104. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  105. package/es/components/table-filter/src/hooks/useAsyncData.d.ts +4 -0
  106. package/es/components/table-filter/src/hooks/useAsyncData.js +1 -0
  107. package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +2 -2
  108. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  109. package/es/components/table-filter/src/tool/baseOptions.d.ts +0 -8
  110. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  111. package/es/components/table-filter/src/tool/transformData.d.ts +0 -1
  112. package/es/components/table-filter/src/tool/transformData.js +1 -1
  113. package/es/components/table-filter/src/types/enums.d.ts +3 -0
  114. package/es/components/table-filter/src/types/enums.js +1 -1
  115. package/es/components/table-filter/src/types/index.d.ts +6 -0
  116. package/es/shared/package.json.js +1 -1
  117. package/package.json +2 -2
  118. package/es/components/table-filter/src/components/render-widget/basicData.d.ts +0 -4
  119. package/es/components/table-filter/src/components/render-widget/basicData.js +0 -1
  120. package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +0 -1
  121. package/es/components/table-filter/src/components/render-widget/components/Date.vue2.js +0 -1
  122. package/es/components/table-filter/src/tool/generateDefOptions.d.ts +0 -7
  123. package/es/components/table-filter/src/tool/generateDefOptions.js +0 -1
@@ -37,27 +37,31 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
37
37
  } | null;
38
38
  resetRenderWidgetValue: (cfg: import("..").ISearchType) => any;
39
39
  isRender: (cfg: import("..").ISearchType) => any;
40
- transformData: (advancedFilterData: import("..").IApiServerType[]) => {
40
+ transformData: (advancedFilterData: import("..").IApiServerType[], extendData: import("..").IExtendConfigurationType) => {
41
41
  fieldType: string;
42
42
  columnName: string;
43
43
  settingObj: {};
44
44
  setting: string;
45
45
  widgetCfg: {
46
46
  isRender: boolean;
47
- isInit: boolean;
48
47
  widgetType: string | null;
48
+ originType: string | null;
49
49
  valueList: {
50
50
  value: any;
51
51
  label: any;
52
52
  }[] | undefined;
53
53
  defaultValue: any;
54
54
  defValueUnit: any;
55
+ optionSetting: string | undefined;
55
56
  multiple: boolean;
56
57
  manualMapping: boolean | null | undefined;
58
+ showWholeOption: boolean | undefined;
57
59
  dynamicOptionInfo: import("..").dynamicOptionInfoType | {} | undefined;
58
60
  classifyStr: string | undefined;
61
+ linkageFieldKeys: string[];
59
62
  };
60
63
  rangeFilter: boolean | undefined;
64
+ _extendData: import("..").IExtendConfigurationType;
61
65
  title: string;
62
66
  alias: string | undefined;
63
67
  isShowSearch: number;
@@ -68,7 +72,7 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
68
72
  advanceColWidth: number | null | undefined;
69
73
  }[];
70
74
  getCacheDef: (item: import("..").ISearchType, cacheList: string[]) => string | string[];
71
- transformParams: (paramsList: any) => {};
75
+ transformParams: (paramsList: any[]) => {};
72
76
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
73
77
  searchFieldList: {
74
78
  type: import("vue").PropType<import("..").IApiServerType[]>;
@@ -111,6 +115,9 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
111
115
  setting?: any;
112
116
  widgetCfg?: any;
113
117
  rangeFilter?: boolean | undefined;
118
+ _extendData?: {
119
+ _filterApiConfig: any;
120
+ } | undefined;
114
121
  _frontId?: any;
115
122
  isRender?: boolean | undefined;
116
123
  widgetType?: any;
@@ -146,6 +153,9 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
146
153
  setting?: any;
147
154
  widgetCfg?: any;
148
155
  rangeFilter?: boolean | undefined;
156
+ _extendData?: {
157
+ _filterApiConfig: any;
158
+ } | undefined;
149
159
  _frontId?: any;
150
160
  isRender?: boolean | undefined;
151
161
  widgetType?: any;
@@ -497,8 +507,7 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
497
507
  [key: string]: any;
498
508
  }> | null;
499
509
  handleUpdate(val: any): void;
500
- handleChangeInitState(_frontId: any, bool: any): void;
501
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "outFilterChange" | "changeInit")[], "update:modelValue" | "outFilterChange" | "changeInit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
510
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "outFilterChange")[], "update:modelValue" | "outFilterChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
502
511
  cfg: {
503
512
  type: ObjectConstructor;
504
513
  required: true;
@@ -509,7 +518,6 @@ declare const CQuickSearch: SFCWithInstall<import("vue").DefineComponent<{
509
518
  }>> & {
510
519
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
511
520
  onOutFilterChange?: ((...args: any[]) => any) | undefined;
512
- onChangeInit?: ((...args: any[]) => any) | undefined;
513
521
  }, {}>;
514
522
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onFilterSearch" | "getFilterParam" | "clearQuickSearchConfig")[], "onFilterSearch" | "getFilterParam" | "clearQuickSearchConfig", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
515
523
  searchFieldList: {
@@ -39,27 +39,31 @@ declare const _default: import("vue").DefineComponent<{
39
39
  } | null;
40
40
  resetRenderWidgetValue: (cfg: ISearchType) => any;
41
41
  isRender: (cfg: ISearchType) => any;
42
- transformData: (advancedFilterData: IApiServerType[]) => {
42
+ transformData: (advancedFilterData: IApiServerType[], extendData: import("../../../../es/components/table-filter/src/types").IExtendConfigurationType) => {
43
43
  fieldType: string;
44
44
  columnName: string;
45
45
  settingObj: {};
46
46
  setting: string;
47
47
  widgetCfg: {
48
48
  isRender: boolean;
49
- isInit: boolean;
50
49
  widgetType: string | null;
50
+ originType: string | null;
51
51
  valueList: {
52
52
  value: any;
53
53
  label: any;
54
54
  }[] | undefined;
55
55
  defaultValue: any;
56
56
  defValueUnit: any;
57
+ optionSetting: string | undefined;
57
58
  multiple: boolean;
58
59
  manualMapping: boolean | null | undefined;
60
+ showWholeOption: boolean | undefined;
59
61
  dynamicOptionInfo: import("../../../../es/components/table-filter/src/types").dynamicOptionInfoType | {} | undefined;
60
62
  classifyStr: string | undefined;
63
+ linkageFieldKeys: string[];
61
64
  };
62
65
  rangeFilter: boolean | undefined;
66
+ _extendData: import("../../../../es/components/table-filter/src/types").IExtendConfigurationType;
63
67
  title: string;
64
68
  alias: string | undefined;
65
69
  isShowSearch: number;
@@ -70,7 +74,7 @@ declare const _default: import("vue").DefineComponent<{
70
74
  advanceColWidth: number | null | undefined;
71
75
  }[];
72
76
  getCacheDef: (item: ISearchType, cacheList: string[]) => string | string[];
73
- transformParams: (paramsList: any) => {};
77
+ transformParams: (paramsList: any[]) => {};
74
78
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
75
79
  searchFieldList: {
76
80
  type: PropType<IApiServerType[]>;
@@ -113,6 +117,9 @@ declare const _default: import("vue").DefineComponent<{
113
117
  setting?: any;
114
118
  widgetCfg?: any;
115
119
  rangeFilter?: boolean | undefined;
120
+ _extendData?: {
121
+ _filterApiConfig: any;
122
+ } | undefined;
116
123
  _frontId?: any;
117
124
  isRender?: boolean | undefined;
118
125
  widgetType?: any;
@@ -148,6 +155,9 @@ declare const _default: import("vue").DefineComponent<{
148
155
  setting?: any;
149
156
  widgetCfg?: any;
150
157
  rangeFilter?: boolean | undefined;
158
+ _extendData?: {
159
+ _filterApiConfig: any;
160
+ } | undefined;
151
161
  _frontId?: any;
152
162
  isRender?: boolean | undefined;
153
163
  widgetType?: any;
@@ -499,8 +509,7 @@ declare const _default: import("vue").DefineComponent<{
499
509
  [key: string]: any;
500
510
  }> | null;
501
511
  handleUpdate(val: any): void;
502
- handleChangeInitState(_frontId: any, bool: any): void;
503
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "outFilterChange" | "changeInit")[], "update:modelValue" | "outFilterChange" | "changeInit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
512
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "outFilterChange")[], "update:modelValue" | "outFilterChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
504
513
  cfg: {
505
514
  type: ObjectConstructor;
506
515
  required: true;
@@ -511,7 +520,6 @@ declare const _default: import("vue").DefineComponent<{
511
520
  }>> & {
512
521
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
513
522
  onOutFilterChange?: ((...args: any[]) => any) | undefined;
514
- onChangeInit?: ((...args: any[]) => any) | undefined;
515
523
  }, {}>;
516
524
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onFilterSearch" | "getFilterParam" | "clearQuickSearchConfig")[], "onFilterSearch" | "getFilterParam" | "clearQuickSearchConfig", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
517
525
  searchFieldList: {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,provide as a,computed as t,watch as i,onMounted as n,openBlock as o,createElementBlock as s,createElementVNode as r,Fragment as c,renderList as u,unref as d,normalizeClass as v,createCommentVNode as f,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as _,NCard as A,NIcon as q,NButton as w,NForm as F,NFormItem as j,NInput as I}from"naive-ui";import{CloseOutline as E,AddOutline as L}from"@vicons/ionicons5";import R from"../../table-filter/src/hooks/useMixins.js";import U from"../../table-filter/src/hooks/useRenderWidget.js";import V from"../../table-filter/src/hooks/useAdvanced.js";import z from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as D}from"lodash-es";import{InjectionFilterApiConfig as T}from"../../table-filter/src/constants/index.js";const B={class:"quick-search-block quick-search-table"},N={class:"quick-row"},O={class:"quick-item-title"},P={class:"quick-item-col"},Q={class:"svg-wrap"},M={class:"flex_right"},W={class:"class-filter-content"},G={class:"quickSearch-content"},J=r("span",{class:"label"},"父类名称:",-1),H=["onDblclick","onClick"],K={key:0,class:"s-content"};var X=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:X,emit:Y}){const Z=e,$={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},ee=S(),{handleGetConfigApi:le,outQuickSearchFn:ae}=R(),{getRenderSearchConObj:te,resetRenderWidgetValue:ie,isRender:ne}=U(),{transformData:oe,getCacheDef:se,transformParams:re}=V(),ce=l(null),ue=l({classname:""});let de=l(!1),ve=l([]),fe=l([]),me=l(!1),pe=l("");a(T,Z.filterApiConfig);let he=t((()=>!!fe.value.length&&fe.value.some((e=>e.isAdd)))),ge=t((()=>(e,l="name")=>e.alias||e[l]));function ke(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let a=0;a<e.length;a++){let t=e[a];const i=te(t);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ve.value)||[]}function be(){var e;null==(e=ce.value)||e.validate((e=>{var l;if(e)return;let a=ke();a.length||(a=[]);let t=null==(l=fe.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await le(e,"requestSaveTableCondiTion",{},Z.filterApiConfig))return;de.value=!1,null==(l=ce.value)||l.restoreValidation(),ue.value.classname="",fe.value=[],_e()}catch(e){console.log(e)}}({tableId:Z.tableId||"",setting:JSON.stringify({displayCategory:t,name:ue.value.classname,conObj:a}),conditionList:"[]"})}))}function ye(e){var l;const a=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{a&&a.focus()})),me.value=!0}function Ce(){me.value=!1,pe.value&&(fe.value.forEach((e=>e.selected=!1)),fe.value.push({disabled:!0,value:pe.value,selected:!0,isAdd:!0}),pe.value="")}function Se(e){!function(e){fe.value.splice(e,1)}(e)}function xe(){de.value=!1}function _e(){Ae(ve.value),Y("clearQuickSearchConfig")}function Ae(e){Array.isArray(e)&&(e.forEach((e=>{ie(e)})),ae.handlerInitSearchItem(ve.value))}return i((()=>Z.searchFieldList),(e=>{e&&e.length>0&&function(){let e=D(oe(Z.searchFieldList)).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ve.value=e||[],ae.handlerInitSearchItem(ve.value)}()}),{immediate:!0,deep:!0}),i((()=>ve),(()=>{const e=ke()||[],l=re(e);Y("getFilterParam",e,l)}),{deep:!0}),n((()=>{const e=Z.quickSearchConfig;if(e&&e.length>0)return l=e,void ve.value.forEach((e=>{var a;if(ne(e)){const t=l.find((l=>l.field_key===e.columnName));t&&(null==(a=t.value)?void 0:a.length)>0&&(e.value=se(e,t.value))}}));var l;Ae(ve.value)})),X({openSaveToCalss:function(){let e=ke();e&&(e.length>0?de.value=!0:ee.warning("请设置搜索条件"))},clearData:_e,onFilterSearch:function(){let e=ke()||[];const l=re(e);return Y("onFilterSearch",e,l,!1),ve.value}}),(e,l)=>(o(),s("div",null,[r("div",B,[(o(!0),s(c,null,u(d(ve),(e=>(o(),s("div",{class:v(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[r("div",N,[f(" title "),r("div",O,[m(d(x),{trigger:"hover"},{trigger:p((()=>[h(g(d(ge)(e,"title")),1)])),default:p((()=>[r("span",null,g(d(ge)(e,"title")),1)])),_:2},1024)]),f(" content "),r("div",P,[f(" 直接渲染组件 "),e.isRender?(o(),k(z,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l},null,8,["cfg","modelValue","onUpdate:modelValue"])):f("v-if",!0)])])],2)))),128))]),f(" 保存到分类的弹窗 "),m(d(_),{show:d(de),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:be,onNegativeClick:xe,class:"classification-modal-block"},{default:p((()=>[m(d(A),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[r("div",Q,[m(d(q),{component:d(E),size:"24",onClick:xe},null,8,["component"])])])),footer:p((()=>[r("div",M,[m(d(w),{onClick:xe},{default:p((()=>[h("取消")])),_:1}),m(d(w),{type:"info",onClick:be},{default:p((()=>[h("确认")])),_:1})])])),default:p((()=>[r("div",W,[m(d(F),{ref_key:"formRef",ref:ce,"label-placement":"left",rules:$,model:ue.value},{default:p((()=>[m(d(j),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(I),{value:ue.value.classname,"onUpdate:value":l[0]||(l[0]=e=>ue.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),r("div",G,[J,(o(!0),s(c,null,u(d(fe),((e,l)=>(o(),s("div",{class:v(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:a=>function(e,l){e.disabled&&(fe.value.forEach(((e,a)=>{a!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(o(),s("div",K,[r("span",null,g(e.value),1)])):(o(),k(d(I),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),m(d(q),{component:d(E),class:"anticon-close",size:"20",onClick:e=>Se(l)},null,8,["component","onClick"])],42,H)))),128)),d(he)?f("v-if",!0):(o(),s(c,{key:0},[b(m(d(w),{dashed:"",icon:"plus",class:"ant-btn",onClick:ye},{default:p((()=>[m(d(q),{component:d(L),size:"20"},null,8,["component"]),h("添加分类 ")])),_:1},512),[[y,!d(me)]]),b(m(d(I),{style:{width:"100px"},class:"edit-tag",value:d(pe),"onUpdate:value":l[1]||(l[1]=e=>C(pe)?pe.value=e:pe=e),valueModifiers:{trim:!0},onBlur:Ce,maxLength:10},null,8,["value"]),[[y,d(me)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{X as default};
1
+ import{defineComponent as e,ref as l,provide as a,computed as t,watch as i,onMounted as n,openBlock as o,createElementBlock as s,createElementVNode as r,Fragment as c,renderList as u,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as _,NCard as A,NIcon as q,NButton as w,NForm as F,NFormItem as j,NInput as I}from"naive-ui";import{CloseOutline as E,AddOutline as L}from"@vicons/ionicons5";import R from"../../table-filter/src/hooks/useMixins.js";import U from"../../table-filter/src/hooks/useRenderWidget.js";import V from"../../table-filter/src/hooks/useAdvanced.js";import z from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as D}from"lodash-es";import{InjectionFilterApiConfig as T,InjectionFilterSearchConfig as B}from"../../table-filter/src/constants/index.js";const N={class:"quick-search-block quick-search-table"},O={class:"quick-row"},P={class:"quick-item-title"},Q={class:"quick-item-col"},M={class:"svg-wrap"},W={class:"flex_right"},G={class:"class-filter-content"},J={class:"quickSearch-content"},H=r("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],X={key:0,class:"s-content"};var Y=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:Y,emit:Z}){const $=e,ee={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},le=S(),{handleGetConfigApi:ae,outQuickSearchFn:te}=R(),{getRenderSearchConObj:ie,resetRenderWidgetValue:ne,isRender:oe}=U(),{transformData:se,getCacheDef:re,transformParams:ce}=V(),ue=l(null),de=l({classname:""});let fe=l(!1),ve=l([]),me=l([]),pe=l(!1),he=l("");a(T,$.filterApiConfig),a(B,ve);let ge=t((()=>!!me.value.length&&me.value.some((e=>e.isAdd)))),ke=t((()=>(e,l="name")=>e.alias||e[l]));function be(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let a=0;a<e.length;a++){let t=e[a];const i=ie(t);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ve.value)||[]}function ye(){var e;null==(e=ue.value)||e.validate((e=>{var l;if(e)return;let a=be();a.length||(a=[]);let t=null==(l=me.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await ae(e,"requestSaveTableCondiTion",{},$.filterApiConfig))return;fe.value=!1,null==(l=ue.value)||l.restoreValidation(),de.value.classname="",me.value=[],Ae()}catch(e){console.log(e)}}({tableId:$.tableId||"",setting:JSON.stringify({displayCategory:t,name:de.value.classname,conObj:a}),conditionList:"[]"})}))}function Ce(e){var l;const a=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{a&&a.focus()})),pe.value=!0}function Se(){pe.value=!1,he.value&&(me.value.forEach((e=>e.selected=!1)),me.value.push({disabled:!0,value:he.value,selected:!0,isAdd:!0}),he.value="")}function xe(e){!function(e){me.value.splice(e,1)}(e)}function _e(){fe.value=!1}function Ae(){qe(ve.value),Z("clearQuickSearchConfig")}function qe(e){Array.isArray(e)&&(e.forEach((e=>{ne(e)})),te.handlerInitSearchItem(ve.value))}return i((()=>$.searchFieldList),(e=>{e&&e.length>0&&function(){let e=D(se($.searchFieldList,{_filterApiConfig:$.filterApiConfig})).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ve.value=e||[],te.handlerInitSearchItem(ve.value)}()}),{immediate:!0,deep:!0}),i((()=>ve),(()=>{const e=be()||[],l=ce(e);Z("getFilterParam",e,l)}),{deep:!0}),n((()=>{const e=$.quickSearchConfig;if(e&&e.length>0)return l=e,void ve.value.forEach((e=>{var a;if(oe(e)){const t=l.find((l=>l.field_key===e.columnName));t&&(null==(a=t.value)?void 0:a.length)>0&&(e.value=re(e,t.value))}}));var l;qe(ve.value)})),Y({openSaveToCalss:function(){let e=be();e&&(e.length>0?fe.value=!0:le.warning("请设置搜索条件"))},clearData:Ae,onFilterSearch:function(){let e=be()||[];const l=ce(e);return Z("onFilterSearch",e,l,!1),ve.value}}),(e,l)=>(o(),s("div",null,[r("div",N,[(o(!0),s(c,null,u(d(ve),(e=>(o(),s("div",{class:f(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[r("div",O,[v(" title "),r("div",P,[m(d(x),{trigger:"hover"},{trigger:p((()=>[h(g(d(ke)(e,"title")),1)])),default:p((()=>[r("span",null,g(d(ke)(e,"title")),1)])),_:2},1024)]),v(" content "),r("div",Q,[v(" 直接渲染组件 "),e.isRender?(o(),k(z,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l},null,8,["cfg","modelValue","onUpdate:modelValue"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),m(d(_),{show:d(fe),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:ye,onNegativeClick:_e,class:"classification-modal-block"},{default:p((()=>[m(d(A),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[r("div",M,[m(d(q),{component:d(E),size:"24",onClick:_e},null,8,["component"])])])),footer:p((()=>[r("div",W,[m(d(w),{onClick:_e},{default:p((()=>[h("取消")])),_:1}),m(d(w),{type:"info",onClick:ye},{default:p((()=>[h("确认")])),_:1})])])),default:p((()=>[r("div",G,[m(d(F),{ref_key:"formRef",ref:ue,"label-placement":"left",rules:ee,model:de.value},{default:p((()=>[m(d(j),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(I),{value:de.value.classname,"onUpdate:value":l[0]||(l[0]=e=>de.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),r("div",J,[H,(o(!0),s(c,null,u(d(me),((e,l)=>(o(),s("div",{class:f(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:a=>function(e,l){e.disabled&&(me.value.forEach(((e,a)=>{a!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(o(),s("div",X,[r("span",null,g(e.value),1)])):(o(),k(d(I),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),m(d(q),{component:d(E),class:"anticon-close",size:"20",onClick:e=>xe(l)},null,8,["component","onClick"])],42,K)))),128)),d(ge)?v("v-if",!0):(o(),s(c,{key:0},[b(m(d(w),{dashed:"",icon:"plus",class:"ant-btn",onClick:Ce},{default:p((()=>[m(d(q),{component:d(L),size:"20"},null,8,["component"]),h("添加分类 ")])),_:1},512),[[y,!d(pe)]]),b(m(d(I),{style:{width:"100px"},class:"edit-tag",value:d(he),"onUpdate:value":l[1]||(l[1]=e=>C(he)?he.value=e:he=e),valueModifiers:{trim:!0},onBlur:Se,maxLength:10},null,8,["value"]),[[y,d(pe)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{Y as default};
@@ -1 +1 @@
1
- .classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter{cursor:pointer;font-size:18px}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter:last-child{margin-left:16px}.classification-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.classification-modal-block .n-card__content{overflow-y:auto}.classification-modal-block .n-card__content .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-title .list-title-item{font-weight:700;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content{padding:0}.classification-modal-block .n-card__content .table-modal-list .list-content li{display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item{align-items:center;display:flex;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item .n-icon{cursor:pointer;margin-right:8px}.classification-modal-block .n-card__content .table-modal-list .list-content li.checked,.classification-modal-block .n-card__content .table-modal-list .list-content li.checked .text{background-color:#f2f2f2}.classification-modal-block .n-card__content .table-modal-list .list-content li .text{background-color:#fff;display:inline-block;padding:0 10px;position:relative}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line{position:relative;text-align:center;width:75%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line:before{border:1px solid #e8e8e8;content:"";left:0;margin-top:20px;position:absolute;width:100%}.classification-modal-block .n-card__content .table-modal-list .list-title-item{margin-left:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item{border-bottom:1px solid #e1dfdf;margin-left:-1px;margin-top:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch{height:16px;min-width:28px;width:28px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch:after{height:12px;width:12px}.classification-modal-block .n-card__content .table-modal-list .list-content-radio,.classification-modal-block .n-card__content .table-modal-list .list-content-switch{text-align:center}.classification-modal-block .n-card__content .table-modal-list .anticon+.anticon{margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .item-name{display:flex;height:32px;line-height:32px;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .item-name .label{text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .item-name .addAction{align-items:center;cursor:pointer;display:flex}.classification-modal-block .n-card__content .class-filter-content .item-name .blue{color:#2d7aff;margin-right:8px}.classification-modal-block .n-card__content .class-filter-content .n-form-item-label{width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content{align-items:center;display:flex;flex-wrap:wrap;line-height:32px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .label{display:inline-block;height:32px;line-height:32px;margin-bottom:10px;text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn-dashed{border-color:#a6a6a6;color:#a6a6a6}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag{margin-bottom:10px;margin-right:10px;position:relative}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .anticon-close{color:#2d7aff;cursor:pointer;line-height:36px;position:absolute;right:5px;top:2px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content{align-items:center;background-color:rgba(45,122,255,.1);border:1px solid #2d7aff;border-radius:3px;box-sizing:border-box;color:#2d7aff;cursor:pointer;display:flex;justify-content:center;opacity:1;padding:0 10px;width:100px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .ant-input-disabled,.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .s-content{background-color:#2d7aff;color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .anticon-close{color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn{margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list{border-top:1px solid #e6e6e6;margin-bottom:6px;margin-top:16px;padding-top:12px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li{align-items:center;display:flex;list-style:none;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .index-span{display:inline-block;width:30px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item{margin-right:10px;width:120px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item.n-date-picker{width:auto}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper{display:flex}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper .form-item{margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .delete-item-icon{color:red;cursor:pointer;font-size:18px;margin-left:8px}.classification-modal-block .n-card__footer{padding-top:10px}.classification-modal-block .n-card__footer .flex_between{display:flex;justify-content:space-between}.classification-modal-block .n-card__footer .flex_right{display:flex;justify-content:right}.classification-modal-block .n-card__footer .n-button{margin-left:8px}.render-widget-input-number-group{align-items:center;display:flex}.render-widget-input-number-group .divider{text-align:center;width:24px}.n-base-select-option__content{width:100%}.n-base-select-option__content .select-widget-dynamic-option{display:flex;flex-wrap:nowrap;width:100%}.n-base-select-option__content .select-widget-dynamic-option .select-widget-dynamic-item{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.render-widget-date-range{align-items:center;display:flex;flex-wrap:nowrap;width:100%}.render-widget-date-range .radio-date-group{border:1px solid #d9d9d9;display:flex;min-width:720px}.render-widget-date-range .radio-date-group .radio-date-item{border-left:1px solid #d9d9d9;cursor:pointer;height:30px;line-height:30px;padding:0 8px}.render-widget-date-range .radio-date-group .radio-date-item:first-child{border:none}.render-widget-date-range .radio-date-group .radio-date-item.radio-date-item-active{background:#3e65cf;border-color:#3e65cf;color:#fff}.render-widget-date-range .select-date-left{margin-left:16px}.render-widget-date-range .select-date-right{margin-right:16px}.render-widget-date-range .date-detail-range{display:flex;flex-wrap:nowrap}.render-widget-date-range .date-detail-range .divider{text-align:center;width:10px}.label-attr-filter-container .edit-f-label{font-size:14px;line-height:32px;padding-left:0}.label-attr-filter-container .edit-f-content.label-select-height{flex:none;height:74px;overflow:hidden}.label-attr-filter-container .edit-f-content .label-f-content{display:flex;flex-wrap:wrap}.label-attr-filter-container .edit-f-content .label-f-content .n-tag{border:1px solid #e0e0e6;height:32px;margin:0 8px 8px 0;max-width:108px;text-align:center}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.label-attr-filter-container .label-f-unfold-btn{margin:8px 0}.label-attr-filter-container .label-f-unfold-btn .operate-btn{align-items:center;cursor:pointer;display:flex}.label-attr-filter-container .label-f-unfold-btn .operate-btn .n-icon{margin-left:6px}.quick-search-block .quick-item{margin-bottom:10px;min-width:32px;width:20%}.quick-search-block .quick-item .quick-row{display:flex}.quick-search-block .quick-item .quick-row .quick-item-title{box-sizing:border-box;flex-basis:134px;line-height:32px;min-width:130px;overflow:hidden;padding-left:4px;padding-right:4px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.quick-search-block .quick-item .quick-row .quick-item-col{align-items:center;display:flex;padding:0 4px;width:calc(100% - 134px)}.quick-search-block .quick-item .quick-row .quick-item-title-default{width:25%}.quick-search-block .quick-item .quick-row .quick-item-col-default{width:75%}.quick-search-block.quick-search-table .quick-item{display:inline-block}.quick-search-block.quick-search-table .quick-item.quick-block{display:block;width:100%}
1
+ .classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter{cursor:pointer;font-size:18px}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter:last-child{margin-left:16px}.classification-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.classification-modal-block .n-card__content{overflow-y:auto}.classification-modal-block .n-card__content .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-title .list-title-item{font-weight:700;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content{padding:0}.classification-modal-block .n-card__content .table-modal-list .list-content li{display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item{align-items:center;display:flex;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item .n-icon{cursor:pointer;margin-right:8px}.classification-modal-block .n-card__content .table-modal-list .list-content li.checked,.classification-modal-block .n-card__content .table-modal-list .list-content li.checked .text{background-color:#f2f2f2}.classification-modal-block .n-card__content .table-modal-list .list-content li .text{background-color:#fff;display:inline-block;padding:0 10px;position:relative}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line{position:relative;text-align:center;width:75%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line:before{border:1px solid #e8e8e8;content:"";left:0;margin-top:20px;position:absolute;width:100%}.classification-modal-block .n-card__content .table-modal-list .list-title-item{margin-left:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item{border-bottom:1px solid #e1dfdf;margin-left:-1px;margin-top:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch{height:16px;min-width:28px;width:28px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch:after{height:12px;width:12px}.classification-modal-block .n-card__content .table-modal-list .list-content-radio,.classification-modal-block .n-card__content .table-modal-list .list-content-switch{text-align:center}.classification-modal-block .n-card__content .table-modal-list .anticon+.anticon{margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .item-name{display:flex;height:32px;line-height:32px;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .item-name .label{text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .item-name .addAction{align-items:center;cursor:pointer;display:flex}.classification-modal-block .n-card__content .class-filter-content .item-name .blue{color:#2d7aff;margin-right:8px}.classification-modal-block .n-card__content .class-filter-content .n-form-item-label{width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content{align-items:center;display:flex;flex-wrap:wrap;line-height:32px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .label{display:inline-block;height:32px;line-height:32px;margin-bottom:10px;text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn-dashed{border-color:#a6a6a6;color:#a6a6a6}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag{margin-bottom:10px;margin-right:10px;position:relative}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .anticon-close{color:#2d7aff;cursor:pointer;line-height:36px;position:absolute;right:5px;top:2px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content{align-items:center;background-color:rgba(45,122,255,.1);border:1px solid #2d7aff;border-radius:3px;box-sizing:border-box;color:#2d7aff;cursor:pointer;display:flex;justify-content:center;opacity:1;padding:0 10px;width:100px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .ant-input-disabled,.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .s-content{background-color:#2d7aff;color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .anticon-close{color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn{margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list{border-top:1px solid #e6e6e6;margin-bottom:6px;margin-top:16px;padding-top:12px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li{align-items:center;display:flex;list-style:none;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .index-span{display:inline-block;width:30px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item{margin-right:10px;width:120px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item.n-date-picker{width:auto}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper{display:flex}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper .form-item{margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .delete-item-icon{color:red;cursor:pointer;font-size:18px;margin-left:8px}.classification-modal-block .n-card__footer{padding-top:10px}.classification-modal-block .n-card__footer .flex_between{display:flex;justify-content:space-between}.classification-modal-block .n-card__footer .flex_right{display:flex;justify-content:right}.classification-modal-block .n-card__footer .n-button{margin-left:8px}.render-widget-input-number-group{align-items:center;display:flex}.render-widget-input-number-group .divider{text-align:center;width:24px}.render-widget-date-range{align-items:center;display:flex;flex-wrap:nowrap;width:100%}.render-widget-date-range .radio-date-group{border:1px solid #d9d9d9;display:flex}.render-widget-date-range .radio-date-group .radio-date-item{border-left:1px solid #d9d9d9;cursor:pointer;height:30px;line-height:30px;padding:0 8px}.render-widget-date-range .radio-date-group .radio-date-item:first-child{border:none}.render-widget-date-range .radio-date-group .radio-date-item.radio-date-item-active{background:#3e65cf;border-color:#3e65cf;color:#fff}.render-widget-date-range .select-date-left{margin-left:16px}.render-widget-date-range .select-date-right{margin-right:16px}.render-widget-date-range .date-detail-range{display:flex;flex-wrap:nowrap}.render-widget-date-range .date-detail-range .divider{text-align:center;width:10px}.label-attr-filter-container .edit-f-label{font-size:14px;line-height:32px;padding-left:0}.label-attr-filter-container .edit-f-content.label-select-height{flex:none;height:74px;overflow:hidden}.label-attr-filter-container .edit-f-content .label-f-content{display:flex;flex-wrap:wrap}.label-attr-filter-container .edit-f-content .label-f-content .n-tag{border:1px solid #e0e0e6;height:32px;margin:0 8px 8px 0;max-width:108px;text-align:center}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.label-attr-filter-container .label-f-unfold-btn{margin:8px 0}.label-attr-filter-container .label-f-unfold-btn .operate-btn{align-items:center;cursor:pointer;display:flex}.label-attr-filter-container .label-f-unfold-btn .operate-btn .n-icon{margin-left:6px}.select-dynamic-popover .n-base-select-menu__empty{justify-content:left;padding:0}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options{background:#fff;box-shadow:0 0 6px rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:left}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .n-empty{padding:12px 32px}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .mixins-options-active{background:#f1f1f1}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-header{display:flex}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-header .name{align-items:center;display:flex;flex:1;font-weight:700;height:34px;padding:0 12px}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-content{list-style:none;margin:0;max-height:250px;outline:none;overflow:auto;padding-left:0}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-content li{color:rgba(0,0,0,.65);cursor:pointer;display:flex;font-size:14px;line-height:22px;text-overflow:ellipsis;transition:background .3s ease;white-space:nowrap}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-content li.actived{color:#5585f5}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-content li:hover{background:#f1f1f1}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-content li .content{flex:1;overflow:hidden;padding:5px 12px;text-overflow:ellipsis;white-space:nowrap}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-pagination{width:100%}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-pagination .n-button-group{display:flex}.select-dynamic-popover .n-base-select-menu__empty .select-dynamic-options .dynamic-pagination .n-button-group .n-button{flex:1}.quick-search-block .quick-item{margin-bottom:10px;min-width:32px;width:20%}.quick-search-block .quick-item .quick-row{display:flex}.quick-search-block .quick-item .quick-row .quick-item-title{box-sizing:border-box;flex-basis:134px;line-height:32px;min-width:130px;overflow:hidden;padding-left:4px;padding-right:4px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.quick-search-block .quick-item .quick-row .quick-item-col{align-items:center;display:flex;padding:0 4px;width:calc(100% - 134px)}.quick-search-block .quick-item .quick-row .quick-item-title-default{width:25%}.quick-search-block .quick-item .quick-row .quick-item-col-default{width:75%}.quick-search-block.quick-search-table .quick-item{display:inline-block}.quick-search-block.quick-search-table .quick-item.quick-block{display:block;width:100%}
@@ -0,0 +1,36 @@
1
+ export const __esModule: true;
2
+ declare const _default: vue_1.DefineComponent<{
3
+ form: {
4
+ type: ObjectConstructor;
5
+ default: () => void;
6
+ };
7
+ item: {
8
+ type: ObjectConstructor;
9
+ default: () => void;
10
+ };
11
+ isLock: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, "scaleChange"[], "scaleChange", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
16
+ form: {
17
+ type: ObjectConstructor;
18
+ default: () => void;
19
+ };
20
+ item: {
21
+ type: ObjectConstructor;
22
+ default: () => void;
23
+ };
24
+ isLock: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ }>> & {
29
+ onScaleChange?: ((...args: any[]) => any) | undefined;
30
+ }, {
31
+ item: Record<string, any>;
32
+ isLock: boolean;
33
+ form: Record<string, any>;
34
+ }>;
35
+ export default _default;
36
+ import vue_1 = require("vue");
@@ -0,0 +1,36 @@
1
+ export const __esModule: true;
2
+ declare const _default: vue_1.DefineComponent<{
3
+ form: {
4
+ type: ObjectConstructor;
5
+ default: () => {};
6
+ };
7
+ item: {
8
+ type: ObjectConstructor;
9
+ default: () => {};
10
+ };
11
+ isLock: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, "scaleChange"[], "scaleChange", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
16
+ form: {
17
+ type: ObjectConstructor;
18
+ default: () => {};
19
+ };
20
+ item: {
21
+ type: ObjectConstructor;
22
+ default: () => {};
23
+ };
24
+ isLock: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ }>> & {
29
+ onScaleChange?: ((...args: any[]) => any) | undefined;
30
+ }, {
31
+ item: Record<string, any>;
32
+ isLock: boolean;
33
+ form: Record<string, any>;
34
+ }>;
35
+ export default _default;
36
+ import vue_1 = require("vue");
@@ -0,0 +1,82 @@
1
+ export const __esModule: true;
2
+ declare const _default: vue_1.DefineComponent<{
3
+ title: {
4
+ type: (StringConstructor | FunctionConstructor)[];
5
+ default: string;
6
+ };
7
+ changeSize: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ closable: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ modalWidth: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ modalHeight: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ handleOk: {
24
+ type: FunctionConstructor;
25
+ default: () => {};
26
+ };
27
+ cancel: {
28
+ type: FunctionConstructor;
29
+ default: () => {};
30
+ };
31
+ visible: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ }, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, ("update:visible" | "onClose")[], "onClose" | "update:visible", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
36
+ title: {
37
+ type: (StringConstructor | FunctionConstructor)[];
38
+ default: string;
39
+ };
40
+ changeSize: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ closable: {
45
+ type: BooleanConstructor;
46
+ default: boolean;
47
+ };
48
+ modalWidth: {
49
+ type: StringConstructor;
50
+ default: string;
51
+ };
52
+ modalHeight: {
53
+ type: StringConstructor;
54
+ default: string;
55
+ };
56
+ handleOk: {
57
+ type: FunctionConstructor;
58
+ default: () => {};
59
+ };
60
+ cancel: {
61
+ type: FunctionConstructor;
62
+ default: () => {};
63
+ };
64
+ visible: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ }>> & {
69
+ "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
70
+ onOnClose?: ((...args: any[]) => any) | undefined;
71
+ }, {
72
+ closable: boolean;
73
+ title: string | Function;
74
+ visible: boolean;
75
+ modalWidth: string;
76
+ modalHeight: string;
77
+ handleOk: Function;
78
+ cancel: Function;
79
+ changeSize: boolean;
80
+ }>;
81
+ export default _default;
82
+ import vue_1 = require("vue");
@@ -105,6 +105,7 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
105
105
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
106
106
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
107
107
  }>>;
108
+ cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
108
109
  emit: (event: "update:show" | "update:value" | "focus", ...args: any[]) => void;
109
110
  emitValue: (value: string | import("../../../es/shared/types").AnyObject[]) => void;
110
111
  onClear: () => void;
@@ -117,6 +118,7 @@ declare const SearchCascader: SFCWithInstall<import("vue").DefineComponent<{
117
118
  uuid: string;
118
119
  show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
119
120
  patternContent: import("vue").Ref<string>;
121
+ editPlaceholderRef: import("vue").ComputedRef<string>;
120
122
  displayValue: import("vue").WritableComputedRef<string>;
121
123
  onFocus: (focusEvt: Event) => void;
122
124
  openMenu: () => void;
@@ -107,6 +107,7 @@ declare const _default: import("vue").DefineComponent<{
107
107
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
108
108
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
109
109
  }>>;
110
+ cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
110
111
  emit: (event: "update:show" | "update:value" | "focus", ...args: any[]) => void;
111
112
  emitValue: (value: ValueType) => void;
112
113
  onClear: () => void;
@@ -119,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
119
120
  uuid: string;
120
121
  show: import("vue").Ref<boolean> | import("vue").WritableComputedRef<boolean>;
121
122
  patternContent: import("vue").Ref<string>;
123
+ editPlaceholderRef: import("vue").ComputedRef<string>;
122
124
  displayValue: import("vue").WritableComputedRef<string>;
123
125
  onFocus: (focusEvt: Event) => void;
124
126
  openMenu: () => void;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as i,isRef as s,normalizeStyle as c,withCtx as d,createVNode as v,createElementVNode as p,renderSlot as f}from"vue";import{uuidGenerator as y}from"../../../shared/utils/index.js";import{NOOP as h}from"@vue/shared";import{useDebounceFn as m,useEventBus as g,useVModel as b,onClickOutside as w}from"@vueuse/core";import{isString as k,isArray as S,isFunction as K,isObject as _}from"lodash-es";import{NPopover as N,NInput as C}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as P,InjectionKeyboardEventBus as x,InjectionSearchCascaderLoadingNode as A,InjectionSearchCascaderValue as U}from"./constants/index.js";import{SearchMenu as W}from"./components/SearchMenu.js";const j=["id"];var F=e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function},menuWidth:{type:[Number,String],default:150}},emits:["update:value","focus","update:show"],setup(e,{expose:F,emit:L}){const V=e;function B(){var e;e=[],Promise.resolve(K(V.beforeSetValue)?V.beforeSetValue(e):e).then((e=>L("update:value",e)),h)}function E(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&G()}const I=m((e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||M.value?T.emit(e.key):G()}),50),R=a((()=>({"--menu-width":V.menuWidth}))),T=g("cascaderKeydown"),$=y(),M=b(V,"show",L);l(P,a((()=>V.checkAbleLevel))),l(x,T);const q=t(""),z=a({get:()=>M.value?q.value:k(V.value)?V.value:S(V.value)?V.value.reduce(((e,a,l)=>0===l?a[V.labelKey]:e+" / "+a[V.labelKey]),""):"",set(e){q.value=e,Z(void 0,e)}});function D(e){L("focus",e)}function G(){M.value||(M.value=!0,q.value="",Z())}async function H(){var e;M.value=!1,null==(e=J.value)||e.blur()}const J=t();w(J,(e=>{var a;if(!M.value)return;const l=e;if(!l.target)return H();!function(e){let a=!1,l=e;for(;l;){if(l.id===$){a=!0;break}l=l.parentElement}return a}(l.target)?H():null==(a=J.value)||a.focus()}));const O=t(),Q=t(),X=t(),Y=t(null);l(A,Y),l(U,a((()=>V.value)));const Z=m((async(e,a)=>{var l;const{type:t,node:r}=e||{};try{if("update"===t)return void(K(V.search)&&V.search({...r,isLeaf:!0}));Y.value=r;const e=await(K(V.search)&&V.search(r,a));Q.value=_(e)||S(e)?e:r,console.log("current_node_value=>",Q.value)}finally{Y.value=null,await o(),null==(l=O.value)||l.syncPosition()}}),400),ee=e=>{X.value=e};return r((()=>V.show),(e=>{e&&(X.value={})})),F({getWidth(){var e;if(!J.value)return 0;const a=null==(e=J.value)?void 0:e.$el;return a?a.clientWidth:void 0}}),(a,l)=>(u(),n(i(N),{class:"search-cascader",trigger:"manual",show:i(M),"onUpdate:show":l[1]||(l[1]=e=>s(M)?M.value=e:null),"show-arrow":!1,placement:"bottom-start",style:c(i(R)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:O},{trigger:d((()=>[v(i(C),{class:"search-cascader__input",placeholder:i(M)?e.editPlaceholder:e.placeholder,clearable:e.clearable,onClear:B,value:i(z),"onUpdate:value":l[0]||(l[0]=e=>s(z)?z.value=e:null),ref_key:"inputRef",ref:J,onFocus:D,onClick:E,onKeydown:i(I)},null,8,["placeholder","clearable","value","onKeydown"])])),default:d((()=>[p("section",{id:i($)},[v(i(W),{"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:i(Z),onChangeCursor:ee,"current-node":Q.value,"cursor-node":X.value},{empty:d((()=>[f(a.$slots,"empty")])),_:3},8,["label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,j)])),_:3},8,["show","style","width"]))}});export{F as default};
1
+ import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as s,isRef as i,normalizeStyle as c,withCtx as v,createVNode as d,createElementVNode as p,renderSlot as f}from"vue";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as h,useEventBus as m,useVModel as g,onClickOutside as b}from"@vueuse/core";import"date-fns";import{isString as w,isArray as k,isObject as S,isFunction as K}from"lodash-es";import{uuidGenerator as _}from"../../../shared/utils/index.js";import{NOOP as N}from"@vue/shared";import{NPopover as C,NInput as P}from"naive-ui";import{InjectionSearchCascaderCheckAbleLevel as j,InjectionKeyboardEventBus as x,InjectionSearchCascaderLoadingNode as A,InjectionSearchCascaderValue as U}from"./constants/index.js";import{SearchMenu as W}from"./components/SearchMenu.js";const F=["id"];var L=e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function},menuWidth:{type:[Number,String],default:150}},emits:["update:value","focus","update:show"],setup(e,{expose:L,emit:T}){const V=e,B=y();function E(){var e;e=[],Promise.resolve(K(V.beforeSetValue)?V.beforeSetValue(e):e).then((e=>T("update:value",e)),N)}function I(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&O()}const R=h((e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||z.value?M.emit(e.key):O()}),50),$=a((()=>({"--menu-width":V.menuWidth}))),M=m("cascaderKeydown"),q=_(),z=g(V,"show",T);l(j,a((()=>V.checkAbleLevel))),l(x,M);const D=t(""),G=a((()=>w(V.value)&&V.value?V.value:k(V.value)&&V.value.length?V.value.map((e=>S(e)?e[V.labelKey]:e)).join(" / "):V.editPlaceholder)),H=a({get:()=>z.value?D.value:w(V.value)?V.value:k(V.value)?V.value.reduce(((e,a,l)=>0===l?a[V.labelKey]:e+" / "+a[V.labelKey]),""):"",set(e){D.value=e,le(void 0,e)}});function J(e){T("focus",e)}function O(){z.value||(z.value=!0,D.value="",le())}async function Q(){var e;z.value=!1,null==(e=X.value)||e.blur()}const X=t();b(X,(e=>{var a;if(!z.value)return;const l=e;if(!l.target)return Q();!function(e){let a=!1,l=e;for(;l;){if(l.id===q){a=!0;break}l=l.parentElement}return a}(l.target)?Q():null==(a=X.value)||a.focus()}));const Y=t(),Z=t(),ee=t(),ae=t(null);l(A,ae),l(U,a((()=>V.value)));const le=h((async(e,a)=>{var l;const{type:t,node:r}=e||{};try{if("update"===t)return void(K(V.search)&&V.search({...r,isLeaf:!0}));ae.value=r;const e=await(K(V.search)&&V.search(r,a));Z.value=S(e)||k(e)?e:r,console.log("current_node_value=>",Z.value)}finally{ae.value=null,await o(),null==(l=Y.value)||l.syncPosition()}}),400),te=e=>{ee.value=e};return r((()=>V.show),(e=>{e&&(ee.value={})})),L({getWidth(){var e;if(!X.value)return 0;const a=null==(e=X.value)?void 0:e.$el;return a?a.clientWidth:void 0}}),(a,l)=>(u(),n(s(C),{class:"search-cascader",trigger:"manual",show:s(z),"onUpdate:show":l[1]||(l[1]=e=>i(z)?z.value=e:null),"show-arrow":!1,placement:"bottom-start",style:c(s($)),width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:Y},{trigger:v((()=>[d(s(P),{class:"search-cascader__input",placeholder:s(z)?s(G):e.placeholder,clearable:e.clearable,onClear:E,value:s(H),"onUpdate:value":l[0]||(l[0]=e=>i(H)?H.value=e:null),ref_key:"inputRef",ref:X,onFocus:J,onClick:I,onKeydown:s(R)},null,8,["placeholder","clearable","value","onKeydown"])])),default:v((()=>[p("section",{id:s(q)},[d(s(W),{style:c(s(B)),"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(le),onChangeCursor:te,"current-node":Z.value,"cursor-node":ee.value},{empty:v((()=>[f(a.$slots,"empty")])),_:3},8,["style","label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,F)])),_:3},8,["show","style","width"]))}});export{L as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,createVNode as t,createTextVNode as o,computed as n,inject as l,withModifiers as a}from"vue";import{traverse as c}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as i}from"@vue/shared";import{useVirtualList as d}from"@vueuse/core";import{isArray as p,isFunction as f,isNumber as v,isEqual as y,isString as h}from"lodash-es";import{NCheckbox as m}from"naive-ui";import{InjectionSearchCascaderLoadingNode as g,InjectionSearchCascaderValue as N,InjectionSearchCascaderCheckAbleLevel as C,InjectionKeyboardEventBus as b}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},cursorNode:{type:Object,default:()=>({})}},emits:["nodeClick","changeCursor"],setup(e,{emit:r}){const o=n((()=>e.options)),{list:c,containerProps:f,wrapperProps:k}=d(o,{itemHeight:32,overscan:5}),K=l(g),_=l(N),x=l(C),A=l(b),S=n((()=>v(x.value)&&x.value<=e.level));function j(e){return Object.keys(e).length<=0}function w(r){return e.cursorNode==r}function I(r){const t=function(e){const r=[e];let t=e;for(;t.parent;)t=t.parent,r.unshift(t);return r}(r);if(p(_.value))return y(o(t,e.valueKey),o(_.value,e.valueKey));if(h(_.value)){const r=_.value.split("/").map((e=>e.trim()));return y(r,o(t,e.labelKey))}return!1;function o(e,r){return e.map((e=>e[r]))}}function O(e){const r=f.ref.value;if(r){const t=32*e-(null==r?void 0:r.clientHeight);r.scrollTo(0,t>0?t:0)}}return A.on((function(t){if("ArrowUp"===t){if(j(e.cursorNode))return;const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=0===t?o.value.length-1:t-1,n=o.value[e];r("changeCursor",n),O(e+3)}}if("ArrowRight"===t){if(j(e.cursorNode))return;r("nodeClick",{type:"search",node:e.cursorNode}),r("changeCursor",{})}if("ArrowDown"===t){if(j(e.cursorNode))return r("changeCursor",o.value[0]);const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=t>=o.value.length-1?0:t+1,n=o.value[e];r("changeCursor",n),O(e+1)}}if("ArrowLeft"===t&&e.activeNodes.length){const t=e.activeNodes.slice(-1);r("changeCursor",t[0])}"Enter"===t&&(S.value?r("nodeClick",{type:"update",node:e.cursorNode}):r("nodeClick",{type:"search",node:e.cursorNode}))})),()=>t("div",{class:"search-cascader__optionWrapper",ref:f.ref,style:f.style,onScroll:f.onScroll},[t("div",{style:k.value.style},[c.value.map((o=>{return t("div",{class:["search-cascader__option",{"search-cascader__option--active":(n=o.data,(null==(l=e.activeNodes)?void 0:l.includes(n))||w(o.data))}],onClick:()=>r("nodeClick",{type:"search",node:o.data}),title:o.data[e.labelKey]},[t("div",{class:"search-cascader__optionText"},[S.value?t(m,{style:{marginRight:"8px"},checked:I(o.data),onClick:a(i,["stop"]),onUpdateChecked:e=>e&&function(e){r("nodeClick",{type:"update",node:e})}(o.data)},null):null,o.data[e.labelKey]]),K.value===o.data?t(s,{class:"rotate"},null):o.data.isLeaf?null:t(u,null,null)]);var n,l}))])])}}),K=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object},cursorNode:{type:Object}},emits:["nodeClick","changeCursor"],setup(e,{slots:n,emit:l}){const a=r([]);function s(r,o){return t(k,{level:o+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:a.value,onNodeClick:e=>l("nodeClick",e),onChangeCursor:e=>l("changeCursor",e),options:r,cursorNode:e.cursorNode},null)}function u(r){let t=!1;return c(r,((r,o)=>{e.currentNode===r&&(t=!0,o())}),["children"]),console.log("node_result=>",r,t,e.currentNode),t}function i(){if(!p(e.options)||!e.currentNode)return[];const r=[e.options];let t=e.options;for(a.value.length=0;p(t);){const o=t.find(u);if(!o)break;a.value.push(o),t=o[e.childKey],r.push(t)}if(e.cursorNode){const t=r.findIndex((r=>(r&&r.findIndex((r=>r===e.cursorNode)))>=0));if(t>=0){const e=r.slice(0,t+1);return a.value.splice(t,r.length),e}}return r}return()=>t("section",{class:"search-cascader__menuWrapper"},[p(e.options)&&e.options.length?e.currentNode?i().map(s):s(e.options,0):t("section",{class:"search-cascader__emptyWrapper"},[f(n.empty)?n.empty():t("section",null,[o("empty")])])])}});export{K as SearchMenu};
1
+ import{defineComponent as e,ref as r,createVNode as t,createTextVNode as o,computed as n,inject as a,withModifiers as l}from"vue";import{traverse as c}from"../../../../shared/utils/index.js";import{Reload as s,ChevronForward as u}from"@vicons/ionicons5";import{NOOP as i}from"@vue/shared";import{useVirtualList as d}from"@vueuse/core";import{isArray as p,isFunction as f,isNumber as v,isEqual as y,isString as h}from"lodash-es";import{NCheckbox as m}from"naive-ui";import{InjectionSearchCascaderLoadingNode as g,InjectionSearchCascaderValue as N,InjectionSearchCascaderCheckAbleLevel as C,InjectionKeyboardEventBus as b}from"../constants/index.js";const k=e({props:{options:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},level:{type:Number,required:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},cursorNode:{type:Object,default:()=>({})}},emits:["nodeClick","changeCursor"],setup(e,{emit:r}){const o=n((()=>e.options)),{list:c,containerProps:f,wrapperProps:k}=d(o,{itemHeight:32,overscan:5}),K=a(g),_=a(N),x=a(C),A=a(b),S=n((()=>v(x.value)&&x.value<=e.level));function j(e){return Object.keys(e).length<=0}function w(r){return e.cursorNode==r}function I(r){const t=function(e){const r=[e];let t=e;for(;t.parent;)t=t.parent,r.unshift(t);return r}(r);if(p(_.value))return y(o(t,e.valueKey),o(_.value,e.valueKey));if(h(_.value)){const r=_.value.split("/").map((e=>e.trim()));return y(r,o(t,e.labelKey))}return!1;function o(e,r){return e.map((e=>e[r]))}}function O(e){const r=f.ref.value;if(r){const t=32*e-(null==r?void 0:r.clientHeight);r.scrollTo(0,t>0?t:0)}}return A.on((function(t){if("ArrowUp"===t){if(j(e.cursorNode))return;const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=0===t?o.value.length-1:t-1,n=o.value[e];r("changeCursor",n),O(e+3)}}if("ArrowRight"===t){if(j(e.cursorNode))return;r("nodeClick",{type:"search",node:e.cursorNode}),r("changeCursor",{})}if("ArrowDown"===t){if(j(e.cursorNode))return r("changeCursor",o.value[0]);const t=o.value.findIndex((r=>r===e.cursorNode));if(t>=0){const e=t>=o.value.length-1?0:t+1,n=o.value[e];r("changeCursor",n),O(e+1)}}if("ArrowLeft"===t&&e.activeNodes.length){const t=e.activeNodes.slice(-1);r("changeCursor",t[0])}"Enter"===t&&(S.value?r("nodeClick",{type:"update",node:e.cursorNode}):r("nodeClick",{type:"search",node:e.cursorNode}))})),()=>t("div",{class:"search-cascader__optionWrapper",ref:f.ref,style:f.style,onScroll:f.onScroll},[t("div",{style:k.value.style},[c.value.map((o=>{return t("div",{class:["search-cascader__option",{"search-cascader__option--active":(n=o.data,(null==(a=e.activeNodes)?void 0:a.includes(n))||w(o.data))}],onClick:()=>r("nodeClick",{type:"search",node:o.data}),title:o.data[e.labelKey]},[t("div",{class:"search-cascader__optionText"},[S.value?t(m,{style:{marginRight:"8px"},checked:I(o.data),onClick:l(i,["stop"]),onUpdateChecked:e=>e&&function(e){r("nodeClick",{type:"update",node:e})}(o.data)},null):null,t("span",{class:{"search-cascader__optionText--active":I(o.data)}},[o.data[e.labelKey]])]),K.value===o.data?t(s,{class:"rotate"},null):o.data.isLeaf?null:t(u,null,null)]);var n,a}))])])}}),K=e({props:{childKey:{type:String,default:"children"},options:{type:Array,default:()=>[]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},currentNode:{type:Object},cursorNode:{type:Object}},emits:["nodeClick","changeCursor"],setup(e,{slots:n,emit:a}){const l=r([]);function s(r,o){return t(k,{level:o+1,labelKey:e.labelKey,valueKey:e.valueKey,activeNodes:l.value,onNodeClick:e=>a("nodeClick",e),onChangeCursor:e=>a("changeCursor",e),options:r,cursorNode:e.cursorNode},null)}function u(r){let t=!1;return c(r,((r,o)=>{e.currentNode===r&&(t=!0,o())}),["children"]),console.log("node_result=>",r,t,e.currentNode),t}function i(){if(!p(e.options)||!e.currentNode)return[];const r=[e.options];let t=e.options;for(l.value.length=0;p(t);){const o=t.find(u);if(!o)break;l.value.push(o),t=o[e.childKey],r.push(t)}if(e.cursorNode){const t=r.findIndex((r=>(r&&r.findIndex((r=>r===e.cursorNode)))>=0));if(t>=0){const e=r.slice(0,t+1);return l.value.splice(t,r.length),e}}return r}return()=>t("section",{class:"search-cascader__menuWrapper"},[p(e.options)&&e.options.length?e.currentNode?i().map(s):s(e.options,0):t("section",{class:"search-cascader__emptyWrapper"},[f(n.empty)?n.empty():t("section",null,[o("empty")])])])}});export{K as SearchMenu};
@@ -0,0 +1,57 @@
1
+ export const __esModule: true;
2
+ export const SearchMenu: vue_1.DefineComponent<{
3
+ childKey: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ options: {
8
+ type: ArrayConstructor;
9
+ default: () => never[];
10
+ };
11
+ labelKey: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ valueKey: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ currentNode: {
20
+ type: ObjectConstructor;
21
+ };
22
+ cursorNode: {
23
+ type: ObjectConstructor;
24
+ };
25
+ }, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
26
+ childKey: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ options: {
31
+ type: ArrayConstructor;
32
+ default: () => never[];
33
+ };
34
+ labelKey: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ valueKey: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ currentNode: {
43
+ type: ObjectConstructor;
44
+ };
45
+ cursorNode: {
46
+ type: ObjectConstructor;
47
+ };
48
+ }>> & {
49
+ onNodeClick?: ((...args: any[]) => any) | undefined;
50
+ onChangeCursor?: ((...args: any[]) => any) | undefined;
51
+ }, {
52
+ options: unknown[];
53
+ valueKey: string;
54
+ childKey: string;
55
+ labelKey: string;
56
+ }>;
57
+ import vue_1 = require("vue");
@@ -0,0 +1,57 @@
1
+ export const __esModule: true;
2
+ export const SearchMenu: vue_1.DefineComponent<{
3
+ childKey: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ options: {
8
+ type: ArrayConstructor;
9
+ default: () => never[];
10
+ };
11
+ labelKey: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ valueKey: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ currentNode: {
20
+ type: ObjectConstructor;
21
+ };
22
+ cursorNode: {
23
+ type: ObjectConstructor;
24
+ };
25
+ }, () => any, any, {}, {}, vue_1.ComponentOptionsMixin, vue_1.ComponentOptionsMixin, ("nodeClick" | "changeCursor")[], "nodeClick" | "changeCursor", vue_1.VNodeProps & vue_1.AllowedComponentProps & vue_1.ComponentCustomProps, Readonly<vue_1.ExtractPropTypes<{
26
+ childKey: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ options: {
31
+ type: ArrayConstructor;
32
+ default: () => never[];
33
+ };
34
+ labelKey: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ valueKey: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ currentNode: {
43
+ type: ObjectConstructor;
44
+ };
45
+ cursorNode: {
46
+ type: ObjectConstructor;
47
+ };
48
+ }>> & {
49
+ onNodeClick?: ((...args: any[]) => any) | undefined;
50
+ onChangeCursor?: ((...args: any[]) => any) | undefined;
51
+ }, {
52
+ options: unknown[];
53
+ valueKey: string;
54
+ childKey: string;
55
+ labelKey: string;
56
+ }>;
57
+ import vue_1 = require("vue");
@@ -1 +1 @@
1
- .search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__input input{cursor:pointer!important}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;min-width:100%;padding:0 8px 0 16px;width:fit-content}.search-cascader__option--active{background:#f8f8f8}.search-cascader__option:hover{background:#f5f5f5;cursor:pointer}.search-cascader__optionWrapper{background:#fff;height:256px;overflow-x:auto;width:calc(var(--menu-width)*1px)}.search-cascader__optionWrapper:not(:last-of-type){border:solid #e5e5e5;border-width:0 1px 0 0}.search-cascader__optionText{white-space:nowrap}.search-cascader__option svg{color:#bfbfbf;flex-shrink:0;font-size:12px;width:20px}.search-cascader__option svg.rotate{animation:rotate 1s linear infinite}.search-cascader__emptyWrapper{align-items:center;background:#fff;box-sizing:border-box;display:flex;height:300px;justify-content:center;padding:16px;width:100%}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}
1
+ .search-cascader__menuWrapper{display:flex;flex-wrap:nowrap;margin:-8px -14px}.search-cascader__input input{cursor:pointer!important}.search-cascader__option{align-items:center;border-radius:4px;box-sizing:border-box;display:flex;height:32px;justify-content:space-between;min-width:100%;padding:0 8px 0 16px;width:fit-content}.search-cascader__option--active{background:#f8f8f8}.search-cascader__option:hover{background:#f5f5f5;cursor:pointer}.search-cascader__optionWrapper{background:#fff;height:256px;overflow-x:auto;width:calc(var(--menu-width)*1px)}.search-cascader__optionWrapper:not(:last-of-type){border:solid #e5e5e5;border-width:0 1px 0 0}.search-cascader__optionText{white-space:nowrap}.search-cascader__optionText--active{color:var(--c-primary-color)}.search-cascader__option svg{color:#bfbfbf;flex-shrink:0;font-size:12px;width:20px}.search-cascader__option svg.rotate{animation:rotate 1s linear infinite}.search-cascader__emptyWrapper{align-items:center;background:#fff;box-sizing:border-box;display:flex;height:300px;justify-content:center;padding:16px;width:100%}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}