cnhis-design-vue 2.1.12 → 2.1.15

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