cnhis-design-vue 2.1.16 → 2.1.19

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 (131) hide show
  1. package/CHANGELOG.md +2219 -2219
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +167 -153
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +60 -54
  15. package/es/button/style.css +1 -1
  16. package/es/calendar/index.js +8 -8
  17. package/es/captcha/index.js +3 -3
  18. package/es/card/index.js +8 -8
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/divider/index.js +8 -8
  30. package/es/drag-layout/index.js +3 -3
  31. package/es/drawer/index.js +8 -8
  32. package/es/dropdown/index.js +8 -8
  33. package/es/editor/index.js +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +480 -376
  36. package/es/fabric-chart/style.css +1 -1
  37. package/es/form/index.js +8 -8
  38. package/es/form-model/index.js +8 -8
  39. package/es/form-table/index.js +62 -62
  40. package/es/index/index.js +1181 -1041
  41. package/es/index/style.css +1 -1
  42. package/es/input/index.js +9 -9
  43. package/es/input-number/index.js +8 -8
  44. package/es/layout/index.js +8 -8
  45. package/es/list/index.js +8 -8
  46. package/es/locale-provider/index.js +8 -8
  47. package/es/map/index.js +9 -9
  48. package/es/mentions/index.js +8 -8
  49. package/es/menu/index.js +8 -8
  50. package/es/message/index.js +8 -8
  51. package/es/multi-chat/index.js +92 -92
  52. package/es/multi-chat-client/index.js +86 -86
  53. package/es/multi-chat-history/index.js +4 -4
  54. package/es/multi-chat-record/index.js +14 -14
  55. package/es/multi-chat-setting/index.js +81 -66
  56. package/es/multi-chat-setting/style.css +1 -1
  57. package/es/multi-chat-sip/index.js +1 -1
  58. package/es/notification/index.js +8 -8
  59. package/es/page-header/index.js +8 -8
  60. package/es/pagination/index.js +8 -8
  61. package/es/popconfirm/index.js +8 -8
  62. package/es/popover/index.js +8 -8
  63. package/es/progress/index.js +8 -8
  64. package/es/radio/index.js +9 -9
  65. package/es/rate/index.js +8 -8
  66. package/es/result/index.js +8 -8
  67. package/es/row/index.js +8 -8
  68. package/es/scale-view/index.js +33 -33
  69. package/es/select/index.js +11 -11
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +20 -20
  72. package/es/skeleton/index.js +8 -8
  73. package/es/slider/index.js +8 -8
  74. package/es/space/index.js +8 -8
  75. package/es/spin/index.js +8 -8
  76. package/es/statistic/index.js +8 -8
  77. package/es/steps/index.js +8 -8
  78. package/es/switch/index.js +8 -8
  79. package/es/table-filter/index.js +171 -164
  80. package/es/table-filter/style.css +1 -1
  81. package/es/tabs/index.js +8 -8
  82. package/es/tag/index.js +9 -9
  83. package/es/time-picker/index.js +8 -8
  84. package/es/timeline/index.js +8 -8
  85. package/es/tooltip/index.js +8 -8
  86. package/es/transfer/index.js +8 -8
  87. package/es/tree/index.js +8 -8
  88. package/es/tree-select/index.js +8 -8
  89. package/es/upload/index.js +8 -8
  90. package/es/verification-code/index.js +2 -2
  91. package/lib/cui.common.js +1253 -1113
  92. package/lib/cui.umd.js +1253 -1113
  93. package/lib/cui.umd.min.js +80 -80
  94. package/package.json +107 -107
  95. package/packages/big-table/src/BigTable.vue +3039 -3038
  96. package/packages/big-table/src/assets/style/table-base.less +370 -370
  97. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  98. package/packages/big-table/src/utils/batchEditing.js +34 -27
  99. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  100. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  101. package/packages/button/src/ButtonPrint/index.vue +728 -724
  102. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -1
  103. package/packages/fabric-chart/src/FabricChart.vue +15 -36
  104. package/packages/fabric-chart/src/components/TimeScaleValue.vue +113 -117
  105. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  106. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +4 -3
  107. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1035 -960
  108. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -133
  109. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  110. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  111. package/packages/fabric-chart/src/mixins/draw.js +70 -62
  112. package/packages/fabric-chart/src/mixins/eventCommon.js +9 -10
  113. package/packages/multi-chat/chat/chatFooter.vue +1598 -1598
  114. package/packages/multi-chat/chat/chatMain.vue +1442 -1442
  115. package/packages/multi-chat/chat/quickReply.vue +439 -439
  116. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  117. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1302
  118. package/packages/multi-chat/store/actions.js +448 -448
  119. package/packages/multi-chat/store/state.js +112 -112
  120. package/packages/scale-view/formitem/r-choice.vue +714 -714
  121. package/packages/scale-view/scaleView.vue +2010 -2010
  122. package/packages/select-person/select-person.vue +1658 -1658
  123. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  124. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  125. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  126. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  127. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +3 -2
  128. package/packages/table-filter/src/const/dataOptions.js +43 -43
  129. package/packages/table-filter/src/mixins/mixins.js +695 -695
  130. package/packages/table-filter/src/quick-search/QuickSearch.vue +2083 -2083
  131. package/src/directive/preventReClick.js +12 -12
@@ -1,695 +1,695 @@
1
- const DURATIONS = {
2
- minute: '分钟',
3
- hour: '小时',
4
- second: '秒',
5
- day: '天'
6
- };
7
- const EVALUATEList = [
8
- {
9
- label: "一星",
10
- value: "1",
11
- isSelect: false
12
- },
13
- {
14
- label: "二星",
15
- value: "2",
16
- isSelect: false
17
- },
18
- {
19
- label: "三星",
20
- value: "3",
21
- isSelect: false
22
- },
23
- {
24
- label: "四星",
25
- value: "4",
26
- isSelect: false
27
- },
28
- {
29
- label: "五星",
30
- value: "5",
31
- isSelect: false
32
- }
33
- ];
34
-
35
- import moment from 'moment';
36
- import timeDomain from '@/utils/time-domain';
37
- export const durationMixin = {
38
- filters: {
39
- // 格式化时长单位
40
- fmtDurationUnit(unit) {
41
- return (unit && DURATIONS[unit]) || '';
42
- }
43
- }
44
- };
45
-
46
- export const filterApiFn = {
47
- props: {
48
- filterApiConfig: {
49
- type: Object,
50
- default: () => ({})
51
- }
52
- },
53
- methods: {
54
- /**
55
- * 获取配置的 api 方法
56
- * @param {*} params 调用参数
57
- * @param {String} key 方法名
58
- * @param {Object} config 其他配置
59
- */
60
- async handleGetConfigApi(params, key, config = {}) {
61
- try {
62
- // TODO: 判断 fn 是异步函数还是同步
63
- const filterApiConfig = this?.filterApiConfig || {};
64
- const fn = filterApiConfig[key] || null;
65
- if (typeof fn === 'function') {
66
- let res = await fn(params, config);
67
- return Promise.resolve(res);
68
- } else {
69
- return Promise.reject(new Error(`${key} Is not a function`));
70
- }
71
- } catch (error) {
72
- return Promise.reject(error);
73
- }
74
- }
75
- }
76
- };
77
-
78
- export const $utils = {
79
- computed: {
80
- $utils() {
81
- return {
82
- filterOption(input, option) {
83
- try {
84
- let text = option.componentOptions.children[0].text;
85
- let lowText = text.toLowerCase();
86
- let lowInput = input.toLowerCase();
87
- let flag = false;
88
- var reg = /^[a-zA-Z]+$/;
89
- if (typeof text === 'string' && reg.test(input) && ''._toPinYin) {
90
- flag = lowText._toPinYin().indexOf(lowInput) >= 0;
91
- }
92
- return flag || lowText.indexOf(lowInput) >= 0;
93
- } catch (error) {
94
- return false;
95
- }
96
- },
97
- /**
98
- * 获取按钮自定义颜色
99
- * @param {string} v
100
- */
101
- getBtnStyle(v) {
102
- // custom_bg, white_bg, none_bg
103
- if (v.showStyle == 'white_bg') {
104
- return {
105
- 'border-color': v.color,
106
- color: v.color
107
- };
108
- } else if (v.showStyle == 'none_bg') {
109
- return {
110
- color: v.color
111
- };
112
- } else if (v.showStyle == 'only_icon') {
113
- return {
114
- 'background-color': v.color,
115
- 'border-color': v.color
116
- // color: v.color
117
- };
118
- }
119
- return {
120
- 'background-color': v.color,
121
- 'border-color': v.color
122
- };
123
- },
124
- /**
125
- * 防抖
126
- * @param {func} func 回调函数
127
- * @param {wait} number 时间间隔
128
- * @param {immediate} boolean 第一是否执行
129
- */
130
- debounce(func, wait, immediate) {
131
- let timeout, args, context, timestamp, result;
132
-
133
- const later = function () {
134
- // 据上一次触发时间间隔
135
- const last = +new Date() - timestamp;
136
-
137
- // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
138
- if (last < wait && last > 0) {
139
- timeout = setTimeout(later, wait - last);
140
- } else {
141
- timeout = null;
142
- // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
143
- if (!immediate) {
144
- result = func.apply(context, args);
145
- if (!timeout) context = args = null;
146
- }
147
- }
148
- };
149
-
150
- return function (...args) {
151
- context = this;
152
- timestamp = +new Date();
153
- const callNow = immediate && !timeout;
154
- // 如果延时不存在,重新设定延时
155
- if (!timeout) timeout = setTimeout(later, wait);
156
- if (callNow) {
157
- result = func.apply(context, args);
158
- context = args = null;
159
- }
160
-
161
- return result;
162
- };
163
- },
164
- /**
165
- * @deprecated: 获取按钮的操作对象
166
- * @param {Object} row 行对象
167
- * @param {Object} btn 按钮
168
- */
169
- getRowOperatorIdSetting(row = {}, btn) {
170
- /** 行操作id */
171
- /**
172
- * 行按钮对象
173
- * operatorColumn 数据为:1290160860597063680###987654321
174
- * btnId(按钮id)###objid(触发对象的id)
175
- * */
176
- if (row.operatorColumn) {
177
- let rowOperatorId = row.operatorColumn.find(v => v.includes(btn.sid));
178
- if (btn.setting && typeof rowOperatorId === 'string' && rowOperatorId.includes('###')) {
179
- let [btnId, objId] = rowOperatorId.split('###');
180
- if (btnId && objId) {
181
- let settingObj = JSON.parse(btn.setting);
182
- if (Array.isArray(settingObj)) {
183
- let f = settingObj.find(s => s.obj_id == objId);
184
- if (f) {
185
- let copyBtn = JSON.parse(JSON.stringify(btn));
186
- copyBtn.settingObj = {
187
- ...f
188
- };
189
- copyBtn.setting = JSON.stringify(f);
190
- return copyBtn;
191
- }
192
- }
193
- }
194
- }
195
- }
196
-
197
- let copyBtn = JSON.parse(JSON.stringify(btn));
198
- if (this.isJSON(copyBtn.setting)) {
199
- let btnSetting = JSON.parse(copyBtn.setting);
200
- if (Array.isArray(btnSetting)) {
201
- let settingObj = btnSetting[0] || {};
202
- copyBtn.settingObj = {
203
- ...settingObj
204
- };
205
- copyBtn.setting = JSON.stringify(settingObj);
206
- return copyBtn;
207
- } else {
208
- return copyBtn;
209
- }
210
- }
211
- return btn;
212
- },
213
- // color 获取 alpha
214
- getAlphafloat(a, alpha) {
215
- if (typeof a !== 'undefined') {
216
- return parseFloat((a / 256).toFixed(2));
217
- }
218
- if (typeof alpha !== 'undefined') {
219
- if (1 < alpha && alpha <= 100) {
220
- return parseFloat((alpha / 100).toFixed(2));
221
- }
222
- if (0 <= alpha && alpha <= 1) {
223
- return parseFloat(alpha.toFixed(2));
224
- }
225
- }
226
- return 1;
227
- },
228
- // hex 转 rgba
229
- hexToRGBA(hex, alpha) {
230
- const isValidHex = hex => /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
231
- const getChunksFromString = (st, chunkSize) => st.match(new RegExp(`.{${chunkSize}}`, 'g'));
232
-
233
- const convertHexUnitTo256 = hexStr => parseInt(hexStr.repeat(2 / hexStr.length), 16);
234
-
235
- if (!isValidHex(hex)) {
236
- console.log('Invalid HEX');
237
- return '';
238
- }
239
- const chunkSize = Math.floor((hex.length - 1) / 3);
240
- const hexArr = getChunksFromString(hex.slice(1), chunkSize);
241
- const [r, g, b, a] = hexArr.map(convertHexUnitTo256);
242
- return {
243
- r: r,
244
- g: g,
245
- b: b,
246
- a: this.getAlphafloat(a, alpha)
247
- };
248
- },
249
- // 标签样式解析
250
- handleLabelColor(item, isSelect) {
251
- let tempColor = '#5585f5';
252
- let oldColorMap = {
253
- blue: '#0000ff',
254
- sky: '#87ceeb',
255
- azure: '#f0ffff',
256
- palegreen: '#98fb98',
257
- yellow: '#ffff00',
258
- darkorange: '#ff8c00',
259
- magenta: '#ff00ff',
260
- purple: '#800080',
261
- maroon: '#800000',
262
- orange: '#ffa500',
263
- green: '#008000',
264
- red: '#ff0000',
265
- grey: '#808080'
266
- };
267
- if (item?.color?.includes('-')) {
268
- let str = item.color.split('-')[1];
269
- tempColor = oldColorMap[str] || '#5585f5';
270
- } else {
271
- tempColor = item.color || '#5585f5';
272
- }
273
- const tempRgba = this.hexToRGBA(tempColor) || {
274
- r: 85,
275
- g: 133,
276
- b: 245,
277
- a: 1
278
- };
279
- if (isSelect) {
280
- return {
281
- color: '#fff',
282
- background: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`,
283
- borderColor: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`
284
- };
285
- }
286
- if (item.isSelect) {
287
- return {
288
- color: '#fff',
289
- background: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`,
290
- borderColor: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`
291
- };
292
- } else {
293
- let isSys = !(item.isPublic && item.isPublic == 1);
294
- let color = isSys ? 'rgba(28, 28, 28, 1)' : 'rgba(33, 33, 33, 0.6)';
295
- return {
296
- color: color,
297
- background: 'rgba(250, 250, 250, 1)',
298
- borderColor: 'rgba(213, 213, 213, 0.8)'
299
- };
300
- }
301
- },
302
- // 生日范围校验
303
- validateBirthday(val, title, type) {
304
- let res = true;
305
- if (!type) return false;
306
- let regObj = {
307
- DAYReg: /^([0-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|(360|361|363|362|364|365))$/,
308
- MONTHReg: /^(?:[0-9]|1[0-2])$/,
309
- YEARReg: /^(?:[1-9]?\d|100)$/
310
- };
311
- let testReg = `${type}Reg`;
312
- if (!regObj[testReg].test(+val)) {
313
- this.$message.warning(`${title}${this.$t('1.9.40')}`, 2);
314
- res = false;
315
- }
316
- return res;
317
- },
318
- /**
319
- *
320
- * 时间转换
321
- * @param {type} type 时间戳类型
322
- * @param {time} time 时间戳
323
- */
324
- formatTime(type, time) {
325
- let format = '';
326
- if (!time) return '';
327
- switch (type) {
328
- case 'DATE':
329
- format = 'yyyy-MM-dd';
330
- break;
331
- case 'DATETIME':
332
- format = 'yyyy-MM-dd HH:mm:ss';
333
- break;
334
- case 'TIME':
335
- format = 'HH:mm:ss';
336
- break;
337
- case 'MOUTH':
338
- format = 'MM-dd';
339
- break;
340
- case 'DATETIMESTR':
341
- format = 'yyyy年M月dd日 HH:mm';
342
- break;
343
- case 'MOUTHTIME':
344
- format = 'M月d日 HH:mm';
345
- break;
346
- case 'HM':
347
- format = ' HH:mm';
348
- break;
349
- default:
350
- break;
351
- }
352
- return moment(time).format(format);
353
- },
354
- isJSON(str) {
355
- if (typeof str == 'string') {
356
- try {
357
- let obj = JSON.parse(str);
358
- if (typeof obj == 'object' && obj) {
359
- return true;
360
- } else {
361
- return false;
362
- }
363
- } catch (e) {
364
- return false;
365
- }
366
- }
367
- return false;
368
- },
369
- isArray(val) {
370
- return Array.isArray(val);
371
- },
372
- isEmpty(val) {
373
- for (var key in val) {
374
- return false;
375
- }
376
- return true;
377
- },
378
- isString(val) {
379
- return typeof val === 'string';
380
- },
381
- isPlainObject(val) {
382
- return typeof val === 'object';
383
- }
384
- };
385
- }
386
- },
387
- components: {}
388
- };
389
-
390
- // start--- 筛选外显 ---start
391
- export const outQuickSearchFn = {
392
- methods: {
393
- handlerInitSearchItem(arr) {
394
- if (!Array.isArray(arr)) return;
395
- arr.forEach(el => {
396
- el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
397
- const attr = el?.settingObj?.attr || "";
398
- const isPreciseSearch = el?.settingObj?.isPreciseSearch || "";
399
- const showSetting = el?.setting?.showSetting || []
400
- /**
401
- * NUMBER和TEXT属性字段
402
- * 如果 开启了精准搜索,则传条件的时候 要传 EQ
403
- * isPreciseSearch: 0/1
404
- */
405
- let textCon = el.fieldType == "TEXT" && isPreciseSearch == 1 ? 'EQ' : 'CL';
406
- let advanceOptionSetting = el.advanceOptionSetting;
407
- // let advanceColWidth = el.advanceColWidth;
408
- // 映射优先级最高
409
- if (showSetting?.length) {
410
- let tvalue = []
411
- // 设置了默认值
412
- let df = el.explicitDefaultVal;
413
- if(df){
414
- let i = df == 'firstOption' ? 0 : showSetting.findIndex(v => v.change_text == df);
415
- if(i > -1){
416
- if(String(advanceOptionSetting) === '0'){
417
- tvalue = i
418
- } else {
419
- tvalue.push(i)
420
- }
421
- }
422
- }
423
- // 存在映射 使用下拉多选框
424
- this.$set(el, "con", "CONVERT");
425
- this.$set(el, "com", "SelectMui");
426
- this.$set(el, "comType", "SelectMui");
427
- this.$set(el, "value", tvalue);
428
- const labelList = el.setting.showSetting.map(i => {
429
- i.labelName = i.change_text;
430
- return i;
431
- });
432
- this.$set(el, "labelList", labelList);
433
- } else if (!this.$utils.isEmpty(el.setting.wordbook)) {
434
- // TODO:
435
- // 存在映射 wordbook
436
- let isTree = "tree" === el?.setting?.wordbook?.showType;
437
- let comType = isTree ? 'treeSelect' : 'SelectMuiWordBook';
438
- let defVal = isTree ? [] : [];
439
- this.$set(el, "con", "QUOTE");
440
- this.$set(el, "com", "SelectMui");
441
- this.$set(el, "comType", comType);
442
- this.$set(el, "value", defVal);
443
- this.$set(el, "dataSource", []);
444
- this.$set(el, "searchPageConfig", {
445
- keyword: undefined,
446
- isRequest: false, // 是否已请求
447
- page: 1, // 当前页
448
- total: 1, // 总页数
449
- hasNextPage: false
450
- });
451
- } else {
452
- if (["MONEY", "PERCENTAGE", "AGE", "NUMBER"].includes(attr) || el.fieldType == "NUMBER") {
453
- this.$set(el, "con", "BIGANDLESS");
454
- this.$set(el, "com", "Number");
455
- this.$set(el, "lessValue", "");
456
- this.$set(el, "bigValue", "");
457
- if (attr == "AGE" && el.fieldType != "NUMBER") {
458
- this.$set(el, "AGEAttr", true);
459
- this.$set(el, "inputUnit", "岁");
460
- }
461
- if (el.fieldType == "NUMBER" && attr == "PERCENTAGE") {
462
- this.$set(el, "inputUnit", "%");
463
- }
464
- } else if (
465
- ["BIRTHDAY", "DATE", "TASKDATE"].includes(attr) ||
466
- ["DATETIME", "DATE"].includes(el.fieldType)
467
- ) {
468
- // 查找默认值
469
- let value = this.getSearchDefValueByLimit(el, this.searchFieldLimit) || [];
470
- // explicitDefaultVal: "YESTERDAY"
471
- // explicitRequired: 1
472
-
473
- // 配置了默认值
474
- if(el.explicitDefaultVal){
475
- // let showFormat = attr === "BIRTHDAY" ? 'MM-DD':'YYYY-MM-DD HH:mm:ss';
476
- let t = timeDomain.getTimeDomain(el.explicitDefaultVal)
477
- if(t.length > 0){
478
- value = t;
479
- }
480
- }
481
- this.$set(el, "con", "IN");
482
- this.$set(el, "com", "DatePicker");
483
- this.$set(el, "value", value);
484
- if (attr === "BIRTHDAY") {
485
- this.$set(el, "showFormat", "MM-DD");
486
- this.$set(el, "showTime", false);
487
- } else if(["TODAY","TOMORROW","YESTERDAY"].includes(el.explicitDefaultVal)){
488
- // 如果外显默认是 以上三个,展示一个框,时间不可选
489
- let [v] = value;
490
- this.$set(el, "showFormat", "YYYY-MM-DD");
491
- this.$set(el, "showTime", false);
492
- this.$set(el, "com", "DayPicker");
493
- this.$set(el, "value",v || moment());
494
- } else {
495
- this.$set(el, "showFormat", "YYYY-MM-DD HH:mm:ss");
496
- this.$set(el, "showTime", true);
497
- }
498
- } else if (["LABEL", "EVALUATE"].includes(attr)) {
499
- this.$set(el, "con", "CL");
500
- this.$set(el, "com", "SelectMui");
501
- this.$set(el, "value", []);
502
- if (attr == "EVALUATE") {
503
- let list = EVALUATEList.map(i => {
504
- i.labelName = i.label;
505
- return i;
506
- });
507
- this.$set(el, "labelList", list);
508
- } else {
509
- this.handleSetLabelOptions(el.setting.labelType, el);
510
- }
511
- } else if ("PASSWORD" === attr) {
512
- this.$set(el, "con", el.fieldType === "NUMBER" ? "EQ" : textCon);
513
- this.$set(el, "comAttr", "PASSWORD");
514
- this.$set(el, "PASSWORDTYPE", true);
515
- this.$set(el, "value", "");
516
- this.$set(el, "com", "Text");
517
- } else if (["DURATION"].includes(attr)) {
518
- this.$set(el, "con", "EQ");
519
- this.$set(el, "value", "");
520
- this.$set(el, "com", "Text");
521
- this.$set(el, "attr", "DURATION");
522
- } else {
523
- this.$set(el, "con", textCon);
524
- this.$set(el, "isPreciseSearch", isPreciseSearch == 1);
525
- this.$set(el, "value", "");
526
- this.$set(el, "com", "Text");
527
- }
528
- }
529
- });
530
- },
531
- handleSetLabelOptions(labelType, el) {
532
- this.handleRequestedLabel(labelType || "")
533
- .then(({ data }) => {
534
- if (data.result === "SUCCESS") {
535
- let labelList = data.map.rows || [];
536
- this.$set(el, "labelList", labelList);
537
- }
538
- })
539
- .catch(err => console.log(err));
540
- },
541
- getConObj(arr) {
542
- if (!Array.isArray(arr)) {
543
- return [];
544
- }
545
- let conObj = [];
546
- arr.forEach(item => {
547
- let temp = {
548
- field_key: item.columnName,
549
- con: item.con,
550
- value: "",
551
- limit_date: "",
552
- start_val: item.start_val || "",
553
- end_val: item.end_val || "",
554
- unit: item.unit || "",
555
- id: item.id
556
- };
557
- if (item.com === "Text" && item.value) {
558
- temp.value = item.value;
559
- conObj.push(temp);
560
- }
561
- let advanceOptionSetting = item.advanceOptionSetting;
562
- if (item.com === "SelectMui" && item.value) {
563
- // 单选模式
564
- let single = String(advanceOptionSetting) === '0';
565
- if(single){
566
- if(!Array.isArray(item.value)) {
567
- item.value = [item.value]
568
- }
569
- }
570
- let hasArr = Array.isArray(item.value) && item.value.length > 0
571
- if (item.comType == "SelectMuiWordBook" && hasArr) {
572
- temp.value = item.value.join("|#|");
573
- } else if(item.comType == "treeSelect"){
574
- // 樹狀
575
- let value = item.value;
576
- if(typeof value === 'string'){
577
- [value] = value.split('<&=&>')
578
- } else if(Array.isArray(value)){
579
- value = value.map((v)=>{
580
- let [k] = typeof v === 'string' ? v.split('<&=&>'): [];
581
- return k;
582
- })
583
- value = value.join("|#|");
584
- }
585
- temp.value = value;
586
- } else {
587
- if(hasArr){
588
- if (item.con == "CONVERT") {
589
- // 存在映射
590
- let value = [];
591
- value = item.value.map(i => {
592
- return item.labelList[i].filter;
593
- });
594
- temp.value = value;
595
- } else {
596
- let value = [];
597
- value = item.value.map(i => {
598
- return item.labelList[i].labelName;
599
- });
600
- temp.value = value.join("|#|");
601
- }
602
- }
603
-
604
- }
605
- conObj.push(temp);
606
- }
607
- if (item.com === "DatePicker" && item.value.length) {
608
- const start_val = item.value[0].format(item.showFormat);
609
- const end_val = item.value[1].format(item.showFormat);
610
- if (item.settingObj.attr === "BIRTHDAY") {
611
- temp.limit_date = `${start_val}~${end_val}`;
612
- } else {
613
- temp.start_val = start_val;
614
- temp.end_val = end_val;
615
- }
616
- conObj.push(temp);
617
- }
618
- if (item.com === "DayPicker" && item.value) {
619
- const start_val = item.value.startOf('day').format('YYYY-MM-DD HH:mm:ss');
620
- const end_val = item.value.endOf('day').format('YYYY-MM-DD HH:mm:ss');
621
- if (item.settingObj.attr === "BIRTHDAY") {
622
- temp.limit_date = `${start_val}~${end_val}`;
623
- } else {
624
- temp.start_val = start_val;
625
- temp.end_val = end_val;
626
- }
627
- conObj.push(temp);
628
- }
629
- if (item.AGEAttr) {
630
- temp.value = "";
631
- temp.con = "IN";
632
- let start_val = Number(item.lessValue) * 365;
633
- let end_val = Number(item.bigValue) * 365;
634
- if ((start_val || start_val === 0) && end_val) {
635
- temp.start_val = start_val;
636
- temp.end_val = end_val;
637
- conObj.push(JSON.parse(JSON.stringify(temp)));
638
- }
639
- } else if (item.com === "Number") {
640
- // 同时有lessValue bigValue 才是一个范围
641
- if (item.lessValue && item.bigValue) {
642
- if (item.settingObj?.attr === "PERCENTAGE") {
643
- temp.value = Number(item.lessValue) / 100 + "~" + Number(item.bigValue) / 100;
644
- } else {
645
- temp.value = item.lessValue + "~" + item.bigValue;
646
- }
647
- } else {
648
- if (item.settingObj?.attr === "PERCENTAGE") {
649
- temp.value = Number(item.lessValue) / 100 || Number(item.bigValue) / 100;
650
- } else {
651
- temp.value = item.lessValue || item.bigValue;
652
- }
653
- }
654
- temp.con = "EQ";
655
- conObj.push(JSON.parse(JSON.stringify(temp)));
656
- }
657
- if (item.com === "SelectQuote" && item.value.length) {
658
- temp.value = item.value.join("|#|");
659
- conObj.push(temp);
660
- }
661
- });
662
- let res = conObj.filter(
663
- item => item.value || item.limit_date || item.start_val || item.end_val
664
- );
665
- return res;
666
- },
667
- getConObjParams() {
668
- let conObj = this.getConObj(this.outSearchFieldList);
669
- let realation = [];
670
- this.outRelationQuickSearch.forEach(item => {
671
- let curQuote = this.getConObj(item.fieldList);
672
- if (curQuote && curQuote.length) {
673
- realation.push({
674
- field_key: item.primaryField,
675
- valueField: item.relationField,
676
- con: "QUOTE_IN",
677
- tableId: item.tableId,
678
- parameterConversionId: item.parameterConversionId,
679
- converFun: item.converFun,
680
- preConObj: item.preConObj,
681
- relationOrgId: item.relationOrgId,
682
- preSqlExpression: item.preSqlExpression,
683
- quote_con: {
684
- conObj: this.getConObj(item.fieldList),
685
- sqlExpression: ""
686
- }
687
- });
688
- }
689
- });
690
- conObj.push(...realation);
691
- return conObj || [];
692
- }
693
- }
694
- }
695
- // end--- 筛选外显 ---end
1
+ const DURATIONS = {
2
+ minute: '分钟',
3
+ hour: '小时',
4
+ second: '秒',
5
+ day: '天'
6
+ };
7
+ const EVALUATEList = [
8
+ {
9
+ label: "一星",
10
+ value: "1",
11
+ isSelect: false
12
+ },
13
+ {
14
+ label: "二星",
15
+ value: "2",
16
+ isSelect: false
17
+ },
18
+ {
19
+ label: "三星",
20
+ value: "3",
21
+ isSelect: false
22
+ },
23
+ {
24
+ label: "四星",
25
+ value: "4",
26
+ isSelect: false
27
+ },
28
+ {
29
+ label: "五星",
30
+ value: "5",
31
+ isSelect: false
32
+ }
33
+ ];
34
+
35
+ import moment from 'moment';
36
+ import timeDomain from '@/utils/time-domain';
37
+ export const durationMixin = {
38
+ filters: {
39
+ // 格式化时长单位
40
+ fmtDurationUnit(unit) {
41
+ return (unit && DURATIONS[unit]) || '';
42
+ }
43
+ }
44
+ };
45
+
46
+ export const filterApiFn = {
47
+ props: {
48
+ filterApiConfig: {
49
+ type: Object,
50
+ default: () => ({})
51
+ }
52
+ },
53
+ methods: {
54
+ /**
55
+ * 获取配置的 api 方法
56
+ * @param {*} params 调用参数
57
+ * @param {String} key 方法名
58
+ * @param {Object} config 其他配置
59
+ */
60
+ async handleGetConfigApi(params, key, config = {}) {
61
+ try {
62
+ // TODO: 判断 fn 是异步函数还是同步
63
+ const filterApiConfig = this?.filterApiConfig || {};
64
+ const fn = filterApiConfig[key] || null;
65
+ if (typeof fn === 'function') {
66
+ let res = await fn(params, config);
67
+ return Promise.resolve(res);
68
+ } else {
69
+ return Promise.reject(new Error(`${key} Is not a function`));
70
+ }
71
+ } catch (error) {
72
+ return Promise.reject(error);
73
+ }
74
+ }
75
+ }
76
+ };
77
+
78
+ export const $utils = {
79
+ computed: {
80
+ $utils() {
81
+ return {
82
+ filterOption(input, option) {
83
+ try {
84
+ let text = option.componentOptions.children[0].text;
85
+ let lowText = text.toLowerCase();
86
+ let lowInput = input.toLowerCase();
87
+ let flag = false;
88
+ var reg = /^[a-zA-Z]+$/;
89
+ if (typeof text === 'string' && reg.test(input) && ''._toPinYin) {
90
+ flag = lowText._toPinYin().indexOf(lowInput) >= 0;
91
+ }
92
+ return flag || lowText.indexOf(lowInput) >= 0;
93
+ } catch (error) {
94
+ return false;
95
+ }
96
+ },
97
+ /**
98
+ * 获取按钮自定义颜色
99
+ * @param {string} v
100
+ */
101
+ getBtnStyle(v) {
102
+ // custom_bg, white_bg, none_bg
103
+ if (v.showStyle == 'white_bg') {
104
+ return {
105
+ 'border-color': v.color,
106
+ color: v.color
107
+ };
108
+ } else if (v.showStyle == 'none_bg') {
109
+ return {
110
+ color: v.color
111
+ };
112
+ } else if (v.showStyle == 'only_icon') {
113
+ return {
114
+ 'background-color': v.color,
115
+ 'border-color': v.color
116
+ // color: v.color
117
+ };
118
+ }
119
+ return {
120
+ 'background-color': v.color,
121
+ 'border-color': v.color
122
+ };
123
+ },
124
+ /**
125
+ * 防抖
126
+ * @param {func} func 回调函数
127
+ * @param {wait} number 时间间隔
128
+ * @param {immediate} boolean 第一是否执行
129
+ */
130
+ debounce(func, wait, immediate) {
131
+ let timeout, args, context, timestamp, result;
132
+
133
+ const later = function () {
134
+ // 据上一次触发时间间隔
135
+ const last = +new Date() - timestamp;
136
+
137
+ // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
138
+ if (last < wait && last > 0) {
139
+ timeout = setTimeout(later, wait - last);
140
+ } else {
141
+ timeout = null;
142
+ // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
143
+ if (!immediate) {
144
+ result = func.apply(context, args);
145
+ if (!timeout) context = args = null;
146
+ }
147
+ }
148
+ };
149
+
150
+ return function (...args) {
151
+ context = this;
152
+ timestamp = +new Date();
153
+ const callNow = immediate && !timeout;
154
+ // 如果延时不存在,重新设定延时
155
+ if (!timeout) timeout = setTimeout(later, wait);
156
+ if (callNow) {
157
+ result = func.apply(context, args);
158
+ context = args = null;
159
+ }
160
+
161
+ return result;
162
+ };
163
+ },
164
+ /**
165
+ * @deprecated: 获取按钮的操作对象
166
+ * @param {Object} row 行对象
167
+ * @param {Object} btn 按钮
168
+ */
169
+ getRowOperatorIdSetting(row = {}, btn) {
170
+ /** 行操作id */
171
+ /**
172
+ * 行按钮对象
173
+ * operatorColumn 数据为:1290160860597063680###987654321
174
+ * btnId(按钮id)###objid(触发对象的id)
175
+ * */
176
+ if (row.operatorColumn) {
177
+ let rowOperatorId = row.operatorColumn.find(v => v.includes(btn.sid));
178
+ if (btn.setting && typeof rowOperatorId === 'string' && rowOperatorId.includes('###')) {
179
+ let [btnId, objId] = rowOperatorId.split('###');
180
+ if (btnId && objId) {
181
+ let settingObj = JSON.parse(btn.setting);
182
+ if (Array.isArray(settingObj)) {
183
+ let f = settingObj.find(s => s.obj_id == objId);
184
+ if (f) {
185
+ let copyBtn = JSON.parse(JSON.stringify(btn));
186
+ copyBtn.settingObj = {
187
+ ...f
188
+ };
189
+ copyBtn.setting = JSON.stringify(f);
190
+ return copyBtn;
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ let copyBtn = JSON.parse(JSON.stringify(btn));
198
+ if (this.isJSON(copyBtn.setting)) {
199
+ let btnSetting = JSON.parse(copyBtn.setting);
200
+ if (Array.isArray(btnSetting)) {
201
+ let settingObj = btnSetting[0] || {};
202
+ copyBtn.settingObj = {
203
+ ...settingObj
204
+ };
205
+ copyBtn.setting = JSON.stringify(settingObj);
206
+ return copyBtn;
207
+ } else {
208
+ return copyBtn;
209
+ }
210
+ }
211
+ return btn;
212
+ },
213
+ // color 获取 alpha
214
+ getAlphafloat(a, alpha) {
215
+ if (typeof a !== 'undefined') {
216
+ return parseFloat((a / 256).toFixed(2));
217
+ }
218
+ if (typeof alpha !== 'undefined') {
219
+ if (1 < alpha && alpha <= 100) {
220
+ return parseFloat((alpha / 100).toFixed(2));
221
+ }
222
+ if (0 <= alpha && alpha <= 1) {
223
+ return parseFloat(alpha.toFixed(2));
224
+ }
225
+ }
226
+ return 1;
227
+ },
228
+ // hex 转 rgba
229
+ hexToRGBA(hex, alpha) {
230
+ const isValidHex = hex => /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
231
+ const getChunksFromString = (st, chunkSize) => st.match(new RegExp(`.{${chunkSize}}`, 'g'));
232
+
233
+ const convertHexUnitTo256 = hexStr => parseInt(hexStr.repeat(2 / hexStr.length), 16);
234
+
235
+ if (!isValidHex(hex)) {
236
+ console.log('Invalid HEX');
237
+ return '';
238
+ }
239
+ const chunkSize = Math.floor((hex.length - 1) / 3);
240
+ const hexArr = getChunksFromString(hex.slice(1), chunkSize);
241
+ const [r, g, b, a] = hexArr.map(convertHexUnitTo256);
242
+ return {
243
+ r: r,
244
+ g: g,
245
+ b: b,
246
+ a: this.getAlphafloat(a, alpha)
247
+ };
248
+ },
249
+ // 标签样式解析
250
+ handleLabelColor(item, isSelect) {
251
+ let tempColor = '#5585f5';
252
+ let oldColorMap = {
253
+ blue: '#0000ff',
254
+ sky: '#87ceeb',
255
+ azure: '#f0ffff',
256
+ palegreen: '#98fb98',
257
+ yellow: '#ffff00',
258
+ darkorange: '#ff8c00',
259
+ magenta: '#ff00ff',
260
+ purple: '#800080',
261
+ maroon: '#800000',
262
+ orange: '#ffa500',
263
+ green: '#008000',
264
+ red: '#ff0000',
265
+ grey: '#808080'
266
+ };
267
+ if (item?.color?.includes('-')) {
268
+ let str = item.color.split('-')[1];
269
+ tempColor = oldColorMap[str] || '#5585f5';
270
+ } else {
271
+ tempColor = item.color || '#5585f5';
272
+ }
273
+ const tempRgba = this.hexToRGBA(tempColor) || {
274
+ r: 85,
275
+ g: 133,
276
+ b: 245,
277
+ a: 1
278
+ };
279
+ if (isSelect) {
280
+ return {
281
+ color: '#fff',
282
+ background: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`,
283
+ borderColor: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`
284
+ };
285
+ }
286
+ if (item.isSelect) {
287
+ return {
288
+ color: '#fff',
289
+ background: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`,
290
+ borderColor: `rgba(${tempRgba.r}, ${tempRgba.g}, ${tempRgba.b})`
291
+ };
292
+ } else {
293
+ let isSys = !(item.isPublic && item.isPublic == 1);
294
+ let color = isSys ? 'rgba(28, 28, 28, 1)' : 'rgba(33, 33, 33, 0.6)';
295
+ return {
296
+ color: color,
297
+ background: 'rgba(250, 250, 250, 1)',
298
+ borderColor: 'rgba(213, 213, 213, 0.8)'
299
+ };
300
+ }
301
+ },
302
+ // 生日范围校验
303
+ validateBirthday(val, title, type) {
304
+ let res = true;
305
+ if (!type) return false;
306
+ let regObj = {
307
+ DAYReg: /^([0-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|(360|361|363|362|364|365))$/,
308
+ MONTHReg: /^(?:[0-9]|1[0-2])$/,
309
+ YEARReg: /^(?:[1-9]?\d|100)$/
310
+ };
311
+ let testReg = `${type}Reg`;
312
+ if (!regObj[testReg].test(+val)) {
313
+ this.$message.warning(`${title}${this.$t('1.9.40')}`, 2);
314
+ res = false;
315
+ }
316
+ return res;
317
+ },
318
+ /**
319
+ *
320
+ * 时间转换
321
+ * @param {type} type 时间戳类型
322
+ * @param {time} time 时间戳
323
+ */
324
+ formatTime(type, time) {
325
+ let format = '';
326
+ if (!time) return '';
327
+ switch (type) {
328
+ case 'DATE':
329
+ format = 'yyyy-MM-dd';
330
+ break;
331
+ case 'DATETIME':
332
+ format = 'yyyy-MM-dd HH:mm:ss';
333
+ break;
334
+ case 'TIME':
335
+ format = 'HH:mm:ss';
336
+ break;
337
+ case 'MOUTH':
338
+ format = 'MM-dd';
339
+ break;
340
+ case 'DATETIMESTR':
341
+ format = 'yyyy年M月dd日 HH:mm';
342
+ break;
343
+ case 'MOUTHTIME':
344
+ format = 'M月d日 HH:mm';
345
+ break;
346
+ case 'HM':
347
+ format = ' HH:mm';
348
+ break;
349
+ default:
350
+ break;
351
+ }
352
+ return moment(time).format(format);
353
+ },
354
+ isJSON(str) {
355
+ if (typeof str == 'string') {
356
+ try {
357
+ let obj = JSON.parse(str);
358
+ if (typeof obj == 'object' && obj) {
359
+ return true;
360
+ } else {
361
+ return false;
362
+ }
363
+ } catch (e) {
364
+ return false;
365
+ }
366
+ }
367
+ return false;
368
+ },
369
+ isArray(val) {
370
+ return Array.isArray(val);
371
+ },
372
+ isEmpty(val) {
373
+ for (var key in val) {
374
+ return false;
375
+ }
376
+ return true;
377
+ },
378
+ isString(val) {
379
+ return typeof val === 'string';
380
+ },
381
+ isPlainObject(val) {
382
+ return typeof val === 'object';
383
+ }
384
+ };
385
+ }
386
+ },
387
+ components: {}
388
+ };
389
+
390
+ // start--- 筛选外显 ---start
391
+ export const outQuickSearchFn = {
392
+ methods: {
393
+ handlerInitSearchItem(arr) {
394
+ if (!Array.isArray(arr)) return;
395
+ arr.forEach(el => {
396
+ el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
397
+ const attr = el?.settingObj?.attr || "";
398
+ const isPreciseSearch = el?.settingObj?.isPreciseSearch || "";
399
+ const showSetting = el?.setting?.showSetting || []
400
+ /**
401
+ * NUMBER和TEXT属性字段
402
+ * 如果 开启了精准搜索,则传条件的时候 要传 EQ
403
+ * isPreciseSearch: 0/1
404
+ */
405
+ let textCon = el.fieldType == "TEXT" && isPreciseSearch == 1 ? 'EQ' : 'CL';
406
+ let advanceOptionSetting = el.advanceOptionSetting;
407
+ // let advanceColWidth = el.advanceColWidth;
408
+ // 映射优先级最高
409
+ if (showSetting?.length) {
410
+ let tvalue = []
411
+ // 设置了默认值
412
+ let df = el.explicitDefaultVal;
413
+ if(df){
414
+ let i = df == 'firstOption' ? 0 : showSetting.findIndex(v => v.change_text == df);
415
+ if(i > -1){
416
+ if(String(advanceOptionSetting) === '0'){
417
+ tvalue = i
418
+ } else {
419
+ tvalue.push(i)
420
+ }
421
+ }
422
+ }
423
+ // 存在映射 使用下拉多选框
424
+ this.$set(el, "con", "CONVERT");
425
+ this.$set(el, "com", "SelectMui");
426
+ this.$set(el, "comType", "SelectMui");
427
+ this.$set(el, "value", tvalue);
428
+ const labelList = el.setting.showSetting.map(i => {
429
+ i.labelName = i.change_text;
430
+ return i;
431
+ });
432
+ this.$set(el, "labelList", labelList);
433
+ } else if (!this.$utils.isEmpty(el.setting.wordbook)) {
434
+ // TODO:
435
+ // 存在映射 wordbook
436
+ let isTree = "tree" === el?.setting?.wordbook?.showType;
437
+ let comType = isTree ? 'treeSelect' : 'SelectMuiWordBook';
438
+ let defVal = isTree ? [] : [];
439
+ this.$set(el, "con", "QUOTE");
440
+ this.$set(el, "com", "SelectMui");
441
+ this.$set(el, "comType", comType);
442
+ this.$set(el, "value", defVal);
443
+ this.$set(el, "dataSource", []);
444
+ this.$set(el, "searchPageConfig", {
445
+ keyword: undefined,
446
+ isRequest: false, // 是否已请求
447
+ page: 1, // 当前页
448
+ total: 1, // 总页数
449
+ hasNextPage: false
450
+ });
451
+ } else {
452
+ if (["MONEY", "PERCENTAGE", "AGE", "NUMBER"].includes(attr) || el.fieldType == "NUMBER") {
453
+ this.$set(el, "con", "BIGANDLESS");
454
+ this.$set(el, "com", "Number");
455
+ this.$set(el, "lessValue", "");
456
+ this.$set(el, "bigValue", "");
457
+ if (attr == "AGE" && el.fieldType != "NUMBER") {
458
+ this.$set(el, "AGEAttr", true);
459
+ this.$set(el, "inputUnit", "岁");
460
+ }
461
+ if (el.fieldType == "NUMBER" && attr == "PERCENTAGE") {
462
+ this.$set(el, "inputUnit", "%");
463
+ }
464
+ } else if (
465
+ ["BIRTHDAY", "DATE", "TASKDATE"].includes(attr) ||
466
+ ["DATETIME", "DATE"].includes(el.fieldType)
467
+ ) {
468
+ // 查找默认值
469
+ let value = this.getSearchDefValueByLimit(el, this.searchFieldLimit) || [];
470
+ // explicitDefaultVal: "YESTERDAY"
471
+ // explicitRequired: 1
472
+
473
+ // 配置了默认值
474
+ if(el.explicitDefaultVal){
475
+ // let showFormat = attr === "BIRTHDAY" ? 'MM-DD':'YYYY-MM-DD HH:mm:ss';
476
+ let t = timeDomain.getTimeDomain(el.explicitDefaultVal)
477
+ if(t.length > 0){
478
+ value = t;
479
+ }
480
+ }
481
+ this.$set(el, "con", "IN");
482
+ this.$set(el, "com", "DatePicker");
483
+ this.$set(el, "value", value);
484
+ if (attr === "BIRTHDAY") {
485
+ this.$set(el, "showFormat", "MM-DD");
486
+ this.$set(el, "showTime", false);
487
+ } else if(["TODAY","TOMORROW","YESTERDAY"].includes(el.explicitDefaultVal)){
488
+ // 如果外显默认是 以上三个,展示一个框,时间不可选
489
+ let [v] = value;
490
+ this.$set(el, "showFormat", "YYYY-MM-DD");
491
+ this.$set(el, "showTime", false);
492
+ this.$set(el, "com", "DayPicker");
493
+ this.$set(el, "value",v || moment());
494
+ } else {
495
+ this.$set(el, "showFormat", "YYYY-MM-DD HH:mm:ss");
496
+ this.$set(el, "showTime", true);
497
+ }
498
+ } else if (["LABEL", "EVALUATE"].includes(attr)) {
499
+ this.$set(el, "con", "CL");
500
+ this.$set(el, "com", "SelectMui");
501
+ this.$set(el, "value", []);
502
+ if (attr == "EVALUATE") {
503
+ let list = EVALUATEList.map(i => {
504
+ i.labelName = i.label;
505
+ return i;
506
+ });
507
+ this.$set(el, "labelList", list);
508
+ } else {
509
+ this.handleSetLabelOptions(el.setting.labelType, el);
510
+ }
511
+ } else if ("PASSWORD" === attr) {
512
+ this.$set(el, "con", el.fieldType === "NUMBER" ? "EQ" : textCon);
513
+ this.$set(el, "comAttr", "PASSWORD");
514
+ this.$set(el, "PASSWORDTYPE", true);
515
+ this.$set(el, "value", "");
516
+ this.$set(el, "com", "Text");
517
+ } else if (["DURATION"].includes(attr)) {
518
+ this.$set(el, "con", "EQ");
519
+ this.$set(el, "value", "");
520
+ this.$set(el, "com", "Text");
521
+ this.$set(el, "attr", "DURATION");
522
+ } else {
523
+ this.$set(el, "con", textCon);
524
+ this.$set(el, "isPreciseSearch", isPreciseSearch == 1);
525
+ this.$set(el, "value", "");
526
+ this.$set(el, "com", "Text");
527
+ }
528
+ }
529
+ });
530
+ },
531
+ handleSetLabelOptions(labelType, el) {
532
+ this.handleRequestedLabel(labelType || "")
533
+ .then(({ data }) => {
534
+ if (data.result === "SUCCESS") {
535
+ let labelList = data.map.rows || [];
536
+ this.$set(el, "labelList", labelList);
537
+ }
538
+ })
539
+ .catch(err => console.log(err));
540
+ },
541
+ getConObj(arr) {
542
+ if (!Array.isArray(arr)) {
543
+ return [];
544
+ }
545
+ let conObj = [];
546
+ arr.forEach(item => {
547
+ let temp = {
548
+ field_key: item.columnName,
549
+ con: item.con,
550
+ value: "",
551
+ limit_date: "",
552
+ start_val: item.start_val || "",
553
+ end_val: item.end_val || "",
554
+ unit: item.unit || "",
555
+ id: item.id
556
+ };
557
+ if (item.com === "Text" && item.value) {
558
+ temp.value = item.value;
559
+ conObj.push(temp);
560
+ }
561
+ let advanceOptionSetting = item.advanceOptionSetting;
562
+ if (item.com === "SelectMui" && item.value) {
563
+ // 单选模式
564
+ let single = String(advanceOptionSetting) === '0';
565
+ if(single){
566
+ if(!Array.isArray(item.value)) {
567
+ item.value = [item.value]
568
+ }
569
+ }
570
+ let hasArr = Array.isArray(item.value) && item.value.length > 0
571
+ if (item.comType == "SelectMuiWordBook" && hasArr) {
572
+ temp.value = item.value.join("|#|");
573
+ } else if(item.comType == "treeSelect"){
574
+ // 樹狀
575
+ let value = item.value;
576
+ if(typeof value === 'string'){
577
+ [value] = value.split('<&=&>')
578
+ } else if(Array.isArray(value)){
579
+ value = value.map((v)=>{
580
+ let [k] = typeof v === 'string' ? v.split('<&=&>'): [];
581
+ return k;
582
+ })
583
+ value = value.join("|#|");
584
+ }
585
+ temp.value = value;
586
+ } else {
587
+ if(hasArr){
588
+ if (item.con == "CONVERT") {
589
+ // 存在映射
590
+ let value = [];
591
+ value = item.value.map(i => {
592
+ return item.labelList[i].filter;
593
+ });
594
+ temp.value = value;
595
+ } else {
596
+ let value = [];
597
+ value = item.value.map(i => {
598
+ return item.labelList[i].labelName;
599
+ });
600
+ temp.value = value.join("|#|");
601
+ }
602
+ }
603
+
604
+ }
605
+ conObj.push(temp);
606
+ }
607
+ if (item.com === "DatePicker" && item.value.length) {
608
+ const start_val = item.value[0].format(item.showFormat);
609
+ const end_val = item.value[1].format(item.showFormat);
610
+ if (item.settingObj.attr === "BIRTHDAY") {
611
+ temp.limit_date = `${start_val}~${end_val}`;
612
+ } else {
613
+ temp.start_val = start_val;
614
+ temp.end_val = end_val;
615
+ }
616
+ conObj.push(temp);
617
+ }
618
+ if (item.com === "DayPicker" && item.value) {
619
+ const start_val = item.value.startOf('day').format('YYYY-MM-DD HH:mm:ss');
620
+ const end_val = item.value.endOf('day').format('YYYY-MM-DD HH:mm:ss');
621
+ if (item.settingObj.attr === "BIRTHDAY") {
622
+ temp.limit_date = `${start_val}~${end_val}`;
623
+ } else {
624
+ temp.start_val = start_val;
625
+ temp.end_val = end_val;
626
+ }
627
+ conObj.push(temp);
628
+ }
629
+ if (item.AGEAttr) {
630
+ temp.value = "";
631
+ temp.con = "IN";
632
+ let start_val = Number(item.lessValue) * 365;
633
+ let end_val = Number(item.bigValue) * 365;
634
+ if ((start_val || start_val === 0) && end_val) {
635
+ temp.start_val = start_val;
636
+ temp.end_val = end_val;
637
+ conObj.push(JSON.parse(JSON.stringify(temp)));
638
+ }
639
+ } else if (item.com === "Number") {
640
+ // 同时有lessValue bigValue 才是一个范围
641
+ if (item.lessValue && item.bigValue) {
642
+ if (item.settingObj?.attr === "PERCENTAGE") {
643
+ temp.value = Number(item.lessValue) / 100 + "~" + Number(item.bigValue) / 100;
644
+ } else {
645
+ temp.value = item.lessValue + "~" + item.bigValue;
646
+ }
647
+ } else {
648
+ if (item.settingObj?.attr === "PERCENTAGE") {
649
+ temp.value = Number(item.lessValue) / 100 || Number(item.bigValue) / 100;
650
+ } else {
651
+ temp.value = item.lessValue || item.bigValue;
652
+ }
653
+ }
654
+ temp.con = "EQ";
655
+ conObj.push(JSON.parse(JSON.stringify(temp)));
656
+ }
657
+ if (item.com === "SelectQuote" && item.value.length) {
658
+ temp.value = item.value.join("|#|");
659
+ conObj.push(temp);
660
+ }
661
+ });
662
+ let res = conObj.filter(
663
+ item => item.value || item.limit_date || item.start_val || item.end_val
664
+ );
665
+ return res;
666
+ },
667
+ getConObjParams() {
668
+ let conObj = this.getConObj(this.outSearchFieldList);
669
+ let realation = [];
670
+ this.outRelationQuickSearch.forEach(item => {
671
+ let curQuote = this.getConObj(item.fieldList);
672
+ if (curQuote && curQuote.length) {
673
+ realation.push({
674
+ field_key: item.primaryField,
675
+ valueField: item.relationField,
676
+ con: "QUOTE_IN",
677
+ tableId: item.tableId,
678
+ parameterConversionId: item.parameterConversionId,
679
+ converFun: item.converFun,
680
+ preConObj: item.preConObj,
681
+ relationOrgId: item.relationOrgId,
682
+ preSqlExpression: item.preSqlExpression,
683
+ quote_con: {
684
+ conObj: this.getConObj(item.fieldList),
685
+ sqlExpression: ""
686
+ }
687
+ });
688
+ }
689
+ });
690
+ conObj.push(...realation);
691
+ return conObj || [];
692
+ }
693
+ }
694
+ }
695
+ // end--- 筛选外显 ---end