cnhis-design-vue 3.1.21-beta.1 → 3.1.21-beta.11

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 (130) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +13 -14
  3. package/es/components/big-table/src/BigTable.vue.d.ts +13 -14
  4. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +34 -21
  5. package/es/components/big-table/src/bigTableProps.d.ts +1 -1
  6. package/es/components/big-table/src/components/edit-form/edit-input.js +15 -7
  7. package/es/components/big-table/src/hooks/useEdit.d.ts +2 -1
  8. package/es/components/big-table/src/hooks/useEdit2.js +3 -2
  9. package/es/components/big-table/src/hooks/useFormat.d.ts +3 -1
  10. package/es/components/big-table/src/hooks/useFormat2.js +11 -2
  11. package/es/components/fabric-chart/src/components/PopupMenu.js +9 -2
  12. package/es/components/fabric-chart/src/hooks/useCenter2.js +21 -20
  13. package/es/components/fabric-chart/src/hooks/useLeft2.js +4 -3
  14. package/es/components/form-config/index.d.ts +1 -0
  15. package/es/components/form-config/src/FormConfig.vue.d.ts +1 -0
  16. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -0
  17. package/es/components/form-render/index2.js +4 -5
  18. package/es/components/form-render/src/FormRender.js +3 -3
  19. package/es/components/form-render/src/components/renderer/cascader.js +3 -4
  20. package/es/components/form-render/src/components/renderer/checkbox.js +2 -5
  21. package/es/components/form-render/src/components/renderer/combination.js +2 -4
  22. package/es/components/form-render/src/components/renderer/complex.js +1 -4
  23. package/es/components/form-render/src/components/renderer/date.js +12 -3
  24. package/es/components/form-render/src/components/renderer/formItem.js +1 -4
  25. package/es/components/form-render/src/components/renderer/radio.js +1 -3
  26. package/es/components/form-render/src/components/renderer/search.js +11 -17
  27. package/es/components/form-render/src/components/renderer/select.js +13 -19
  28. package/es/components/form-render/src/components/renderer/switch.js +2 -5
  29. package/es/components/form-render/src/components/renderer/textarea.js +2 -5
  30. package/es/components/form-render/src/hooks/useAnchor2.js +1 -3
  31. package/es/components/form-render/src/hooks/useBusinessBinding2.js +1 -3
  32. package/es/components/form-render/src/hooks/useChangeContext.d.ts +3 -5
  33. package/es/components/form-render/src/hooks/useChangeContext2.js +2 -2
  34. package/es/components/form-render/src/hooks/useFormItemDeps2.js +1 -4
  35. package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides.d.ts +0 -0
  36. package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides.js +0 -0
  37. package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides2.js +0 -0
  38. package/es/components/form-render/src/hooks/usePresetScope2.js +1 -4
  39. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  40. package/es/components/form-render/src/utils/index.d.ts +4 -1
  41. package/es/components/form-render/src/utils/index.js +27 -1
  42. package/es/components/index.d.ts +1 -2
  43. package/es/components/index.js +0 -1
  44. package/es/components/index2.js +0 -3
  45. package/es/components/info-header/index.d.ts +31 -8
  46. package/es/components/info-header/src/HiddenContent.vue.d.ts +2 -2
  47. package/es/components/info-header/src/InfoEllipsis.vue.d.ts +1 -1
  48. package/es/components/info-header/src/InfoHeader.js +9 -10
  49. package/es/components/info-header/src/InfoHeader.vue.d.ts +32 -8
  50. package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
  51. package/es/components/shortcut-setter/index.d.ts +1 -0
  52. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  53. package/es/components/steps-wheel/index.d.ts +1 -1
  54. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
  55. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
  56. package/package.json +2 -2
  57. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +0 -4
  58. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  59. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  60. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  61. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  62. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  63. package/es/components/form-table/index.d.ts +0 -4019
  64. package/es/components/form-table/index.js +0 -1
  65. package/es/components/form-table/index2.js +0 -10
  66. package/es/components/form-table/src/FormTable.js +0 -474
  67. package/es/components/form-table/src/FormTable.vue.d.ts +0 -4019
  68. package/es/components/form-table/src/components/index.d.ts +0 -3778
  69. package/es/components/form-table/src/components/index.js +0 -1
  70. package/es/components/form-table/src/components/index2.js +0 -40
  71. package/es/components/form-table/src/components/table-age.js +0 -235
  72. package/es/components/form-table/src/components/table-age.vue.d.ts +0 -318
  73. package/es/components/form-table/src/components/table-date-picker.js +0 -179
  74. package/es/components/form-table/src/components/table-date-picker.vue.d.ts +0 -250
  75. package/es/components/form-table/src/components/table-digital.js +0 -141
  76. package/es/components/form-table/src/components/table-digital.vue.d.ts +0 -261
  77. package/es/components/form-table/src/components/table-input-password.js +0 -141
  78. package/es/components/form-table/src/components/table-input-password.vue.d.ts +0 -304
  79. package/es/components/form-table/src/components/table-input.js +0 -127
  80. package/es/components/form-table/src/components/table-input.vue.d.ts +0 -261
  81. package/es/components/form-table/src/components/table-month-picker.js +0 -104
  82. package/es/components/form-table/src/components/table-month-picker.vue.d.ts +0 -193
  83. package/es/components/form-table/src/components/table-search-more.js +0 -6
  84. package/es/components/form-table/src/components/table-search-more.vue.d.ts +0 -392
  85. package/es/components/form-table/src/components/table-search-more.vue_vue_type_script_setup_true_lang.js +0 -276
  86. package/es/components/form-table/src/components/table-search.js +0 -6
  87. package/es/components/form-table/src/components/table-search.vue.d.ts +0 -386
  88. package/es/components/form-table/src/components/table-search.vue_vue_type_script_setup_true_lang.js +0 -276
  89. package/es/components/form-table/src/components/table-select-multiple.js +0 -164
  90. package/es/components/form-table/src/components/table-select-multiple.vue.d.ts +0 -235
  91. package/es/components/form-table/src/components/table-select.js +0 -159
  92. package/es/components/form-table/src/components/table-select.vue.d.ts +0 -234
  93. package/es/components/form-table/src/components/table-textarea.js +0 -157
  94. package/es/components/form-table/src/components/table-textarea.vue.d.ts +0 -320
  95. package/es/components/form-table/src/components/table-time-picker.js +0 -150
  96. package/es/components/form-table/src/components/table-time-picker.vue.d.ts +0 -246
  97. package/es/components/form-table/src/components/table-tree-select.js +0 -285
  98. package/es/components/form-table/src/components/table-tree-select.vue.d.ts +0 -349
  99. package/es/components/form-table/src/components/text-over-tooltip.js +0 -64
  100. package/es/components/form-table/src/components/text-over-tooltip.vue.d.ts +0 -70
  101. package/es/components/form-table/src/configs/index.d.ts +0 -35
  102. package/es/components/form-table/src/configs/index.js +0 -1
  103. package/es/components/form-table/src/configs/index2.js +0 -67
  104. package/es/components/form-table/src/hooks/index.d.ts +0 -5
  105. package/es/components/form-table/src/hooks/index.js +0 -5
  106. package/es/components/form-table/src/hooks/useBoundDate.d.ts +0 -21
  107. package/es/components/form-table/src/hooks/useBoundDate.js +0 -1
  108. package/es/components/form-table/src/hooks/useBoundDate2.js +0 -414
  109. package/es/components/form-table/src/hooks/useDateType.d.ts +0 -17
  110. package/es/components/form-table/src/hooks/useDateType.js +0 -1
  111. package/es/components/form-table/src/hooks/useDateType2.js +0 -160
  112. package/es/components/form-table/src/hooks/useFormCommon.d.ts +0 -14
  113. package/es/components/form-table/src/hooks/useFormCommon.js +0 -1
  114. package/es/components/form-table/src/hooks/useFormCommon2.js +0 -101
  115. package/es/components/form-table/src/hooks/useFormEvent.d.ts +0 -9
  116. package/es/components/form-table/src/hooks/useFormEvent.js +0 -1
  117. package/es/components/form-table/src/hooks/useFormEvent2.js +0 -68
  118. package/es/components/form-table/src/hooks/useItemDefault.d.ts +0 -53
  119. package/es/components/form-table/src/hooks/useItemDefault.js +0 -1
  120. package/es/components/form-table/src/hooks/useItemDefault2.js +0 -218
  121. package/es/components/form-table/src/hooks/useSearch.d.ts +0 -165
  122. package/es/components/form-table/src/hooks/useSearch.js +0 -1
  123. package/es/components/form-table/src/hooks/useSearch2.js +0 -1154
  124. package/es/components/form-table/src/hooks/useValidate.d.ts +0 -24
  125. package/es/components/form-table/src/hooks/useValidate.js +0 -1
  126. package/es/components/form-table/src/hooks/useValidate2.js +0 -480
  127. package/es/components/form-table/src/types/index.d.ts +0 -11
  128. package/es/components/form-table/src/types/index.js +0 -1
  129. package/es/components/form-table/style/index.css +0 -1
  130. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,1154 +0,0 @@
1
- import XEUtils from 'xe-utils';
2
- import 'moment';
3
- import { ref, computed, onMounted, nextTick, h } from 'vue';
4
- import { useItemDefault } from './useItemDefault2.js';
5
-
6
- const SELECT_LIST = ["SEARCH_MORE", "SEARCH", "SEARCH_CASCADE", "LEVEL_SEARCH_CASCADE"];
7
- function useSearch({
8
- loadDataPrimary_key,
9
- optionsRequestSource,
10
- axios,
11
- $qs,
12
- dropdownHide,
13
- curAddBtnItem,
14
- message,
15
- Choose_to_complete,
16
- noAllow_check_mid_level,
17
- selsectVisible,
18
- baseForm,
19
- refs,
20
- $t,
21
- $_handleTracherLog,
22
- open,
23
- wrapperRef,
24
- props,
25
- emit
26
- }) {
27
- const {
28
- formTable,
29
- hasErr,
30
- handleGetJsonStr,
31
- handleSetFieldsValue,
32
- handleGetUniqueKey,
33
- handleSysParams,
34
- defaultInit,
35
- handleTableBlur,
36
- handleFormParams,
37
- radioColor,
38
- handleGetAgeUnit,
39
- handleAgeToBirthDay,
40
- changeAgeSelect,
41
- handlerSetIdCarInfoValidate,
42
- getInputCheck,
43
- getCustomRegular,
44
- checkDigital,
45
- checkAgeJson,
46
- checkAge,
47
- checkMultipleChoice,
48
- checkLength,
49
- checkinputBlank,
50
- handlerGetDateType,
51
- checkSearchCascade,
52
- checkMultipleTree,
53
- handleDateClearBtn,
54
- handleStartDateEndDate,
55
- showTimePanel,
56
- momentLib,
57
- judgeTimeBoundary,
58
- setTimeValue,
59
- judgeTimeRange,
60
- isSameDate,
61
- setDefaultCurrent,
62
- handleDefaultRimeRange,
63
- judgeMinMaxDateIsSameDate,
64
- handleDefaultTimeRange,
65
- changeTimeDate,
66
- setTimeRangeArr
67
- } = useItemDefault({ message, props, emit });
68
- const fetching = ref(false);
69
- const timeout = ref(null);
70
- const curOptions = ref([]);
71
- const selectedOptions = ref([]);
72
- const levelNum = ref(1);
73
- const cascaderInitLabel = ref(true);
74
- const defList = ref([]);
75
- const panelOpen = ref(false);
76
- const hideHotSearch = ref(false);
77
- const searchAddObj = ref({});
78
- const searchPageConfig = ref({
79
- keyword: void 0,
80
- isFetching: false,
81
- isRequest: false,
82
- hasNextPage: false,
83
- page: 1,
84
- total: 1
85
- });
86
- const optionsMaxWidth = ref("100%");
87
- const cacheReqOptionsParams = ref("");
88
- const hotSearchConfig = ref({
89
- hotList: [],
90
- latestList: [],
91
- isRequest: false,
92
- isclose: true
93
- });
94
- const searchShowHotList = ref(false);
95
- const curMultipleSelected = ref([]);
96
- const showHotSearchConfig = computed(() => {
97
- const { hotList = [], latestList = [] } = (hotSearchConfig == null ? void 0 : hotSearchConfig.value) || {};
98
- let f = hotList.length || latestList.length;
99
- return f && !searchPageConfig.value.keyword;
100
- });
101
- const showSearchEmpty = computed(() => {
102
- if (props.item.free_entry != "1")
103
- return false;
104
- const len = curOptions.value.length;
105
- const i = curOptions.value.slice(0, 2).findIndex((ele) => ele.is_free_entry_input__add);
106
- return i < 0 ? false : len < i + 2;
107
- });
108
- const selectIsOpen = computed(() => {
109
- const { html_type, show_type } = props.item;
110
- if (["SEARCH_MORE", "SEARCH"].includes(html_type)) {
111
- return !["pop", "dialog"].includes(show_type);
112
- }
113
- return true;
114
- });
115
- const isnoPages = computed(() => {
116
- return searchPageConfig.value.page <= 1 && !searchPageConfig.value.hasNextPage;
117
- });
118
- function init() {
119
- const {
120
- validate = {},
121
- html_type = void 0,
122
- name,
123
- default_val,
124
- show_type = void 0,
125
- guage_num = void 0
126
- } = props.item;
127
- let targetStr = props.defaultValue[name] || default_val;
128
- targetStr = handleSysParams(targetStr);
129
- if (html_type == "SEARCH") {
130
- if (targetStr) {
131
- nextTick(() => {
132
- handleRequestedOptions(props.item, targetStr, true);
133
- });
134
- }
135
- } else if (html_type == "SEARCH_MORE") {
136
- hanldeInitSearchMoreVal(props.item);
137
- }
138
- cacheReqOptionsParams.value = "";
139
- }
140
- async function hanldeInitSearchMoreVal(i, v) {
141
- var _a;
142
- try {
143
- const item = i;
144
- let n;
145
- if (v) {
146
- n = v;
147
- } else {
148
- n = props.defaultValue[item.name] || item.default_val;
149
- }
150
- if (n) {
151
- if (typeof n === "string") {
152
- n = handleSysParams(n);
153
- }
154
- n = handleGetJsonStr(n) || {};
155
- let NOWORDBOOK = item.wordbook.type != "WORDBOOK";
156
- if (n && n.objs && n.objs.length) {
157
- let curUniqueLabel;
158
- if (NOWORDBOOK) {
159
- curUniqueLabel = await handleRequestedUniqueKey(item.wordbook.id);
160
- }
161
- curUniqueLabel = curUniqueLabel || void 0;
162
- let defList2 = [];
163
- const defOptions = [];
164
- let l = [], objs = [];
165
- let objStr = typeof n.objStr === "string" ? [...new Set(n.objStr.split(","))].join(",") : n.objStr;
166
- n.objs.forEach((f) => {
167
- let v2 = typeof f === "object" ? JSON.parse(JSON.stringify(f)) : f;
168
- v2.myUniqueKey = v2[curUniqueLabel] || "";
169
- v2.myUniqueLabel = curUniqueLabel || "";
170
- defList2.push({
171
- key: `${v2[item.wordbook.value_key]}-${v2[curUniqueLabel] || ""}`,
172
- label: hanlderGetSearchLabel(item, v2)
173
- });
174
- let k = `${v2[item.wordbook.value_key]}-${v2["myUniqueKey"]}`;
175
- if (!l.includes(k)) {
176
- defOptions.push({
177
- ...v2
178
- });
179
- l.push(k);
180
- objs.push({
181
- ...f
182
- });
183
- }
184
- });
185
- if (l.length !== (((_a = n == null ? void 0 : n.objs) == null ? void 0 : _a.length) || void 0)) {
186
- props.formType[item.val_key].filtration_val = JSON.stringify({
187
- objStr,
188
- objs
189
- });
190
- }
191
- item.defOptions = defOptions;
192
- if (defOptions && defOptions.length) {
193
- curOptions.value = [...defOptions];
194
- selectedOptions.value = [...defOptions || []];
195
- }
196
- defList2 = XEUtils.uniqArrObj(defList2, "key");
197
- props.row[item.val_key] = defList2;
198
- Reflect.set(props.item, "useFormValue", defList2);
199
- emit("valueOnChange", [...defOptions], props.item, props.row);
200
- } else {
201
- props.defaultValue[item.name] = [];
202
- }
203
- } else {
204
- props.defaultValue[item.name] = [];
205
- }
206
- } catch (e) {
207
- console.log(e);
208
- }
209
- }
210
- function getSearchDefParams(keyword, itemData = {}, other = {}) {
211
- const { wordbook, html_type, autograph } = itemData;
212
- const isCascade = html_type.includes("SEARCH_CASCADE");
213
- const fieldKeys = wordbook.fieldKeys || wordbook.search_key;
214
- let conObj = wordbook.conObj;
215
- const extraParams = {
216
- primaryKey: wordbook.primary_key,
217
- levelKey: wordbook.level_key
218
- };
219
- const pageSizeConfig = {
220
- pageSize: isCascade ? 1e4 : 20
221
- };
222
- const params = {
223
- wordbookId: wordbook.id,
224
- autograph,
225
- wordbookType: wordbook.type || "WORDBOOK",
226
- preConObj: wordbook.preConObj ? JSON.stringify(wordbook.preConObj) : void 0,
227
- conObj: conObj ? JSON.stringify(conObj) : void 0,
228
- preSqlExpression: wordbook.preSqlExpression || void 0,
229
- sqlExpression: wordbook.sqlExpression || void 0,
230
- fieldKeys: fieldKeys ? JSON.stringify(fieldKeys) : void 0,
231
- keyword: keyword || "",
232
- page: 1,
233
- ...isCascade ? extraParams : {},
234
- ...isCascade ? pageSizeConfig : {}
235
- };
236
- if (other.page) {
237
- params.page = other.page;
238
- searchPageConfig.value.isFetching = true;
239
- }
240
- return params;
241
- }
242
- function getCascadeParams(params, itemData, otherConfig, defFalg) {
243
- const { wordbook, html_type } = itemData;
244
- if (html_type.includes("LEVEL_SEARCH_CASCADE")) {
245
- let pageObj = void 0;
246
- if (Object.keys(otherConfig || {}).length > 0) {
247
- let { levelNum: levelNum2 = 1, pageSetting } = otherConfig || {};
248
- levelNum2.value = levelNum2;
249
- loadDataPrimary_key.value = otherConfig.loadDataPrimary_key;
250
- pageObj = pageSetting;
251
- }
252
- const { levelSetting = [] } = wordbook;
253
- let curLevel = levelSetting[levelNum.value - 1];
254
- if ((defFalg || !loadDataPrimary_key.value) && wordbook.conObjFirstLevel) {
255
- params.conObj = wordbook.conObjFirstLevel ? JSON.stringify(wordbook.conObjFirstLevel) : void 0;
256
- params.sqlExperssions = wordbook.sqlExpressionFirstLevel || void 0;
257
- } else {
258
- let conObjList = [];
259
- if (loadDataPrimary_key.value) {
260
- conObjList.push({
261
- field_key: wordbook.level_key,
262
- con: "EQ",
263
- value: loadDataPrimary_key.value
264
- });
265
- }
266
- if (curLevel && html_type === "LEVEL_SEARCH_CASCADE2") {
267
- conObjList.push({
268
- field_key: wordbook.grade_key,
269
- con: "EQ",
270
- value: curLevel.level
271
- });
272
- }
273
- if (pageObj) {
274
- Object.assign(params, pageObj);
275
- }
276
- params.conObj = JSON.stringify(conObjList);
277
- params.sqlExperssions = "";
278
- }
279
- }
280
- return params;
281
- }
282
- function handleRowUnique(rows, itemData, uniqueConfig = {}) {
283
- const { myUniqueKey, reqUniqueKey } = uniqueConfig;
284
- const { wordbook } = itemData;
285
- return rows.reduce((acc, cur) => {
286
- cur.setting = wordbook.setting;
287
- cur.showLabel = "";
288
- cur.myUniqueKey = cur[myUniqueKey] || "";
289
- cur.myUniqueLabel = reqUniqueKey || "";
290
- if (wordbook.render_key && wordbook.render_key.length > 0) {
291
- wordbook.render_key.forEach((ren) => {
292
- cur.showLabel += `\u224C${formatField(cur[ren])}`;
293
- });
294
- cur.showLabel = cur.showLabel.slice(1);
295
- } else {
296
- cur.showLabel = cur[wordbook.value_key];
297
- }
298
- if (typeof cur === "object") {
299
- Object.keys(cur || {}).forEach((t) => cur[t] = formatFieldValue(cur[t]));
300
- }
301
- return acc.some((v) => {
302
- return `${v[wordbook.value_key]}-${v[myUniqueKey]}` == `${cur[wordbook.value_key]}-${cur[myUniqueKey]}`;
303
- }) ? acc : [...acc, cur];
304
- }, []);
305
- }
306
- function handleGetSearchDefVal(defFalg, rowData, itemData, uniqueConfig = {}) {
307
- const { is_plugin_set, keyword } = uniqueConfig;
308
- const { wordbook, html_type, val_key, default_val, name } = itemData;
309
- let defVal = props.defaultValue[name] || handleSysParams(default_val || "");
310
- if (is_plugin_set) {
311
- defVal = keyword;
312
- }
313
- if (defFalg && rowData.length) {
314
- let defItem = rowData[0];
315
- let itemKkey = `${defItem[wordbook.value_key]}>>>${defItem["myUniqueKey"]}`;
316
- if (html_type == "SEARCH") {
317
- const f = rowData.find((r) => r[wordbook.value_key] == defVal);
318
- if (f) {
319
- defItem = f;
320
- itemKkey = `${f[wordbook.value_key]}>>>${f["myUniqueKey"]}`;
321
- handleSearchSelect(itemKkey, itemData, "", {
322
- eventType: defFalg ? "init" : "trigger"
323
- });
324
- }
325
- if (defVal != defItem[wordbook.value_key]) {
326
- if (f) {
327
- itemKkey = `${f[wordbook.value_key]}>>>${f["myUniqueKey"]}`;
328
- } else {
329
- itemKkey = defVal;
330
- }
331
- }
332
- if (itemKkey) {
333
- handleSetFieldsValue({ [itemData.val_key]: itemKkey });
334
- } else {
335
- Reflect.set(itemData, "useFormValue", void 0);
336
- }
337
- } else if (html_type == "SEARCH_MORE") {
338
- itemKkey.replace(">>>", "-");
339
- handleSetFieldsValue({
340
- [itemData.val_key]: [
341
- {
342
- key: itemKkey,
343
- label: defItem["showLabel"] || defItem[wordbook.value_key]
344
- }
345
- ]
346
- }, itemData);
347
- multipleSelect({
348
- key: itemKkey,
349
- label: defItem["showLabel"] || defItem[wordbook.value_key]
350
- }, itemData);
351
- }
352
- } else if (defFalg) {
353
- if (html_type == "SEARCH") {
354
- handleSetFieldsValue({
355
- [itemData.val_key]: void 0
356
- }, itemData);
357
- }
358
- }
359
- }
360
- async function handleRequestedOptions(itemData = {}, keyword = void 0, defFalg = false, otherConfig = {}) {
361
- const closeLoading = () => {
362
- fetching.value = false;
363
- searchPageConfig.value.isFetching = false;
364
- };
365
- try {
366
- const { wordbook = {}, val_key, html_type, free_entry, show_type } = itemData;
367
- let { queryParamsType, queryParams = [] } = wordbook;
368
- if (Object.keys(wordbook || {}).length === 0) {
369
- return;
370
- }
371
- if (keyword && typeof keyword === "string")
372
- keyword = keyword.replace(/^\s+|\s+$/, "");
373
- const isCascade = html_type.includes("SEARCH_CASCADE");
374
- const NOWORDBOOK = wordbook.type != "WORDBOOK";
375
- const ISDICTIONARY = wordbook.type === "DICTIONARY";
376
- let params = getSearchDefParams(keyword, itemData, otherConfig);
377
- let formData = getFormValue();
378
- let queryArr = ["SEARCH", "SEARCH_MORE", "SEARCH_CASCADE", "LEVEL_SEARCH_CASCADE", "LEVEL_SEARCH_CASCADE2"];
379
- if (queryArr.includes(html_type) && queryParamsType == 1) {
380
- let tempFormData = handleQueryParams(formData, queryParams);
381
- Object.assign(params, tempFormData);
382
- } else {
383
- Object.assign(params, formData);
384
- }
385
- const arr = ["SEARCH", "SEARCH_MORE"];
386
- if (arr.includes(html_type) && ISDICTIONARY) {
387
- Object.assign(params, {
388
- dictType: JSON.stringify(wordbook.dictType)
389
- });
390
- }
391
- cacheReqOptionsParams.value = JSON.stringify(params);
392
- let reqUniqueKey;
393
- let myUniqueKey = "theUniqueKey";
394
- if (NOWORDBOOK) {
395
- reqUniqueKey = await handleRequestedUniqueKey(wordbook.id);
396
- myUniqueKey = reqUniqueKey || void 0;
397
- }
398
- if (html_type == "SEARCH_MORE" && myUniqueKey == "theUniqueKey") {
399
- myUniqueKey = void 0;
400
- }
401
- props.formType[val_key].wordbook && (props.formType[val_key].wordbook.myUniqueLabel = myUniqueKey);
402
- fetching.value = true;
403
- if (!html_type.includes("SEARCH_CASCADE")) {
404
- cancelOptionsRequest && cancelOptionsRequest();
405
- }
406
- optionsRequestSource.value = axios.CancelToken.source();
407
- if (keyword && !defFalg) {
408
- let key = typeof keyword === "string" ? keyword.trim() : keyword;
409
- key && handleSearchTracher(itemData, {
410
- keyword: key
411
- });
412
- }
413
- Object.assign(params, {
414
- asyncCount: 1
415
- });
416
- return axios.post(`/tableReader/getWordbookData`, $qs.stringify(params), {
417
- cancelToken: optionsRequestSource.value.token
418
- }).then(({ data }) => {
419
- if (otherConfig.page) {
420
- handleSearchScrollTop(itemData);
421
- }
422
- optionsRequestSource.value = null;
423
- fetching.value = false;
424
- if (data.result === "SUCCESS") {
425
- searchAddObj.value[`${itemData.val_key}_${itemData.name}`] = true;
426
- let { rows, fieldList, page, total, hasNextPage } = data.map;
427
- itemData._hasNextPage = hasNextPage;
428
- searchPageConfig.value = Object.assign(searchPageConfig.value, {
429
- page,
430
- hasNextPage,
431
- isRequest: true,
432
- keyword
433
- });
434
- let rowData = [];
435
- if (isCascade) {
436
- wordbook.myUniqueLabel = myUniqueKey;
437
- wordbook.myUniqueKey = myUniqueKey;
438
- wordbook.isLoadData = html_type == "LEVEL_SEARCH_CASCADE";
439
- if (wordbook.isLoadData) {
440
- levelNum.value = defFalg ? 1 : levelNum.value;
441
- }
442
- rows = hanldeRemoveDuplicates(rows, {
443
- key: wordbook.value_key
444
- });
445
- handleFormCascade(rows, wordbook);
446
- rowData = rows;
447
- } else {
448
- rowData = handleRowUnique(rows, itemData, {
449
- myUniqueKey,
450
- reqUniqueKey
451
- });
452
- if (html_type == "SEARCH" && show_type == "tree") {
453
- Object.assign(wordbook, {
454
- myUniqueLabel: myUniqueKey,
455
- myUniqueKey
456
- });
457
- return rowData;
458
- }
459
- if (rowData.length > 0 && wordbook.render_key && wordbook.render_key.length > 1) {
460
- rowData.unshift(Object.assign({}, {
461
- showLabel: getTitleHeader(fieldList, wordbook.render_key),
462
- myUniqueKey: Math.random()
463
- }));
464
- }
465
- }
466
- const searchList = ["SEARCH", "SEARCH_CASCADE", "SEARCH_MORE", "LEVEL_SEARCH_CASCADE"];
467
- if (searchList.includes(html_type)) {
468
- if (html_type != "LEVEL_SEARCH_CASCADE") {
469
- curOptions.value = rowData;
470
- } else {
471
- (defFalg || !loadDataPrimary_key.value) && (curOptions.value = rowData);
472
- }
473
- }
474
- handleGetSearchDefVal(defFalg, rowData, itemData, {
475
- myUniqueKey,
476
- reqUniqueKey,
477
- keyword,
478
- ...otherConfig
479
- });
480
- return rowData;
481
- }
482
- return [];
483
- }).catch((err) => {
484
- console.log(err);
485
- }).finally(() => {
486
- closeLoading();
487
- });
488
- } catch (error) {
489
- closeLoading();
490
- console.log(error);
491
- }
492
- }
493
- function handleFreeEntry(option = {}) {
494
- const { rowData, keyword, wordbook, fieldList, myUniqueKey } = option;
495
- if (!keyword)
496
- return;
497
- const curKey = +new Date();
498
- const data = {
499
- [myUniqueKey]: curKey,
500
- myUniqueKey: curKey,
501
- myUniqueLabel: myUniqueKey,
502
- [wordbook.value_key]: keyword,
503
- is_free_entry_input__add: true
504
- };
505
- const hasRenderKey = wordbook.render_key && wordbook.render_key.length > 1;
506
- if (rowData.length === 0) {
507
- curOptions.value = [];
508
- if (hasRenderKey) {
509
- rowData.unshift({
510
- showLabel: getTitleHeader(fieldList, wordbook.render_key),
511
- myUniqueKey: Math.random()
512
- });
513
- }
514
- }
515
- hasRenderKey ? rowData.splice(1, 0, data) : rowData.unshift(data);
516
- curOptions.value = rowData;
517
- }
518
- function formatField(value) {
519
- let res = value;
520
- try {
521
- if (res && typeof res == "string" && res.startsWith("###")) {
522
- res = res.slice(3);
523
- res = JSON.parse(res);
524
- res = res.change_text;
525
- }
526
- return res || "";
527
- } catch (error) {
528
- return "";
529
- }
530
- }
531
- function formatFieldValue(value) {
532
- try {
533
- if (value && typeof value == "string" && value.startsWith("###")) {
534
- value = value.slice(3);
535
- value = JSON.parse(value);
536
- value = value.value;
537
- }
538
- return value || "";
539
- } catch (error) {
540
- console.log(error);
541
- return "";
542
- }
543
- }
544
- function getTitleHeader(fieldList, renderKey) {
545
- let titleHeader = "";
546
- let renderKeyArr = [];
547
- if (Array.isArray(renderKey)) {
548
- renderKeyArr = [...renderKey];
549
- } else {
550
- renderKeyArr = [renderKey];
551
- }
552
- renderKeyArr.forEach((render) => {
553
- for (let i = 0; i < fieldList.length; i++) {
554
- if (render === fieldList[i].columnName) {
555
- titleHeader += `\u224C${fieldList[i].title}`;
556
- break;
557
- }
558
- }
559
- });
560
- titleHeader = titleHeader.slice(1);
561
- return titleHeader;
562
- }
563
- function handleRequestedUniqueKey(id) {
564
- const starTiem = +new Date();
565
- const getUniqueKey = (resolve, reject) => {
566
- setTimeout(() => {
567
- const res = handleGetUniqueKey(id);
568
- if (res && res.status) {
569
- resolve(res.value);
570
- } else {
571
- let curTime = +new Date();
572
- if (curTime - starTiem > 5e3) {
573
- reject("\u83B7\u53D6UniqueKe \u5F02\u5E38!!");
574
- return;
575
- }
576
- getUniqueKey(resolve, reject);
577
- }
578
- }, 16);
579
- };
580
- return new Promise((resolve, reject) => {
581
- getUniqueKey(resolve, reject);
582
- });
583
- }
584
- function dealDictionatySearch(val) {
585
- curOptions.value = curOptions.value.filter((i) => {
586
- return i.showLabel.includes(val);
587
- });
588
- }
589
- function handleMultipleSearch(val, itemData) {
590
- clearTimeout(timeout.value);
591
- const { wordbook = {}, html_type } = itemData;
592
- const ISDICTIONARY = wordbook.type === "DICTIONARY";
593
- const arr = ["SEARCH", "SEARCH_MORE"];
594
- if (arr.includes(html_type) && ISDICTIONARY && val) {
595
- dealDictionatySearch(val);
596
- return;
597
- }
598
- searchPageConfig.value.keyword = val || void 0;
599
- if (dropdownHide.value && !val) {
600
- return;
601
- }
602
- timeout.value = setTimeout(() => {
603
- handleRequestedOptions(itemData, val);
604
- }, 200);
605
- }
606
- function multipleSelect(e, item) {
607
- const valKey = item.wordbook.value_key;
608
- const selectList = selectedOptions.value || [];
609
- const isSelect = selectList.some((v) => `${v[valKey]}-${v["myUniqueKey"]}` == e.key);
610
- let selectItem = {};
611
- if (!isSelect) {
612
- const fdItem = curOptions.value.find((v) => `${v[valKey]}-${v["myUniqueKey"]}` == e.key);
613
- selectList.push({
614
- ...fdItem
615
- });
616
- selectItem = fdItem;
617
- }
618
- selectedOptions.value = [...selectList];
619
- emit("valueOnChange", [...selectList], item, props.row);
620
- hanlderSendSelectLog(item, selectItem);
621
- handleTableBlur();
622
- }
623
- function multipleDeselect(e, item) {
624
- const valKey = item.wordbook.value_key;
625
- const selectList = selectedOptions.value || [];
626
- const fnIndex = selectList.findIndex((v) => `${v[valKey]}-${v["myUniqueKey"]}` == e.key);
627
- if (fnIndex != -1) {
628
- selectList.splice(fnIndex, 1);
629
- }
630
- selectedOptions.value = [...selectList];
631
- emit("valueOnChange", [...selectList], item, props.row);
632
- }
633
- function handlerAddOptions(data, item) {
634
- curAddBtnItem.value = item;
635
- emit("handlerAddOptions", { data });
636
- }
637
- function searchMoreOnChange(value, item) {
638
- props.formType[item.val_key].isOnchange = "00";
639
- if (!value || value.length === 0) {
640
- emit("valueOnChange", [], item, props.row);
641
- }
642
- }
643
- function handleFormCascade(list = [], v = {}, level = 1) {
644
- list.forEach((item) => {
645
- item.myLabel = hanldeGetCascadelabel(v.render_key, item) || item[v["value_key"]];
646
- item.myUniqueKey = item[v.myUniqueKey];
647
- item.myUniqueLabel = v.myUniqueKey;
648
- if (v.isLoadData) {
649
- item.isLeaf = v.level_num ? levelNum.value >= v.level_num : false;
650
- } else {
651
- if (level >= v.level_num) {
652
- delete item.children;
653
- }
654
- if (item.children && item.children.length) {
655
- handleFormCascade(item.children, v, level + 1);
656
- }
657
- }
658
- });
659
- }
660
- function hanldeGetCascadelabel(v = [], k = {}) {
661
- if (Array.isArray(v) && v.length) {
662
- const l = [];
663
- v.forEach((i) => {
664
- let res = formatField(k[i]);
665
- l.push(res);
666
- });
667
- if (l.length == 0) {
668
- return "";
669
- }
670
- return l.join("_");
671
- }
672
- return "";
673
- }
674
- function handleCascaderChange(option, item) {
675
- Choose_to_complete.value = false;
676
- cascaderInitLabel.value = false;
677
- let [value, selectedOptions2] = option;
678
- selectedOptions2 = selectedOptions2 || [];
679
- let isAllowClear = value.length === 0 && selectedOptions2.length === 0;
680
- if (item.allow_check_mid_level && item.is_allow_check_mid == 1 && !isAllowClear) {
681
- if (item.allow_check_mid_level > ((value == null ? void 0 : value.length) || 0)) {
682
- noAllow_check_mid_level.value = true;
683
- return;
684
- }
685
- }
686
- noAllow_check_mid_level.value = false;
687
- item.selectValue = value;
688
- item.selectedOptions = null;
689
- item.selectedOptions = selectedOptions2;
690
- selectedOptions2.value = [...selectedOptions2];
691
- emit("valueOnChange", [...selectedOptions2], item, props.row);
692
- props.formType[item.val_key].isOnchange = "00";
693
- if (value.length == 0 && selectedOptions2.length == 0) {
694
- props.defaultValue[item.name] = "";
695
- props.formType[item.val_key].default_val = "";
696
- hideHotSearch.value = true;
697
- }
698
- Choose_to_complete.value = true;
699
- }
700
- function handleCascaderFilter(inputValue, path) {
701
- return path.some((option) => option.myLabel.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
702
- }
703
- async function handleCascadeLoadData(selectedOptions2) {
704
- levelNum.value = selectedOptions2.length + 1;
705
- const targetOption = selectedOptions2[selectedOptions2.length - 1];
706
- loadDataPrimary_key.value = targetOption[props.item.wordbook.primary_key];
707
- targetOption.loading = true;
708
- try {
709
- const res = await handleRequestedOptions(props.item, "", false);
710
- targetOption.loading = false;
711
- targetOption.children = res && res.length ? [...res] : void 0;
712
- curOptions.value = [...curOptions.value];
713
- } catch (error) {
714
- console.log(error);
715
- }
716
- }
717
- function handlerDropdownVisibleChange(e, data) {
718
- if (e) {
719
- handleCalculateOptionsMaxWidth();
720
- }
721
- let isRequest = true;
722
- if (optionsMaxWidth.value === "100%") {
723
- handleCalculateOptionsMaxWidth();
724
- }
725
- dropdownHide.value = !e;
726
- if (Object.keys(data || {}).length > 0) {
727
- const searchList2 = ["SEARCH_CASCADE", "LEVEL_SEARCH_CASCADE"];
728
- if (searchList2.includes(data.html_type)) {
729
- isRequest = !(curOptions.value && curOptions.value.length);
730
- }
731
- if (e && ["SEARCH_MORE", "SEARCH"].includes(data.html_type)) {
732
- handlerSearchOnFocus(data);
733
- }
734
- if (e && isRequest) {
735
- handleRequestedOptions(data);
736
- }
737
- if (!e && noAllow_check_mid_level.value && searchList2.includes(data.html_type)) {
738
- setTimeout(() => {
739
- Reflect.set(data, "useFormValue", null);
740
- }, 16);
741
- }
742
- }
743
- if (!e) {
744
- handleCascaderTracher();
745
- setTimeout(() => {
746
- searchPageConfig.value.keyword = void 0;
747
- }, 300);
748
- }
749
- }
750
- function hanlderGetSearchLabel(config, v) {
751
- const { wordbook } = config;
752
- let showLabel = "";
753
- if (!v.is_free_entry_input__add && wordbook.show_key && wordbook.show_key.length) {
754
- wordbook.show_key.forEach((s) => {
755
- showLabel += ` ${formatField(v[s])}`;
756
- });
757
- return showLabel;
758
- }
759
- return v[wordbook.value_key];
760
- }
761
- function hanlderSendSelectLog(item = {}, value) {
762
- const show_key = (item.wordbook && item.wordbook.show_key || [])[0];
763
- const label = show_key ? value[show_key] : "";
764
- label && handleSearchTracher(item, {
765
- select: label
766
- });
767
- }
768
- function handleSearchSelect(e, option, type, eventConfig) {
769
- var _a;
770
- (option == null ? void 0 : option.bindEventSetting) || [];
771
- (eventConfig == null ? void 0 : eventConfig.eventType) === "init";
772
- getFormValue();
773
- const searchOption = curOptions.value;
774
- let selectItem = searchOption.find((ele) => `${ele[option.wordbook.value_key]}>>>${ele["myUniqueKey"]}` === e);
775
- const is_free = (selectItem == null ? void 0 : selectItem.is_free_entry_input__add) || false;
776
- if (is_free) {
777
- selectItem = {};
778
- }
779
- const setting = ((_a = option == null ? void 0 : option.wordbook) == null ? void 0 : _a.setting) || {};
780
- if (Object.keys(selectItem || {}).length > 0 && type === "select") {
781
- hanlderSendSelectLog(option, selectItem);
782
- }
783
- if (selectItem && setting) {
784
- Object.keys(selectItem).forEach((s) => {
785
- if (selectItem[s] && typeof selectItem[s] == "string" && selectItem[s].startsWith("###")) {
786
- selectItem[s] = selectItem[s].slice(3);
787
- selectItem[s] = JSON.parse(selectItem[s]);
788
- selectItem[s] = selectItem[s].value;
789
- }
790
- });
791
- }
792
- }
793
- function handleSearchChangePage(type = "next") {
794
- let cType = type || "next";
795
- let { page, keyword = void 0 } = searchPageConfig.value;
796
- page = cType === "next" ? page + 1 : page - 1;
797
- handleRequestedOptions(props.item, keyword, false, { page });
798
- }
799
- function handleCalculateOptionsMaxWidth() {
800
- var _a;
801
- if (!SELECT_LIST.includes(((_a = props.item) == null ? void 0 : _a.html_type) || void 0)) {
802
- return;
803
- }
804
- nextTick(() => {
805
- var _a2;
806
- const offsetWidth = (_a2 = wrapperRef.value) == null ? void 0 : _a2.offsetWidth;
807
- let res = offsetWidth, maxwith;
808
- try {
809
- let item = wrapperRef.value.querySelector(".ant-select");
810
- if (!item)
811
- return;
812
- const itemRect = item.getBoundingClientRect();
813
- let baseDom = formTable.$el;
814
- const baseRect = baseDom.getBoundingClientRect();
815
- maxwith = baseRect.right - itemRect.left;
816
- if (typeof offsetWidth === "number" && isFinite(maxwith)) {
817
- if (maxwith > offsetWidth) {
818
- res = maxwith;
819
- } else {
820
- res = offsetWidth;
821
- }
822
- }
823
- } catch (error) {
824
- res = offsetWidth;
825
- }
826
- res = parseInt(res + "", 10);
827
- optionsMaxWidth.value = `${res}px`;
828
- });
829
- }
830
- function handlerSearchOnFocus(item) {
831
- if (selectIsOpen.value)
832
- return;
833
- let { queryParamsType, queryParams = [] } = item.wordbook || {};
834
- nextTick(() => {
835
- selsectVisible.value = true;
836
- let formData = props.row;
837
- let params = formData;
838
- if (queryParamsType == 1) {
839
- params = handleQueryParams(formData, queryParams);
840
- }
841
- emit("opentableSelect", true, props.item, params);
842
- });
843
- }
844
- function handleQueryParams(formData, queryParams) {
845
- let tempFormData = {};
846
- if (queryParams.length) {
847
- queryParams.forEach((v) => {
848
- if (v in formData) {
849
- tempFormData[v] = formData[v];
850
- }
851
- });
852
- }
853
- return tempFormData;
854
- }
855
- function confirmSelect({ value, selectRow = [], myUniqueKey }) {
856
- if (props.item.html_type === "SEARCH_MORE") {
857
- let selecteds = baseForm.value.getFieldValue(props.item.val_key) || [];
858
- props.formType[props.item.val_key].isOnchange = "00";
859
- let mergeValList = [...value, ...selecteds];
860
- let mergeSelectList = [...selectRow, ...curMultipleSelected.value];
861
- let valueList = hanldeRemoveDuplicates(mergeValList, {
862
- key: "key"
863
- });
864
- let list = hanldeRemoveDuplicates(mergeSelectList, {
865
- key: myUniqueKey
866
- });
867
- let copy = JSON.parse(JSON.stringify(list));
868
- curOptions.value = [...copy];
869
- Reflect.set(props.item, "useFormValue", valueList);
870
- curMultipleSelected.value = [...copy];
871
- emit("valueOnChange", [...copy], props.item, props.row);
872
- } else {
873
- curOptions.value = [...selectRow];
874
- Reflect.set(props.item, "useFormValue", value);
875
- handleSearchSelect(value, props.item);
876
- }
877
- }
878
- function hanldeRemoveDuplicates(list = [], config = {}) {
879
- if (!Array.isArray(list))
880
- return [];
881
- const { key } = config;
882
- let obj = {};
883
- if (!key)
884
- return list;
885
- let resList = list.reduce((cur, next) => {
886
- obj[next[key]] ? "" : obj[next[key]] = cur.push(next);
887
- return cur;
888
- }, []);
889
- return [...resList];
890
- }
891
- function getFormValue() {
892
- var _a;
893
- let tempRow = JSON.parse(JSON.stringify(props.row));
894
- tempRow = (_a = props.handleFormTableValue) == null ? void 0 : _a.call(props, tempRow, tempRow == null ? void 0 : tempRow._rowIndex_, true);
895
- for (let key in tempRow) {
896
- if (key.startsWith("_") && key.endsWith("_")) {
897
- delete tempRow[key];
898
- }
899
- }
900
- return tempRow;
901
- }
902
- function cancelOptionsRequest() {
903
- if (optionsRequestSource.value && typeof optionsRequestSource.value.cancel === "function") {
904
- optionsRequestSource.value.cancel("\u8BF7\u6C42\u5DF2\u53D6\u6D88\uFF01");
905
- optionsRequestSource.value = null;
906
- }
907
- }
908
- function getHotSearchConfig() {
909
- if (!SELECT_LIST.includes(props.item.html_type) || props.item.is_recommend != "1")
910
- return;
911
- axios.get("form/commonLatestAndHot", {
912
- params: {
913
- formId: props.params_formId,
914
- valKey: props.item.val_key,
915
- htmlType: props.item.html_type
916
- }
917
- }).then(({ data }) => {
918
- var _a, _b;
919
- if (data.result == "SUCCESS") {
920
- hotSearchConfig.value.isRequest = true;
921
- let hotList = (((_a = data == null ? void 0 : data.map) == null ? void 0 : _a.hotList) || []).filter(Boolean);
922
- let latestList = (((_b = data == null ? void 0 : data.map) == null ? void 0 : _b.latestList) || []).filter(Boolean);
923
- hotSearchConfig.value = Object.assign(hotSearchConfig.value, {
924
- hotList,
925
- latestList
926
- });
927
- }
928
- }).catch((err) => {
929
- console.log(err, "getHotSearchConfig");
930
- });
931
- }
932
- function handleSelectHotKeyword(key) {
933
- var _a, _b, _c;
934
- const input = (_a = wrapperRef.value) == null ? void 0 : _a.querySelector(".ant-select-search__field");
935
- if (input) {
936
- input.value = key;
937
- var event = new InputEvent("input");
938
- input.dispatchEvent(event);
939
- } else {
940
- open.value = false;
941
- if (SELECT_LIST.includes(props.item.html_type)) {
942
- if (!key.keyword)
943
- return;
944
- handleSearchTracher(props.item, { select: key.value, keyword: key.keyword });
945
- let input2 = (_b = wrapperRef.value) == null ? void 0 : _b.querySelector(".ant-cascader-input");
946
- let cascader = (_c = wrapperRef.value) == null ? void 0 : _c.querySelector(".ant-cascader-picker");
947
- cascader && cascader.blur();
948
- if (input2) {
949
- input2.blur();
950
- }
951
- }
952
- }
953
- }
954
- function hanldeClearLately() {
955
- axios.post("form/deleteLatestAndHot", $qs.stringify({
956
- formId: props.params_formId,
957
- valKey: props.item.val_key,
958
- htmlType: props.item.html_type
959
- })).then(({ data }) => {
960
- if (data.result == "SUCCESS") ; else {
961
- message.warning(data.resultMsg || $t("1.7.1.10"));
962
- }
963
- });
964
- }
965
- function closeHotSearch() {
966
- hideHotSearch.value = false;
967
- searchShowHotList.value = false;
968
- }
969
- function handleSearchTracher(item, obj = { keyword: "", select: "" }) {
970
- if (!SELECT_LIST.includes((item == null ? void 0 : item.html_type) || void 0))
971
- return;
972
- const { keyword = "", select = "" } = obj || {};
973
- try {
974
- let key = item.html_type === "SEARCH_MORE" ? "\u8868\u5355\u641C\u7D22\u591A\u9009\u6846" : item.html_type === "SEARCH" ? "\u8868\u5355\u641C\u7D22\u6846" : item.html_type === "SEARCH_CASCADE" ? "\u8868\u5355\u7EA7\u8054\u641C\u7D22" : "\u8868\u5355\u9010\u7EA7\u7EA7\u8054";
975
- $_handleTracherLog(key, {
976
- \u8868\u5355ID: props.params_formId,
977
- \u5B57\u6BB5Key: item.val_key,
978
- \u5B57\u6BB5\u540D\u79F0: item.name,
979
- \u641C\u7D22\u5173\u952E\u5B57: keyword,
980
- \u9009\u4E2D\u503C: select
981
- });
982
- } catch (error) {
983
- console.log(error);
984
- }
985
- }
986
- function hanldercheckOption(data) {
987
- return data.wordbook && data.wordbook.add_btn;
988
- }
989
- function handleSearchScrollTop(item) {
990
- try {
991
- let c = `.search-menu-${item.val_key}`;
992
- let list = document.querySelectorAll(c);
993
- list.forEach((v) => {
994
- let u = v.querySelector(".ant-select-dropdown-menu");
995
- if (u) {
996
- u.scrollTop = 0;
997
- }
998
- });
999
- } catch (error) {
1000
- console.log(error, "handleSearchScrollTop");
1001
- }
1002
- }
1003
- function handleCascaderTracher() {
1004
- if (!Choose_to_complete.value) {
1005
- return;
1006
- }
1007
- const CASCADELIST = ["LEVEL_SEARCH_CASCADE", "SEARCH_CASCADE"];
1008
- nextTick(() => {
1009
- var _a;
1010
- if (!CASCADELIST.includes(props.item.html_type))
1011
- return;
1012
- if (Array.isArray(selectedOptions) && selectedOptions.length > 0) {
1013
- let val = props.row[props.item.val_key];
1014
- let keyword = "";
1015
- if (XEUtils.isJSON(val)) {
1016
- keyword = ((_a = JSON.parse(val)) == null ? void 0 : _a.objStr) || "";
1017
- }
1018
- if (!keyword)
1019
- return;
1020
- handleSearchTracher(props.item, {
1021
- select: val,
1022
- keyword
1023
- });
1024
- }
1025
- });
1026
- Choose_to_complete.value = false;
1027
- }
1028
- function handleSearchBlur() {
1029
- try {
1030
- let k = `search-${props.item.val_key}`;
1031
- let t = refs[k];
1032
- if (Array.isArray(t)) {
1033
- t = t[0];
1034
- }
1035
- searchShowHotList.value = false;
1036
- t == null ? void 0 : t.blur();
1037
- } catch (error) {
1038
- console.log(error);
1039
- }
1040
- }
1041
- onMounted(() => {
1042
- init();
1043
- });
1044
- const VNodes = (props2) => h(props2.vnodes);
1045
- VNodes.props = ["vnodes"];
1046
- return {
1047
- VNodes,
1048
- fetching,
1049
- timeout,
1050
- curOptions,
1051
- selectedOptions,
1052
- levelNum,
1053
- cascaderInitLabel,
1054
- defList,
1055
- panelOpen,
1056
- searchAddObj,
1057
- searchPageConfig,
1058
- optionsMaxWidth,
1059
- cacheReqOptionsParams,
1060
- hotSearchConfig,
1061
- searchShowHotList,
1062
- showHotSearchConfig,
1063
- showSearchEmpty,
1064
- selectIsOpen,
1065
- isnoPages,
1066
- init,
1067
- hanldeInitSearchMoreVal,
1068
- getSearchDefParams,
1069
- getCascadeParams,
1070
- handleRowUnique,
1071
- handleGetSearchDefVal,
1072
- handleRequestedOptions,
1073
- handleFreeEntry,
1074
- formatField,
1075
- formatFieldValue,
1076
- getTitleHeader,
1077
- handleRequestedUniqueKey,
1078
- dealDictionatySearch,
1079
- handleMultipleSearch,
1080
- multipleSelect,
1081
- multipleDeselect,
1082
- handlerAddOptions,
1083
- searchMoreOnChange,
1084
- handleFormCascade,
1085
- hanldeGetCascadelabel,
1086
- handleCascaderChange,
1087
- handleCascaderFilter,
1088
- handleCascadeLoadData,
1089
- handlerDropdownVisibleChange,
1090
- hanlderGetSearchLabel,
1091
- hanlderSendSelectLog,
1092
- handleSearchSelect,
1093
- handleSearchChangePage,
1094
- handleCalculateOptionsMaxWidth,
1095
- handlerSearchOnFocus,
1096
- handleQueryParams,
1097
- hideHotSearch,
1098
- confirmSelect,
1099
- hanldeRemoveDuplicates,
1100
- getFormValue,
1101
- cancelOptionsRequest,
1102
- getHotSearchConfig,
1103
- handleSelectHotKeyword,
1104
- hanldeClearLately,
1105
- closeHotSearch,
1106
- handleSearchTracher,
1107
- hanldercheckOption,
1108
- handleSearchScrollTop,
1109
- handleCascaderTracher,
1110
- handleSearchBlur,
1111
- curMultipleSelected,
1112
- formTable,
1113
- hasErr,
1114
- handleGetJsonStr,
1115
- handleSetFieldsValue,
1116
- handleGetUniqueKey,
1117
- handleSysParams,
1118
- defaultInit,
1119
- handleTableBlur,
1120
- handleFormParams,
1121
- radioColor,
1122
- handleGetAgeUnit,
1123
- handleAgeToBirthDay,
1124
- changeAgeSelect,
1125
- handlerSetIdCarInfoValidate,
1126
- getInputCheck,
1127
- getCustomRegular,
1128
- checkDigital,
1129
- checkAgeJson,
1130
- checkAge,
1131
- checkMultipleChoice,
1132
- checkLength,
1133
- checkinputBlank,
1134
- handlerGetDateType,
1135
- checkSearchCascade,
1136
- checkMultipleTree,
1137
- handleDateClearBtn,
1138
- handleStartDateEndDate,
1139
- showTimePanel,
1140
- momentLib,
1141
- judgeTimeBoundary,
1142
- setTimeValue,
1143
- judgeTimeRange,
1144
- isSameDate,
1145
- setDefaultCurrent,
1146
- handleDefaultRimeRange,
1147
- judgeMinMaxDateIsSameDate,
1148
- handleDefaultTimeRange,
1149
- changeTimeDate,
1150
- setTimeRangeArr
1151
- };
1152
- }
1153
-
1154
- export { useSearch };