cnhis-design-vue 2.1.17 → 2.1.18

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 (122) hide show
  1. package/CHANGELOG.md +2219 -2219
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +164 -164
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +32 -32
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/empty/index.js +8 -8
  33. package/es/fabric-chart/index.js +34 -34
  34. package/es/form/index.js +8 -8
  35. package/es/form-model/index.js +8 -8
  36. package/es/form-table/index.js +62 -62
  37. package/es/index/index.js +672 -657
  38. package/es/index/style.css +1 -1
  39. package/es/input/index.js +9 -9
  40. package/es/input-number/index.js +8 -8
  41. package/es/layout/index.js +8 -8
  42. package/es/list/index.js +8 -8
  43. package/es/locale-provider/index.js +8 -8
  44. package/es/map/index.js +9 -9
  45. package/es/mentions/index.js +8 -8
  46. package/es/menu/index.js +8 -8
  47. package/es/message/index.js +8 -8
  48. package/es/multi-chat/index.js +92 -92
  49. package/es/multi-chat-client/index.js +86 -86
  50. package/es/multi-chat-history/index.js +4 -4
  51. package/es/multi-chat-record/index.js +14 -14
  52. package/es/multi-chat-setting/index.js +81 -66
  53. package/es/multi-chat-setting/style.css +1 -1
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-view/index.js +33 -33
  66. package/es/select/index.js +11 -11
  67. package/es/select-label/index.js +11 -11
  68. package/es/select-person/index.js +20 -20
  69. package/es/skeleton/index.js +8 -8
  70. package/es/slider/index.js +8 -8
  71. package/es/space/index.js +8 -8
  72. package/es/spin/index.js +8 -8
  73. package/es/statistic/index.js +8 -8
  74. package/es/steps/index.js +8 -8
  75. package/es/switch/index.js +8 -8
  76. package/es/table-filter/index.js +118 -118
  77. package/es/tabs/index.js +8 -8
  78. package/es/tag/index.js +9 -9
  79. package/es/time-picker/index.js +8 -8
  80. package/es/timeline/index.js +8 -8
  81. package/es/tooltip/index.js +8 -8
  82. package/es/transfer/index.js +8 -8
  83. package/es/tree/index.js +8 -8
  84. package/es/tree-select/index.js +8 -8
  85. package/es/upload/index.js +8 -8
  86. package/es/verification-code/index.js +2 -2
  87. package/lib/cui.common.js +620 -605
  88. package/lib/cui.umd.js +620 -605
  89. package/lib/cui.umd.min.js +71 -71
  90. package/package.json +106 -106
  91. package/packages/big-table/src/BigTable.vue +3038 -3038
  92. package/packages/big-table/src/assets/style/table-base.less +370 -370
  93. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  94. package/packages/big-table/src/utils/batchEditing.js +610 -610
  95. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  96. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  97. package/packages/button/src/ButtonPrint/index.vue +728 -728
  98. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -1
  99. package/packages/fabric-chart/src/components/TimeScaleValue.vue +117 -117
  100. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  101. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +960 -960
  102. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  103. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  104. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  105. package/packages/multi-chat/chat/chatFooter.vue +1598 -1598
  106. package/packages/multi-chat/chat/chatMain.vue +1442 -1442
  107. package/packages/multi-chat/chat/quickReply.vue +439 -439
  108. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  109. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1302
  110. package/packages/multi-chat/store/actions.js +448 -448
  111. package/packages/multi-chat/store/state.js +112 -112
  112. package/packages/scale-view/formitem/r-choice.vue +714 -714
  113. package/packages/scale-view/scaleView.vue +2010 -2010
  114. package/packages/select-person/select-person.vue +1658 -1658
  115. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  116. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  117. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  118. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  119. package/packages/table-filter/src/const/dataOptions.js +43 -43
  120. package/packages/table-filter/src/mixins/mixins.js +695 -695
  121. package/packages/table-filter/src/quick-search/QuickSearch.vue +2083 -2083
  122. package/src/directive/preventReClick.js +12 -12
@@ -1,2083 +1,2083 @@
1
-
2
- <template>
3
- <div>
4
- <div class="form-box" :class="{ 'quick-search-table': source === 'editTable' }">
5
- <p class="module-title" v-if="source === 'editTable' && hasRelationQuickSearch">高级筛选</p>
6
- <div
7
- class="quick-item"
8
- v-for="item in quickSearch"
9
- :key="item.sid"
10
- :class="{
11
- 'quick-block':
12
- item.con == 'DATE' || item.con == 'BIRTHDAY' || item.con == 'CONVERT' || item.LABELAttr
13
- }"
14
- >
15
- <div class="quick-row">
16
- <!-- title -->
17
- <div
18
- class="quick-item-title"
19
- :class="{ 'quick-item-title-default': source !== 'editTable' }"
20
- >
21
- <span>{{ handleName(item, "title") }}&nbsp;&nbsp;</span>
22
- <a-tooltip
23
- v-if="searchFieldLimit[item.columnName] && searchFieldLimit[item.columnName].tips"
24
- :title="searchFieldLimit[item.columnName].tips"
25
- >
26
- <svg-icon icon-class="xitongtubiaodaohangtubiaowenti" />
27
- &nbsp;&nbsp;
28
- </a-tooltip>
29
- </div>
30
- <div class="quick-item-col" :class="{ 'quick-item-col-default': source !== 'editTable' }">
31
- <!-- age -->
32
- <!-- TODO: 清除,跨表 -->
33
- <div v-if="item.AGEAttr" class="age-container">
34
- <range-age
35
- :ref="`${item.columnName}_AGEAttr`"
36
- :format="item.format"
37
- @change="ageRangeOnChange($event, item)"
38
- ></range-age>
39
- </div>
40
- <!-- age -->
41
- <!-- label -->
42
- <div v-else-if="item.LABELAttr" class="label-attr-container">
43
- <slot v-if="item.labelObj && Object.keys(item.labelObj || {}).length > 0">
44
- <div v-for="(v, k) in item.labelObj" :key="k" class="edit-label-content">
45
- <div class="edit-label">{{ k }}:</div>
46
-
47
- <div
48
- class="edit-content quickSearch_label-container"
49
- :class="{
50
- 'label-container-height': !v.isUnfold && v.itemList && v.isShowBtn
51
- }"
52
- >
53
- <div class="label-content" v-resize="el => onResize(el, v)">
54
- <a-checkable-tag
55
- v-for="(v, i) in v.itemList"
56
- v-model="v.isSelect"
57
- @change="handleLabelChange($event, v, item)"
58
- :key="i"
59
- :style="handleLabelColor(v)"
60
- >
61
- <a-tooltip placement="topLeft">
62
- <template slot="title">
63
- <span>{{ v.labelName }}</span>
64
- </template>
65
- {{ v.labelName }}
66
- </a-tooltip>
67
- </a-checkable-tag>
68
- </div>
69
- </div>
70
- <div class="label-unfold-btn" v-if="v.itemList && v.isShowBtn">
71
- <!-- {{ v.isUnfold }} -->
72
- <span @click.stop="handleLabelUpfold(v)">
73
- <template v-if="v.isUnfold">
74
- <span>收起</span>
75
- <a-icon
76
- type="up-square"
77
-
78
- />
79
- </template>
80
- <template v-else>
81
- <span>展开</span>
82
- <a-icon
83
- type="down-square"
84
- />
85
- </template>
86
- </span>
87
- </div>
88
- </div>
89
- </slot>
90
- <a-input v-else style="width: 200px" v-model="item.inputVal" allowClear></a-input>
91
- </div>
92
- <!-- label -->
93
-
94
- <!-- EVALUATE -->
95
- <div v-else-if="item.EVALUATEAttr">
96
- <template v-for="tag in EVALUATEList">
97
- <a-checkable-tag
98
- :key="tag.value"
99
- :checked="item.selecteds.indexOf(tag.value) > -1"
100
- @change="checked => handleEvaluateOnChange(tag, checked, item)"
101
- >
102
- {{ tag.label }}
103
- </a-checkable-tag>
104
- </template>
105
- <!-- <a-icon v-if="item.CL" type="close" @click="item.CL = ''" /> -->
106
- </div>
107
- <!-- EVALUATE -->
108
-
109
- <!-- NUMBERFiled -->
110
- <div v-else-if="item.NUMBERFiled" class="ant-calendar-picker" style="width: 300px">
111
- <span
112
- class="ant-calendar-picker-input ant-input num-picker"
113
- :class="{ 'num-picker-unit': item.inputUnit }"
114
- >
115
- <input
116
- v-model="item.lessValue"
117
- @keyup.enter="() => changeFilterNumber(item)"
118
- :title="`起始${item.alias || item.title}`"
119
- :placeholder="`起始${item.alias || item.title}`"
120
- class="ant-calendar-range-picker-input"/>
121
- <span class="ant-calendar-range-picker-separator"> ~ &nbsp;</span>
122
- <input
123
- v-model="item.bigValue"
124
- :title="`截止${item.alias || item.title}`"
125
- @keyup.enter="() => changeFilterNumber(item)"
126
- :placeholder="`截止${item.alias || item.title}`"
127
- class="ant-calendar-range-picker-input"/>
128
- <template v-if="item.inputUnit">&nbsp;{{ item.inputUnit }}</template>
129
- <span
130
- class="ant-input-suffix clear-number-icon"
131
- v-if="item.lessValue || item.bigValue"
132
- @click="clearFilterNumber(item)"
133
- ><i
134
- aria-label="图标: close-circle"
135
- tabindex="-1"
136
- class="anticon anticon-close-circle ant-input-clear-icon"
137
- ><svg
138
- viewBox="64 64 896 896"
139
- data-icon="close-circle"
140
- width="1em"
141
- height="1em"
142
- fill="currentColor"
143
- aria-hidden="true"
144
- focusable="false"
145
- class=""
146
- >
147
- <path
148
- d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
149
- ></path></svg></i></span
150
- ></span>
151
- </div>
152
- <!-- NUMBERFiled -->
153
-
154
- <!-- other -->
155
- <slot v-else>
156
- <template v-if="item.con == 'CL'">
157
- <template v-if="showPercent(item)">
158
- <a-input-number
159
- class="CL-input"
160
- :style="`width: ${getEleWidth(item)}`"
161
- v-model="item.CL"
162
- :min="0"
163
- :max="100"
164
- allowClear
165
- />
166
- </template>
167
- <template v-else>
168
- <a-input
169
- class="CL-input"
170
- :style="{
171
- width: `${getEleWidth(item)}`,
172
- 'font-family': item.PASSWORDTYPE ? 'text-security-disc' : 'inherit'
173
- }"
174
- v-model="item.CL"
175
- :class="{ 'psw-icon': item.comAttr == 'PASSWORD' }"
176
- allowClear
177
- >
178
- <template slot="suffix" v-if="item.comAttr == 'PASSWORD'">
179
- <svg-icon
180
- class="psw-icon"
181
- @click="item.PASSWORDTYPE = !item.PASSWORDTYPE"
182
- :icon-class="item.PASSWORDTYPE ? 'anniuyincang' : 'chakan'"
183
- style="font-size: 1em;"
184
- />
185
- </template>
186
- </a-input>
187
- </template>
188
- </template>
189
- <template v-if="item.con == 'EQ'">
190
- <template v-if="showPercent(item)">
191
- <a-input-number
192
- class="EQ-input"
193
- :style="`width: ${getEleWidth(item)}`"
194
- v-model="item.EQ"
195
- :min="0"
196
- :max="100"
197
- allowClear
198
- />
199
- </template>
200
- <template v-else>
201
- <a-input
202
- :class="{ 'psw-icon': item.comAttr == 'PASSWORD' }"
203
- class="EQ-input"
204
- :style="{
205
- width: `${getEleWidth(item)}`,
206
- 'font-family': item.PASSWORDTYPE ? 'text-security-disc' : 'inherit'
207
- }"
208
- v-model="item.EQ"
209
- :placeholder="item.isPreciseSearch || item.fieldType == 'JSONB' ? '' : getI18nText('1.9.6', '区间搜素用~分割')"
210
- allowClear
211
- >
212
- <template slot="suffix" v-if="item.comAttr == 'PASSWORD'">
213
- <svg-icon
214
- class="psw-icon"
215
- @click="item.PASSWORDTYPE = !item.PASSWORDTYPE"
216
- :icon-class="item.PASSWORDTYPE ? 'anniuyincang' : 'chakan'"
217
- style="font-size: 1em;"
218
- />
219
- </template>
220
- </a-input>
221
- </template>
222
- </template>
223
- <template v-if="showPercent(item)">&nbsp;%</template>
224
- <!-- date -->
225
- <div v-if="item.con == 'DATE'">
226
- <a-radio-group v-model="item.DATE.con" buttonStyle="solid">
227
- <a-radio-button
228
- v-for="date in item.dateTeam"
229
- v-show="!item.showDate"
230
- @click="clickRadioGroup(item.DATE, date.con)"
231
- :key="date.con"
232
- :value="date.con"
233
- >{{ getI18nText(date.title, date.name) }}
234
- </a-radio-button>
235
- <span v-show="item.advanceOptionSetting != 1" :class="['check-date-btn', item.marginx]" @click="checkDate(item)">{{
236
- getI18nText('1.1.4.52', '选择时间')
237
- }}</span>
238
- <div class="check-date" v-show="item.showDate">
239
- <a-date-picker
240
- format="YYYY-MM-DD HH:mm:ss"
241
- v-model="item.DATE.start_val"
242
- :show-time="{
243
- defaultValue: $moment('00:00:00', 'HH:mm:ss')
244
- }"
245
- :placeholder="getI18nText('1.1.4.53', '开始时间')"
246
- style="width: 120px"
247
- allowClear
248
- />
249
- &nbsp;
250
- <a-date-picker
251
- format="YYYY-MM-DD HH:mm:ss"
252
- :show-time="{
253
- defaultValue: $moment('23:59:59', 'HH:mm:ss')
254
- }"
255
- :placeholder="getI18nText('1.9.147', '结束时间')"
256
- v-model="item.DATE.end_val"
257
- style="width: 120px"
258
- allowClear
259
- />
260
- </div>
261
- </a-radio-group>
262
- </div>
263
- <!-- BIRTHDAY -->
264
- <div v-if="item.con == 'BIRTHDAY'" :class="{ 'birthday-item': item.showDate }">
265
- <a-radio-group v-model="item.BIRTHDAY.con" buttonStyle="solid">
266
- <template v-if="!item.showDate">
267
- <a-radio-button
268
- v-for="date in birthdayTeam"
269
- @click="clickBirthdayRadioGroup(item.BIRTHDAY, date.con)"
270
- :key="date.con"
271
- :value="date.con"
272
- >{{ getI18nText(date.title, date.name) }}
273
- </a-radio-button>
274
- </template>
275
- <template v-else>
276
- <div>
277
- <a-range-picker
278
- v-model="item.BIRTHDAY.limit_date"
279
- :disabledDate="disabledDate"
280
- @change="changeRange"
281
- format="MM-DD"
282
- />
283
- </div>
284
- <div class="age-wrap">
285
- <p>{{ getI18nText('1.2.5.34', '年龄') }}</p>
286
- <a-input
287
- style="width: 60px; margin-right: 10px"
288
- v-model="item.BIRTHDAY.start_val"
289
- allowClear
290
- />
291
- <a-input
292
- style="width: 60px; margin-right: 10px"
293
- v-model="item.BIRTHDAY.end_val"
294
- allowClear
295
- />
296
- <a-select
297
- v-model="item.BIRTHDAY.unit"
298
- defaultValue="YEAR"
299
- showSearch
300
- :filterOption="filterOption"
301
- allowClear
302
- >
303
- <a-select-option
304
- v-for="v in item.BIRTHDAY.units"
305
- :key="v.con"
306
- :value="v.con"
307
- >
308
- {{ getI18nText(v.title, v.name) }}
309
- </a-select-option>
310
- </a-select>
311
- </div>
312
- </template>
313
- <span :class="['check-date-btn', item.marginx]" @click="checkBirthDay(item)">{{
314
- getI18nText('1.1.5.2', '切换')
315
- }}</span>
316
- </a-radio-group>
317
- </div>
318
- <!-- <a-select
319
- v-if="item.con == 'QUOTE'"
320
- v-model="item.QUOTE"
321
- mode="multiple"
322
- :placeholder="$t('1.1.6.7')"
323
- :tokenSeparators="['|#|']"
324
- style="width: 200px"
325
- :filter-option="false"
326
- @dropdownVisibleChange="dropdownVisibleChange($event, item)"
327
- @search="handleSearch($event, item)"
328
- showSearch
329
- allowClear
330
- >
331
- <a-select-option
332
- v-for="sea in item.dataSource"
333
- :key="item.sid + sea.myName"
334
- :value="sea.myName"
335
- >
336
- {{ sea.showKeys || sea.myName }}
337
- </a-select-option>
338
- </a-select> -->
339
- <template v-if="item.con == 'QUOTE' || item.com == 'SelectMui'">
340
- <c-tree-select
341
- v-if="item.comType === 'treeSelect'"
342
- :item="item"
343
- :handleGetConfigApi="handleGetConfigApi"
344
- style="margin: 0 8px 8px 0"
345
- />
346
- <multiSelect
347
- v-else
348
- :item="item"
349
- source="quickSearch"
350
- :maxTagPlaceholder="maxTagPlaceholder"
351
- :outFilterChange="filterChange"
352
- :handleWordBookSearch="handleSearch"
353
- :dropdownVisibleChange="dropdownVisibleChange"
354
- :fetchingWordbook="fetchingWordbook"
355
- ></multiSelect>
356
- </template>
357
-
358
- <a-checkbox-group
359
- class="check-box"
360
- v-else-if="item.con == 'CONVERT'"
361
- :options="item.setting.showSetting"
362
- v-model="item.CONVERT"
363
- />
364
- </slot>
365
- </div>
366
- </div>
367
- </div>
368
- <!-- 跨表 -->
369
- <template v-for="(relationItem, i) in relationQuickSearch">
370
- <div :key="i" v-if="relationItem.fieldList && relationItem.fieldList.length">
371
- <p class="module-title">{{ relationItem.tableName }}</p>
372
- <div
373
- class="quick-item"
374
- v-for="item in relationItem.fieldList"
375
- :key="item.sid"
376
- :class="{
377
- 'quick-block':
378
- item.con == 'DATE' ||
379
- item.con == 'BIRTHDAY' ||
380
- item.con == 'CONVERT' ||
381
- item.LABELAttr
382
- }"
383
- >
384
- <div class="quick-row">
385
- <!-- title -->
386
- <div
387
- class="quick-item-title"
388
- :class="{ 'quick-item-title-default': source !== 'editTable' }"
389
- >
390
- <span>{{ handleName(item, "title") }}&nbsp;&nbsp;</span>
391
- </div>
392
- <div
393
- class="quick-item-col"
394
- :class="{ 'quick-item-col-default': source !== 'editTable' }"
395
- >
396
- <div v-if="item.LABELAttr">
397
- <slot v-if="item.labelObj && Object.keys(item.labelObj || {}).length > 0">
398
- <div v-for="(v, k) in item.labelObj" :key="k" class="edit-label-content">
399
- <div class="edit-label">{{ k }}:</div>
400
- <div class="edit-content">
401
- <div class="label-content">
402
- <a-checkable-tag
403
- v-for="(v, i) in v.itemList"
404
- v-model="v.isSelect"
405
- @change="handleLabelChange($event, v, item)"
406
- :key="i"
407
- :class="['label-tag-' + handleLabelColorClass(v)]"
408
- >
409
- <a-tooltip placement="topLeft">
410
- <template slot="title">
411
- <span>{{ v.labelName }}</span>
412
- </template>
413
- {{ v.labelName }}
414
- </a-tooltip>
415
- </a-checkable-tag>
416
- </div>
417
- </div>
418
- </div>
419
- </slot>
420
- <a-input v-else style="width: 200px" v-model="item.inputVal"> </a-input>
421
- </div>
422
-
423
- <!-- EVALUATE -->
424
- <div v-else-if="item.EVALUATEAttr">
425
- <template v-for="tag in EVALUATEList">
426
- <a-checkable-tag
427
- :key="tag.value"
428
- :checked="item.selecteds.indexOf(tag.value) > -1"
429
- @change="checked => handleEvaluateOnChange(tag, checked, item)"
430
- >
431
- {{ tag.label }}
432
- </a-checkable-tag>
433
- </template>
434
- <!-- <a-icon v-if="item.CL" type="close" @click="item.CL = ''" /> -->
435
- </div>
436
- <!-- EVALUATE -->
437
-
438
- <!-- NUMBERFiled -->
439
- <div v-else-if="item.NUMBERFiled" class="ant-calendar-picker" style="width: 300px">
440
- <span
441
- class="ant-calendar-picker-input ant-input num-picker"
442
- :class="{ 'num-picker-unit': item.inputUnit }"
443
- >
444
- <input
445
- v-model="item.lessValue"
446
- @keyup.enter="() => changeFilterNumber(item)"
447
- :title="`起始${item.alias || item.title}`"
448
- :placeholder="`起始${item.alias || item.title}`"
449
- class="ant-calendar-range-picker-input"/>
450
- <span class="ant-calendar-range-picker-separator"> ~ &nbsp;</span>
451
- <input
452
- v-model="item.bigValue"
453
- :title="`截止${item.alias || item.title}`"
454
- @keyup.enter="() => changeFilterNumber(item)"
455
- :placeholder="`截止${item.alias || item.title}`"
456
- class="ant-calendar-range-picker-input"/>
457
- <template v-if="item.inputUnit">&nbsp;{{ item.inputUnit }}</template>
458
- <span
459
- class="ant-input-suffix clear-number-icon"
460
- v-if="item.lessValue || item.bigValue"
461
- @click="clearFilterNumber(item)"
462
- ><i
463
- aria-label="图标: close-circle"
464
- tabindex="-1"
465
- class="anticon anticon-close-circle ant-input-clear-icon"
466
- ><svg
467
- viewBox="64 64 896 896"
468
- data-icon="close-circle"
469
- width="1em"
470
- height="1em"
471
- fill="currentColor"
472
- aria-hidden="true"
473
- focusable="false"
474
- class=""
475
- >
476
- <path
477
- d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
478
- ></path></svg></i
479
- ></span>
480
- <span class="ant-calendar-picker-icon"></span
481
- ></span>
482
- </div>
483
- <!-- NUMBERFiled -->
484
-
485
- <slot v-else>
486
- <template v-if="item.con == 'CL'">
487
- <template v-if="showPercent(item)">
488
- <a-input-number
489
- class="CL-input"
490
- :style="`width: ${getEleWidth(item)}`"
491
- v-model="item.CL"
492
- :min="0"
493
- :max="100"
494
- allowClear
495
- />
496
- </template>
497
- <template v-else>
498
- <a-input class="CL-input" :style="`width: ${getEleWidth(item)}`" v-model="item.CL" allowClear>
499
- </a-input>
500
- </template>
501
- </template>
502
- <template v-if="item.con == 'EQ'">
503
- <template v-if="showPercent(item)">
504
- <a-input-number
505
- class="EQ-input"
506
- :style="`width: ${getEleWidth(item)}`"
507
- v-model="item.EQ"
508
- :min="0"
509
- :max="100"
510
- allowClear
511
- />
512
- </template>
513
- <template v-else>
514
- <a-input
515
- class="EQ-input"
516
- :style="`width: ${getEleWidth(item)}`"
517
- v-model="item.EQ"
518
- :placeholder="item.isPreciseSearch || item.fieldType == 'JSONB' ? '' : getI18nText('1.9.6', '区间搜素用~分割')"
519
- allowClear
520
- >
521
- </a-input>
522
- </template>
523
- </template>
524
- <template v-if="showPercent(item)">&nbsp;%</template>
525
- <!-- date -->
526
- <div v-if="item.con == 'DATE'">
527
- <a-radio-group v-model="item.DATE.con" buttonStyle="solid">
528
- <a-radio-button
529
- v-for="date in dateTeam"
530
- v-show="!item.showDate"
531
- @click="clickRadioGroup(item.DATE, date.con)"
532
- :key="date.con"
533
- :value="date.con"
534
- >{{ getI18nText(date.title, date.name) }}
535
- </a-radio-button>
536
- <span :class="['check-date-btn', item.marginx]" @click="checkDate(item)">{{
537
- getI18nText('1.1.4.53', '开始时间')
538
- }}</span>
539
- <div class="check-date" v-show="item.showDate">
540
- <a-date-picker
541
- format="YYYY-MM-DD HH:mm:ss"
542
- v-model="item.DATE.start_val"
543
- :show-time="{
544
- defaultValue: $moment('00:00:00', 'HH:mm:ss')
545
- }"
546
- :placeholder="'起始日期'"
547
- style="width: 120px"
548
- allowClear
549
- />
550
- &nbsp;
551
- <a-date-picker
552
- format="YYYY-MM-DD HH:mm:ss"
553
- v-model="item.DATE.end_val"
554
- :placeholder="'截止日期'"
555
- :show-time="{
556
- defaultValue: $moment('23:59:59', 'HH:mm:ss')
557
- }"
558
- style="width: 120px"
559
- allowClear
560
- />
561
- </div>
562
- </a-radio-group>
563
- </div>
564
- <!-- <a-select
565
- v-if="item.con == 'QUOTE'"
566
- v-model="item.QUOTE"
567
- mode="multiple"
568
- :placeholder="$t('1.1.6.7')"
569
- :tokenSeparators="['|#|']"
570
- style="width: 200px"
571
- :filter-option="false"
572
- @dropdownVisibleChange="dropdownVisibleChange($event, item)"
573
- @search="handleSearch($event, item)"
574
- showSearch
575
- allowClear
576
- >
577
- <a-select-option
578
- v-for="sea in item.dataSource"
579
- :key="item.sid + sea.myName"
580
- :value="sea.myName"
581
- >
582
- {{ sea.myName }}
583
- </a-select-option>
584
- </a-select> -->
585
- <template v-if="item.con == 'QUOTE' || item.com == 'SelectMui'">
586
- <c-tree-select
587
- v-if="item.comType === 'treeSelect'"
588
- :item="item"
589
- :handleGetConfigApi="handleGetConfigApi"
590
- style="margin: 0 8px 8px 0"
591
- />
592
- <multiSelect
593
- v-else
594
- :item="item"
595
- source="quickSearch"
596
- :maxTagPlaceholder="maxTagPlaceholder"
597
- :outFilterChange="filterChange"
598
- :handleWordBookSearch="handleSearch"
599
- :dropdownVisibleChange="dropdownVisibleChange"
600
- :fetchingWordbook="fetchingWordbook"
601
- ></multiSelect>
602
- </template>
603
-
604
- <a-checkbox-group
605
- class="check-box"
606
- v-else-if="item.con == 'CONVERT'"
607
- :options="item.setting.showSetting"
608
- v-model="item.CONVERT"
609
- />
610
- </slot>
611
- </div>
612
- </div>
613
- </div>
614
- </div>
615
- </template>
616
- </div>
617
-
618
- <a-modal
619
- :title="'设置筛选分类'"
620
- :visible="showInner"
621
- @ok="saveToCalss"
622
- @cancel="cancelSaveToCalss"
623
- wrapClassName="quickSearch-saveToClass-modal"
624
- >
625
- <a-form :form="formInner" :label-col="{ span: 5 }" :wrapper-col="{ span: 18 }">
626
- <a-form-item :label="'筛选集名称'">
627
- <a-input
628
- v-decorator="[
629
- 'classname',
630
- {
631
- rules: [{ required: true, message: getI18nText('1.1.6.6', '请输入分类名称') }]
632
- }
633
- ]"
634
- />
635
- </a-form-item>
636
- </a-form>
637
- <a-row>
638
- <a-col :span="5" style="text-align: right; color: rgba(0, 0, 0, 0.85)"> 父类名称: </a-col>
639
- <a-col :span="18">
640
- <div
641
- class="edit-tag"
642
- v-for="(item, index) in parentNames"
643
- :key="index"
644
- @dblclick="e => editParentName(e, item)"
645
- @click="handleParentNameSelect(item, index)"
646
- :class="{ 'edit-tag-select': item.selected && item.disabled }"
647
- >
648
- <a-input
649
- style="width: 100px"
650
- :value="item"
651
- :disabled="item.disabled"
652
- @blur="() => (item.disabled = true)"
653
- v-model="item.value"
654
- />
655
- <a-icon slot="suffix" type="close" @click="handleParentNamesRemove(index, item)" />
656
- </div>
657
- <template v-if="!parentNamesHasAdd">
658
- <a-button
659
- v-show="!showAdd"
660
- icon="plus"
661
- type="dashed"
662
- class="add-parent"
663
- @click="handleParentNamesAdd"
664
- >
665
- {{ getI18nText('1.9.363', '添加分类') }}
666
- </a-button>
667
- <a-input
668
- class="edit-tag"
669
- v-model.trim="addVal"
670
- v-show="showAdd"
671
- style="width: 100px"
672
- @blur="hanldeBlur"
673
- />
674
- </template>
675
- </a-col>
676
- </a-row>
677
- </a-modal>
678
- </div>
679
- <!-- </a-modal> -->
680
- </template>
681
-
682
- <script>
683
- const EVALUATEList = [
684
- {
685
- label: "一星",
686
- value: "1",
687
- isSelect: false
688
- },
689
- {
690
- label: "二星",
691
- value: "2",
692
- isSelect: false
693
- },
694
- {
695
- label: "三星",
696
- value: "3",
697
- isSelect: false
698
- },
699
- {
700
- label: "四星",
701
- value: "4",
702
- isSelect: false
703
- },
704
- {
705
- label: "五星",
706
- value: "5",
707
- isSelect: false
708
- }
709
- ];
710
-
711
- const AGEOPTIONS = [
712
- {
713
- label: "岁",
714
- value: "YY"
715
- },
716
- {
717
- label: "月",
718
- value: "MM"
719
- },
720
- {
721
- label: "日",
722
- value: "DD"
723
- }
724
- ];
725
- import tableSearchCon from "../mixins/tableSearchCon";
726
- import moment from 'moment';
727
- import 'moment/locale/zh-cn';
728
- // antd
729
- import _ from 'lodash';
730
- import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu, Radio, Checkbox, Row, Tag, InputNumber, Col, Form, Modal, Tooltip } from 'ant-design-vue';
731
- import rangeAge from '../components/range-age/index';
732
- import multiSelect from '../components/multi-select/multi-select';
733
- import resize from 'vue-resize-directive';
734
- import { durationMixin, $utils, filterApiFn } from '../mixins/mixins';
735
- import vexutils from '@/utils/vexutils';
736
- import wordBookutils from '../mixins/wordBookutils';
737
- import cTreeSelect from '../components/c-tree-select/tree-select';
738
- import create from '@/core/create';
739
- import utils from '@/utils/utils-map';
740
- import {dataOptions} from '../const/dataOptions'
741
- export default create({
742
- name: "quick-search",
743
- mixins: [durationMixin, $utils, filterApiFn, tableSearchCon],
744
- props: {
745
- visible: Boolean,
746
- searchFieldList: {
747
- type: Array,
748
- default: () => []
749
- },
750
- searchFieldLimit: {
751
- type: Object,
752
- default: () => ({})
753
- },
754
- quickSearchConfig: Array,
755
- source: String,
756
- quickSearchListObj: Object,
757
- originConditionList: Array,
758
- isOrgAdmin: Boolean,
759
- lastQuickSearchData: Array,
760
- show: Boolean,
761
- getFilterData: Function
762
- },
763
- components: {
764
- rangeAge,
765
- [Button.name]: Button,
766
- [Icon.name]: Icon,
767
- [Dropdown.name]: Dropdown,
768
- [Select.name]: Select,
769
- [Select.Option.name]: Select.Option,
770
- [Upload.name]: Upload,
771
- [DatePicker.name]: DatePicker,
772
- [DatePicker.RangePicker.name]: DatePicker.RangePicker,
773
- [Input.name]: Input,
774
- [Input.Group.name]: Input.Group,
775
- [InputNumber.name]: InputNumber,
776
- [Input.Search.name]: Input.Search,
777
- [Menu.name]: Menu,
778
- [Menu.Item.name]: Menu.Item,
779
- [Menu.ItemGroup.name]: Menu.ItemGroup,
780
- [Radio.name]: Radio,
781
- [Radio.Button.name]: Radio.Button,
782
- [Radio.Group.name]: Radio.Group,
783
- [Checkbox.name]: Checkbox,
784
- [Checkbox.Group.name]: Checkbox.Group,
785
- [Row.name]: Row,
786
- [Col.name]: Col,
787
- [Tag.name]: Tag,
788
- AModal: Modal,
789
- [Form.name]: Form,
790
- [Tooltip.name]: Tooltip,
791
- [Form.Item.name]: Form.Item,
792
- [Tag.CheckableTag.name]: Tag.CheckableTag,
793
- multiSelect,
794
- cTreeSelect
795
- },
796
- computed: {
797
- showPercent() {
798
- return function(item) {
799
- return item.settingObj?.attr === "PERCENTAGE" || false;
800
- };
801
- },
802
- getEleWidth(){
803
- return function(item) {
804
- return `${item.advanceColWidth||200}px`
805
- }
806
- },
807
- hasRelationQuickSearch() {
808
- return this.relationQuickSearch.findIndex(i => i.fieldList && i.fieldList.length) != -1;
809
- },
810
- parentNamesHasAdd() {
811
- if (!this.parentNames.length) return false;
812
- return this.parentNames.some(v => v.isAdd);
813
- },
814
- handleName() {
815
- return function(item, key = "name") {
816
- return item.alias || item[key];
817
- };
818
- },
819
-
820
- $moment() {
821
- return moment;
822
- }
823
- },
824
- data() {
825
- return {
826
- modalVisible: this.visible,
827
- showInner: false,
828
- quickSearch: [],
829
- relationTableList: [], // 跨表查询
830
- relationQuickSearch: [], // 跨表查询检索条件
831
- formData: {},
832
- searchItem: {},
833
- curWordbookData: undefined,
834
- curAutograph: "",
835
- dateTeam: [
836
- { con: 'TODAY', title: '1.1.4.37', name: '今天' },
837
- { con: 'TOMORROW', title: '1.1.4.38', name: '明天' },
838
- { con: 'YESTERDAY', title: '1.1.4.39', name: '昨天' },
839
- { con: 'THIS_WEEK', title: '1.1.4.40', name: '本周' },
840
- { con: 'NEXT_WEEK', title: '1.1.4.41', name: '下周' },
841
- { con: 'UP_WEEK', title: '1.1.4.42', name: '上周' },
842
- { con: 'THIS_MONTH', title: '1.1.4.43', name: '本月' },
843
- { con: 'NEXT_MONTH', title: '1.1.4.44', name: '下月' },
844
- { con: 'UP_MONTH', title: '1.1.4.45', name: '上月' },
845
- { con: 'THIS_SEASON', title: '1.1.4.46', name: '本季度' },
846
- { con: 'NEXT_SEASON', title: '1.1.4.47', name: '下季度' },
847
- { con: 'UP_SEASON', title: '1.1.4.48', name: '上季度' },
848
- { con: 'THIS_YEAR', title: '1.1.4.49', name: '本年' },
849
- { con: 'NEXT_YEAR', title: '1.1.4.50', name: '下年' },
850
- { con: 'UP_YEAR', title: '1.1.4.51', name: '上年' }
851
- ],
852
- birthdayTeam: [],
853
- limit_date: "",
854
- birthdayUnits: [
855
- { title: '1.2.5.58', units: 1, con: 'DAY', name: '天' },
856
- { title: '1.2.5.59', units: 2, con: 'WEEK', name: '周' },
857
- { title: '1.2.1.11.18', units: 1, con: 'MONTH', name: '月' },
858
- { title: '1.9.273', units: 1, con: 'YEAR', name: '岁' },
859
- ],
860
- isChangeWindow: false,
861
- modalWidth: "700px",
862
- modalHeight: "60vh",
863
- EVALUATEList,
864
- AGEOPTIONS,
865
- label_max_count: 8,
866
- parentNames: [],
867
- showAdd: false,
868
- addVal: "",
869
- fetchingWordbook: false,
870
- ...dataOptions
871
- };
872
- },
873
- watch: {
874
- visible(value) {
875
- this.modalVisible = value;
876
- // this.init();
877
- this.setDefaultCon(this.quickSearchConfig);
878
- },
879
- searchFieldList: {
880
- immediate: true,
881
- deep: true,
882
- handler(val) {
883
- if (val && val.length > 0) {
884
- let { relationTableList = [] } = this.$attrs;
885
- this.relationTableList = relationTableList;
886
- this.init();
887
- }
888
- }
889
- },
890
- quickSearchConfig: {
891
- handler(val) {
892
- this.setDefaultCon(val);
893
- },
894
- deep: true
895
- },
896
- quickSearchListObj: {
897
- immediate: true,
898
- deep: true,
899
- handler(val) {
900
- if (!val || !Object.keys(val).length) {
901
- this.parentNames = [];
902
- return;
903
- }
904
- this.handleParentName();
905
- }
906
- },
907
- quickSearch: {
908
- deep: true,
909
- handler() {
910
- const conObj = this.getConObjParams() || [];
911
- this.$emit("filterCountChange", conObj.length);
912
- }
913
- },
914
- show: {
915
- deep: true,
916
- handler(newVal) {
917
- if (newVal && this.lastQuickSearchData.length > 0) {
918
- this.quickSearch = _.cloneDeep(this.lastQuickSearchData);
919
- }
920
- }
921
- }
922
- },
923
- beforeCreate() {
924
- this.formInner = this.$form.createForm(this);
925
- },
926
- created() {},
927
- methods: {
928
- filterOption(...arg) {
929
- return utils.filterOption(...arg);
930
- },
931
- handleLabelColor(...arg) {
932
- return utils.handleLabelColor(...arg);
933
- },
934
- init() {
935
- this.quickSearch = [];
936
- this.relationQuickSearch = [];
937
- this.birthdayTeam = this.dateTeam.filter(
938
- item => item.con != "THIS_YEAR" && item.con != "NEXT_YEAR" && item.con != "UP_YEAR"
939
- );
940
- let copyList = _.cloneDeep(this.searchFieldList);
941
- let mySearchFieldList = copyList.filter(i => i.isShowSearch == 1 && i.filterExplicit != 1) || [];
942
- // let relationTableList = JSON.parse(JSON.stringify(this.relationTableList));
943
- let relationTableList = _.cloneDeep(this.relationTableList);
944
-
945
- // 跨表
946
- let relationQuickSearch = relationTableList.map(item => {
947
- return {
948
- fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit != 1),
949
- tableName: item.tableName,
950
- primaryField: item.primaryField,
951
- parameterConversionId: item.parameterConversionId,
952
- tableId: item.tableId,
953
- relationField: item.relationField,
954
- converFun: item.converFun,
955
- relationOrgId: item.relationOrgId,
956
- preConObj: item.preConObj,
957
- preSqlExpression: item.preSqlExpression
958
- };
959
- });
960
-
961
- this.$set(this, "relationQuickSearch", relationQuickSearch);
962
- // 过滤获取 快速检索的字段
963
- this.quickSearch = mySearchFieldList || [];
964
- this.handlerInitSearchItem(this.quickSearch);
965
- this.relationQuickSearch.forEach(item => {
966
- this.handlerInitSearchItem(item.fieldList);
967
- });
968
- },
969
- handleParentName() {
970
- let parentNames = [];
971
- let { displayCategoryList = [] } = this.quickSearchListObj;
972
- if (!displayCategoryList || !displayCategoryList.length) {
973
- this.parentNames = [];
974
- return;
975
- }
976
- displayCategoryList.forEach(item => {
977
- if (item !== "未分类") {
978
- parentNames.push({
979
- disabled: true,
980
- selected: false,
981
- value: item
982
- });
983
- }
984
- });
985
- this.parentNames = parentNames;
986
- },
987
- setDefaultCon(val) {
988
- if (!val.length) {
989
- this.quickSearch.forEach((item, index) => {
990
- let advanceOptionSetting = item?.advanceOptionSetting;
991
- // 单选
992
- let optionSetting0 =String(advanceOptionSetting) == '0';
993
- if(optionSetting0){
994
- this.$set(this.quickSearch[index], "value", undefined);
995
- } else {
996
- if (item.CONVERT && Array.isArray(item.CONVERT)) {
997
- this.$set(this.quickSearch[index], "CONVERT", []);
998
- }
999
- }
1000
-
1001
- });
1002
- return false;
1003
- }
1004
-
1005
- this.quickSearch.forEach((item, index) => {
1006
- let advanceOptionSetting = item?.advanceOptionSetting;
1007
- // 单选
1008
- let optionSetting0 =String(advanceOptionSetting) == '0';
1009
- let find = val.find(valItem => valItem.field_key === item.columnName);
1010
- if (find) {
1011
- let value = find.value.map(item => JSON.stringify(item));
1012
- value = value.filter(Boolean)
1013
- this.$set(this.quickSearch[index], "CONVERT", value);
1014
- if(optionSetting0){
1015
- let i = value[0] ? item.labelList.findIndex(v=> v.value== value[0]) : ""
1016
- this.$set(this.quickSearch[index], "value", i);
1017
- }
1018
- } else {
1019
- this.$set(this.quickSearch[index], "CONVERT",optionSetting0?"": []);
1020
- }
1021
- });
1022
- },
1023
- handlerInitSearchItem(arr) {
1024
- if (!Array.isArray(arr)) return;
1025
- arr.forEach(el => {
1026
- const isPreciseSearch = el?.settingObj?.isPreciseSearch || "";
1027
-
1028
- if (el.setting) {
1029
- // el.seting 可能是 string / object
1030
- el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
1031
-
1032
- let advanceOptionSetting = el?.advanceOptionSetting;
1033
- // 单选
1034
- let optionSetting0 =String(advanceOptionSetting) == '0';
1035
- if (!vexutils.isEmpty(el.setting.wordbook)) {
1036
- let isTree = "tree" === el?.setting?.wordbook?.showType;
1037
- let comType = isTree ? 'treeSelect' : 'SelectMuiWordBook';
1038
- let defVal = isTree ? [] : [];
1039
- if(optionSetting0){
1040
- defVal = undefined
1041
- }
1042
- this.$set(el, "con", "QUOTE");
1043
- this.$set(el, "dataSource", []);
1044
- this.$set(el, "QUOTE", []);
1045
- this.$set(el, "value", defVal);
1046
- this.$set(el, "com", "SelectMui");
1047
- this.$set(el, "comType", comType);
1048
- this.$set(el, "searchPageConfig", {
1049
- keyword: undefined,
1050
- isRequest: false, // 是否已请求
1051
- page: 1, // 当前页
1052
- total: 1, // 总页数
1053
- hasNextPage: false
1054
- });
1055
- return;
1056
- } else if (el.setting.showSetting && el.setting.showSetting.length > 0) {
1057
- this.$set(el, "con", "CONVERT");
1058
- let showSetting = el.setting.showSetting;
1059
-
1060
- // 字典推荐值
1061
- let dictionItem = this.handleDictionDef(el);
1062
- if (dictionItem) {
1063
- showSetting.unshift(dictionItem);
1064
- }
1065
- showSetting.forEach(set => {
1066
- set.label = set.change_text;
1067
- set.value = JSON.stringify(set.filter);
1068
- });
1069
- // el.setting.showSetting.forEach(set => {
1070
- // this.$set(set, "label", set.change_text);
1071
- // this.$set(set, "value", JSON.stringify(set.filter));
1072
- // });
1073
- /**
1074
- * 映射方式的单选模式
1075
- */
1076
- if(optionSetting0){
1077
- this.$set(el, "com", "SelectMui");
1078
- this.$set(el, "comType", "SelectMui");
1079
- const labelList = el.setting.showSetting.map(i => {
1080
- i.labelName = i.change_text;
1081
- return i;
1082
- });
1083
- this.$set(el, "labelList", labelList);
1084
- }
1085
-
1086
- this.$set(el.setting, "showSetting", showSetting);
1087
- this.$set(el, "CONVERT",optionSetting0? "": []);
1088
- return;
1089
- }
1090
- }
1091
- if (el.setting.attr === "LABEL") {
1092
- this.$set(el, "con", "CL"); // 2020-09-04 朱亚徽 EQ => CL
1093
- this.$set(el, "LABELAttr", true);
1094
- this.$set(el, "labelSelectList", []);
1095
- this.$set(el, "inputVal", "");
1096
- this.handleSetLabelOptions(el.setting.labelType, el);
1097
- } else if (el.setting.attr === "EVALUATE") {
1098
- this.$set(el, "con", "CL");
1099
- this.$set(el, "selecteds", []);
1100
- this.$set(el, "EVALUATEAttr", true);
1101
- } else if (el.setting.attr === "AGE" && el.fieldType != "NUMBER") {
1102
- // 年龄组件
1103
- let format = el.setting.format || "YYYY-MM-DD";
1104
- format = format.toUpperCase();
1105
- this.$set(el, "con", "IN");
1106
- this.$set(el, "ageObj", {});
1107
- this.$set(el, "format", format);
1108
- this.$set(el, "AGEAttr", true);
1109
- } else if (el.setting.attr === "PASSWORD") {
1110
- this.$set(el, "comAttr", "PASSWORD");
1111
- this.$set(el, "PASSWORDTYPE", true);
1112
- } else if (el.fieldType == "NUMBER") {
1113
- this.$set(el, "con", "EQ");
1114
- this.$set(el, "EQ", "");
1115
- this.$set(el, "NUMBERFiled", true);
1116
- this.$set(el, "lessValue", "");
1117
- this.$set(el, "bigValue", "");
1118
- if (el.setting.attr == "PERCENTAGE") {
1119
- this.$set(el, "inputUnit", "%");
1120
- }
1121
- } else if (el.fieldType.includes("DATE")) {
1122
- if (el.settingObj && el.settingObj.attr == "BIRTHDAY") {
1123
- this.$set(el, "con", "BIRTHDAY");
1124
- this.$set(el, "showDate", false);
1125
- this.$set(el, "marginx", "ml");
1126
- this.$set(el, "BIRTHDAY", this.initBirthdayParams());
1127
- } else {
1128
- // 判断是否有默认值
1129
- const value = this.getSearchDefValueByLimit(el, this.searchFieldLimit);
1130
- let hasValue = Array.isArray(value);
1131
- let advanceOptionSetting = el?.advanceOptionSetting;
1132
- // 选择时间模式
1133
- let optionSetting1 = String(advanceOptionSetting) == '1';
1134
-
1135
- this.$set(el, "con", "DATE");
1136
- this.$set(el, "showDate", optionSetting1 || hasValue);
1137
- this.$set(el, "marginx",optionSetting1 || hasValue ? "mr" : "ml");
1138
- this.$set(el, "DATE", {
1139
- con: hasValue ? "IN" : null,
1140
- start_val: hasValue ? value[0] : null,
1141
- end_val: hasValue ? value[1] : null
1142
- });
1143
- let dateTeam = optionSetting1 ? [] : this[`dateTeam${advanceOptionSetting}`] || this.dateTeam0;
1144
- this.$set(el, 'dateTeam' , dateTeam)
1145
- }
1146
- } else if (el.fieldType == "TEXT") {
1147
- /**
1148
- * NUMBER和TEXT属性字段
1149
- * 如果 开启了精准搜索,则传条件的时候 要传 EQ
1150
- * isPreciseSearch: 0/1
1151
- */
1152
- let con = isPreciseSearch == 1 ? 'EQ': 'CL';
1153
- this.$set(el, "con", con);
1154
- this.$set(el, "isPreciseSearch", isPreciseSearch == 1);
1155
- this.$set(el, con, "");
1156
- } else if (el.fieldType == "JSONB") {
1157
- this.$set(el, "con", "EQ");
1158
- this.$set(el, "EQ", "");
1159
- }
1160
- });
1161
- },
1162
- // 字典推荐值 item处理
1163
- handleDictionDef(el) {
1164
- let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1165
- let dictionItem = null;
1166
- if (defaultValue && defaultValueTitle) {
1167
- dictionItem = {
1168
- change_text: defaultValueTitle,
1169
- filter: [
1170
- {
1171
- con: "EQ",
1172
- field_key: el.columnName,
1173
- value: defaultValue
1174
- }
1175
- ]
1176
- };
1177
- }
1178
- return dictionItem;
1179
- },
1180
- checkDate(item) {
1181
- item.showDate = !item.showDate;
1182
- item.showDate ? (item.marginx = "mr") : (item.marginx = "ml");
1183
- },
1184
- checkBirthDay(item) {
1185
- item.showDate = !item.showDate;
1186
- },
1187
- getWordbookData(o, obj) {
1188
- let { id, filterKeys, wordbookType } = o;
1189
- this.fetchingWordbook = true;
1190
- let resFieldKeys = Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1191
- let url = `/tableReader/getWordbookData`;
1192
- let params = {
1193
- wordbookId: id,
1194
- fieldKeys: resFieldKeys,
1195
- wordbookType: wordbookType || "WORDBOOK",
1196
- asyncCount: 1, // 开启性能模式
1197
- ...obj
1198
- };
1199
- return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1200
- this.fetchingWordbook = false;
1201
- if(typeof res.data === 'object'){
1202
- res.data.reqParams = params;
1203
- }
1204
- return res;
1205
- }).catch(() => {
1206
- this.fetchingWordbook = false;
1207
- });
1208
- },
1209
- handleWordbookData(item, data, params) {
1210
- this.$set(item, "hasFieldList", false);
1211
- const {rows,hasFieldList,searchPageConfig} = wordBookutils.handleWordbookData(item,data,params);
1212
- this.$set(item, "hasFieldList", hasFieldList);
1213
- this.$set(item, "dataSource", rows);
1214
- item.searchPageConfig = Object.assign(item.searchPageConfig, searchPageConfig);
1215
- },
1216
- filterChange() {},
1217
- maxTagPlaceholder(item) {
1218
- if (Array.isArray(item.value)) {
1219
- return item.value.length;
1220
- } else {
1221
- return 1;
1222
- }
1223
- },
1224
- dropdownVisibleChange(open, item) {
1225
- if (item.comType == "SelectMui" && String(item.advanceOptionSetting) === '0') return;
1226
- if (open) {
1227
- let obj = {};
1228
- if (item.setting.wordbook.params) {
1229
- item.setting.wordbook.params.forEach(item => {
1230
- obj[item.p_name] = item.p_value;
1231
- });
1232
- }
1233
- if (item.settingObj.wordbook) {
1234
- obj.autograph = item.settingObj.wordbook.autograph;
1235
- }
1236
- this.curWordbookData = item.setting.wordbook;
1237
- this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1238
- this.searchItem = item;
1239
- this.getWordbookData(item.setting.wordbook, obj).then(({ data }) => {
1240
- this.handleWordbookData(item, data, obj);
1241
- });
1242
- }
1243
- },
1244
- /**
1245
- * 输入自动联想
1246
- */
1247
- handleSearch(value, item, config={}) {
1248
- if (item.comType == "SelectMui" && String(item.advanceOptionSetting) === '0') return;
1249
- let params = {
1250
- keyword: value,
1251
- autograph: this.curAutograph
1252
- };
1253
- let obj = {};
1254
- let p = item?.setting?.wordbook?.params || undefined;
1255
- if (p) {
1256
- item.setting.wordbook.params.forEach(item => {
1257
- obj[item.p_name] = item.p_value;
1258
- });
1259
- }
1260
- let rp = { ...params, ...obj, ...config };
1261
- this.getWordbookData(this.curWordbookData, rp).then(({ data }) => {
1262
- this.handleWordbookData(this.searchItem, data, rp);
1263
- });
1264
- },
1265
- onSave() {
1266
- let mergeConObj = this.getMergeConObj();
1267
- this.resetChangeWindow();
1268
-
1269
- if (!this.validConObj(mergeConObj, this.searchFieldList, this.searchFieldLimit)) return false;
1270
- this.$emit("onSave", mergeConObj);
1271
- return this.quickSearch;
1272
- },
1273
- // 方便外部调用
1274
- getMergeConObj() {
1275
- let conObj = this.getConObjParams() || [];
1276
- let mergeConObj = [...conObj];
1277
- // 合并表格表头未设置高级筛选的筛选项
1278
- this.quickSearchConfig.forEach(i => {
1279
- let find = mergeConObj.find(j => {
1280
- return i.field_key === j.field_key;
1281
- });
1282
- if (
1283
- !find &&
1284
- !this.quickSearch.find(item => {
1285
- return item.columnName === i.field_key;
1286
- })
1287
- ) {
1288
- mergeConObj.push(i);
1289
- }
1290
- });
1291
- return mergeConObj || [];
1292
- },
1293
- getConObjParams() {
1294
- let conObj = this.getConObj(this.quickSearch) || [];
1295
- let realation = [];
1296
- this.relationQuickSearch.forEach(item => {
1297
- let curQuote = this.getConObj(item.fieldList);
1298
- if (curQuote && curQuote.length) {
1299
- realation.push({
1300
- field_key: item.primaryField,
1301
- valueField: item.relationField,
1302
- con: "QUOTE_IN",
1303
- tableId: item.tableId,
1304
- parameterConversionId: item.parameterConversionId,
1305
- converFun: item.converFun,
1306
- preConObj: item.preConObj,
1307
- relationOrgId: item.relationOrgId,
1308
- preSqlExpression: item.preSqlExpression,
1309
- quote_con: {
1310
- conObj: this.getConObj(item.fieldList),
1311
- sqlExpression: ""
1312
- }
1313
- });
1314
- }
1315
- });
1316
- conObj.push(...realation);
1317
- return conObj || [];
1318
- },
1319
- closeModal() {
1320
- this.resetChangeWindow();
1321
- this.$emit("closeModal");
1322
- },
1323
- resetChangeWindow() {
1324
- this.modalWidth = "700px";
1325
- this.modalHeight = "60vh";
1326
- this.isChangeWindow = false;
1327
- },
1328
- // 填写搜索设置条件后打开新增搜索分类名称弹框
1329
- openSaveToCalss() {
1330
- let conObj = this.getConObjParams();
1331
- if (!conObj) return;
1332
- if (conObj.length > 0) {
1333
- if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return;
1334
- this.showInner = true;
1335
- } else {
1336
- this.$message.warning(this.getI18nText('1.1.6.18', '请设置搜索条件'), 2);
1337
- }
1338
- },
1339
- // 格式化设置搜索条件参数
1340
- getConObj(arr) {
1341
- // this.quickSearch
1342
- if (!Array.isArray(arr)) {
1343
- return [];
1344
- }
1345
- let conObj = [];
1346
- for (let i = 0; i < arr.length; i++) {
1347
- let item = arr[i];
1348
- let value = "";
1349
- let limit_date = "";
1350
- let advanceOptionSetting = item?.advanceOptionSetting;
1351
- // 单选
1352
- let optionSetting0 =String(advanceOptionSetting) === '0';
1353
- if (item.EQ || item.CL) {
1354
- value = item.EQ || item.CL;
1355
- if (item.settingObj?.attr === "PERCENTAGE") {
1356
- value = Number(value) / 100;
1357
- }
1358
- if (item.EVALUATEAttr) {
1359
- value = item.selecteds.join("|#|");
1360
- }
1361
- } else if((item.comType == 'SelectMui'&& optionSetting0)){
1362
- // 单选模式
1363
- let i = item.value;
1364
- let c = item?.labelList[i];
1365
- if (item.con == "CONVERT") {
1366
- value = c?.filter ? [c?.filter] : undefined
1367
- } else {
1368
- value= c?.labelName ? [c?.labelName] : undefined;
1369
- }
1370
- } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1371
- // value = item.QUOTE.join("|#|");
1372
- if(item.comType == "treeSelect"){
1373
- let cval = item.value;
1374
- if(typeof cval === 'string'){
1375
- [cval] = cval.split('<&=&>');
1376
- value = cval;
1377
- } else if(Array.isArray(cval)) {
1378
- cval = cval.map((v)=>{
1379
- let [k] = typeof v === 'string' ? v.split('<&=&>'): [];
1380
- return k;
1381
- })
1382
- value = cval.join("|#|");
1383
- }
1384
- } else {
1385
- value = optionSetting0? item.value : item.value.join("|#|");
1386
- }
1387
- } else if (!vexutils.isEmpty(item.CONVERT)) {
1388
- value = item.CONVERT.map(item => {
1389
- if (item && vexutils.isJSON(item)) {
1390
- return JSON.parse(item);
1391
- }
1392
- return item;
1393
- });
1394
- } else if (item.DATE && !item.AGEAttr) {
1395
- // 年龄组件的不按照 date 类型处理
1396
- if (item.DATE.start_val || item.DATE.end_val) {
1397
- item.DATE.con = "IN";
1398
- }
1399
- item.tempCon = item.DATE.con;
1400
- item.start_val = item.DATE.start_val
1401
- ? item.DATE.start_val.format("YYYY-MM-DD HH:mm:ss")
1402
- : "";
1403
- item.end_val = item.DATE.end_val ? item.DATE.end_val.format("YYYY-MM-DD HH:mm:ss") : "";
1404
- } else if (item.BIRTHDAY) {
1405
- // 生日
1406
- let isChange = false;
1407
- if (
1408
- item.BIRTHDAY.limit_date.length > 0 ||
1409
- item.BIRTHDAY.start_val ||
1410
- item.BIRTHDAY.end_val
1411
- ) {
1412
- item.BIRTHDAY.con = "IN";
1413
- }
1414
- item.tempCon = item.BIRTHDAY.con;
1415
- // 因为年龄下拉有个默认值, 当输入框中有值时才取下拉值
1416
- if (item.BIRTHDAY.start_val || item.BIRTHDAY.end_val) {
1417
- isChange = true;
1418
- } else {
1419
- isChange = false;
1420
- }
1421
-
1422
- // 校验
1423
- if (item.BIRTHDAY.start_val) {
1424
- let res = vexutils.validateBirthday(
1425
- item.BIRTHDAY.start_val,
1426
- item.title,
1427
- item.BIRTHDAY.unit
1428
- );
1429
- if (!res) return;
1430
- }
1431
- if (item.BIRTHDAY.end_val) {
1432
- let res = vexutils.validateBirthday(
1433
- item.BIRTHDAY.end_val,
1434
- item.title,
1435
- item.BIRTHDAY.unit
1436
- );
1437
- if (!res) return;
1438
- }
1439
- if (+item.BIRTHDAY.start_val > +item.BIRTHDAY.end_val) {
1440
- this.$message.warning(this.getI18nText(['1.9.47', { title: item.title }], `${item.title}请输入有效范围`), 2);
1441
- return;
1442
- }
1443
-
1444
- limit_date = this.limit_date || "";
1445
- item.unit = isChange ? item.BIRTHDAY.unit || "" : "";
1446
- item.start_val = item.BIRTHDAY.start_val || "";
1447
- item.end_val = item.BIRTHDAY.end_val || "";
1448
- }
1449
- // 根据属性判断取值
1450
- if (item.LABELAttr) {
1451
- if (Object.keys(item.labelObj || {}).length > 0) {
1452
- let valList = [];
1453
- item.labelSelectList.forEach(v => {
1454
- valList.push(v.labelName);
1455
- });
1456
- value = valList.join("|#|");
1457
- } else {
1458
- value = item.inputVal;
1459
- }
1460
- } else if (item.EVALUATEAttr) {
1461
- value = item.selecteds.join("|#|");
1462
- } else if (item.AGEAttr) {
1463
- value = "";
1464
- } else if (item.NUMBERFiled && item.lessValue && item.bigValue) {
1465
- if (item.setting?.attr === "PERCENTAGE") {
1466
- value = Number(item.lessValue) / 100 + "~" + Number(item.bigValue) / 100;
1467
- } else {
1468
- value = item.lessValue + "~" + item.bigValue;
1469
- }
1470
- }
1471
- // 删除字符串前后空格
1472
- if (value && vexutils.isString(value)) {
1473
- value = value.trim();
1474
- }
1475
- let temp = {
1476
- field_key: item.columnName, // 一级value
1477
- con: item.DATE || item.BIRTHDAY ? item.tempCon : item.con, // 二级选择项value
1478
- value: value, // input输入值
1479
- limit_date: limit_date || "", // 生日
1480
- start_val: item.start_val || "", // 开始时间
1481
- end_val: item.end_val || "", // 结束时间
1482
- unit: item.unit || "", // 年龄
1483
- id: item.id
1484
- };
1485
- conObj.push(temp);
1486
- }
1487
- let dateCons = this.dateTeam.map(item => item.con);
1488
- let res = conObj.filter(
1489
- item =>
1490
- item.value ||
1491
- item.limit_date ||
1492
- item.start_val ||
1493
- item.end_val ||
1494
- dateCons.includes(item.con)
1495
- );
1496
- return res;
1497
- },
1498
- range(start, end) {
1499
- const result = [];
1500
- for (let i = start; i < end; i++) {
1501
- result.push(i);
1502
- }
1503
- return result;
1504
- },
1505
- // 日期选择范围
1506
- disabledDate(current) {
1507
- return (
1508
- (current && current < moment().startOf("year")) ||
1509
- current > moment().endOf("year")
1510
- );
1511
- },
1512
- changeRange(date, dateString) {
1513
- // 这里没有使用item中的limit_date, 而是用全局的变量limit_date储存
1514
- // 原因是因为range-picker 要求是个[] 并且v-model中的数据是个moment对象 即item.BIRRHDAY.limit_date = [moment, moment]
1515
- if (dateString[0]) {
1516
- this.limit_date = dateString.join("~");
1517
- } else {
1518
- this.limit_date = "";
1519
- }
1520
- },
1521
- // 填写新增搜索分类名称后保存按钮
1522
- saveToCalss() {
1523
- this.formInner.validateFields((err, values) => {
1524
- if (err) return;
1525
- let conObj = this.getConObjParams();
1526
- if (!conObj.length) {
1527
- conObj = [];
1528
- }
1529
- let displayCategory = this.parentNames.filter(item => item.selected)[0]?.value;
1530
- let params = {
1531
- tableId: this.$attrs.tableId || "",
1532
- setting: JSON.stringify({
1533
- displayCategory,
1534
- name: values.classname,
1535
- conObj: conObj
1536
- }),
1537
- conditionList: JSON.stringify(this.originConditionList)
1538
- };
1539
- this.saveTableCondiTion(params);
1540
-
1541
- });
1542
- },
1543
- handleParentNamesAdd(e) {
1544
- const nextInput = e?.target?.nextElementSibling;
1545
- setTimeout(() => {
1546
- nextInput && nextInput.focus();
1547
- });
1548
- this.showAdd = true;
1549
- },
1550
- hanldeBlur() {
1551
- this.showAdd = false;
1552
- if (!this.addVal) return;
1553
- this.parentNames.forEach(v => (v.selected = false));
1554
- this.parentNames.push({
1555
- disabled: true,
1556
- value: this.addVal,
1557
- selected: true,
1558
- isAdd: true
1559
- });
1560
- this.addVal = "";
1561
- },
1562
- editParentName(e, item) {
1563
- item.disabled = false;
1564
- setTimeout(() => {
1565
- e.target.focus();
1566
- }, 0);
1567
- },
1568
- handleParentNameSelect(item, index) {
1569
- if (!item.disabled) return;
1570
- this.parentNames.forEach((pItem, pIndex) => {
1571
- if (pIndex !== index) {
1572
- pItem.selected = false;
1573
- }
1574
- });
1575
- item.selected = !item.selected;
1576
- },
1577
- handleParentNamesRemove(index, item) {
1578
- this.handleParent(index, item);
1579
- },
1580
- handleParent(index, item) {
1581
- let { conditionList = [] } = this.quickSearchListObj;
1582
- if (!conditionList || !conditionList.length) {
1583
- this.parentNames.splice(index, 1);
1584
- return;
1585
- }
1586
- let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1587
- if (!hasItem || !hasItem.length) {
1588
- this.parentNames.splice(index, 1);
1589
- return;
1590
- }
1591
- this.$message.error("该分类下有已有数据,请删除该分类下的筛选集后重试!");
1592
- },
1593
- // 7.12保存列表搜索分类
1594
- async saveTableCondiTion(params) {
1595
- // let url = `/tableList/saveTableCondiTion`;
1596
- // this.axios.post(url, this.$qs.stringify(params)).then(({ data }) => {
1597
- // if (data.result == "SUCCESS") {
1598
- // this.showInner = false;
1599
- // this.formInner.resetFields();
1600
- // this.$emit("updateTableCondiTion");
1601
- // this.clearData();
1602
- // this.closeModal();
1603
- // } else {
1604
- // this.$message.error(data.resultMsg);
1605
- // }
1606
- // });
1607
- try {
1608
- let res = await this.handleGetConfigApi(params, 'requestSaveTableCondiTion');
1609
- if (!res) return;
1610
- this.showInner = false;
1611
- this.formInner.resetFields();
1612
- this.$emit("updateTableCondiTion");
1613
- this.clearData();
1614
- this.closeModal();
1615
- } catch (error) {
1616
- console.log(error)
1617
- }
1618
- },
1619
- cancelSaveToCalss() {
1620
- this.showInner = false;
1621
- },
1622
- // 清空快速搜索设置条件
1623
- clearData() {
1624
- this.handlerReset(this.quickSearch);
1625
- this.relationQuickSearch.forEach(item => {
1626
- this.handlerReset(item.fieldList);
1627
- });
1628
- if (this.source === "editTable") {
1629
- this.$emit("clearQuickSearchConfig");
1630
- return;
1631
- }
1632
- this.$listeners?.clearQuickSearchConfig();
1633
- },
1634
- handlerReset(arr) {
1635
- if (!Array.isArray(arr)) {
1636
- return;
1637
- }
1638
- arr.forEach(item => {
1639
- let advanceOptionSetting = item?.advanceOptionSetting;
1640
- // 单选
1641
- let optionSetting0 =String(advanceOptionSetting) === '0';
1642
- if (item.EQ || item.CL) {
1643
- item.EQ = "";
1644
- item.CL = "";
1645
- } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1646
- item.QUOTE = [];
1647
- item.value = [];
1648
- } else if(item.com == 'SelectMui' && item.con == 'CONVERT' && optionSetting0){
1649
- item.CONVERT = [];
1650
- item.value = undefined
1651
- } else if (!vexutils.isEmpty(item.CONVERT)) {
1652
- item.CONVERT = [];
1653
- } else if (item.DATE) {
1654
- item.showDate = String(advanceOptionSetting) == '1' ? true: false;
1655
- item.marginx = "ml";
1656
- item.DATE = {
1657
- con: null,
1658
- start_val: null,
1659
- end_val: null
1660
- };
1661
- } else if (item.BIRTHDAY) {
1662
- item.showDate = false;
1663
- item.marginx = "ml";
1664
- item.BIRTHDAY = this.initBirthdayParams();
1665
- } else if (item.LABELAttr) {
1666
- this.handleClearLabel(item);
1667
- } else if (item.EVALUATEAttr) {
1668
- item.selecteds = [];
1669
- } else if (item.AGEAttr) {
1670
- this.handleResetAge(item);
1671
- } else if (item.NUMBERFiled) {
1672
- this.clearFilterNumber(item);
1673
- }
1674
- });
1675
- },
1676
- initBirthdayParams() {
1677
- this.limit_date = "";
1678
- return {
1679
- con: null,
1680
- limit_date: [],
1681
- start_val: null,
1682
- end_val: null,
1683
- unit: "YEAR",
1684
- units: this.birthdayUnits.filter(i => i.units === 1)
1685
- };
1686
- },
1687
- // 单选按钮组合点击取消选中状态
1688
- clickRadioGroup(item, con) {
1689
- if (item.con == con) {
1690
- item.con = null;
1691
- } else {
1692
- if (item.con === "IN") {
1693
- item.start_val = null;
1694
- item.end_val = null;
1695
- }
1696
- item.con = con;
1697
- }
1698
- },
1699
- clickBirthdayRadioGroup(item, con) {
1700
- this.limit_date = "";
1701
- Object.assign(item, this.initBirthdayParams());
1702
- this.clickRadioGroup(item, con);
1703
- },
1704
- changeModalWindow() {
1705
- this.isChangeWindow = !this.isChangeWindow;
1706
- let docHeight = document.body.clientHeight;
1707
- this.modalWidth = this.modalWidth === "700px" ? `100%` : "700px";
1708
- this.modalHeight = this.modalHeight === "60vh" ? `${docHeight - 108}px` : "60vh";
1709
-
1710
- if (this.modalWidth === "700px") {
1711
- this.label_max_count = 8;
1712
- } else {
1713
- this.$nextTick(() => {
1714
- let ele = document.querySelector(".quickSearch_label-container");
1715
- ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
1716
- });
1717
- }
1718
- },
1719
-
1720
- /* 获取 label */
1721
- handleRequestedLabel(v) {
1722
- let params = { type: v, pageSize: 10000 };
1723
- return this.axios.get("/label/list", { params: params });
1724
- },
1725
-
1726
- async handleSetLabelOptions(labelType, el) {
1727
- let labelObj = {};
1728
- let labelList = await this.handleGetConfigApi(labelType, 'requestedLabel');
1729
- labelList.forEach(n => {
1730
- this.$set(n, 'isSelect', false);
1731
- if (labelObj[n.typeName]) {
1732
- labelObj[n.typeName].itemList.push({ ...n });
1733
- } else {
1734
- labelObj[n.typeName] = {
1735
- itemList: [{ ...n }],
1736
- showAdd: false,
1737
- addVal: '',
1738
- typeName: n.typeName,
1739
- typeId: n.typeId,
1740
- isUnfold: false,
1741
- isShowBtn: false
1742
- };
1743
- }
1744
- });
1745
- this.$set(el, 'labelObj', labelObj);
1746
- this.$set(el, 'labelList', labelList);
1747
- },
1748
-
1749
- handleLabelColorClass(item) {
1750
- return item?.color?.split("-")[1] || "yellow";
1751
- },
1752
-
1753
- handleLabelChange() {
1754
- const args = arguments;
1755
- if (args.length === 3) {
1756
- let [flag, item, options] = [...arguments];
1757
- let selectedList = options.labelSelectList || [];
1758
- if (flag) {
1759
- if (selectedList.some(n => n.labelId == item.labelId)) {
1760
- return;
1761
- }
1762
- selectedList.push(item);
1763
- } else {
1764
- let fdIndex = selectedList.findIndex(n => n.labelId == item.labelId);
1765
- if (fdIndex != -1) {
1766
- selectedList.splice(fdIndex, 1);
1767
- }
1768
- }
1769
- options.labelSelectList = selectedList;
1770
- }
1771
- },
1772
-
1773
- handleClearLabel(v) {
1774
- v.labelSelectList.length = 0;
1775
- v.inputVal = "";
1776
- Object.entries(v.labelObj || {}).forEach(h => {
1777
- let [, item] = h;
1778
- item.itemList.forEach(l => {
1779
- l.isSelect = false;
1780
- });
1781
- });
1782
- },
1783
-
1784
- handleLabelUpfold(v) {
1785
- console.log('触发---isUnfold');
1786
- v.isUnfold = !v.isUnfold;
1787
- },
1788
-
1789
- handleEvaluateOnChange(tag, checked, item) {
1790
- if (checked) {
1791
- item.selecteds.push(tag.value);
1792
- } else {
1793
- let i = item.selecteds.findIndex(v => v === tag.value);
1794
- item.selecteds.splice(i, 1);
1795
- }
1796
- },
1797
-
1798
- // 年龄组件变化
1799
- ageRangeOnChange(obj, item) {
1800
- let s = obj.star_val;
1801
- let e = obj.end_val;
1802
- this.$set(item, "start_val", isNaN(s) ? undefined : s);
1803
- this.$set(item, "end_val", isNaN(e) ? undefined : e);
1804
- },
1805
-
1806
- // 清空年龄组件
1807
- handleResetAge(item) {
1808
- this.$set(item, "start_val", "");
1809
- this.$set(item, "end_val", "");
1810
- let key = `${item.columnName}_AGEAttr`;
1811
- let curRef = this.$refs[key];
1812
- if (Array.isArray(curRef)) {
1813
- curRef = curRef[0] || false;
1814
- }
1815
- curRef?.reset();
1816
- },
1817
-
1818
- onResize(el, v) {
1819
- let height = el.offsetHeight || 0;
1820
- // let ch = el?.firstElementChild?.offsetHeight || 0;
1821
- if (!height) {
1822
- return;
1823
- }
1824
- if (height > 80) {
1825
- v.isShowBtn = true;
1826
- } else {
1827
- v.isShowBtn = false;
1828
- v.isUnfold = false;
1829
- }
1830
- },
1831
- changeFilterNumber(item) {
1832
- if (item.lessValue && item.bigValue) {
1833
- const lessValue = item.lessValue;
1834
- const bigValue = item.bigValue;
1835
- if (bigValue < lessValue) {
1836
- this.$set(item, "lessValue", bigValue);
1837
- this.$set(item, "bigValue", lessValue);
1838
- }
1839
- return;
1840
- }
1841
- },
1842
- clearFilterNumber(item) {
1843
- this.$set(item, "lessValue", "");
1844
- this.$set(item, "bigValue", "");
1845
- },
1846
-
1847
- getI18nText(i, d) {
1848
- if (Array.isArray(i)) {
1849
- return this.$t ? this.$t.apply(this, i) : d;
1850
- }
1851
- return this.$t ? this.$t(i) : d;
1852
- }
1853
- },
1854
- directives: { resize }
1855
- });
1856
- </script>
1857
-
1858
- <style lang="less" scoped>
1859
- .form-box {
1860
- .quick-item {
1861
- margin-bottom: 10px;
1862
- min-width: 32px;
1863
-
1864
- .quick-row {
1865
- display: flex;
1866
- > div {
1867
- display: inline-block;
1868
- box-sizing: border-box;
1869
- }
1870
- .quick-item-title {
1871
- min-width: 80px;
1872
- line-height: 32px;
1873
- text-align: right;
1874
- padding-left: 12px;
1875
- color: #000;
1876
- }
1877
- .quick-item-col {
1878
- padding: 0 12px;
1879
- }
1880
- .quick-item-title-default {
1881
- width: 25%;
1882
- }
1883
- .quick-item-col-default {
1884
- width: 75%;
1885
- }
1886
- }
1887
- .check-box {
1888
- line-height: 32px;
1889
- }
1890
- .check-date-btn {
1891
- display: inline-block;
1892
- line-height: 32px;
1893
- height: 32px;
1894
- padding: 0 10px;
1895
- background-color: #ddd;
1896
- cursor: pointer;
1897
- &.ml {
1898
- margin-left: 20px;
1899
- }
1900
- &.mr {
1901
- margin-right: 20px;
1902
- }
1903
- }
1904
- .check-date {
1905
- display: inline-block;
1906
- line-height: 33px;
1907
- }
1908
- .birthday-item {
1909
- > div {
1910
- margin-top: 5px;
1911
- p {
1912
- display: inline-block;
1913
- margin: 0 20px;
1914
- }
1915
- > span {
1916
- margin-top: 5px;
1917
- }
1918
- }
1919
- .age-wrap {
1920
- display: inline-block;
1921
- }
1922
- }
1923
- /deep/ .ant-input-wrapper {
1924
- .ant-input-group-addon {
1925
- border: 1px solid #d9d9d9 !important;
1926
- border-left: 0 !important;
1927
- }
1928
- }
1929
-
1930
- /deep/ .num-picker {
1931
- position: relative;
1932
- display: flex;
1933
- &.num-picker-unit {
1934
- padding-right: 20px;
1935
- }
1936
- input {
1937
- text-align: left !important;
1938
- }
1939
- &:hover {
1940
- .clear-number-icon {
1941
- display: block;
1942
- }
1943
- }
1944
- /deep/ .ant-calendar-range-picker-input {
1945
- text-align: left;
1946
- }
1947
- .clear-number-icon {
1948
- position: absolute;
1949
- right: 5px;
1950
- top: 6px;
1951
- display: none;
1952
- cursor: pointer;
1953
- z-index: 1000;
1954
- }
1955
- }
1956
- }
1957
- .ant-radio-button-wrapper {
1958
- padding: 0 8px;
1959
- height: 30px;
1960
- line-height: 30px;
1961
- margin-top: 5px;
1962
- }
1963
-
1964
- // 标签
1965
- .label-attr-container {
1966
- .edit-label {
1967
- color: #000000;
1968
- font-size: 14px;
1969
- line-height: 32px;
1970
- padding-left: 0;;
1971
- }
1972
- .label-container-height {
1973
- overflow: hidden;
1974
- // width: 380px;
1975
- height: 74px;
1976
- flex: none;
1977
- }
1978
- .edit-content {
1979
- padding: 0;
1980
- }
1981
- .label-unfold-btn {
1982
- margin: 8px 0;
1983
- color: rgba(0, 0, 0, 0.6);
1984
- cursor: pointer;
1985
- >span {
1986
- display: flex;
1987
- align-items: center;
1988
- line-height: 1;
1989
- }
1990
- .anticon {
1991
- font-size: 16px;
1992
- margin-left: 8px;
1993
- }
1994
- &:hover {
1995
- color: #2d7aff;
1996
- }
1997
- &:active {
1998
- color: #2d7aff;
1999
- }
2000
- }
2001
- }
2002
- &.quick-search-table {
2003
- .module-title {
2004
- color: #506493;
2005
- line-height: 20px;
2006
- padding-left: 12px;
2007
- border-left: 4px solid #2d7aff;
2008
- }
2009
- .quick-item {
2010
- display: inline-block;
2011
- &.quick-block {
2012
- display: block;
2013
- }
2014
- }
2015
- }
2016
-
2017
- .psw-icon {
2018
- cursor: pointer;
2019
- &:active {
2020
- color: #5585f5;
2021
- // #2474ff
2022
- }
2023
- color: #969696;
2024
- }
2025
-
2026
- ::-webkit-input-placeholder {
2027
- /* WebKit browsers */
2028
- font-family: "Avenir", Helvetica, Arial, sans-serif;
2029
- }
2030
-
2031
- ::-moz-placeholder {
2032
- /* Mozilla Firefox 19+ */
2033
- font-family: "Avenir", Helvetica, Arial, sans-serif;
2034
- }
2035
-
2036
- :-ms-input-placeholder {
2037
- /* Internet Explorer 10+ */
2038
- font-family: "Avenir", Helvetica, Arial, sans-serif;
2039
- }
2040
- }
2041
- // .age-container {
2042
- // }
2043
- </style>
2044
- <style lang="less">
2045
- .quickSearch-saveToClass-modal {
2046
- .edit-tag {
2047
- position: relative;
2048
- display: inline-block;
2049
- margin-right: 10px;
2050
- margin-bottom: 10px;
2051
- .add-parent {
2052
- border-color: #d9d9d9;
2053
- }
2054
- .anticon-close {
2055
- position: absolute;
2056
- right: 5px;
2057
- line-height: 36px;
2058
- color: #2d7aff;
2059
- }
2060
- .ant-input-disabled {
2061
- color: #2d7aff;
2062
- background-color: rgba(45, 122, 255, 0.1);
2063
- opacity: 1;
2064
- border-color: #2d7aff;
2065
- cursor: pointer;
2066
- }
2067
- .ant-input-group-addon,
2068
- .ant-input:not(:hover),
2069
- .ant-input-number:not(:hover) {
2070
- border-color: #2d7aff !important;
2071
- }
2072
- &.edit-tag-select {
2073
- .ant-input-disabled {
2074
- color: #fff;
2075
- background-color: #2d7aff;
2076
- }
2077
- .anticon-close {
2078
- color: #fff;
2079
- }
2080
- }
2081
- }
2082
- }
2083
- </style>
1
+
2
+ <template>
3
+ <div>
4
+ <div class="form-box" :class="{ 'quick-search-table': source === 'editTable' }">
5
+ <p class="module-title" v-if="source === 'editTable' && hasRelationQuickSearch">高级筛选</p>
6
+ <div
7
+ class="quick-item"
8
+ v-for="item in quickSearch"
9
+ :key="item.sid"
10
+ :class="{
11
+ 'quick-block':
12
+ item.con == 'DATE' || item.con == 'BIRTHDAY' || item.con == 'CONVERT' || item.LABELAttr
13
+ }"
14
+ >
15
+ <div class="quick-row">
16
+ <!-- title -->
17
+ <div
18
+ class="quick-item-title"
19
+ :class="{ 'quick-item-title-default': source !== 'editTable' }"
20
+ >
21
+ <span>{{ handleName(item, "title") }}&nbsp;&nbsp;</span>
22
+ <a-tooltip
23
+ v-if="searchFieldLimit[item.columnName] && searchFieldLimit[item.columnName].tips"
24
+ :title="searchFieldLimit[item.columnName].tips"
25
+ >
26
+ <svg-icon icon-class="xitongtubiaodaohangtubiaowenti" />
27
+ &nbsp;&nbsp;
28
+ </a-tooltip>
29
+ </div>
30
+ <div class="quick-item-col" :class="{ 'quick-item-col-default': source !== 'editTable' }">
31
+ <!-- age -->
32
+ <!-- TODO: 清除,跨表 -->
33
+ <div v-if="item.AGEAttr" class="age-container">
34
+ <range-age
35
+ :ref="`${item.columnName}_AGEAttr`"
36
+ :format="item.format"
37
+ @change="ageRangeOnChange($event, item)"
38
+ ></range-age>
39
+ </div>
40
+ <!-- age -->
41
+ <!-- label -->
42
+ <div v-else-if="item.LABELAttr" class="label-attr-container">
43
+ <slot v-if="item.labelObj && Object.keys(item.labelObj || {}).length > 0">
44
+ <div v-for="(v, k) in item.labelObj" :key="k" class="edit-label-content">
45
+ <div class="edit-label">{{ k }}:</div>
46
+
47
+ <div
48
+ class="edit-content quickSearch_label-container"
49
+ :class="{
50
+ 'label-container-height': !v.isUnfold && v.itemList && v.isShowBtn
51
+ }"
52
+ >
53
+ <div class="label-content" v-resize="el => onResize(el, v)">
54
+ <a-checkable-tag
55
+ v-for="(v, i) in v.itemList"
56
+ v-model="v.isSelect"
57
+ @change="handleLabelChange($event, v, item)"
58
+ :key="i"
59
+ :style="handleLabelColor(v)"
60
+ >
61
+ <a-tooltip placement="topLeft">
62
+ <template slot="title">
63
+ <span>{{ v.labelName }}</span>
64
+ </template>
65
+ {{ v.labelName }}
66
+ </a-tooltip>
67
+ </a-checkable-tag>
68
+ </div>
69
+ </div>
70
+ <div class="label-unfold-btn" v-if="v.itemList && v.isShowBtn">
71
+ <!-- {{ v.isUnfold }} -->
72
+ <span @click.stop="handleLabelUpfold(v)">
73
+ <template v-if="v.isUnfold">
74
+ <span>收起</span>
75
+ <a-icon
76
+ type="up-square"
77
+
78
+ />
79
+ </template>
80
+ <template v-else>
81
+ <span>展开</span>
82
+ <a-icon
83
+ type="down-square"
84
+ />
85
+ </template>
86
+ </span>
87
+ </div>
88
+ </div>
89
+ </slot>
90
+ <a-input v-else style="width: 200px" v-model="item.inputVal" allowClear></a-input>
91
+ </div>
92
+ <!-- label -->
93
+
94
+ <!-- EVALUATE -->
95
+ <div v-else-if="item.EVALUATEAttr">
96
+ <template v-for="tag in EVALUATEList">
97
+ <a-checkable-tag
98
+ :key="tag.value"
99
+ :checked="item.selecteds.indexOf(tag.value) > -1"
100
+ @change="checked => handleEvaluateOnChange(tag, checked, item)"
101
+ >
102
+ {{ tag.label }}
103
+ </a-checkable-tag>
104
+ </template>
105
+ <!-- <a-icon v-if="item.CL" type="close" @click="item.CL = ''" /> -->
106
+ </div>
107
+ <!-- EVALUATE -->
108
+
109
+ <!-- NUMBERFiled -->
110
+ <div v-else-if="item.NUMBERFiled" class="ant-calendar-picker" style="width: 300px">
111
+ <span
112
+ class="ant-calendar-picker-input ant-input num-picker"
113
+ :class="{ 'num-picker-unit': item.inputUnit }"
114
+ >
115
+ <input
116
+ v-model="item.lessValue"
117
+ @keyup.enter="() => changeFilterNumber(item)"
118
+ :title="`起始${item.alias || item.title}`"
119
+ :placeholder="`起始${item.alias || item.title}`"
120
+ class="ant-calendar-range-picker-input"/>
121
+ <span class="ant-calendar-range-picker-separator"> ~ &nbsp;</span>
122
+ <input
123
+ v-model="item.bigValue"
124
+ :title="`截止${item.alias || item.title}`"
125
+ @keyup.enter="() => changeFilterNumber(item)"
126
+ :placeholder="`截止${item.alias || item.title}`"
127
+ class="ant-calendar-range-picker-input"/>
128
+ <template v-if="item.inputUnit">&nbsp;{{ item.inputUnit }}</template>
129
+ <span
130
+ class="ant-input-suffix clear-number-icon"
131
+ v-if="item.lessValue || item.bigValue"
132
+ @click="clearFilterNumber(item)"
133
+ ><i
134
+ aria-label="图标: close-circle"
135
+ tabindex="-1"
136
+ class="anticon anticon-close-circle ant-input-clear-icon"
137
+ ><svg
138
+ viewBox="64 64 896 896"
139
+ data-icon="close-circle"
140
+ width="1em"
141
+ height="1em"
142
+ fill="currentColor"
143
+ aria-hidden="true"
144
+ focusable="false"
145
+ class=""
146
+ >
147
+ <path
148
+ d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
149
+ ></path></svg></i></span
150
+ ></span>
151
+ </div>
152
+ <!-- NUMBERFiled -->
153
+
154
+ <!-- other -->
155
+ <slot v-else>
156
+ <template v-if="item.con == 'CL'">
157
+ <template v-if="showPercent(item)">
158
+ <a-input-number
159
+ class="CL-input"
160
+ :style="`width: ${getEleWidth(item)}`"
161
+ v-model="item.CL"
162
+ :min="0"
163
+ :max="100"
164
+ allowClear
165
+ />
166
+ </template>
167
+ <template v-else>
168
+ <a-input
169
+ class="CL-input"
170
+ :style="{
171
+ width: `${getEleWidth(item)}`,
172
+ 'font-family': item.PASSWORDTYPE ? 'text-security-disc' : 'inherit'
173
+ }"
174
+ v-model="item.CL"
175
+ :class="{ 'psw-icon': item.comAttr == 'PASSWORD' }"
176
+ allowClear
177
+ >
178
+ <template slot="suffix" v-if="item.comAttr == 'PASSWORD'">
179
+ <svg-icon
180
+ class="psw-icon"
181
+ @click="item.PASSWORDTYPE = !item.PASSWORDTYPE"
182
+ :icon-class="item.PASSWORDTYPE ? 'anniuyincang' : 'chakan'"
183
+ style="font-size: 1em;"
184
+ />
185
+ </template>
186
+ </a-input>
187
+ </template>
188
+ </template>
189
+ <template v-if="item.con == 'EQ'">
190
+ <template v-if="showPercent(item)">
191
+ <a-input-number
192
+ class="EQ-input"
193
+ :style="`width: ${getEleWidth(item)}`"
194
+ v-model="item.EQ"
195
+ :min="0"
196
+ :max="100"
197
+ allowClear
198
+ />
199
+ </template>
200
+ <template v-else>
201
+ <a-input
202
+ :class="{ 'psw-icon': item.comAttr == 'PASSWORD' }"
203
+ class="EQ-input"
204
+ :style="{
205
+ width: `${getEleWidth(item)}`,
206
+ 'font-family': item.PASSWORDTYPE ? 'text-security-disc' : 'inherit'
207
+ }"
208
+ v-model="item.EQ"
209
+ :placeholder="item.isPreciseSearch || item.fieldType == 'JSONB' ? '' : getI18nText('1.9.6', '区间搜素用~分割')"
210
+ allowClear
211
+ >
212
+ <template slot="suffix" v-if="item.comAttr == 'PASSWORD'">
213
+ <svg-icon
214
+ class="psw-icon"
215
+ @click="item.PASSWORDTYPE = !item.PASSWORDTYPE"
216
+ :icon-class="item.PASSWORDTYPE ? 'anniuyincang' : 'chakan'"
217
+ style="font-size: 1em;"
218
+ />
219
+ </template>
220
+ </a-input>
221
+ </template>
222
+ </template>
223
+ <template v-if="showPercent(item)">&nbsp;%</template>
224
+ <!-- date -->
225
+ <div v-if="item.con == 'DATE'">
226
+ <a-radio-group v-model="item.DATE.con" buttonStyle="solid">
227
+ <a-radio-button
228
+ v-for="date in item.dateTeam"
229
+ v-show="!item.showDate"
230
+ @click="clickRadioGroup(item.DATE, date.con)"
231
+ :key="date.con"
232
+ :value="date.con"
233
+ >{{ getI18nText(date.title, date.name) }}
234
+ </a-radio-button>
235
+ <span v-show="item.advanceOptionSetting != 1" :class="['check-date-btn', item.marginx]" @click="checkDate(item)">{{
236
+ getI18nText('1.1.4.52', '选择时间')
237
+ }}</span>
238
+ <div class="check-date" v-show="item.showDate">
239
+ <a-date-picker
240
+ format="YYYY-MM-DD HH:mm:ss"
241
+ v-model="item.DATE.start_val"
242
+ :show-time="{
243
+ defaultValue: $moment('00:00:00', 'HH:mm:ss')
244
+ }"
245
+ :placeholder="getI18nText('1.1.4.53', '开始时间')"
246
+ style="width: 120px"
247
+ allowClear
248
+ />
249
+ &nbsp;
250
+ <a-date-picker
251
+ format="YYYY-MM-DD HH:mm:ss"
252
+ :show-time="{
253
+ defaultValue: $moment('23:59:59', 'HH:mm:ss')
254
+ }"
255
+ :placeholder="getI18nText('1.9.147', '结束时间')"
256
+ v-model="item.DATE.end_val"
257
+ style="width: 120px"
258
+ allowClear
259
+ />
260
+ </div>
261
+ </a-radio-group>
262
+ </div>
263
+ <!-- BIRTHDAY -->
264
+ <div v-if="item.con == 'BIRTHDAY'" :class="{ 'birthday-item': item.showDate }">
265
+ <a-radio-group v-model="item.BIRTHDAY.con" buttonStyle="solid">
266
+ <template v-if="!item.showDate">
267
+ <a-radio-button
268
+ v-for="date in birthdayTeam"
269
+ @click="clickBirthdayRadioGroup(item.BIRTHDAY, date.con)"
270
+ :key="date.con"
271
+ :value="date.con"
272
+ >{{ getI18nText(date.title, date.name) }}
273
+ </a-radio-button>
274
+ </template>
275
+ <template v-else>
276
+ <div>
277
+ <a-range-picker
278
+ v-model="item.BIRTHDAY.limit_date"
279
+ :disabledDate="disabledDate"
280
+ @change="changeRange"
281
+ format="MM-DD"
282
+ />
283
+ </div>
284
+ <div class="age-wrap">
285
+ <p>{{ getI18nText('1.2.5.34', '年龄') }}</p>
286
+ <a-input
287
+ style="width: 60px; margin-right: 10px"
288
+ v-model="item.BIRTHDAY.start_val"
289
+ allowClear
290
+ />
291
+ <a-input
292
+ style="width: 60px; margin-right: 10px"
293
+ v-model="item.BIRTHDAY.end_val"
294
+ allowClear
295
+ />
296
+ <a-select
297
+ v-model="item.BIRTHDAY.unit"
298
+ defaultValue="YEAR"
299
+ showSearch
300
+ :filterOption="filterOption"
301
+ allowClear
302
+ >
303
+ <a-select-option
304
+ v-for="v in item.BIRTHDAY.units"
305
+ :key="v.con"
306
+ :value="v.con"
307
+ >
308
+ {{ getI18nText(v.title, v.name) }}
309
+ </a-select-option>
310
+ </a-select>
311
+ </div>
312
+ </template>
313
+ <span :class="['check-date-btn', item.marginx]" @click="checkBirthDay(item)">{{
314
+ getI18nText('1.1.5.2', '切换')
315
+ }}</span>
316
+ </a-radio-group>
317
+ </div>
318
+ <!-- <a-select
319
+ v-if="item.con == 'QUOTE'"
320
+ v-model="item.QUOTE"
321
+ mode="multiple"
322
+ :placeholder="$t('1.1.6.7')"
323
+ :tokenSeparators="['|#|']"
324
+ style="width: 200px"
325
+ :filter-option="false"
326
+ @dropdownVisibleChange="dropdownVisibleChange($event, item)"
327
+ @search="handleSearch($event, item)"
328
+ showSearch
329
+ allowClear
330
+ >
331
+ <a-select-option
332
+ v-for="sea in item.dataSource"
333
+ :key="item.sid + sea.myName"
334
+ :value="sea.myName"
335
+ >
336
+ {{ sea.showKeys || sea.myName }}
337
+ </a-select-option>
338
+ </a-select> -->
339
+ <template v-if="item.con == 'QUOTE' || item.com == 'SelectMui'">
340
+ <c-tree-select
341
+ v-if="item.comType === 'treeSelect'"
342
+ :item="item"
343
+ :handleGetConfigApi="handleGetConfigApi"
344
+ style="margin: 0 8px 8px 0"
345
+ />
346
+ <multiSelect
347
+ v-else
348
+ :item="item"
349
+ source="quickSearch"
350
+ :maxTagPlaceholder="maxTagPlaceholder"
351
+ :outFilterChange="filterChange"
352
+ :handleWordBookSearch="handleSearch"
353
+ :dropdownVisibleChange="dropdownVisibleChange"
354
+ :fetchingWordbook="fetchingWordbook"
355
+ ></multiSelect>
356
+ </template>
357
+
358
+ <a-checkbox-group
359
+ class="check-box"
360
+ v-else-if="item.con == 'CONVERT'"
361
+ :options="item.setting.showSetting"
362
+ v-model="item.CONVERT"
363
+ />
364
+ </slot>
365
+ </div>
366
+ </div>
367
+ </div>
368
+ <!-- 跨表 -->
369
+ <template v-for="(relationItem, i) in relationQuickSearch">
370
+ <div :key="i" v-if="relationItem.fieldList && relationItem.fieldList.length">
371
+ <p class="module-title">{{ relationItem.tableName }}</p>
372
+ <div
373
+ class="quick-item"
374
+ v-for="item in relationItem.fieldList"
375
+ :key="item.sid"
376
+ :class="{
377
+ 'quick-block':
378
+ item.con == 'DATE' ||
379
+ item.con == 'BIRTHDAY' ||
380
+ item.con == 'CONVERT' ||
381
+ item.LABELAttr
382
+ }"
383
+ >
384
+ <div class="quick-row">
385
+ <!-- title -->
386
+ <div
387
+ class="quick-item-title"
388
+ :class="{ 'quick-item-title-default': source !== 'editTable' }"
389
+ >
390
+ <span>{{ handleName(item, "title") }}&nbsp;&nbsp;</span>
391
+ </div>
392
+ <div
393
+ class="quick-item-col"
394
+ :class="{ 'quick-item-col-default': source !== 'editTable' }"
395
+ >
396
+ <div v-if="item.LABELAttr">
397
+ <slot v-if="item.labelObj && Object.keys(item.labelObj || {}).length > 0">
398
+ <div v-for="(v, k) in item.labelObj" :key="k" class="edit-label-content">
399
+ <div class="edit-label">{{ k }}:</div>
400
+ <div class="edit-content">
401
+ <div class="label-content">
402
+ <a-checkable-tag
403
+ v-for="(v, i) in v.itemList"
404
+ v-model="v.isSelect"
405
+ @change="handleLabelChange($event, v, item)"
406
+ :key="i"
407
+ :class="['label-tag-' + handleLabelColorClass(v)]"
408
+ >
409
+ <a-tooltip placement="topLeft">
410
+ <template slot="title">
411
+ <span>{{ v.labelName }}</span>
412
+ </template>
413
+ {{ v.labelName }}
414
+ </a-tooltip>
415
+ </a-checkable-tag>
416
+ </div>
417
+ </div>
418
+ </div>
419
+ </slot>
420
+ <a-input v-else style="width: 200px" v-model="item.inputVal"> </a-input>
421
+ </div>
422
+
423
+ <!-- EVALUATE -->
424
+ <div v-else-if="item.EVALUATEAttr">
425
+ <template v-for="tag in EVALUATEList">
426
+ <a-checkable-tag
427
+ :key="tag.value"
428
+ :checked="item.selecteds.indexOf(tag.value) > -1"
429
+ @change="checked => handleEvaluateOnChange(tag, checked, item)"
430
+ >
431
+ {{ tag.label }}
432
+ </a-checkable-tag>
433
+ </template>
434
+ <!-- <a-icon v-if="item.CL" type="close" @click="item.CL = ''" /> -->
435
+ </div>
436
+ <!-- EVALUATE -->
437
+
438
+ <!-- NUMBERFiled -->
439
+ <div v-else-if="item.NUMBERFiled" class="ant-calendar-picker" style="width: 300px">
440
+ <span
441
+ class="ant-calendar-picker-input ant-input num-picker"
442
+ :class="{ 'num-picker-unit': item.inputUnit }"
443
+ >
444
+ <input
445
+ v-model="item.lessValue"
446
+ @keyup.enter="() => changeFilterNumber(item)"
447
+ :title="`起始${item.alias || item.title}`"
448
+ :placeholder="`起始${item.alias || item.title}`"
449
+ class="ant-calendar-range-picker-input"/>
450
+ <span class="ant-calendar-range-picker-separator"> ~ &nbsp;</span>
451
+ <input
452
+ v-model="item.bigValue"
453
+ :title="`截止${item.alias || item.title}`"
454
+ @keyup.enter="() => changeFilterNumber(item)"
455
+ :placeholder="`截止${item.alias || item.title}`"
456
+ class="ant-calendar-range-picker-input"/>
457
+ <template v-if="item.inputUnit">&nbsp;{{ item.inputUnit }}</template>
458
+ <span
459
+ class="ant-input-suffix clear-number-icon"
460
+ v-if="item.lessValue || item.bigValue"
461
+ @click="clearFilterNumber(item)"
462
+ ><i
463
+ aria-label="图标: close-circle"
464
+ tabindex="-1"
465
+ class="anticon anticon-close-circle ant-input-clear-icon"
466
+ ><svg
467
+ viewBox="64 64 896 896"
468
+ data-icon="close-circle"
469
+ width="1em"
470
+ height="1em"
471
+ fill="currentColor"
472
+ aria-hidden="true"
473
+ focusable="false"
474
+ class=""
475
+ >
476
+ <path
477
+ d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
478
+ ></path></svg></i
479
+ ></span>
480
+ <span class="ant-calendar-picker-icon"></span
481
+ ></span>
482
+ </div>
483
+ <!-- NUMBERFiled -->
484
+
485
+ <slot v-else>
486
+ <template v-if="item.con == 'CL'">
487
+ <template v-if="showPercent(item)">
488
+ <a-input-number
489
+ class="CL-input"
490
+ :style="`width: ${getEleWidth(item)}`"
491
+ v-model="item.CL"
492
+ :min="0"
493
+ :max="100"
494
+ allowClear
495
+ />
496
+ </template>
497
+ <template v-else>
498
+ <a-input class="CL-input" :style="`width: ${getEleWidth(item)}`" v-model="item.CL" allowClear>
499
+ </a-input>
500
+ </template>
501
+ </template>
502
+ <template v-if="item.con == 'EQ'">
503
+ <template v-if="showPercent(item)">
504
+ <a-input-number
505
+ class="EQ-input"
506
+ :style="`width: ${getEleWidth(item)}`"
507
+ v-model="item.EQ"
508
+ :min="0"
509
+ :max="100"
510
+ allowClear
511
+ />
512
+ </template>
513
+ <template v-else>
514
+ <a-input
515
+ class="EQ-input"
516
+ :style="`width: ${getEleWidth(item)}`"
517
+ v-model="item.EQ"
518
+ :placeholder="item.isPreciseSearch || item.fieldType == 'JSONB' ? '' : getI18nText('1.9.6', '区间搜素用~分割')"
519
+ allowClear
520
+ >
521
+ </a-input>
522
+ </template>
523
+ </template>
524
+ <template v-if="showPercent(item)">&nbsp;%</template>
525
+ <!-- date -->
526
+ <div v-if="item.con == 'DATE'">
527
+ <a-radio-group v-model="item.DATE.con" buttonStyle="solid">
528
+ <a-radio-button
529
+ v-for="date in dateTeam"
530
+ v-show="!item.showDate"
531
+ @click="clickRadioGroup(item.DATE, date.con)"
532
+ :key="date.con"
533
+ :value="date.con"
534
+ >{{ getI18nText(date.title, date.name) }}
535
+ </a-radio-button>
536
+ <span :class="['check-date-btn', item.marginx]" @click="checkDate(item)">{{
537
+ getI18nText('1.1.4.53', '开始时间')
538
+ }}</span>
539
+ <div class="check-date" v-show="item.showDate">
540
+ <a-date-picker
541
+ format="YYYY-MM-DD HH:mm:ss"
542
+ v-model="item.DATE.start_val"
543
+ :show-time="{
544
+ defaultValue: $moment('00:00:00', 'HH:mm:ss')
545
+ }"
546
+ :placeholder="'起始日期'"
547
+ style="width: 120px"
548
+ allowClear
549
+ />
550
+ &nbsp;
551
+ <a-date-picker
552
+ format="YYYY-MM-DD HH:mm:ss"
553
+ v-model="item.DATE.end_val"
554
+ :placeholder="'截止日期'"
555
+ :show-time="{
556
+ defaultValue: $moment('23:59:59', 'HH:mm:ss')
557
+ }"
558
+ style="width: 120px"
559
+ allowClear
560
+ />
561
+ </div>
562
+ </a-radio-group>
563
+ </div>
564
+ <!-- <a-select
565
+ v-if="item.con == 'QUOTE'"
566
+ v-model="item.QUOTE"
567
+ mode="multiple"
568
+ :placeholder="$t('1.1.6.7')"
569
+ :tokenSeparators="['|#|']"
570
+ style="width: 200px"
571
+ :filter-option="false"
572
+ @dropdownVisibleChange="dropdownVisibleChange($event, item)"
573
+ @search="handleSearch($event, item)"
574
+ showSearch
575
+ allowClear
576
+ >
577
+ <a-select-option
578
+ v-for="sea in item.dataSource"
579
+ :key="item.sid + sea.myName"
580
+ :value="sea.myName"
581
+ >
582
+ {{ sea.myName }}
583
+ </a-select-option>
584
+ </a-select> -->
585
+ <template v-if="item.con == 'QUOTE' || item.com == 'SelectMui'">
586
+ <c-tree-select
587
+ v-if="item.comType === 'treeSelect'"
588
+ :item="item"
589
+ :handleGetConfigApi="handleGetConfigApi"
590
+ style="margin: 0 8px 8px 0"
591
+ />
592
+ <multiSelect
593
+ v-else
594
+ :item="item"
595
+ source="quickSearch"
596
+ :maxTagPlaceholder="maxTagPlaceholder"
597
+ :outFilterChange="filterChange"
598
+ :handleWordBookSearch="handleSearch"
599
+ :dropdownVisibleChange="dropdownVisibleChange"
600
+ :fetchingWordbook="fetchingWordbook"
601
+ ></multiSelect>
602
+ </template>
603
+
604
+ <a-checkbox-group
605
+ class="check-box"
606
+ v-else-if="item.con == 'CONVERT'"
607
+ :options="item.setting.showSetting"
608
+ v-model="item.CONVERT"
609
+ />
610
+ </slot>
611
+ </div>
612
+ </div>
613
+ </div>
614
+ </div>
615
+ </template>
616
+ </div>
617
+
618
+ <a-modal
619
+ :title="'设置筛选分类'"
620
+ :visible="showInner"
621
+ @ok="saveToCalss"
622
+ @cancel="cancelSaveToCalss"
623
+ wrapClassName="quickSearch-saveToClass-modal"
624
+ >
625
+ <a-form :form="formInner" :label-col="{ span: 5 }" :wrapper-col="{ span: 18 }">
626
+ <a-form-item :label="'筛选集名称'">
627
+ <a-input
628
+ v-decorator="[
629
+ 'classname',
630
+ {
631
+ rules: [{ required: true, message: getI18nText('1.1.6.6', '请输入分类名称') }]
632
+ }
633
+ ]"
634
+ />
635
+ </a-form-item>
636
+ </a-form>
637
+ <a-row>
638
+ <a-col :span="5" style="text-align: right; color: rgba(0, 0, 0, 0.85)"> 父类名称: </a-col>
639
+ <a-col :span="18">
640
+ <div
641
+ class="edit-tag"
642
+ v-for="(item, index) in parentNames"
643
+ :key="index"
644
+ @dblclick="e => editParentName(e, item)"
645
+ @click="handleParentNameSelect(item, index)"
646
+ :class="{ 'edit-tag-select': item.selected && item.disabled }"
647
+ >
648
+ <a-input
649
+ style="width: 100px"
650
+ :value="item"
651
+ :disabled="item.disabled"
652
+ @blur="() => (item.disabled = true)"
653
+ v-model="item.value"
654
+ />
655
+ <a-icon slot="suffix" type="close" @click="handleParentNamesRemove(index, item)" />
656
+ </div>
657
+ <template v-if="!parentNamesHasAdd">
658
+ <a-button
659
+ v-show="!showAdd"
660
+ icon="plus"
661
+ type="dashed"
662
+ class="add-parent"
663
+ @click="handleParentNamesAdd"
664
+ >
665
+ {{ getI18nText('1.9.363', '添加分类') }}
666
+ </a-button>
667
+ <a-input
668
+ class="edit-tag"
669
+ v-model.trim="addVal"
670
+ v-show="showAdd"
671
+ style="width: 100px"
672
+ @blur="hanldeBlur"
673
+ />
674
+ </template>
675
+ </a-col>
676
+ </a-row>
677
+ </a-modal>
678
+ </div>
679
+ <!-- </a-modal> -->
680
+ </template>
681
+
682
+ <script>
683
+ const EVALUATEList = [
684
+ {
685
+ label: "一星",
686
+ value: "1",
687
+ isSelect: false
688
+ },
689
+ {
690
+ label: "二星",
691
+ value: "2",
692
+ isSelect: false
693
+ },
694
+ {
695
+ label: "三星",
696
+ value: "3",
697
+ isSelect: false
698
+ },
699
+ {
700
+ label: "四星",
701
+ value: "4",
702
+ isSelect: false
703
+ },
704
+ {
705
+ label: "五星",
706
+ value: "5",
707
+ isSelect: false
708
+ }
709
+ ];
710
+
711
+ const AGEOPTIONS = [
712
+ {
713
+ label: "岁",
714
+ value: "YY"
715
+ },
716
+ {
717
+ label: "月",
718
+ value: "MM"
719
+ },
720
+ {
721
+ label: "日",
722
+ value: "DD"
723
+ }
724
+ ];
725
+ import tableSearchCon from "../mixins/tableSearchCon";
726
+ import moment from 'moment';
727
+ import 'moment/locale/zh-cn';
728
+ // antd
729
+ import _ from 'lodash';
730
+ import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu, Radio, Checkbox, Row, Tag, InputNumber, Col, Form, Modal, Tooltip } from 'ant-design-vue';
731
+ import rangeAge from '../components/range-age/index';
732
+ import multiSelect from '../components/multi-select/multi-select';
733
+ import resize from 'vue-resize-directive';
734
+ import { durationMixin, $utils, filterApiFn } from '../mixins/mixins';
735
+ import vexutils from '@/utils/vexutils';
736
+ import wordBookutils from '../mixins/wordBookutils';
737
+ import cTreeSelect from '../components/c-tree-select/tree-select';
738
+ import create from '@/core/create';
739
+ import utils from '@/utils/utils-map';
740
+ import {dataOptions} from '../const/dataOptions'
741
+ export default create({
742
+ name: "quick-search",
743
+ mixins: [durationMixin, $utils, filterApiFn, tableSearchCon],
744
+ props: {
745
+ visible: Boolean,
746
+ searchFieldList: {
747
+ type: Array,
748
+ default: () => []
749
+ },
750
+ searchFieldLimit: {
751
+ type: Object,
752
+ default: () => ({})
753
+ },
754
+ quickSearchConfig: Array,
755
+ source: String,
756
+ quickSearchListObj: Object,
757
+ originConditionList: Array,
758
+ isOrgAdmin: Boolean,
759
+ lastQuickSearchData: Array,
760
+ show: Boolean,
761
+ getFilterData: Function
762
+ },
763
+ components: {
764
+ rangeAge,
765
+ [Button.name]: Button,
766
+ [Icon.name]: Icon,
767
+ [Dropdown.name]: Dropdown,
768
+ [Select.name]: Select,
769
+ [Select.Option.name]: Select.Option,
770
+ [Upload.name]: Upload,
771
+ [DatePicker.name]: DatePicker,
772
+ [DatePicker.RangePicker.name]: DatePicker.RangePicker,
773
+ [Input.name]: Input,
774
+ [Input.Group.name]: Input.Group,
775
+ [InputNumber.name]: InputNumber,
776
+ [Input.Search.name]: Input.Search,
777
+ [Menu.name]: Menu,
778
+ [Menu.Item.name]: Menu.Item,
779
+ [Menu.ItemGroup.name]: Menu.ItemGroup,
780
+ [Radio.name]: Radio,
781
+ [Radio.Button.name]: Radio.Button,
782
+ [Radio.Group.name]: Radio.Group,
783
+ [Checkbox.name]: Checkbox,
784
+ [Checkbox.Group.name]: Checkbox.Group,
785
+ [Row.name]: Row,
786
+ [Col.name]: Col,
787
+ [Tag.name]: Tag,
788
+ AModal: Modal,
789
+ [Form.name]: Form,
790
+ [Tooltip.name]: Tooltip,
791
+ [Form.Item.name]: Form.Item,
792
+ [Tag.CheckableTag.name]: Tag.CheckableTag,
793
+ multiSelect,
794
+ cTreeSelect
795
+ },
796
+ computed: {
797
+ showPercent() {
798
+ return function(item) {
799
+ return item.settingObj?.attr === "PERCENTAGE" || false;
800
+ };
801
+ },
802
+ getEleWidth(){
803
+ return function(item) {
804
+ return `${item.advanceColWidth||200}px`
805
+ }
806
+ },
807
+ hasRelationQuickSearch() {
808
+ return this.relationQuickSearch.findIndex(i => i.fieldList && i.fieldList.length) != -1;
809
+ },
810
+ parentNamesHasAdd() {
811
+ if (!this.parentNames.length) return false;
812
+ return this.parentNames.some(v => v.isAdd);
813
+ },
814
+ handleName() {
815
+ return function(item, key = "name") {
816
+ return item.alias || item[key];
817
+ };
818
+ },
819
+
820
+ $moment() {
821
+ return moment;
822
+ }
823
+ },
824
+ data() {
825
+ return {
826
+ modalVisible: this.visible,
827
+ showInner: false,
828
+ quickSearch: [],
829
+ relationTableList: [], // 跨表查询
830
+ relationQuickSearch: [], // 跨表查询检索条件
831
+ formData: {},
832
+ searchItem: {},
833
+ curWordbookData: undefined,
834
+ curAutograph: "",
835
+ dateTeam: [
836
+ { con: 'TODAY', title: '1.1.4.37', name: '今天' },
837
+ { con: 'TOMORROW', title: '1.1.4.38', name: '明天' },
838
+ { con: 'YESTERDAY', title: '1.1.4.39', name: '昨天' },
839
+ { con: 'THIS_WEEK', title: '1.1.4.40', name: '本周' },
840
+ { con: 'NEXT_WEEK', title: '1.1.4.41', name: '下周' },
841
+ { con: 'UP_WEEK', title: '1.1.4.42', name: '上周' },
842
+ { con: 'THIS_MONTH', title: '1.1.4.43', name: '本月' },
843
+ { con: 'NEXT_MONTH', title: '1.1.4.44', name: '下月' },
844
+ { con: 'UP_MONTH', title: '1.1.4.45', name: '上月' },
845
+ { con: 'THIS_SEASON', title: '1.1.4.46', name: '本季度' },
846
+ { con: 'NEXT_SEASON', title: '1.1.4.47', name: '下季度' },
847
+ { con: 'UP_SEASON', title: '1.1.4.48', name: '上季度' },
848
+ { con: 'THIS_YEAR', title: '1.1.4.49', name: '本年' },
849
+ { con: 'NEXT_YEAR', title: '1.1.4.50', name: '下年' },
850
+ { con: 'UP_YEAR', title: '1.1.4.51', name: '上年' }
851
+ ],
852
+ birthdayTeam: [],
853
+ limit_date: "",
854
+ birthdayUnits: [
855
+ { title: '1.2.5.58', units: 1, con: 'DAY', name: '天' },
856
+ { title: '1.2.5.59', units: 2, con: 'WEEK', name: '周' },
857
+ { title: '1.2.1.11.18', units: 1, con: 'MONTH', name: '月' },
858
+ { title: '1.9.273', units: 1, con: 'YEAR', name: '岁' },
859
+ ],
860
+ isChangeWindow: false,
861
+ modalWidth: "700px",
862
+ modalHeight: "60vh",
863
+ EVALUATEList,
864
+ AGEOPTIONS,
865
+ label_max_count: 8,
866
+ parentNames: [],
867
+ showAdd: false,
868
+ addVal: "",
869
+ fetchingWordbook: false,
870
+ ...dataOptions
871
+ };
872
+ },
873
+ watch: {
874
+ visible(value) {
875
+ this.modalVisible = value;
876
+ // this.init();
877
+ this.setDefaultCon(this.quickSearchConfig);
878
+ },
879
+ searchFieldList: {
880
+ immediate: true,
881
+ deep: true,
882
+ handler(val) {
883
+ if (val && val.length > 0) {
884
+ let { relationTableList = [] } = this.$attrs;
885
+ this.relationTableList = relationTableList;
886
+ this.init();
887
+ }
888
+ }
889
+ },
890
+ quickSearchConfig: {
891
+ handler(val) {
892
+ this.setDefaultCon(val);
893
+ },
894
+ deep: true
895
+ },
896
+ quickSearchListObj: {
897
+ immediate: true,
898
+ deep: true,
899
+ handler(val) {
900
+ if (!val || !Object.keys(val).length) {
901
+ this.parentNames = [];
902
+ return;
903
+ }
904
+ this.handleParentName();
905
+ }
906
+ },
907
+ quickSearch: {
908
+ deep: true,
909
+ handler() {
910
+ const conObj = this.getConObjParams() || [];
911
+ this.$emit("filterCountChange", conObj.length);
912
+ }
913
+ },
914
+ show: {
915
+ deep: true,
916
+ handler(newVal) {
917
+ if (newVal && this.lastQuickSearchData.length > 0) {
918
+ this.quickSearch = _.cloneDeep(this.lastQuickSearchData);
919
+ }
920
+ }
921
+ }
922
+ },
923
+ beforeCreate() {
924
+ this.formInner = this.$form.createForm(this);
925
+ },
926
+ created() {},
927
+ methods: {
928
+ filterOption(...arg) {
929
+ return utils.filterOption(...arg);
930
+ },
931
+ handleLabelColor(...arg) {
932
+ return utils.handleLabelColor(...arg);
933
+ },
934
+ init() {
935
+ this.quickSearch = [];
936
+ this.relationQuickSearch = [];
937
+ this.birthdayTeam = this.dateTeam.filter(
938
+ item => item.con != "THIS_YEAR" && item.con != "NEXT_YEAR" && item.con != "UP_YEAR"
939
+ );
940
+ let copyList = _.cloneDeep(this.searchFieldList);
941
+ let mySearchFieldList = copyList.filter(i => i.isShowSearch == 1 && i.filterExplicit != 1) || [];
942
+ // let relationTableList = JSON.parse(JSON.stringify(this.relationTableList));
943
+ let relationTableList = _.cloneDeep(this.relationTableList);
944
+
945
+ // 跨表
946
+ let relationQuickSearch = relationTableList.map(item => {
947
+ return {
948
+ fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit != 1),
949
+ tableName: item.tableName,
950
+ primaryField: item.primaryField,
951
+ parameterConversionId: item.parameterConversionId,
952
+ tableId: item.tableId,
953
+ relationField: item.relationField,
954
+ converFun: item.converFun,
955
+ relationOrgId: item.relationOrgId,
956
+ preConObj: item.preConObj,
957
+ preSqlExpression: item.preSqlExpression
958
+ };
959
+ });
960
+
961
+ this.$set(this, "relationQuickSearch", relationQuickSearch);
962
+ // 过滤获取 快速检索的字段
963
+ this.quickSearch = mySearchFieldList || [];
964
+ this.handlerInitSearchItem(this.quickSearch);
965
+ this.relationQuickSearch.forEach(item => {
966
+ this.handlerInitSearchItem(item.fieldList);
967
+ });
968
+ },
969
+ handleParentName() {
970
+ let parentNames = [];
971
+ let { displayCategoryList = [] } = this.quickSearchListObj;
972
+ if (!displayCategoryList || !displayCategoryList.length) {
973
+ this.parentNames = [];
974
+ return;
975
+ }
976
+ displayCategoryList.forEach(item => {
977
+ if (item !== "未分类") {
978
+ parentNames.push({
979
+ disabled: true,
980
+ selected: false,
981
+ value: item
982
+ });
983
+ }
984
+ });
985
+ this.parentNames = parentNames;
986
+ },
987
+ setDefaultCon(val) {
988
+ if (!val.length) {
989
+ this.quickSearch.forEach((item, index) => {
990
+ let advanceOptionSetting = item?.advanceOptionSetting;
991
+ // 单选
992
+ let optionSetting0 =String(advanceOptionSetting) == '0';
993
+ if(optionSetting0){
994
+ this.$set(this.quickSearch[index], "value", undefined);
995
+ } else {
996
+ if (item.CONVERT && Array.isArray(item.CONVERT)) {
997
+ this.$set(this.quickSearch[index], "CONVERT", []);
998
+ }
999
+ }
1000
+
1001
+ });
1002
+ return false;
1003
+ }
1004
+
1005
+ this.quickSearch.forEach((item, index) => {
1006
+ let advanceOptionSetting = item?.advanceOptionSetting;
1007
+ // 单选
1008
+ let optionSetting0 =String(advanceOptionSetting) == '0';
1009
+ let find = val.find(valItem => valItem.field_key === item.columnName);
1010
+ if (find) {
1011
+ let value = find.value.map(item => JSON.stringify(item));
1012
+ value = value.filter(Boolean)
1013
+ this.$set(this.quickSearch[index], "CONVERT", value);
1014
+ if(optionSetting0){
1015
+ let i = value[0] ? item.labelList.findIndex(v=> v.value== value[0]) : ""
1016
+ this.$set(this.quickSearch[index], "value", i);
1017
+ }
1018
+ } else {
1019
+ this.$set(this.quickSearch[index], "CONVERT",optionSetting0?"": []);
1020
+ }
1021
+ });
1022
+ },
1023
+ handlerInitSearchItem(arr) {
1024
+ if (!Array.isArray(arr)) return;
1025
+ arr.forEach(el => {
1026
+ const isPreciseSearch = el?.settingObj?.isPreciseSearch || "";
1027
+
1028
+ if (el.setting) {
1029
+ // el.seting 可能是 string / object
1030
+ el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
1031
+
1032
+ let advanceOptionSetting = el?.advanceOptionSetting;
1033
+ // 单选
1034
+ let optionSetting0 =String(advanceOptionSetting) == '0';
1035
+ if (!vexutils.isEmpty(el.setting.wordbook)) {
1036
+ let isTree = "tree" === el?.setting?.wordbook?.showType;
1037
+ let comType = isTree ? 'treeSelect' : 'SelectMuiWordBook';
1038
+ let defVal = isTree ? [] : [];
1039
+ if(optionSetting0){
1040
+ defVal = undefined
1041
+ }
1042
+ this.$set(el, "con", "QUOTE");
1043
+ this.$set(el, "dataSource", []);
1044
+ this.$set(el, "QUOTE", []);
1045
+ this.$set(el, "value", defVal);
1046
+ this.$set(el, "com", "SelectMui");
1047
+ this.$set(el, "comType", comType);
1048
+ this.$set(el, "searchPageConfig", {
1049
+ keyword: undefined,
1050
+ isRequest: false, // 是否已请求
1051
+ page: 1, // 当前页
1052
+ total: 1, // 总页数
1053
+ hasNextPage: false
1054
+ });
1055
+ return;
1056
+ } else if (el.setting.showSetting && el.setting.showSetting.length > 0) {
1057
+ this.$set(el, "con", "CONVERT");
1058
+ let showSetting = el.setting.showSetting;
1059
+
1060
+ // 字典推荐值
1061
+ let dictionItem = this.handleDictionDef(el);
1062
+ if (dictionItem) {
1063
+ showSetting.unshift(dictionItem);
1064
+ }
1065
+ showSetting.forEach(set => {
1066
+ set.label = set.change_text;
1067
+ set.value = JSON.stringify(set.filter);
1068
+ });
1069
+ // el.setting.showSetting.forEach(set => {
1070
+ // this.$set(set, "label", set.change_text);
1071
+ // this.$set(set, "value", JSON.stringify(set.filter));
1072
+ // });
1073
+ /**
1074
+ * 映射方式的单选模式
1075
+ */
1076
+ if(optionSetting0){
1077
+ this.$set(el, "com", "SelectMui");
1078
+ this.$set(el, "comType", "SelectMui");
1079
+ const labelList = el.setting.showSetting.map(i => {
1080
+ i.labelName = i.change_text;
1081
+ return i;
1082
+ });
1083
+ this.$set(el, "labelList", labelList);
1084
+ }
1085
+
1086
+ this.$set(el.setting, "showSetting", showSetting);
1087
+ this.$set(el, "CONVERT",optionSetting0? "": []);
1088
+ return;
1089
+ }
1090
+ }
1091
+ if (el.setting.attr === "LABEL") {
1092
+ this.$set(el, "con", "CL"); // 2020-09-04 朱亚徽 EQ => CL
1093
+ this.$set(el, "LABELAttr", true);
1094
+ this.$set(el, "labelSelectList", []);
1095
+ this.$set(el, "inputVal", "");
1096
+ this.handleSetLabelOptions(el.setting.labelType, el);
1097
+ } else if (el.setting.attr === "EVALUATE") {
1098
+ this.$set(el, "con", "CL");
1099
+ this.$set(el, "selecteds", []);
1100
+ this.$set(el, "EVALUATEAttr", true);
1101
+ } else if (el.setting.attr === "AGE" && el.fieldType != "NUMBER") {
1102
+ // 年龄组件
1103
+ let format = el.setting.format || "YYYY-MM-DD";
1104
+ format = format.toUpperCase();
1105
+ this.$set(el, "con", "IN");
1106
+ this.$set(el, "ageObj", {});
1107
+ this.$set(el, "format", format);
1108
+ this.$set(el, "AGEAttr", true);
1109
+ } else if (el.setting.attr === "PASSWORD") {
1110
+ this.$set(el, "comAttr", "PASSWORD");
1111
+ this.$set(el, "PASSWORDTYPE", true);
1112
+ } else if (el.fieldType == "NUMBER") {
1113
+ this.$set(el, "con", "EQ");
1114
+ this.$set(el, "EQ", "");
1115
+ this.$set(el, "NUMBERFiled", true);
1116
+ this.$set(el, "lessValue", "");
1117
+ this.$set(el, "bigValue", "");
1118
+ if (el.setting.attr == "PERCENTAGE") {
1119
+ this.$set(el, "inputUnit", "%");
1120
+ }
1121
+ } else if (el.fieldType.includes("DATE")) {
1122
+ if (el.settingObj && el.settingObj.attr == "BIRTHDAY") {
1123
+ this.$set(el, "con", "BIRTHDAY");
1124
+ this.$set(el, "showDate", false);
1125
+ this.$set(el, "marginx", "ml");
1126
+ this.$set(el, "BIRTHDAY", this.initBirthdayParams());
1127
+ } else {
1128
+ // 判断是否有默认值
1129
+ const value = this.getSearchDefValueByLimit(el, this.searchFieldLimit);
1130
+ let hasValue = Array.isArray(value);
1131
+ let advanceOptionSetting = el?.advanceOptionSetting;
1132
+ // 选择时间模式
1133
+ let optionSetting1 = String(advanceOptionSetting) == '1';
1134
+
1135
+ this.$set(el, "con", "DATE");
1136
+ this.$set(el, "showDate", optionSetting1 || hasValue);
1137
+ this.$set(el, "marginx",optionSetting1 || hasValue ? "mr" : "ml");
1138
+ this.$set(el, "DATE", {
1139
+ con: hasValue ? "IN" : null,
1140
+ start_val: hasValue ? value[0] : null,
1141
+ end_val: hasValue ? value[1] : null
1142
+ });
1143
+ let dateTeam = optionSetting1 ? [] : this[`dateTeam${advanceOptionSetting}`] || this.dateTeam0;
1144
+ this.$set(el, 'dateTeam' , dateTeam)
1145
+ }
1146
+ } else if (el.fieldType == "TEXT") {
1147
+ /**
1148
+ * NUMBER和TEXT属性字段
1149
+ * 如果 开启了精准搜索,则传条件的时候 要传 EQ
1150
+ * isPreciseSearch: 0/1
1151
+ */
1152
+ let con = isPreciseSearch == 1 ? 'EQ': 'CL';
1153
+ this.$set(el, "con", con);
1154
+ this.$set(el, "isPreciseSearch", isPreciseSearch == 1);
1155
+ this.$set(el, con, "");
1156
+ } else if (el.fieldType == "JSONB") {
1157
+ this.$set(el, "con", "EQ");
1158
+ this.$set(el, "EQ", "");
1159
+ }
1160
+ });
1161
+ },
1162
+ // 字典推荐值 item处理
1163
+ handleDictionDef(el) {
1164
+ let { defaultValue, defaultValueTitle } = el?.dictionarieObj || {};
1165
+ let dictionItem = null;
1166
+ if (defaultValue && defaultValueTitle) {
1167
+ dictionItem = {
1168
+ change_text: defaultValueTitle,
1169
+ filter: [
1170
+ {
1171
+ con: "EQ",
1172
+ field_key: el.columnName,
1173
+ value: defaultValue
1174
+ }
1175
+ ]
1176
+ };
1177
+ }
1178
+ return dictionItem;
1179
+ },
1180
+ checkDate(item) {
1181
+ item.showDate = !item.showDate;
1182
+ item.showDate ? (item.marginx = "mr") : (item.marginx = "ml");
1183
+ },
1184
+ checkBirthDay(item) {
1185
+ item.showDate = !item.showDate;
1186
+ },
1187
+ getWordbookData(o, obj) {
1188
+ let { id, filterKeys, wordbookType } = o;
1189
+ this.fetchingWordbook = true;
1190
+ let resFieldKeys = Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
1191
+ let url = `/tableReader/getWordbookData`;
1192
+ let params = {
1193
+ wordbookId: id,
1194
+ fieldKeys: resFieldKeys,
1195
+ wordbookType: wordbookType || "WORDBOOK",
1196
+ asyncCount: 1, // 开启性能模式
1197
+ ...obj
1198
+ };
1199
+ return this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: o }).then(res => {
1200
+ this.fetchingWordbook = false;
1201
+ if(typeof res.data === 'object'){
1202
+ res.data.reqParams = params;
1203
+ }
1204
+ return res;
1205
+ }).catch(() => {
1206
+ this.fetchingWordbook = false;
1207
+ });
1208
+ },
1209
+ handleWordbookData(item, data, params) {
1210
+ this.$set(item, "hasFieldList", false);
1211
+ const {rows,hasFieldList,searchPageConfig} = wordBookutils.handleWordbookData(item,data,params);
1212
+ this.$set(item, "hasFieldList", hasFieldList);
1213
+ this.$set(item, "dataSource", rows);
1214
+ item.searchPageConfig = Object.assign(item.searchPageConfig, searchPageConfig);
1215
+ },
1216
+ filterChange() {},
1217
+ maxTagPlaceholder(item) {
1218
+ if (Array.isArray(item.value)) {
1219
+ return item.value.length;
1220
+ } else {
1221
+ return 1;
1222
+ }
1223
+ },
1224
+ dropdownVisibleChange(open, item) {
1225
+ if (item.comType == "SelectMui" && String(item.advanceOptionSetting) === '0') return;
1226
+ if (open) {
1227
+ let obj = {};
1228
+ if (item.setting.wordbook.params) {
1229
+ item.setting.wordbook.params.forEach(item => {
1230
+ obj[item.p_name] = item.p_value;
1231
+ });
1232
+ }
1233
+ if (item.settingObj.wordbook) {
1234
+ obj.autograph = item.settingObj.wordbook.autograph;
1235
+ }
1236
+ this.curWordbookData = item.setting.wordbook;
1237
+ this.curAutograph = item.settingObj.wordbook && item.settingObj.wordbook.autograph;
1238
+ this.searchItem = item;
1239
+ this.getWordbookData(item.setting.wordbook, obj).then(({ data }) => {
1240
+ this.handleWordbookData(item, data, obj);
1241
+ });
1242
+ }
1243
+ },
1244
+ /**
1245
+ * 输入自动联想
1246
+ */
1247
+ handleSearch(value, item, config={}) {
1248
+ if (item.comType == "SelectMui" && String(item.advanceOptionSetting) === '0') return;
1249
+ let params = {
1250
+ keyword: value,
1251
+ autograph: this.curAutograph
1252
+ };
1253
+ let obj = {};
1254
+ let p = item?.setting?.wordbook?.params || undefined;
1255
+ if (p) {
1256
+ item.setting.wordbook.params.forEach(item => {
1257
+ obj[item.p_name] = item.p_value;
1258
+ });
1259
+ }
1260
+ let rp = { ...params, ...obj, ...config };
1261
+ this.getWordbookData(this.curWordbookData, rp).then(({ data }) => {
1262
+ this.handleWordbookData(this.searchItem, data, rp);
1263
+ });
1264
+ },
1265
+ onSave() {
1266
+ let mergeConObj = this.getMergeConObj();
1267
+ this.resetChangeWindow();
1268
+
1269
+ if (!this.validConObj(mergeConObj, this.searchFieldList, this.searchFieldLimit)) return false;
1270
+ this.$emit("onSave", mergeConObj);
1271
+ return this.quickSearch;
1272
+ },
1273
+ // 方便外部调用
1274
+ getMergeConObj() {
1275
+ let conObj = this.getConObjParams() || [];
1276
+ let mergeConObj = [...conObj];
1277
+ // 合并表格表头未设置高级筛选的筛选项
1278
+ this.quickSearchConfig.forEach(i => {
1279
+ let find = mergeConObj.find(j => {
1280
+ return i.field_key === j.field_key;
1281
+ });
1282
+ if (
1283
+ !find &&
1284
+ !this.quickSearch.find(item => {
1285
+ return item.columnName === i.field_key;
1286
+ })
1287
+ ) {
1288
+ mergeConObj.push(i);
1289
+ }
1290
+ });
1291
+ return mergeConObj || [];
1292
+ },
1293
+ getConObjParams() {
1294
+ let conObj = this.getConObj(this.quickSearch) || [];
1295
+ let realation = [];
1296
+ this.relationQuickSearch.forEach(item => {
1297
+ let curQuote = this.getConObj(item.fieldList);
1298
+ if (curQuote && curQuote.length) {
1299
+ realation.push({
1300
+ field_key: item.primaryField,
1301
+ valueField: item.relationField,
1302
+ con: "QUOTE_IN",
1303
+ tableId: item.tableId,
1304
+ parameterConversionId: item.parameterConversionId,
1305
+ converFun: item.converFun,
1306
+ preConObj: item.preConObj,
1307
+ relationOrgId: item.relationOrgId,
1308
+ preSqlExpression: item.preSqlExpression,
1309
+ quote_con: {
1310
+ conObj: this.getConObj(item.fieldList),
1311
+ sqlExpression: ""
1312
+ }
1313
+ });
1314
+ }
1315
+ });
1316
+ conObj.push(...realation);
1317
+ return conObj || [];
1318
+ },
1319
+ closeModal() {
1320
+ this.resetChangeWindow();
1321
+ this.$emit("closeModal");
1322
+ },
1323
+ resetChangeWindow() {
1324
+ this.modalWidth = "700px";
1325
+ this.modalHeight = "60vh";
1326
+ this.isChangeWindow = false;
1327
+ },
1328
+ // 填写搜索设置条件后打开新增搜索分类名称弹框
1329
+ openSaveToCalss() {
1330
+ let conObj = this.getConObjParams();
1331
+ if (!conObj) return;
1332
+ if (conObj.length > 0) {
1333
+ if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return;
1334
+ this.showInner = true;
1335
+ } else {
1336
+ this.$message.warning(this.getI18nText('1.1.6.18', '请设置搜索条件'), 2);
1337
+ }
1338
+ },
1339
+ // 格式化设置搜索条件参数
1340
+ getConObj(arr) {
1341
+ // this.quickSearch
1342
+ if (!Array.isArray(arr)) {
1343
+ return [];
1344
+ }
1345
+ let conObj = [];
1346
+ for (let i = 0; i < arr.length; i++) {
1347
+ let item = arr[i];
1348
+ let value = "";
1349
+ let limit_date = "";
1350
+ let advanceOptionSetting = item?.advanceOptionSetting;
1351
+ // 单选
1352
+ let optionSetting0 =String(advanceOptionSetting) === '0';
1353
+ if (item.EQ || item.CL) {
1354
+ value = item.EQ || item.CL;
1355
+ if (item.settingObj?.attr === "PERCENTAGE") {
1356
+ value = Number(value) / 100;
1357
+ }
1358
+ if (item.EVALUATEAttr) {
1359
+ value = item.selecteds.join("|#|");
1360
+ }
1361
+ } else if((item.comType == 'SelectMui'&& optionSetting0)){
1362
+ // 单选模式
1363
+ let i = item.value;
1364
+ let c = item?.labelList[i];
1365
+ if (item.con == "CONVERT") {
1366
+ value = c?.filter ? [c?.filter] : undefined
1367
+ } else {
1368
+ value= c?.labelName ? [c?.labelName] : undefined;
1369
+ }
1370
+ } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1371
+ // value = item.QUOTE.join("|#|");
1372
+ if(item.comType == "treeSelect"){
1373
+ let cval = item.value;
1374
+ if(typeof cval === 'string'){
1375
+ [cval] = cval.split('<&=&>');
1376
+ value = cval;
1377
+ } else if(Array.isArray(cval)) {
1378
+ cval = cval.map((v)=>{
1379
+ let [k] = typeof v === 'string' ? v.split('<&=&>'): [];
1380
+ return k;
1381
+ })
1382
+ value = cval.join("|#|");
1383
+ }
1384
+ } else {
1385
+ value = optionSetting0? item.value : item.value.join("|#|");
1386
+ }
1387
+ } else if (!vexutils.isEmpty(item.CONVERT)) {
1388
+ value = item.CONVERT.map(item => {
1389
+ if (item && vexutils.isJSON(item)) {
1390
+ return JSON.parse(item);
1391
+ }
1392
+ return item;
1393
+ });
1394
+ } else if (item.DATE && !item.AGEAttr) {
1395
+ // 年龄组件的不按照 date 类型处理
1396
+ if (item.DATE.start_val || item.DATE.end_val) {
1397
+ item.DATE.con = "IN";
1398
+ }
1399
+ item.tempCon = item.DATE.con;
1400
+ item.start_val = item.DATE.start_val
1401
+ ? item.DATE.start_val.format("YYYY-MM-DD HH:mm:ss")
1402
+ : "";
1403
+ item.end_val = item.DATE.end_val ? item.DATE.end_val.format("YYYY-MM-DD HH:mm:ss") : "";
1404
+ } else if (item.BIRTHDAY) {
1405
+ // 生日
1406
+ let isChange = false;
1407
+ if (
1408
+ item.BIRTHDAY.limit_date.length > 0 ||
1409
+ item.BIRTHDAY.start_val ||
1410
+ item.BIRTHDAY.end_val
1411
+ ) {
1412
+ item.BIRTHDAY.con = "IN";
1413
+ }
1414
+ item.tempCon = item.BIRTHDAY.con;
1415
+ // 因为年龄下拉有个默认值, 当输入框中有值时才取下拉值
1416
+ if (item.BIRTHDAY.start_val || item.BIRTHDAY.end_val) {
1417
+ isChange = true;
1418
+ } else {
1419
+ isChange = false;
1420
+ }
1421
+
1422
+ // 校验
1423
+ if (item.BIRTHDAY.start_val) {
1424
+ let res = vexutils.validateBirthday(
1425
+ item.BIRTHDAY.start_val,
1426
+ item.title,
1427
+ item.BIRTHDAY.unit
1428
+ );
1429
+ if (!res) return;
1430
+ }
1431
+ if (item.BIRTHDAY.end_val) {
1432
+ let res = vexutils.validateBirthday(
1433
+ item.BIRTHDAY.end_val,
1434
+ item.title,
1435
+ item.BIRTHDAY.unit
1436
+ );
1437
+ if (!res) return;
1438
+ }
1439
+ if (+item.BIRTHDAY.start_val > +item.BIRTHDAY.end_val) {
1440
+ this.$message.warning(this.getI18nText(['1.9.47', { title: item.title }], `${item.title}请输入有效范围`), 2);
1441
+ return;
1442
+ }
1443
+
1444
+ limit_date = this.limit_date || "";
1445
+ item.unit = isChange ? item.BIRTHDAY.unit || "" : "";
1446
+ item.start_val = item.BIRTHDAY.start_val || "";
1447
+ item.end_val = item.BIRTHDAY.end_val || "";
1448
+ }
1449
+ // 根据属性判断取值
1450
+ if (item.LABELAttr) {
1451
+ if (Object.keys(item.labelObj || {}).length > 0) {
1452
+ let valList = [];
1453
+ item.labelSelectList.forEach(v => {
1454
+ valList.push(v.labelName);
1455
+ });
1456
+ value = valList.join("|#|");
1457
+ } else {
1458
+ value = item.inputVal;
1459
+ }
1460
+ } else if (item.EVALUATEAttr) {
1461
+ value = item.selecteds.join("|#|");
1462
+ } else if (item.AGEAttr) {
1463
+ value = "";
1464
+ } else if (item.NUMBERFiled && item.lessValue && item.bigValue) {
1465
+ if (item.setting?.attr === "PERCENTAGE") {
1466
+ value = Number(item.lessValue) / 100 + "~" + Number(item.bigValue) / 100;
1467
+ } else {
1468
+ value = item.lessValue + "~" + item.bigValue;
1469
+ }
1470
+ }
1471
+ // 删除字符串前后空格
1472
+ if (value && vexutils.isString(value)) {
1473
+ value = value.trim();
1474
+ }
1475
+ let temp = {
1476
+ field_key: item.columnName, // 一级value
1477
+ con: item.DATE || item.BIRTHDAY ? item.tempCon : item.con, // 二级选择项value
1478
+ value: value, // input输入值
1479
+ limit_date: limit_date || "", // 生日
1480
+ start_val: item.start_val || "", // 开始时间
1481
+ end_val: item.end_val || "", // 结束时间
1482
+ unit: item.unit || "", // 年龄
1483
+ id: item.id
1484
+ };
1485
+ conObj.push(temp);
1486
+ }
1487
+ let dateCons = this.dateTeam.map(item => item.con);
1488
+ let res = conObj.filter(
1489
+ item =>
1490
+ item.value ||
1491
+ item.limit_date ||
1492
+ item.start_val ||
1493
+ item.end_val ||
1494
+ dateCons.includes(item.con)
1495
+ );
1496
+ return res;
1497
+ },
1498
+ range(start, end) {
1499
+ const result = [];
1500
+ for (let i = start; i < end; i++) {
1501
+ result.push(i);
1502
+ }
1503
+ return result;
1504
+ },
1505
+ // 日期选择范围
1506
+ disabledDate(current) {
1507
+ return (
1508
+ (current && current < moment().startOf("year")) ||
1509
+ current > moment().endOf("year")
1510
+ );
1511
+ },
1512
+ changeRange(date, dateString) {
1513
+ // 这里没有使用item中的limit_date, 而是用全局的变量limit_date储存
1514
+ // 原因是因为range-picker 要求是个[] 并且v-model中的数据是个moment对象 即item.BIRRHDAY.limit_date = [moment, moment]
1515
+ if (dateString[0]) {
1516
+ this.limit_date = dateString.join("~");
1517
+ } else {
1518
+ this.limit_date = "";
1519
+ }
1520
+ },
1521
+ // 填写新增搜索分类名称后保存按钮
1522
+ saveToCalss() {
1523
+ this.formInner.validateFields((err, values) => {
1524
+ if (err) return;
1525
+ let conObj = this.getConObjParams();
1526
+ if (!conObj.length) {
1527
+ conObj = [];
1528
+ }
1529
+ let displayCategory = this.parentNames.filter(item => item.selected)[0]?.value;
1530
+ let params = {
1531
+ tableId: this.$attrs.tableId || "",
1532
+ setting: JSON.stringify({
1533
+ displayCategory,
1534
+ name: values.classname,
1535
+ conObj: conObj
1536
+ }),
1537
+ conditionList: JSON.stringify(this.originConditionList)
1538
+ };
1539
+ this.saveTableCondiTion(params);
1540
+
1541
+ });
1542
+ },
1543
+ handleParentNamesAdd(e) {
1544
+ const nextInput = e?.target?.nextElementSibling;
1545
+ setTimeout(() => {
1546
+ nextInput && nextInput.focus();
1547
+ });
1548
+ this.showAdd = true;
1549
+ },
1550
+ hanldeBlur() {
1551
+ this.showAdd = false;
1552
+ if (!this.addVal) return;
1553
+ this.parentNames.forEach(v => (v.selected = false));
1554
+ this.parentNames.push({
1555
+ disabled: true,
1556
+ value: this.addVal,
1557
+ selected: true,
1558
+ isAdd: true
1559
+ });
1560
+ this.addVal = "";
1561
+ },
1562
+ editParentName(e, item) {
1563
+ item.disabled = false;
1564
+ setTimeout(() => {
1565
+ e.target.focus();
1566
+ }, 0);
1567
+ },
1568
+ handleParentNameSelect(item, index) {
1569
+ if (!item.disabled) return;
1570
+ this.parentNames.forEach((pItem, pIndex) => {
1571
+ if (pIndex !== index) {
1572
+ pItem.selected = false;
1573
+ }
1574
+ });
1575
+ item.selected = !item.selected;
1576
+ },
1577
+ handleParentNamesRemove(index, item) {
1578
+ this.handleParent(index, item);
1579
+ },
1580
+ handleParent(index, item) {
1581
+ let { conditionList = [] } = this.quickSearchListObj;
1582
+ if (!conditionList || !conditionList.length) {
1583
+ this.parentNames.splice(index, 1);
1584
+ return;
1585
+ }
1586
+ let hasItem = conditionList.filter(v => v.displayCategory === item.value);
1587
+ if (!hasItem || !hasItem.length) {
1588
+ this.parentNames.splice(index, 1);
1589
+ return;
1590
+ }
1591
+ this.$message.error("该分类下有已有数据,请删除该分类下的筛选集后重试!");
1592
+ },
1593
+ // 7.12保存列表搜索分类
1594
+ async saveTableCondiTion(params) {
1595
+ // let url = `/tableList/saveTableCondiTion`;
1596
+ // this.axios.post(url, this.$qs.stringify(params)).then(({ data }) => {
1597
+ // if (data.result == "SUCCESS") {
1598
+ // this.showInner = false;
1599
+ // this.formInner.resetFields();
1600
+ // this.$emit("updateTableCondiTion");
1601
+ // this.clearData();
1602
+ // this.closeModal();
1603
+ // } else {
1604
+ // this.$message.error(data.resultMsg);
1605
+ // }
1606
+ // });
1607
+ try {
1608
+ let res = await this.handleGetConfigApi(params, 'requestSaveTableCondiTion');
1609
+ if (!res) return;
1610
+ this.showInner = false;
1611
+ this.formInner.resetFields();
1612
+ this.$emit("updateTableCondiTion");
1613
+ this.clearData();
1614
+ this.closeModal();
1615
+ } catch (error) {
1616
+ console.log(error)
1617
+ }
1618
+ },
1619
+ cancelSaveToCalss() {
1620
+ this.showInner = false;
1621
+ },
1622
+ // 清空快速搜索设置条件
1623
+ clearData() {
1624
+ this.handlerReset(this.quickSearch);
1625
+ this.relationQuickSearch.forEach(item => {
1626
+ this.handlerReset(item.fieldList);
1627
+ });
1628
+ if (this.source === "editTable") {
1629
+ this.$emit("clearQuickSearchConfig");
1630
+ return;
1631
+ }
1632
+ this.$listeners?.clearQuickSearchConfig();
1633
+ },
1634
+ handlerReset(arr) {
1635
+ if (!Array.isArray(arr)) {
1636
+ return;
1637
+ }
1638
+ arr.forEach(item => {
1639
+ let advanceOptionSetting = item?.advanceOptionSetting;
1640
+ // 单选
1641
+ let optionSetting0 =String(advanceOptionSetting) === '0';
1642
+ if (item.EQ || item.CL) {
1643
+ item.EQ = "";
1644
+ item.CL = "";
1645
+ } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1646
+ item.QUOTE = [];
1647
+ item.value = [];
1648
+ } else if(item.com == 'SelectMui' && item.con == 'CONVERT' && optionSetting0){
1649
+ item.CONVERT = [];
1650
+ item.value = undefined
1651
+ } else if (!vexutils.isEmpty(item.CONVERT)) {
1652
+ item.CONVERT = [];
1653
+ } else if (item.DATE) {
1654
+ item.showDate = String(advanceOptionSetting) == '1' ? true: false;
1655
+ item.marginx = "ml";
1656
+ item.DATE = {
1657
+ con: null,
1658
+ start_val: null,
1659
+ end_val: null
1660
+ };
1661
+ } else if (item.BIRTHDAY) {
1662
+ item.showDate = false;
1663
+ item.marginx = "ml";
1664
+ item.BIRTHDAY = this.initBirthdayParams();
1665
+ } else if (item.LABELAttr) {
1666
+ this.handleClearLabel(item);
1667
+ } else if (item.EVALUATEAttr) {
1668
+ item.selecteds = [];
1669
+ } else if (item.AGEAttr) {
1670
+ this.handleResetAge(item);
1671
+ } else if (item.NUMBERFiled) {
1672
+ this.clearFilterNumber(item);
1673
+ }
1674
+ });
1675
+ },
1676
+ initBirthdayParams() {
1677
+ this.limit_date = "";
1678
+ return {
1679
+ con: null,
1680
+ limit_date: [],
1681
+ start_val: null,
1682
+ end_val: null,
1683
+ unit: "YEAR",
1684
+ units: this.birthdayUnits.filter(i => i.units === 1)
1685
+ };
1686
+ },
1687
+ // 单选按钮组合点击取消选中状态
1688
+ clickRadioGroup(item, con) {
1689
+ if (item.con == con) {
1690
+ item.con = null;
1691
+ } else {
1692
+ if (item.con === "IN") {
1693
+ item.start_val = null;
1694
+ item.end_val = null;
1695
+ }
1696
+ item.con = con;
1697
+ }
1698
+ },
1699
+ clickBirthdayRadioGroup(item, con) {
1700
+ this.limit_date = "";
1701
+ Object.assign(item, this.initBirthdayParams());
1702
+ this.clickRadioGroup(item, con);
1703
+ },
1704
+ changeModalWindow() {
1705
+ this.isChangeWindow = !this.isChangeWindow;
1706
+ let docHeight = document.body.clientHeight;
1707
+ this.modalWidth = this.modalWidth === "700px" ? `100%` : "700px";
1708
+ this.modalHeight = this.modalHeight === "60vh" ? `${docHeight - 108}px` : "60vh";
1709
+
1710
+ if (this.modalWidth === "700px") {
1711
+ this.label_max_count = 8;
1712
+ } else {
1713
+ this.$nextTick(() => {
1714
+ let ele = document.querySelector(".quickSearch_label-container");
1715
+ ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
1716
+ });
1717
+ }
1718
+ },
1719
+
1720
+ /* 获取 label */
1721
+ handleRequestedLabel(v) {
1722
+ let params = { type: v, pageSize: 10000 };
1723
+ return this.axios.get("/label/list", { params: params });
1724
+ },
1725
+
1726
+ async handleSetLabelOptions(labelType, el) {
1727
+ let labelObj = {};
1728
+ let labelList = await this.handleGetConfigApi(labelType, 'requestedLabel');
1729
+ labelList.forEach(n => {
1730
+ this.$set(n, 'isSelect', false);
1731
+ if (labelObj[n.typeName]) {
1732
+ labelObj[n.typeName].itemList.push({ ...n });
1733
+ } else {
1734
+ labelObj[n.typeName] = {
1735
+ itemList: [{ ...n }],
1736
+ showAdd: false,
1737
+ addVal: '',
1738
+ typeName: n.typeName,
1739
+ typeId: n.typeId,
1740
+ isUnfold: false,
1741
+ isShowBtn: false
1742
+ };
1743
+ }
1744
+ });
1745
+ this.$set(el, 'labelObj', labelObj);
1746
+ this.$set(el, 'labelList', labelList);
1747
+ },
1748
+
1749
+ handleLabelColorClass(item) {
1750
+ return item?.color?.split("-")[1] || "yellow";
1751
+ },
1752
+
1753
+ handleLabelChange() {
1754
+ const args = arguments;
1755
+ if (args.length === 3) {
1756
+ let [flag, item, options] = [...arguments];
1757
+ let selectedList = options.labelSelectList || [];
1758
+ if (flag) {
1759
+ if (selectedList.some(n => n.labelId == item.labelId)) {
1760
+ return;
1761
+ }
1762
+ selectedList.push(item);
1763
+ } else {
1764
+ let fdIndex = selectedList.findIndex(n => n.labelId == item.labelId);
1765
+ if (fdIndex != -1) {
1766
+ selectedList.splice(fdIndex, 1);
1767
+ }
1768
+ }
1769
+ options.labelSelectList = selectedList;
1770
+ }
1771
+ },
1772
+
1773
+ handleClearLabel(v) {
1774
+ v.labelSelectList.length = 0;
1775
+ v.inputVal = "";
1776
+ Object.entries(v.labelObj || {}).forEach(h => {
1777
+ let [, item] = h;
1778
+ item.itemList.forEach(l => {
1779
+ l.isSelect = false;
1780
+ });
1781
+ });
1782
+ },
1783
+
1784
+ handleLabelUpfold(v) {
1785
+ console.log('触发---isUnfold');
1786
+ v.isUnfold = !v.isUnfold;
1787
+ },
1788
+
1789
+ handleEvaluateOnChange(tag, checked, item) {
1790
+ if (checked) {
1791
+ item.selecteds.push(tag.value);
1792
+ } else {
1793
+ let i = item.selecteds.findIndex(v => v === tag.value);
1794
+ item.selecteds.splice(i, 1);
1795
+ }
1796
+ },
1797
+
1798
+ // 年龄组件变化
1799
+ ageRangeOnChange(obj, item) {
1800
+ let s = obj.star_val;
1801
+ let e = obj.end_val;
1802
+ this.$set(item, "start_val", isNaN(s) ? undefined : s);
1803
+ this.$set(item, "end_val", isNaN(e) ? undefined : e);
1804
+ },
1805
+
1806
+ // 清空年龄组件
1807
+ handleResetAge(item) {
1808
+ this.$set(item, "start_val", "");
1809
+ this.$set(item, "end_val", "");
1810
+ let key = `${item.columnName}_AGEAttr`;
1811
+ let curRef = this.$refs[key];
1812
+ if (Array.isArray(curRef)) {
1813
+ curRef = curRef[0] || false;
1814
+ }
1815
+ curRef?.reset();
1816
+ },
1817
+
1818
+ onResize(el, v) {
1819
+ let height = el.offsetHeight || 0;
1820
+ // let ch = el?.firstElementChild?.offsetHeight || 0;
1821
+ if (!height) {
1822
+ return;
1823
+ }
1824
+ if (height > 80) {
1825
+ v.isShowBtn = true;
1826
+ } else {
1827
+ v.isShowBtn = false;
1828
+ v.isUnfold = false;
1829
+ }
1830
+ },
1831
+ changeFilterNumber(item) {
1832
+ if (item.lessValue && item.bigValue) {
1833
+ const lessValue = item.lessValue;
1834
+ const bigValue = item.bigValue;
1835
+ if (bigValue < lessValue) {
1836
+ this.$set(item, "lessValue", bigValue);
1837
+ this.$set(item, "bigValue", lessValue);
1838
+ }
1839
+ return;
1840
+ }
1841
+ },
1842
+ clearFilterNumber(item) {
1843
+ this.$set(item, "lessValue", "");
1844
+ this.$set(item, "bigValue", "");
1845
+ },
1846
+
1847
+ getI18nText(i, d) {
1848
+ if (Array.isArray(i)) {
1849
+ return this.$t ? this.$t.apply(this, i) : d;
1850
+ }
1851
+ return this.$t ? this.$t(i) : d;
1852
+ }
1853
+ },
1854
+ directives: { resize }
1855
+ });
1856
+ </script>
1857
+
1858
+ <style lang="less" scoped>
1859
+ .form-box {
1860
+ .quick-item {
1861
+ margin-bottom: 10px;
1862
+ min-width: 32px;
1863
+
1864
+ .quick-row {
1865
+ display: flex;
1866
+ > div {
1867
+ display: inline-block;
1868
+ box-sizing: border-box;
1869
+ }
1870
+ .quick-item-title {
1871
+ min-width: 80px;
1872
+ line-height: 32px;
1873
+ text-align: right;
1874
+ padding-left: 12px;
1875
+ color: #000;
1876
+ }
1877
+ .quick-item-col {
1878
+ padding: 0 12px;
1879
+ }
1880
+ .quick-item-title-default {
1881
+ width: 25%;
1882
+ }
1883
+ .quick-item-col-default {
1884
+ width: 75%;
1885
+ }
1886
+ }
1887
+ .check-box {
1888
+ line-height: 32px;
1889
+ }
1890
+ .check-date-btn {
1891
+ display: inline-block;
1892
+ line-height: 32px;
1893
+ height: 32px;
1894
+ padding: 0 10px;
1895
+ background-color: #ddd;
1896
+ cursor: pointer;
1897
+ &.ml {
1898
+ margin-left: 20px;
1899
+ }
1900
+ &.mr {
1901
+ margin-right: 20px;
1902
+ }
1903
+ }
1904
+ .check-date {
1905
+ display: inline-block;
1906
+ line-height: 33px;
1907
+ }
1908
+ .birthday-item {
1909
+ > div {
1910
+ margin-top: 5px;
1911
+ p {
1912
+ display: inline-block;
1913
+ margin: 0 20px;
1914
+ }
1915
+ > span {
1916
+ margin-top: 5px;
1917
+ }
1918
+ }
1919
+ .age-wrap {
1920
+ display: inline-block;
1921
+ }
1922
+ }
1923
+ /deep/ .ant-input-wrapper {
1924
+ .ant-input-group-addon {
1925
+ border: 1px solid #d9d9d9 !important;
1926
+ border-left: 0 !important;
1927
+ }
1928
+ }
1929
+
1930
+ /deep/ .num-picker {
1931
+ position: relative;
1932
+ display: flex;
1933
+ &.num-picker-unit {
1934
+ padding-right: 20px;
1935
+ }
1936
+ input {
1937
+ text-align: left !important;
1938
+ }
1939
+ &:hover {
1940
+ .clear-number-icon {
1941
+ display: block;
1942
+ }
1943
+ }
1944
+ /deep/ .ant-calendar-range-picker-input {
1945
+ text-align: left;
1946
+ }
1947
+ .clear-number-icon {
1948
+ position: absolute;
1949
+ right: 5px;
1950
+ top: 6px;
1951
+ display: none;
1952
+ cursor: pointer;
1953
+ z-index: 1000;
1954
+ }
1955
+ }
1956
+ }
1957
+ .ant-radio-button-wrapper {
1958
+ padding: 0 8px;
1959
+ height: 30px;
1960
+ line-height: 30px;
1961
+ margin-top: 5px;
1962
+ }
1963
+
1964
+ // 标签
1965
+ .label-attr-container {
1966
+ .edit-label {
1967
+ color: #000000;
1968
+ font-size: 14px;
1969
+ line-height: 32px;
1970
+ padding-left: 0;;
1971
+ }
1972
+ .label-container-height {
1973
+ overflow: hidden;
1974
+ // width: 380px;
1975
+ height: 74px;
1976
+ flex: none;
1977
+ }
1978
+ .edit-content {
1979
+ padding: 0;
1980
+ }
1981
+ .label-unfold-btn {
1982
+ margin: 8px 0;
1983
+ color: rgba(0, 0, 0, 0.6);
1984
+ cursor: pointer;
1985
+ >span {
1986
+ display: flex;
1987
+ align-items: center;
1988
+ line-height: 1;
1989
+ }
1990
+ .anticon {
1991
+ font-size: 16px;
1992
+ margin-left: 8px;
1993
+ }
1994
+ &:hover {
1995
+ color: #2d7aff;
1996
+ }
1997
+ &:active {
1998
+ color: #2d7aff;
1999
+ }
2000
+ }
2001
+ }
2002
+ &.quick-search-table {
2003
+ .module-title {
2004
+ color: #506493;
2005
+ line-height: 20px;
2006
+ padding-left: 12px;
2007
+ border-left: 4px solid #2d7aff;
2008
+ }
2009
+ .quick-item {
2010
+ display: inline-block;
2011
+ &.quick-block {
2012
+ display: block;
2013
+ }
2014
+ }
2015
+ }
2016
+
2017
+ .psw-icon {
2018
+ cursor: pointer;
2019
+ &:active {
2020
+ color: #5585f5;
2021
+ // #2474ff
2022
+ }
2023
+ color: #969696;
2024
+ }
2025
+
2026
+ ::-webkit-input-placeholder {
2027
+ /* WebKit browsers */
2028
+ font-family: "Avenir", Helvetica, Arial, sans-serif;
2029
+ }
2030
+
2031
+ ::-moz-placeholder {
2032
+ /* Mozilla Firefox 19+ */
2033
+ font-family: "Avenir", Helvetica, Arial, sans-serif;
2034
+ }
2035
+
2036
+ :-ms-input-placeholder {
2037
+ /* Internet Explorer 10+ */
2038
+ font-family: "Avenir", Helvetica, Arial, sans-serif;
2039
+ }
2040
+ }
2041
+ // .age-container {
2042
+ // }
2043
+ </style>
2044
+ <style lang="less">
2045
+ .quickSearch-saveToClass-modal {
2046
+ .edit-tag {
2047
+ position: relative;
2048
+ display: inline-block;
2049
+ margin-right: 10px;
2050
+ margin-bottom: 10px;
2051
+ .add-parent {
2052
+ border-color: #d9d9d9;
2053
+ }
2054
+ .anticon-close {
2055
+ position: absolute;
2056
+ right: 5px;
2057
+ line-height: 36px;
2058
+ color: #2d7aff;
2059
+ }
2060
+ .ant-input-disabled {
2061
+ color: #2d7aff;
2062
+ background-color: rgba(45, 122, 255, 0.1);
2063
+ opacity: 1;
2064
+ border-color: #2d7aff;
2065
+ cursor: pointer;
2066
+ }
2067
+ .ant-input-group-addon,
2068
+ .ant-input:not(:hover),
2069
+ .ant-input-number:not(:hover) {
2070
+ border-color: #2d7aff !important;
2071
+ }
2072
+ &.edit-tag-select {
2073
+ .ant-input-disabled {
2074
+ color: #fff;
2075
+ background-color: #2d7aff;
2076
+ }
2077
+ .anticon-close {
2078
+ color: #fff;
2079
+ }
2080
+ }
2081
+ }
2082
+ }
2083
+ </style>