cnhis-design-vue 2.1.24 → 2.1.25

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