cloud-web-corejs 1.0.54-dev.744 → 1.0.54-dev.746
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.
- package/package.json +192 -192
- package/src/App.vue +73 -71
- package/src/components/baseArea/index.vue +1628 -1628
- package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
- package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -298
- package/src/components/fileLibrary/index.vue +1109 -1110
- package/src/components/fileLibrary/propertiesDialog.vue +190 -190
- package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
- package/src/components/wf/mixins/setCandidateDialog.js +217 -217
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -986
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +408 -0
- package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -272
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +216 -216
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +928 -928
- package/src/components/xform/form-designer/index.vue +195 -195
- package/src/components/xform/form-designer/indexMixin.js +848 -848
- package/src/components/xform/form-designer/setting-panel/index.vue +313 -314
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +369 -369
- package/src/components/xform/form-designer/widget-panel/index.vue +389 -389
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +343 -343
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4531 -4531
- package/src/components/xform/form-render/container-item/data-table-mixin.js +4748 -4576
- package/src/components/xform/form-render/container-item/tab-item.vue +125 -125
- package/src/components/xform/form-render/indexMixin.js +5061 -5078
- package/src/components/xform/lang/en-US.js +457 -457
- package/src/components/xform/lang/zh-CN.js +628 -628
- package/src/components/xform/utils/formHttp.js +162 -0
- package/src/components/xform/utils/util.js +1585 -1554
- package/src/index.js +344 -230
- package/src/layout/components/AppMain.vue +122 -122
- package/src/layout/components/extractedCode/viewDialog.vue +207 -207
- package/src/layout/components/langTool.vue +128 -123
- package/src/layout/defaultLayout.vue +164 -158
- package/src/permission.js +185 -135
- package/src/store/config/index.js +667 -669
- package/src/store/modules/micro.js +46 -0
- package/src/store/modules/permission.js +461 -373
- package/src/store/modules/user.js +419 -415
- package/src/utils/auth.js +27 -1
- package/src/utils/index.js +579 -6
- package/src/utils/keepAlive.js +4 -0
- package/src/utils/menuAdapter.js +183 -0
- package/src/utils/request.js +417 -28
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +483 -491
- package/src/views/bd/setting/form_script/form_list.vue +174 -174
- package/src/views/bd/setting/form_script/mixins/form_list.js +330 -330
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -171
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -254
- package/src/views/user/menuFallback/index.vue +123 -0
- package/src/views/user/wf/wfReport/index.vue +625 -619
|
@@ -1,1554 +1,1585 @@
|
|
|
1
|
-
import Clipboard from "clipboard";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import request from "../../../utils/request.js";
|
|
4
|
-
import { decode } from "js-base64";
|
|
5
|
-
|
|
6
|
-
export function getAccessUrl() {
|
|
7
|
-
return SUPPORT_PREFIX + "/report_ins/getData";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function isNull(value) {
|
|
11
|
-
return value === null || value === undefined;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function isNilOrEmptyStr(value) {
|
|
15
|
-
return value === null || value === undefined || value === "";
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function isNotNull(value) {
|
|
19
|
-
return value !== null && value !== undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const ATTACHMENT_WIDGET_TYPES = ["vabUpload", "baseAttachment", "vabUpload2"];
|
|
23
|
-
|
|
24
|
-
const PROJECT_TAG_WIDGET_TYPES = [
|
|
25
|
-
"project-tag",
|
|
26
|
-
"user-project-tag",
|
|
27
|
-
"saleOrg-project-tag",
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
const VABSEARCH_WIDGET_TYPES = ["vabsearch", "singerSearch", "multiSearch"];
|
|
31
|
-
|
|
32
|
-
export function isAttachmentWidgetType(type) {
|
|
33
|
-
return ATTACHMENT_WIDGET_TYPES.includes(type);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function isVabsearchWidgetType(type) {
|
|
37
|
-
return VABSEARCH_WIDGET_TYPES.includes(type);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function isVabsearchMultiWidget(widget) {
|
|
41
|
-
if (!widget) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
const type = widget.type;
|
|
45
|
-
if (type === "multiSearch") {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
if (!isVabsearchWidgetType(type)) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
const options = widget.options || {};
|
|
52
|
-
return !!(
|
|
53
|
-
options.multipleChoices || options.searchDialogConfig?.multipleChoices
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** 绑定值为数组的字段组件(含附件) */
|
|
58
|
-
export function isArrayValueWidgetType(type, options = {}) {
|
|
59
|
-
if (isAttachmentWidgetType(type)) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
if (type === "checkbox") {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
if (type === "select" && options.multiple) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
if (type === "time-range" || type === "date-range") {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
if (type === "date" && options.type === "dates") {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (PROJECT_TAG_WIDGET_TYPES.includes(type)) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
if (type === "multiSearch") {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
if (
|
|
81
|
-
type === "vabsearch" &&
|
|
82
|
-
(options.multipleChoices || options.searchDialogConfig?.multipleChoices)
|
|
83
|
-
) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** 数组类字段值是否为空(用于必填校验) */
|
|
90
|
-
export function isEmptyArrayFieldValue(value, type, options = {}) {
|
|
91
|
-
if (value === null || value === undefined) {
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
if (type === "time-range" || type === "date-range") {
|
|
95
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
return value.every(
|
|
99
|
-
(item) => item === null || item === undefined || item === ""
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
if (!Array.isArray(value)) {
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
return value.length === 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function isEmptyStr(str) {
|
|
109
|
-
//return (str === undefined) || (!str) || (!/[^\s]/.test(str));
|
|
110
|
-
return (
|
|
111
|
-
str === undefined ||
|
|
112
|
-
(!str && str !== 0 && str !== "0") ||
|
|
113
|
-
!/[^\s]/.test(str)
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export const generateId = function () {
|
|
118
|
-
return Math.floor(
|
|
119
|
-
Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
export const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
export const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
if (
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
)
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
} else if (con.
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
) {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
con
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
)
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
if (!
|
|
844
|
-
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
) {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
return result;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
export function
|
|
1091
|
-
var
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
"
|
|
1329
|
-
"
|
|
1330
|
-
"
|
|
1331
|
-
"
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
if (
|
|
1452
|
-
else
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
} else if ("
|
|
1517
|
-
|
|
1518
|
-
e.
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
});
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
e.
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1
|
+
import Clipboard from "clipboard";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import request from "../../../utils/request.js";
|
|
4
|
+
import { decode } from "js-base64";
|
|
5
|
+
|
|
6
|
+
export function getAccessUrl() {
|
|
7
|
+
return SUPPORT_PREFIX + "/report_ins/getData";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function isNull(value) {
|
|
11
|
+
return value === null || value === undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function isNilOrEmptyStr(value) {
|
|
15
|
+
return value === null || value === undefined || value === "";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function isNotNull(value) {
|
|
19
|
+
return value !== null && value !== undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ATTACHMENT_WIDGET_TYPES = ["vabUpload", "baseAttachment", "vabUpload2"];
|
|
23
|
+
|
|
24
|
+
const PROJECT_TAG_WIDGET_TYPES = [
|
|
25
|
+
"project-tag",
|
|
26
|
+
"user-project-tag",
|
|
27
|
+
"saleOrg-project-tag",
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const VABSEARCH_WIDGET_TYPES = ["vabsearch", "singerSearch", "multiSearch"];
|
|
31
|
+
|
|
32
|
+
export function isAttachmentWidgetType(type) {
|
|
33
|
+
return ATTACHMENT_WIDGET_TYPES.includes(type);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isVabsearchWidgetType(type) {
|
|
37
|
+
return VABSEARCH_WIDGET_TYPES.includes(type);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function isVabsearchMultiWidget(widget) {
|
|
41
|
+
if (!widget) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const type = widget.type;
|
|
45
|
+
if (type === "multiSearch") {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (!isVabsearchWidgetType(type)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const options = widget.options || {};
|
|
52
|
+
return !!(
|
|
53
|
+
options.multipleChoices || options.searchDialogConfig?.multipleChoices
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** 绑定值为数组的字段组件(含附件) */
|
|
58
|
+
export function isArrayValueWidgetType(type, options = {}) {
|
|
59
|
+
if (isAttachmentWidgetType(type)) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (type === "checkbox") {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (type === "select" && options.multiple) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (type === "time-range" || type === "date-range") {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
if (type === "date" && options.type === "dates") {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (PROJECT_TAG_WIDGET_TYPES.includes(type)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (type === "multiSearch") {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if (
|
|
81
|
+
type === "vabsearch" &&
|
|
82
|
+
(options.multipleChoices || options.searchDialogConfig?.multipleChoices)
|
|
83
|
+
) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** 数组类字段值是否为空(用于必填校验) */
|
|
90
|
+
export function isEmptyArrayFieldValue(value, type, options = {}) {
|
|
91
|
+
if (value === null || value === undefined) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (type === "time-range" || type === "date-range") {
|
|
95
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return value.every(
|
|
99
|
+
(item) => item === null || item === undefined || item === ""
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (!Array.isArray(value)) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return value.length === 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function isEmptyStr(str) {
|
|
109
|
+
//return (str === undefined) || (!str) || (!/[^\s]/.test(str));
|
|
110
|
+
return (
|
|
111
|
+
str === undefined ||
|
|
112
|
+
(!str && str !== 0 && str !== "0") ||
|
|
113
|
+
!/[^\s]/.test(str)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const generateId = function () {
|
|
118
|
+
return Math.floor(
|
|
119
|
+
Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// 审计字段:创建/修改人及时间,camelCase 与 snake_case 两种形式;后端保存时重新生成
|
|
124
|
+
const AUDIT_FIELDS = [
|
|
125
|
+
"createBy",
|
|
126
|
+
"createDate",
|
|
127
|
+
"modifyBy",
|
|
128
|
+
"modifyDate",
|
|
129
|
+
"_createBy",
|
|
130
|
+
"_modifyBy",
|
|
131
|
+
"create_by",
|
|
132
|
+
"create_date",
|
|
133
|
+
"modify_by",
|
|
134
|
+
"modify_date",
|
|
135
|
+
];
|
|
136
|
+
// 展示态字段:查询时后端回填的创建/修改人昵称、手机号,保存前需剔除
|
|
137
|
+
const DISPLAY_FIELDS = [
|
|
138
|
+
"_createNickName",
|
|
139
|
+
"_createMobile",
|
|
140
|
+
"_modifyNickName",
|
|
141
|
+
"_modifyMobile",
|
|
142
|
+
];
|
|
143
|
+
// 子表/树表外键:复制场景下需断链
|
|
144
|
+
export const XFORM_SUB_FK_FIELDS = [
|
|
145
|
+
"head_table_id",
|
|
146
|
+
"headTableId",
|
|
147
|
+
"alias_id",
|
|
148
|
+
"object_foreign_id",
|
|
149
|
+
];
|
|
150
|
+
// 主表系统字段(含 id):供对比功能 sanitizeChangeData 清洗使用
|
|
151
|
+
export const XFORM_SYSTEM_FIELDS = ["id", ...AUDIT_FIELDS];
|
|
152
|
+
// 行级复制清洗字段:审计 + 展示态 + 子表外键;不含 id/parentField,
|
|
153
|
+
// 二者承载树层级,由调用方的树逻辑单独生成/重映射
|
|
154
|
+
export const XFORM_ROW_CLEAN_FIELDS = [
|
|
155
|
+
...AUDIT_FIELDS,
|
|
156
|
+
...DISPLAY_FIELDS,
|
|
157
|
+
...XFORM_SUB_FK_FIELDS,
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
export const createUUID = function () {
|
|
161
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
162
|
+
.replace(/[xy]/g, function (c) {
|
|
163
|
+
var r = (Math.random() * 16) | 0,
|
|
164
|
+
v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
165
|
+
return v.toString(16);
|
|
166
|
+
})
|
|
167
|
+
.replaceAll("-", "");
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const deepClone = function (origin) {
|
|
171
|
+
if (origin === undefined) {
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return JSON.parse(JSON.stringify(origin));
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const overwriteObj = function (obj1, obj2) {
|
|
179
|
+
/* 浅拷贝对象属性,obj2覆盖obj1 */
|
|
180
|
+
// for (let prop in obj2) {
|
|
181
|
+
// if (obj2.hasOwnProperty(prop)) {
|
|
182
|
+
// obj1[prop] = obj2[prop]
|
|
183
|
+
// }
|
|
184
|
+
// }
|
|
185
|
+
|
|
186
|
+
Object.keys(obj2).forEach((prop) => {
|
|
187
|
+
obj1[prop] = obj2[prop];
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const addWindowResizeHandler = function (handler) {
|
|
192
|
+
// qiankun 沙箱下 window.onresize 直赋值落在代理对象上收不到真实事件,
|
|
193
|
+
// 统一走 addEventListener(沙箱会在子应用卸载时自动清理)
|
|
194
|
+
window.addEventListener("resize", handler);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const createStyleSheet = function () {
|
|
198
|
+
let head = document.head || document.getElementsByTagName("head")[0];
|
|
199
|
+
let style = document.createElement("style");
|
|
200
|
+
style.type = "text/css";
|
|
201
|
+
head.appendChild(style);
|
|
202
|
+
return style.sheet;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const insertCustomCssToHead = function (cssCode, formId = "") {
|
|
206
|
+
let head = document.getElementsByTagName("head")[0];
|
|
207
|
+
let oldStyle = document.getElementById("vform-custom-css");
|
|
208
|
+
if (!!oldStyle) {
|
|
209
|
+
head.removeChild(oldStyle); //先清除后插入!!
|
|
210
|
+
}
|
|
211
|
+
if (!!formId) {
|
|
212
|
+
oldStyle = document.getElementById("vform-custom-css" + "-" + formId);
|
|
213
|
+
!!oldStyle && head.removeChild(oldStyle); //先清除后插入!!
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let newStyle = document.createElement("style");
|
|
217
|
+
newStyle.type = "text/css";
|
|
218
|
+
newStyle.rel = "stylesheet";
|
|
219
|
+
newStyle.id = !!formId
|
|
220
|
+
? "vform-custom-css" + "-" + formId
|
|
221
|
+
: "vform-custom-css";
|
|
222
|
+
try {
|
|
223
|
+
newStyle.appendChild(document.createTextNode(cssCode));
|
|
224
|
+
} catch (ex) {
|
|
225
|
+
newStyle.styleSheet.cssText = cssCode;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
head.appendChild(newStyle);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const insertGlobalFunctionsToHtml = function (
|
|
232
|
+
functionsCode,
|
|
233
|
+
formId = ""
|
|
234
|
+
) {
|
|
235
|
+
let bodyEle = document.getElementsByTagName("body")[0];
|
|
236
|
+
let oldScriptEle = document.getElementById("v_form_global_functions");
|
|
237
|
+
!!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!
|
|
238
|
+
if (!!formId) {
|
|
239
|
+
oldScriptEle = document.getElementById(
|
|
240
|
+
"v_form_global_functions" + "-" + formId
|
|
241
|
+
);
|
|
242
|
+
!!oldScriptEle && bodyEle.removeChild(oldScriptEle); //先清除后插入!!
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
let newScriptEle = document.createElement("script");
|
|
246
|
+
newScriptEle.id = !!formId
|
|
247
|
+
? "v_form_global_functions" + "-" + formId
|
|
248
|
+
: "v_form_global_functions";
|
|
249
|
+
newScriptEle.type = "text/javascript";
|
|
250
|
+
newScriptEle.innerHTML = functionsCode;
|
|
251
|
+
bodyEle.appendChild(newScriptEle);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const optionExists = function (optionsObj, optionName) {
|
|
255
|
+
if (!optionsObj) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return Object.keys(optionsObj).indexOf(optionName) > -1;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export const loadRemoteScript = function (srcPath, callback) {
|
|
263
|
+
/*加载远程js,加载成功后执行回调函数*/
|
|
264
|
+
let sid = encodeURIComponent(srcPath);
|
|
265
|
+
let oldScriptEle = document.getElementById(sid);
|
|
266
|
+
|
|
267
|
+
if (!oldScriptEle) {
|
|
268
|
+
let s = document.createElement("script");
|
|
269
|
+
s.src = srcPath;
|
|
270
|
+
s.id = sid;
|
|
271
|
+
document.body.appendChild(s);
|
|
272
|
+
|
|
273
|
+
s.onload = s.onreadystatechange = function (_, isAbort) {
|
|
274
|
+
/* 借鉴自ace.js */
|
|
275
|
+
if (
|
|
276
|
+
isAbort ||
|
|
277
|
+
!s.readyState ||
|
|
278
|
+
s.readyState === "loaded" ||
|
|
279
|
+
s.readyState === "complete"
|
|
280
|
+
) {
|
|
281
|
+
s = s.onload = s.onreadystatechange = null;
|
|
282
|
+
if (!isAbort) {
|
|
283
|
+
callback();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export function traverseFieldWidgets(
|
|
291
|
+
widgetList,
|
|
292
|
+
handler,
|
|
293
|
+
parent = null,
|
|
294
|
+
staticWidgetsIncluded
|
|
295
|
+
) {
|
|
296
|
+
if (!widgetList) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
loopHandleWidget(widgetList, (w, parent) => {
|
|
301
|
+
if (w.formItemFlag || (w.formItemFlag === false && staticWidgetsIncluded)) {
|
|
302
|
+
handler(w, parent);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
/* widgetList.forEach((w) => {
|
|
307
|
+
if (w.formItemFlag || (w.formItemFlag === false && staticWidgetsIncluded)) {
|
|
308
|
+
handler(w, parent);
|
|
309
|
+
} else if (w.type === "grid") {
|
|
310
|
+
w.cols.forEach((col) => {
|
|
311
|
+
traverseFieldWidgets(col.widgetList, handler, w, staticWidgetsIncluded);
|
|
312
|
+
});
|
|
313
|
+
} else if (w.type === "table") {
|
|
314
|
+
w.rows.forEach((row) => {
|
|
315
|
+
row.cols.forEach((cell) => {
|
|
316
|
+
traverseFieldWidgets(
|
|
317
|
+
cell.widgetList,
|
|
318
|
+
handler,
|
|
319
|
+
w,
|
|
320
|
+
staticWidgetsIncluded
|
|
321
|
+
);
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
} else if (w.type === "tab") {
|
|
325
|
+
w.tabs.forEach((tab) => {
|
|
326
|
+
traverseFieldWidgets(tab.widgetList, handler, w, staticWidgetsIncluded);
|
|
327
|
+
});
|
|
328
|
+
} else if (w.type === "sub-form" || w.type === "grid-sub-form") {
|
|
329
|
+
traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);
|
|
330
|
+
} else if (w.category === "container") {
|
|
331
|
+
//自定义容器
|
|
332
|
+
traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);
|
|
333
|
+
}
|
|
334
|
+
}); */
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export function traverseContainerWidgets(
|
|
338
|
+
widgetList,
|
|
339
|
+
handler,
|
|
340
|
+
skipDialogAndDrawer
|
|
341
|
+
) {
|
|
342
|
+
if (!widgetList) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
loopHandleWidget(widgetList, (w, parent) => {
|
|
347
|
+
if (w.category === "container") {
|
|
348
|
+
if (
|
|
349
|
+
skipDialogAndDrawer &&
|
|
350
|
+
(w.type === "vf-dialog" || w.type === "vf-drawer")
|
|
351
|
+
) {
|
|
352
|
+
//什么也不做
|
|
353
|
+
} else {
|
|
354
|
+
handler(w);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
/* widgetList.forEach((w) => {
|
|
360
|
+
if (w.category === "container") {
|
|
361
|
+
if (
|
|
362
|
+
skipDialogAndDrawer &&
|
|
363
|
+
(w.type === "vf-dialog" || w.type === "vf-drawer")
|
|
364
|
+
) {
|
|
365
|
+
//什么也不做
|
|
366
|
+
} else {
|
|
367
|
+
handler(w);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (w.type === "grid") {
|
|
372
|
+
w.cols.forEach((col) => {
|
|
373
|
+
traverseContainerWidgets(col.widgetList, handler);
|
|
374
|
+
});
|
|
375
|
+
} else if (w.type === "table") {
|
|
376
|
+
w.rows.forEach((row) => {
|
|
377
|
+
row.cols.forEach((cell) => {
|
|
378
|
+
traverseContainerWidgets(cell.widgetList, handler);
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
} else if (w.type === "tab") {
|
|
382
|
+
w.tabs.forEach((tab) => {
|
|
383
|
+
traverseContainerWidgets(tab.widgetList, handler);
|
|
384
|
+
});
|
|
385
|
+
} else if (w.type === "sub-form" || w.type === "grid-sub-form") {
|
|
386
|
+
traverseContainerWidgets(w.widgetList, handler);
|
|
387
|
+
} else if (w.category === "container") {
|
|
388
|
+
//自定义容器
|
|
389
|
+
if (
|
|
390
|
+
skipDialogAndDrawer &&
|
|
391
|
+
(w.type === "vf-dialog" || w.type === "vf-drawer")
|
|
392
|
+
) {
|
|
393
|
+
//什么也不做
|
|
394
|
+
} else {
|
|
395
|
+
traverseContainerWidgets(w.widgetList, handler);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}); */
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export function traverseAllWidgetsNew(widgetList, callback) {
|
|
402
|
+
if (!widgetList) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
let columnLoopDo = (t, parentWidget) => {
|
|
406
|
+
if (t.children && t.children.length) {
|
|
407
|
+
t.children.forEach((item) => {
|
|
408
|
+
columnLoopDo(item, parentWidget);
|
|
409
|
+
});
|
|
410
|
+
} else {
|
|
411
|
+
if (t.widget) {
|
|
412
|
+
callback && callback(t.widget, parentWidget);
|
|
413
|
+
}
|
|
414
|
+
if (t.editWidget) {
|
|
415
|
+
callback && callback(t.editWidget, parentWidget);
|
|
416
|
+
}
|
|
417
|
+
if (t.widgetList && t.widgetList.length) {
|
|
418
|
+
loopHandleWidget(t.widgetList, (widget) => {
|
|
419
|
+
callback && callback(widget, parentWidget);
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
loopHandleWidget(widgetList, (widget, parentWidget) => {
|
|
425
|
+
if (callback) {
|
|
426
|
+
callback(widget, parentWidget);
|
|
427
|
+
if (widget.type === "data-table") {
|
|
428
|
+
for (let item of widget.options.tableColumns) {
|
|
429
|
+
columnLoopDo(item, parentWidget);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export function traverseAllWidgets(widgetList, handler) {
|
|
437
|
+
if (!widgetList) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
loopHandleWidget(widgetList, (w, parentWidget) => {
|
|
442
|
+
handler(w, parentWidget);
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
/* widgetList.forEach((w) => {
|
|
446
|
+
handler(w);
|
|
447
|
+
|
|
448
|
+
if (w.type === "grid") {
|
|
449
|
+
w.cols.forEach((col) => {
|
|
450
|
+
handler(col);
|
|
451
|
+
traverseAllWidgets(col.widgetList, handler);
|
|
452
|
+
});
|
|
453
|
+
} else if (w.type === "table") {
|
|
454
|
+
w.rows.forEach((row) => {
|
|
455
|
+
row.cols.forEach((cell) => {
|
|
456
|
+
handler(cell);
|
|
457
|
+
traverseAllWidgets(cell.widgetList, handler);
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
} else if (w.type === "tab") {
|
|
461
|
+
w.tabs.forEach((tab) => {
|
|
462
|
+
traverseAllWidgets(tab.widgetList, handler);
|
|
463
|
+
});
|
|
464
|
+
} else if (w.type === "sub-form" || w.type === "grid-sub-form") {
|
|
465
|
+
traverseAllWidgets(w.widgetList, handler);
|
|
466
|
+
} else if (w.category === "container") {
|
|
467
|
+
//自定义容器
|
|
468
|
+
traverseAllWidgets(w.widgetList, handler);
|
|
469
|
+
}
|
|
470
|
+
}); */
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function handleWidgetForTraverse(
|
|
474
|
+
widget,
|
|
475
|
+
handler,
|
|
476
|
+
staticWidgetsIncluded = false
|
|
477
|
+
) {
|
|
478
|
+
if (!!widget.category && widget.category === "container") {
|
|
479
|
+
traverseFieldWidgetsOfContainer(widget, handler);
|
|
480
|
+
} else if (widget.formItemFlag) {
|
|
481
|
+
handler(widget);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export const itemFieldMap = {
|
|
486
|
+
grid: "cols",
|
|
487
|
+
table: "rows",
|
|
488
|
+
"table-cell": "widgetList",
|
|
489
|
+
"h5-table": "rows",
|
|
490
|
+
"h5-table-cell": "widgetList",
|
|
491
|
+
tab: "tabs",
|
|
492
|
+
"tab-pane": "widgetList",
|
|
493
|
+
"grid-col": "widgetList",
|
|
494
|
+
"vf-box": "widgetList",
|
|
495
|
+
card: "widgetList",
|
|
496
|
+
detail: "panes",
|
|
497
|
+
"detail-pane": "widgetList",
|
|
498
|
+
"detail-h5": "panes",
|
|
499
|
+
"h5-card": "panes",
|
|
500
|
+
"h5-card-pane": "widgetList",
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* 遍历容器内的字段组件
|
|
505
|
+
* @param con
|
|
506
|
+
* @param handler
|
|
507
|
+
* @param staticWidgetsIncluded
|
|
508
|
+
*/
|
|
509
|
+
export function traverseFieldWidgetsOfContainer(
|
|
510
|
+
con,
|
|
511
|
+
handler,
|
|
512
|
+
staticWidgetsIncluded = false
|
|
513
|
+
) {
|
|
514
|
+
/*loopHandleWidget([con],(w, parent)=>{
|
|
515
|
+
handleWidgetForTraverse(w, handler, staticWidgetsIncluded);
|
|
516
|
+
});*/
|
|
517
|
+
if (con.type === "grid") {
|
|
518
|
+
con.cols.forEach((col) => {
|
|
519
|
+
col.widgetList.forEach((cw) => {
|
|
520
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
} else if (con.type === "table") {
|
|
524
|
+
con.rows.forEach((row) => {
|
|
525
|
+
row.cols.forEach((cell) => {
|
|
526
|
+
cell.widgetList.forEach((cw) => {
|
|
527
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
} else if (con.type === "tab") {
|
|
532
|
+
con.tabs.forEach((tab) => {
|
|
533
|
+
tab.widgetList.forEach((cw) => {
|
|
534
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
535
|
+
});
|
|
536
|
+
});
|
|
537
|
+
} else if (con.type === "sub-form" || con.type === "grid-sub-form") {
|
|
538
|
+
con.widgetList.forEach((cw) => {
|
|
539
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
540
|
+
});
|
|
541
|
+
} else if (con.type === "data-table") {
|
|
542
|
+
/*con.widgetList.forEach((cw) => {
|
|
543
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
544
|
+
});*/
|
|
545
|
+
if (!!con.widgetList) {
|
|
546
|
+
con.widgetList.forEach((childItem) => {
|
|
547
|
+
loopHandleWidgetItem(childItem, con, handler);
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
if (!!con.buttons) {
|
|
551
|
+
con.buttons.forEach((childItem) => {
|
|
552
|
+
loopHandleWidgetItem(childItem, con, handler);
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
for (let column of con.options.tableColumns) {
|
|
556
|
+
if (column.widget) {
|
|
557
|
+
handleWidgetForTraverse(column.widget, handler, staticWidgetsIncluded);
|
|
558
|
+
}
|
|
559
|
+
if (column.widgetList) {
|
|
560
|
+
column.widgetList.forEach((cw) => {
|
|
561
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
562
|
+
});
|
|
563
|
+
/*loopHandleWidget(column.widgetList, (cw) => {
|
|
564
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
565
|
+
});*/
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
} else if (con.category === "container") {
|
|
569
|
+
//自定义容器
|
|
570
|
+
/*let key = itemFieldMap[con.type]
|
|
571
|
+
con[key].forEach((cw) => {
|
|
572
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
|
|
573
|
+
});*/
|
|
574
|
+
|
|
575
|
+
/*con.widgetList.forEach(cw => {
|
|
576
|
+
handleWidgetForTraverse(cw, handler, staticWidgetsIncluded)
|
|
577
|
+
})*/
|
|
578
|
+
loopHandleWidgetItem(con, null, (w) => {
|
|
579
|
+
if (con.id != w.id)
|
|
580
|
+
handleWidgetForTraverse(w, handler, staticWidgetsIncluded);
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function handleContainerTraverse(
|
|
586
|
+
widget,
|
|
587
|
+
fieldHandler,
|
|
588
|
+
containerHandler,
|
|
589
|
+
internalContainerCallFlag,
|
|
590
|
+
staticWidgetsIncluded
|
|
591
|
+
) {
|
|
592
|
+
if (!!widget.category && widget.category === "container") {
|
|
593
|
+
traverseWidgetsOfContainer(
|
|
594
|
+
widget,
|
|
595
|
+
fieldHandler,
|
|
596
|
+
containerHandler,
|
|
597
|
+
internalContainerCallFlag,
|
|
598
|
+
staticWidgetsIncluded
|
|
599
|
+
);
|
|
600
|
+
} else if (widget.formItemFlag) {
|
|
601
|
+
fieldHandler(widget);
|
|
602
|
+
} else if (staticWidgetsIncluded) {
|
|
603
|
+
fieldHandler(widget);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* 遍历容器内部的字段组件和容器组件
|
|
609
|
+
* @param con
|
|
610
|
+
* @param fieldHandler
|
|
611
|
+
* @param containerHandler
|
|
612
|
+
* @param internalContainerCallFlag 是否需要处理内部容器组件,默认不处理
|
|
613
|
+
* @param staticWidgetsIncluded 是否需要处理静态非表单交互类组件
|
|
614
|
+
*/
|
|
615
|
+
export function traverseWidgetsOfContainer(
|
|
616
|
+
con,
|
|
617
|
+
fieldHandler,
|
|
618
|
+
containerHandler,
|
|
619
|
+
internalContainerCallFlag,
|
|
620
|
+
staticWidgetsIncluded
|
|
621
|
+
) {
|
|
622
|
+
if (con.category === "container") {
|
|
623
|
+
containerHandler(con);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/*loopHandleWidget([con], (cw, parent) => {
|
|
627
|
+
if (con.id !== cw.id) {
|
|
628
|
+
handleContainerTraverse(
|
|
629
|
+
cw,
|
|
630
|
+
fieldHandler,
|
|
631
|
+
containerHandler,
|
|
632
|
+
internalContainerCallFlag,
|
|
633
|
+
staticWidgetsIncluded
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
});*/
|
|
637
|
+
|
|
638
|
+
if (con.type === "grid") {
|
|
639
|
+
con.cols.forEach((col) => {
|
|
640
|
+
if (internalContainerCallFlag) {
|
|
641
|
+
containerHandler(col);
|
|
642
|
+
}
|
|
643
|
+
col.widgetList.forEach((cw) => {
|
|
644
|
+
handleContainerTraverse(
|
|
645
|
+
cw,
|
|
646
|
+
fieldHandler,
|
|
647
|
+
containerHandler,
|
|
648
|
+
internalContainerCallFlag,
|
|
649
|
+
staticWidgetsIncluded
|
|
650
|
+
);
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
} else if (con.type === "table") {
|
|
654
|
+
con.rows.forEach((row) => {
|
|
655
|
+
if (internalContainerCallFlag) {
|
|
656
|
+
containerHandler(row);
|
|
657
|
+
}
|
|
658
|
+
row.cols.forEach((cell) => {
|
|
659
|
+
if (internalContainerCallFlag) {
|
|
660
|
+
containerHandler(cell);
|
|
661
|
+
}
|
|
662
|
+
cell.widgetList.forEach((cw) => {
|
|
663
|
+
handleContainerTraverse(
|
|
664
|
+
cw,
|
|
665
|
+
fieldHandler,
|
|
666
|
+
containerHandler,
|
|
667
|
+
internalContainerCallFlag,
|
|
668
|
+
staticWidgetsIncluded
|
|
669
|
+
);
|
|
670
|
+
});
|
|
671
|
+
});
|
|
672
|
+
});
|
|
673
|
+
} else if (con.type === "tab") {
|
|
674
|
+
con.tabs.forEach((tab) => {
|
|
675
|
+
if (internalContainerCallFlag) {
|
|
676
|
+
containerHandler(tab);
|
|
677
|
+
}
|
|
678
|
+
tab.widgetList.forEach((cw) => {
|
|
679
|
+
handleContainerTraverse(
|
|
680
|
+
cw,
|
|
681
|
+
fieldHandler,
|
|
682
|
+
containerHandler,
|
|
683
|
+
internalContainerCallFlag,
|
|
684
|
+
staticWidgetsIncluded
|
|
685
|
+
);
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
} else if (con.type === "sub-form" || con.type === "grid-sub-form") {
|
|
689
|
+
con.widgetList.forEach((cw) => {
|
|
690
|
+
handleContainerTraverse(
|
|
691
|
+
cw,
|
|
692
|
+
fieldHandler,
|
|
693
|
+
containerHandler,
|
|
694
|
+
internalContainerCallFlag,
|
|
695
|
+
staticWidgetsIncluded
|
|
696
|
+
);
|
|
697
|
+
});
|
|
698
|
+
} else if (con.category === "container") {
|
|
699
|
+
//自定义容器
|
|
700
|
+
let key = itemFieldMap[con.type];
|
|
701
|
+
con[key].forEach((cw) => {
|
|
702
|
+
handleContainerTraverse(
|
|
703
|
+
cw,
|
|
704
|
+
fieldHandler,
|
|
705
|
+
containerHandler,
|
|
706
|
+
internalContainerCallFlag,
|
|
707
|
+
staticWidgetsIncluded
|
|
708
|
+
);
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export function traverseWidgetsOfGridCol(
|
|
714
|
+
gridCol,
|
|
715
|
+
fieldHandler,
|
|
716
|
+
containerHandler
|
|
717
|
+
) {
|
|
718
|
+
// if (gridCol.category === 'container') {
|
|
719
|
+
// containerHandler(gridCol)
|
|
720
|
+
// }
|
|
721
|
+
|
|
722
|
+
if (gridCol.type === "grid-col") {
|
|
723
|
+
gridCol.widgetList.forEach((cw) => {
|
|
724
|
+
handleContainerTraverse(cw, fieldHandler, containerHandler);
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* 获取所有字段组件
|
|
731
|
+
* @param widgetList
|
|
732
|
+
* @param staticWidgetsIncluded 是否包含按钮等静态组件,默认不包含
|
|
733
|
+
* @returns {[]}
|
|
734
|
+
*/
|
|
735
|
+
export function getAllFieldWidgets(widgetList, staticWidgetsIncluded) {
|
|
736
|
+
if (!widgetList) {
|
|
737
|
+
return [];
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
let result = [];
|
|
741
|
+
let handlerFn = (w) => {
|
|
742
|
+
result.push({
|
|
743
|
+
type: w.type,
|
|
744
|
+
name: w.options.name,
|
|
745
|
+
field: w,
|
|
746
|
+
});
|
|
747
|
+
};
|
|
748
|
+
traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);
|
|
749
|
+
|
|
750
|
+
return result;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* 获取所有容器组件
|
|
755
|
+
* @param widgetList
|
|
756
|
+
* @param skipDialogAndDrawer 是否跳过弹窗和抽屉内部组件,默认不跳过
|
|
757
|
+
* @returns {[]}
|
|
758
|
+
*/
|
|
759
|
+
export function getAllContainerWidgets(widgetList, skipDialogAndDrawer) {
|
|
760
|
+
if (!widgetList) {
|
|
761
|
+
return [];
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
let result = [];
|
|
765
|
+
let handlerFn = (w) => {
|
|
766
|
+
result.push({
|
|
767
|
+
type: w.type,
|
|
768
|
+
name: w.options.name,
|
|
769
|
+
container: w,
|
|
770
|
+
});
|
|
771
|
+
};
|
|
772
|
+
traverseContainerWidgets(widgetList, handlerFn, skipDialogAndDrawer);
|
|
773
|
+
|
|
774
|
+
return result;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
export function getFieldWidgetByName(
|
|
778
|
+
widgetList,
|
|
779
|
+
fieldName,
|
|
780
|
+
staticWidgetsIncluded
|
|
781
|
+
) {
|
|
782
|
+
if (!widgetList) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
let foundWidget = null;
|
|
787
|
+
let handlerFn = (widget) => {
|
|
788
|
+
if (widget.options.name === fieldName) {
|
|
789
|
+
foundWidget = widget;
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);
|
|
794
|
+
return foundWidget;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export const columnFormatMap = {
|
|
798
|
+
editInput: "input",
|
|
799
|
+
editNumber: "number",
|
|
800
|
+
editDate: "date",
|
|
801
|
+
editSelect: "select",
|
|
802
|
+
editSearch: "vabsearch",
|
|
803
|
+
editAttachment: "baseAttachment",
|
|
804
|
+
editStatus: "status",
|
|
805
|
+
aText: "a-text",
|
|
806
|
+
aLink: "a-link",
|
|
807
|
+
editDelete: "a-link",
|
|
808
|
+
editButton: "a-link",
|
|
809
|
+
button: "button",
|
|
810
|
+
addSiblingEditRow: "a-link",
|
|
811
|
+
addChildTreeRow: "a-link",
|
|
812
|
+
moveUpRow: "a-link",
|
|
813
|
+
moveDownRow: "a-link",
|
|
814
|
+
removeTreeRow: "a-link",
|
|
815
|
+
text: "text",
|
|
816
|
+
checkbox: "checkbox",
|
|
817
|
+
radio: "radio",
|
|
818
|
+
dropdown: "dropdown",
|
|
819
|
+
textarea: "textarea",
|
|
820
|
+
editScriptInput: "script-input",
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
/** 列 widget 扩展选项:动态列 widgetOptions;设计器静态列 columnOption */
|
|
824
|
+
export function getColumnWidgetOptions(row, isEdit = false) {
|
|
825
|
+
if (!row) {
|
|
826
|
+
return undefined;
|
|
827
|
+
}
|
|
828
|
+
if (isEdit) {
|
|
829
|
+
return row.editWidgetOptions ?? row.editColumnOption;
|
|
830
|
+
}
|
|
831
|
+
return row.widgetOptions ?? row.columnOption;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/** 将列级 label / keyName / required 同步到列内 field widget(动态列 label 在列顶层) */
|
|
835
|
+
export function applyColumnMetaToFieldWidget(fieldWidget, row, isEdit = false) {
|
|
836
|
+
if (!fieldWidget || !row) {
|
|
837
|
+
return fieldWidget;
|
|
838
|
+
}
|
|
839
|
+
const widgetOptions = getColumnWidgetOptions(row, isEdit);
|
|
840
|
+
if (fieldWidget.options.hasOwnProperty("required")) {
|
|
841
|
+
fieldWidget.options.required = !!(row.required || widgetOptions?.required);
|
|
842
|
+
}
|
|
843
|
+
if (!fieldWidget.options.label && row.label) {
|
|
844
|
+
fieldWidget.options.label = row.label;
|
|
845
|
+
}
|
|
846
|
+
if (row.prop) {
|
|
847
|
+
if (fieldWidget.options.hasOwnProperty("keyName")) {
|
|
848
|
+
fieldWidget.options.keyName = row.prop;
|
|
849
|
+
fieldWidget.options.keyNameEnabled = true;
|
|
850
|
+
} else if (!fieldWidget.options.name) {
|
|
851
|
+
fieldWidget.options.name = row.prop;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (fieldWidget.type !== "button" && fieldWidget.type !== "a-link") {
|
|
855
|
+
fieldWidget.options.labelHidden = true;
|
|
856
|
+
}
|
|
857
|
+
return fieldWidget;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/** 同步列 widget / editWidget 的列级元数据(含 labelHidden) */
|
|
861
|
+
export function applyColumnMetaToColumnRow(row) {
|
|
862
|
+
if (!row) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
if (row.widget) {
|
|
866
|
+
applyColumnMetaToFieldWidget(row.widget, row, false);
|
|
867
|
+
}
|
|
868
|
+
if (row.editWidget) {
|
|
869
|
+
applyColumnMetaToFieldWidget(row.editWidget, row, true);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export function getFieldWidgetById(widgetList, fieldId, staticWidgetsIncluded) {
|
|
874
|
+
if (!widgetList) {
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
let foundWidget = null;
|
|
879
|
+
let handlerFn = (widget) => {
|
|
880
|
+
if (widget.id === fieldId) {
|
|
881
|
+
foundWidget = widget;
|
|
882
|
+
} else if (widget.type === "data-table") {
|
|
883
|
+
for (let column of widget.options.tableColumns) {
|
|
884
|
+
if (column?.widget?.id + "" === fieldId) {
|
|
885
|
+
foundWidget = column.widget;
|
|
886
|
+
break;
|
|
887
|
+
} else if (column.widgetList) {
|
|
888
|
+
loopHandleWidget(column.widgetList, (item1) => {
|
|
889
|
+
if (item1.id === fieldId) {
|
|
890
|
+
foundWidget = item1;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
traverseFieldWidgets(widgetList, handlerFn, null, staticWidgetsIncluded);
|
|
899
|
+
return foundWidget;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export function getContainerWidgetByName(widgetList, containerName) {
|
|
903
|
+
if (!widgetList) {
|
|
904
|
+
return null;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
let foundContainer = null;
|
|
908
|
+
let handlerFn = (con) => {
|
|
909
|
+
if (con.options.name === containerName) {
|
|
910
|
+
foundContainer = con;
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
traverseContainerWidgets(widgetList, handlerFn);
|
|
915
|
+
return foundContainer;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export function getContainerWidgetById(widgetList, containerId) {
|
|
919
|
+
if (!widgetList) {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
let foundContainer = null;
|
|
924
|
+
let handlerFn = (con) => {
|
|
925
|
+
if (con.id === containerId) {
|
|
926
|
+
foundContainer = con;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
traverseContainerWidgets(widgetList, handlerFn);
|
|
931
|
+
return foundContainer;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export function copyToClipboard(
|
|
935
|
+
content,
|
|
936
|
+
clickEvent,
|
|
937
|
+
$message,
|
|
938
|
+
successMsg,
|
|
939
|
+
errorMsg
|
|
940
|
+
) {
|
|
941
|
+
const clipboard = new Clipboard(clickEvent.target, {
|
|
942
|
+
text: () => content,
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
clipboard.on("success", () => {
|
|
946
|
+
$message.success(successMsg);
|
|
947
|
+
clipboard.destroy();
|
|
948
|
+
});
|
|
949
|
+
|
|
950
|
+
clipboard.on("error", () => {
|
|
951
|
+
$message.error(errorMsg);
|
|
952
|
+
clipboard.destroy();
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
clipboard.onClick(clickEvent);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export function getQueryParam(variable) {
|
|
959
|
+
let query = window.location.search.substring(1);
|
|
960
|
+
let vars = query.split("&");
|
|
961
|
+
for (let i = 0; i < vars.length; i++) {
|
|
962
|
+
let pair = vars[i].split("=");
|
|
963
|
+
if (pair[0] === variable) {
|
|
964
|
+
return pair[1];
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return undefined;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export function getDefaultFormConfig() {
|
|
972
|
+
return {
|
|
973
|
+
modelName: "formData",
|
|
974
|
+
refName: "vForm",
|
|
975
|
+
rulesName: "rules",
|
|
976
|
+
labelWidth: 80,
|
|
977
|
+
labelPosition: "left",
|
|
978
|
+
size: "",
|
|
979
|
+
labelAlign: "label-right-align",
|
|
980
|
+
cssCode: "",
|
|
981
|
+
customClass: "",
|
|
982
|
+
functions: "",
|
|
983
|
+
layoutType: "PC",
|
|
984
|
+
dataSources: [],
|
|
985
|
+
onBeforeCreated: "",
|
|
986
|
+
onFormCreated: "",
|
|
987
|
+
onFormBeforeMounted: "",
|
|
988
|
+
onFormMounted: "",
|
|
989
|
+
onFormDataChange: "",
|
|
990
|
+
gridConfig: {
|
|
991
|
+
accessReturnType: 1,
|
|
992
|
+
isLoadDataByAccess: false,
|
|
993
|
+
},
|
|
994
|
+
getConfig: {
|
|
995
|
+
accessType: "1",
|
|
996
|
+
accessUrl: null,
|
|
997
|
+
accessParam: null,
|
|
998
|
+
accessCallback: null,
|
|
999
|
+
scriptName: null,
|
|
1000
|
+
scriptCode: null,
|
|
1001
|
+
},
|
|
1002
|
+
saveConfig: {
|
|
1003
|
+
accessType: "1",
|
|
1004
|
+
accessUrl: null,
|
|
1005
|
+
accessParam: null,
|
|
1006
|
+
accessCallback: null,
|
|
1007
|
+
scriptName: null,
|
|
1008
|
+
scriptCode: null,
|
|
1009
|
+
},
|
|
1010
|
+
scriptList: [],
|
|
1011
|
+
formType: 0,
|
|
1012
|
+
entityTableCode: null,
|
|
1013
|
+
entityTableDesc: null,
|
|
1014
|
+
editFormCode: null,
|
|
1015
|
+
editFormName: null,
|
|
1016
|
+
searchDialogNameField: null,
|
|
1017
|
+
searchDialogUniqueField: null,
|
|
1018
|
+
entity: null,
|
|
1019
|
+
wfEnabled: false,
|
|
1020
|
+
isLoadEntity: false,
|
|
1021
|
+
formScriptCode: "getOne",
|
|
1022
|
+
formScriptParam: null,
|
|
1023
|
+
formScriptSuccess: null,
|
|
1024
|
+
saveScriptCode: "saveUpdate",
|
|
1025
|
+
wfConfig: null,
|
|
1026
|
+
wfStartBindSave: false,
|
|
1027
|
+
wfAgreenBindSave: false,
|
|
1028
|
+
wfAgreeConfigData: [],
|
|
1029
|
+
wfConfigDataEnabled: false,
|
|
1030
|
+
wfConfigData: [],
|
|
1031
|
+
multiTabEnabled: false,
|
|
1032
|
+
multiTabLabelField: null,
|
|
1033
|
+
addTabEnabled: false, // 新增打开独立页签(不走「常规」页签)
|
|
1034
|
+
submitBehavior: "refreshCurrent", // 提交后行为: refreshCurrent(默认,留在详情页) | closeToList
|
|
1035
|
+
billNavEnabled: false, // 详情页签显示「上一单/下一单」翻单按钮
|
|
1036
|
+
addFormCode: null,
|
|
1037
|
+
addFormName: null,
|
|
1038
|
+
wfTheme: null,
|
|
1039
|
+
otherTabEnabled: false,
|
|
1040
|
+
otherTabList: [],
|
|
1041
|
+
hideNormalTab: false,
|
|
1042
|
+
customListTabLabel: null,
|
|
1043
|
+
globalConfig: null,
|
|
1044
|
+
// 表单级动态字段规则:按本地规则/后台脚本动态控制整个表单内任意字段/容器的显隐/必填/只读/禁用/取值
|
|
1045
|
+
dynamicFieldEnabled: false,
|
|
1046
|
+
dynamicFieldSourceType: "local",
|
|
1047
|
+
dynamicFieldRules: [],
|
|
1048
|
+
dynamicFieldScriptCode: null,
|
|
1049
|
+
dynamicFieldScriptParam: null,
|
|
1050
|
+
dynamicFieldTriggerFields: [],
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
export function buildDefaultFormJson() {
|
|
1055
|
+
return {
|
|
1056
|
+
widgetList: [],
|
|
1057
|
+
formConfig: deepClone(getDefaultFormConfig()),
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
export function cloneFormConfigWithoutEventHandler(e) {
|
|
1062
|
+
var t = deepClone(e);
|
|
1063
|
+
return (
|
|
1064
|
+
(t.onFormCreated = ""),
|
|
1065
|
+
(t.onFormBeforeMounted = ""),
|
|
1066
|
+
(t.onFormMounted = ""),
|
|
1067
|
+
(t.onFormDataChange = ""),
|
|
1068
|
+
t
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
export function translateOptionItems(rawData, widgetType, labelKey, valueKey) {
|
|
1073
|
+
if (widgetType === "cascader") {
|
|
1074
|
+
// 级联选择不转译
|
|
1075
|
+
return deepClone(rawData);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
let result = [];
|
|
1079
|
+
if (!!rawData && rawData.length > 0) {
|
|
1080
|
+
result = deepClone(rawData);
|
|
1081
|
+
result.forEach((ri) => {
|
|
1082
|
+
ri[labelKey] = ri[labelKey] ?? null;
|
|
1083
|
+
ri[valueKey] = ri[valueKey] ?? null;
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
return result;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export function assembleAxiosConfig(arrayObj, DSV, VFR) {
|
|
1091
|
+
var result = {};
|
|
1092
|
+
if (arrayObj && arrayObj.length) {
|
|
1093
|
+
arrayObj.map(function (ai) {
|
|
1094
|
+
if ("String" === ai.type) {
|
|
1095
|
+
result[ai.name] = String(ai.value);
|
|
1096
|
+
} else if ("Number" === ai.type) {
|
|
1097
|
+
result[ai.name] = Number(ai.value);
|
|
1098
|
+
} else if ("Boolean" === ai.type) {
|
|
1099
|
+
"false" === ai.value.toLowerCase() || "0" === ai.value
|
|
1100
|
+
? (result[ai.name] = !1)
|
|
1101
|
+
: "true" === ai.value.toLowerCase() || "1" === ai.value
|
|
1102
|
+
? (result[ai.name] = !0)
|
|
1103
|
+
: (result[ai.name] = null);
|
|
1104
|
+
} else if ("Variable" === ai.type) {
|
|
1105
|
+
result[ai.name] = eval(ai.value);
|
|
1106
|
+
} else if ("FormData" === ai.type) {
|
|
1107
|
+
if (VFR.formDataModel.hasOwnProperty(ai.value)) {
|
|
1108
|
+
result[ai.name] = VFR.formDataModel[ai.value];
|
|
1109
|
+
} else {
|
|
1110
|
+
let parentForm = VFR.parentForm;
|
|
1111
|
+
if (parentForm && parentForm.formDataModel.hasOwnProperty(ai.value)) {
|
|
1112
|
+
result[ai.name] = parentForm.formDataModel[ai.value];
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
return result;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export function buildRequestConfig(dataSource, DSV, VFR, isSandbox) {
|
|
1122
|
+
var config = {};
|
|
1123
|
+
/* "String" === dataSource.requestaccessType ? config.url = dataSource.requestURL : config.url = eval(dataSource
|
|
1124
|
+
.requestURL), */
|
|
1125
|
+
let requestAccess = DSV.requestAccess;
|
|
1126
|
+
// config.url = dataSource.requestURL;
|
|
1127
|
+
config.url = getAccessUrl();
|
|
1128
|
+
(config.method = dataSource.requestMethod || "post"),
|
|
1129
|
+
(config.headers = assembleAxiosConfig(dataSource.headers, DSV, VFR)),
|
|
1130
|
+
(config.params = assembleAxiosConfig(dataSource.params, DSV, VFR));
|
|
1131
|
+
// config.data = assembleAxiosConfig(dataSource.data, DSV, VFR);
|
|
1132
|
+
let data = {};
|
|
1133
|
+
let conditions = assembleAxiosConfig(dataSource.data, DSV, VFR);
|
|
1134
|
+
|
|
1135
|
+
let globalReqData = getReportGlobalMap(); //全局请求参数
|
|
1136
|
+
Object.assign(conditions, globalReqData);
|
|
1137
|
+
|
|
1138
|
+
let doms = VFR.getWidgetRef(DSV.widgetName);
|
|
1139
|
+
let extraAccessData = doms.extraAccessData || {};
|
|
1140
|
+
|
|
1141
|
+
data.accessCode = requestAccess.accessCode;
|
|
1142
|
+
data.conditions = conditions;
|
|
1143
|
+
Object.assign(data.conditions, extraAccessData);
|
|
1144
|
+
|
|
1145
|
+
config.data = data;
|
|
1146
|
+
var chFn = new Function(
|
|
1147
|
+
"config",
|
|
1148
|
+
"isSandbox",
|
|
1149
|
+
"DSV",
|
|
1150
|
+
"VFR",
|
|
1151
|
+
dataSource.configHandlerCode
|
|
1152
|
+
);
|
|
1153
|
+
return chFn.call(null, config, isSandbox, DSV, VFR);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export function runDataSourceRequest(e, t, i, n, o) {
|
|
1157
|
+
return _runDataSourceRequest.apply(this, arguments);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
export function _runDataSourceRequest() {
|
|
1161
|
+
let _runDataSourceRequestN = function (t, i, n, o, a) {
|
|
1162
|
+
var l, s, r, d;
|
|
1163
|
+
(l = buildRequestConfig(t, i, n, o)),
|
|
1164
|
+
(r = new Function(
|
|
1165
|
+
"result",
|
|
1166
|
+
"isSandbox",
|
|
1167
|
+
"DSV",
|
|
1168
|
+
"VFR",
|
|
1169
|
+
t.dataHandlerCode
|
|
1170
|
+
)),
|
|
1171
|
+
(d = new Function(
|
|
1172
|
+
"error",
|
|
1173
|
+
"isSandbox",
|
|
1174
|
+
"DSV",
|
|
1175
|
+
"$message",
|
|
1176
|
+
"VFR",
|
|
1177
|
+
t.errorHandlerCode
|
|
1178
|
+
));
|
|
1179
|
+
|
|
1180
|
+
return new Promise((resolve, reject) => {
|
|
1181
|
+
request({
|
|
1182
|
+
...l,
|
|
1183
|
+
callback: (res) => {
|
|
1184
|
+
resolve(r.call(null, res, o, i, n));
|
|
1185
|
+
},
|
|
1186
|
+
error: (error) => {
|
|
1187
|
+
d.call(null, error, o, i, a, n);
|
|
1188
|
+
reject(error);
|
|
1189
|
+
},
|
|
1190
|
+
});
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
return _runDataSourceRequestN.apply(this, arguments);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
export function getDSByName(e, t) {
|
|
1197
|
+
var i = null;
|
|
1198
|
+
return (
|
|
1199
|
+
t &&
|
|
1200
|
+
e.dataSources &&
|
|
1201
|
+
e.dataSources.forEach(function (e) {
|
|
1202
|
+
e.uniqueName === t && (i = e);
|
|
1203
|
+
}),
|
|
1204
|
+
i
|
|
1205
|
+
);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
export function setReportGlobalParam(value) {
|
|
1209
|
+
sessionStorage.setItem("reportGlobalParam", value);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
export function getReportGlobalMap() {
|
|
1213
|
+
let param = sessionStorage.getItem("reportGlobalParam");
|
|
1214
|
+
if (param) {
|
|
1215
|
+
let globalReqData = JSON.parse(decode(param));
|
|
1216
|
+
return globalReqData;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
export function getSubFormNameByFieldId(o, e) {
|
|
1221
|
+
let n = null;
|
|
1222
|
+
return (
|
|
1223
|
+
getAllContainerWidgets(o).forEach((s) => {
|
|
1224
|
+
const c = (u) => {
|
|
1225
|
+
u.id === e && (n = s.name);
|
|
1226
|
+
};
|
|
1227
|
+
(s.type === "sub-form" || s.type === "grid-sub-form") &&
|
|
1228
|
+
traverseFieldWidgetsOfContainer(s.container, c);
|
|
1229
|
+
}),
|
|
1230
|
+
n
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
export const FORMULA_REG_EXP = /\{\{(\w+\.[^.]+\.\w+)}}/g;
|
|
1235
|
+
|
|
1236
|
+
export function fieldIsUsedInFormula(o, e, n) {
|
|
1237
|
+
const l = e.match(FORMULA_REG_EXP);
|
|
1238
|
+
if (!l) return !1;
|
|
1239
|
+
let s = !1;
|
|
1240
|
+
return (
|
|
1241
|
+
l.forEach((c) => {
|
|
1242
|
+
const u = c.split(".")[2];
|
|
1243
|
+
if (u.substring(0, u.length - 2) === "func") return;
|
|
1244
|
+
const g = c.split(".")[0],
|
|
1245
|
+
y = g.substring(2, g.length);
|
|
1246
|
+
getFieldWidgetById(n.formJsonObj.widgetList, y, !1).options.name === o &&
|
|
1247
|
+
(s = !0);
|
|
1248
|
+
}),
|
|
1249
|
+
s
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export function calculateFormula(o, e, n, l, s) {
|
|
1254
|
+
if (
|
|
1255
|
+
!!l.subFormItemFlag &&
|
|
1256
|
+
!!s.subFormItemFlag &&
|
|
1257
|
+
s.subFormRowId !== l.subFormRowId
|
|
1258
|
+
)
|
|
1259
|
+
return;
|
|
1260
|
+
let c = l.field.options.formula;
|
|
1261
|
+
c = replaceFieldsAndFunctionsOfFormula(o, l);
|
|
1262
|
+
const u = c.match(/[A-Za-z]*/g);
|
|
1263
|
+
u &&
|
|
1264
|
+
u.forEach((g) => {
|
|
1265
|
+
if (!!g && findCalFunStartIndex(g) !== -1) {
|
|
1266
|
+
const y = g.toUpperCase();
|
|
1267
|
+
c = c.replace(g, "formulaJs." + y);
|
|
1268
|
+
}
|
|
1269
|
+
}),
|
|
1270
|
+
console.log("formula: ", c),
|
|
1271
|
+
console.log("formulaFieldRef: ", l);
|
|
1272
|
+
const $ = evalFn(c, e, o, n);
|
|
1273
|
+
l.setValue($);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
export function replaceFieldsAndFunctionsOfFormula(o, e) {
|
|
1277
|
+
let n = e.field.options.formula;
|
|
1278
|
+
const l = n.match(FORMULA_REG_EXP);
|
|
1279
|
+
if (!l) return n;
|
|
1280
|
+
let s = n;
|
|
1281
|
+
return (
|
|
1282
|
+
l.forEach((c) => {
|
|
1283
|
+
const u = c.split(".")[2];
|
|
1284
|
+
if (u.substring(0, u.length - 2) === "func") {
|
|
1285
|
+
const v = c.split(".")[1];
|
|
1286
|
+
s = s.replace(c, v);
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
const g = c.split(".")[0],
|
|
1290
|
+
y = g.substring(2, g.length),
|
|
1291
|
+
f = getFieldWidgetById(o.formJsonObj.widgetList, y, !1);
|
|
1292
|
+
if (f) {
|
|
1293
|
+
let v = o.getWidgetRef(f.options.name);
|
|
1294
|
+
if (v) s = s.replace(c, v.getValue());
|
|
1295
|
+
else {
|
|
1296
|
+
const w = o.getSubFormNameOfWidget(f.options.name);
|
|
1297
|
+
if (e.subFormItemFlag)
|
|
1298
|
+
w === e.subFormName
|
|
1299
|
+
? ((v = o.getWidgetRef(f.options.name + "@row" + e.subFormRowId)),
|
|
1300
|
+
v && (s = s.replaceAll(c, v.getValue())))
|
|
1301
|
+
: console.error("Invalid formula!");
|
|
1302
|
+
else {
|
|
1303
|
+
const _ = o.formDataModel[w];
|
|
1304
|
+
let O = "";
|
|
1305
|
+
const S = f.options.name;
|
|
1306
|
+
_.forEach((x, E) => {
|
|
1307
|
+
O = E === 0 ? x[S] : O + ", " + x[S];
|
|
1308
|
+
}),
|
|
1309
|
+
(s = s.replaceAll(c, O));
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}),
|
|
1314
|
+
s
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
export function findCalFunStartIndex(o) {
|
|
1319
|
+
let e = -1;
|
|
1320
|
+
for (let n = 0; n < FORMULA_JS_FUNCTIONS.length; n++) {
|
|
1321
|
+
let l = o.indexOf(FORMULA_JS_FUNCTIONS[n]);
|
|
1322
|
+
if (l !== -1) return l;
|
|
1323
|
+
}
|
|
1324
|
+
return e;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
export const FORMULA_JS_FUNCTIONS = [
|
|
1328
|
+
"INT",
|
|
1329
|
+
"SUM",
|
|
1330
|
+
"AVERAGE",
|
|
1331
|
+
"MAX",
|
|
1332
|
+
"MIN",
|
|
1333
|
+
"ABS",
|
|
1334
|
+
"ROUND",
|
|
1335
|
+
"CEILING",
|
|
1336
|
+
"LOG",
|
|
1337
|
+
"MOD",
|
|
1338
|
+
"POWER",
|
|
1339
|
+
"AND",
|
|
1340
|
+
"IF",
|
|
1341
|
+
"IFS",
|
|
1342
|
+
"IFERROR",
|
|
1343
|
+
"IFNA",
|
|
1344
|
+
"NOT",
|
|
1345
|
+
"OR",
|
|
1346
|
+
"SWITCH",
|
|
1347
|
+
"XOR",
|
|
1348
|
+
"YEAR",
|
|
1349
|
+
"MONTH",
|
|
1350
|
+
"DAY",
|
|
1351
|
+
"TODAY",
|
|
1352
|
+
"NOW",
|
|
1353
|
+
"EMONTH",
|
|
1354
|
+
"EDAY",
|
|
1355
|
+
"FIND",
|
|
1356
|
+
"LEFT",
|
|
1357
|
+
"RIGHT",
|
|
1358
|
+
"LEN",
|
|
1359
|
+
"LOWER",
|
|
1360
|
+
"UPPER",
|
|
1361
|
+
"MID",
|
|
1362
|
+
"TRIM",
|
|
1363
|
+
],
|
|
1364
|
+
formulas = [
|
|
1365
|
+
{
|
|
1366
|
+
fClass: "designer.hint.formulaFunctionMaths",
|
|
1367
|
+
flist: [
|
|
1368
|
+
{
|
|
1369
|
+
fName: "INT",
|
|
1370
|
+
fType: "designer.hint.formulaNumber",
|
|
1371
|
+
fIntro: "designer.hint.formulaINT",
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
fName: "SUM",
|
|
1375
|
+
fType: "designer.hint.formulaNumber",
|
|
1376
|
+
fIntro: "designer.hint.formulaSUM",
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
fName: "AVERAGE",
|
|
1380
|
+
fType: "designer.hint.formulaNumber",
|
|
1381
|
+
fIntro: "designer.hint.formulaAVERAGE",
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
fName: "MAX",
|
|
1385
|
+
fType: "designer.hint.formulaNumber",
|
|
1386
|
+
fIntro: "designer.hint.formulaMAX",
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
fName: "MIN",
|
|
1390
|
+
fType: "designer.hint.formulaNumber",
|
|
1391
|
+
fIntro: "designer.hint.formulaMIN",
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
fName: "ABS",
|
|
1395
|
+
fType: "designer.hint.formulaNumber",
|
|
1396
|
+
fIntro: "designer.hint.formulaABS",
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
fName: "ROUND",
|
|
1400
|
+
fType: "designer.hint.formulaNumber",
|
|
1401
|
+
fIntro: "designer.hint.formulaROUND",
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
fName: "CEILING",
|
|
1405
|
+
fType: "designer.hint.formulaNumber",
|
|
1406
|
+
fIntro: "designer.hint.formulaCEILING",
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
fName: "LOG",
|
|
1410
|
+
fType: "designer.hint.formulaNumber",
|
|
1411
|
+
fIntro: "designer.hint.formulaLOG",
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
fName: "MOD",
|
|
1415
|
+
fType: "designer.hint.formulaNumber",
|
|
1416
|
+
fIntro: "designer.hint.formulaMOD",
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
fName: "POWER",
|
|
1420
|
+
fType: "designer.hint.formulaNumber",
|
|
1421
|
+
fIntro: "designer.hint.formulaPOWER",
|
|
1422
|
+
},
|
|
1423
|
+
],
|
|
1424
|
+
},
|
|
1425
|
+
];
|
|
1426
|
+
|
|
1427
|
+
export function evalFn(o, e = null, n = null, l = null) {
|
|
1428
|
+
return new Function("DSV", "VFR", "LS", "formulaJs", "return " + o)(
|
|
1429
|
+
e,
|
|
1430
|
+
n,
|
|
1431
|
+
localStorage,
|
|
1432
|
+
l
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
export function trimEx(o, e, n) {
|
|
1437
|
+
return e
|
|
1438
|
+
? n === "left"
|
|
1439
|
+
? o.replace(new RegExp("^%%" + e + "+", "g"), "")
|
|
1440
|
+
: n === "right"
|
|
1441
|
+
? o.replace(new RegExp("%%" + e + "+$", "g"), "")
|
|
1442
|
+
: o.replace(new RegExp("^%%" + e + "+|%%" + e + "+$", "g"), "")
|
|
1443
|
+
: o.replace(/^%s+|%s+$/g, "");
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export function hasPropertyOfObject(o, e) {
|
|
1447
|
+
const n = e.split(".");
|
|
1448
|
+
let l = o,
|
|
1449
|
+
s = !0;
|
|
1450
|
+
for (const c of n)
|
|
1451
|
+
if (l.hasOwnProperty(c)) l = l[c];
|
|
1452
|
+
else {
|
|
1453
|
+
s = !1;
|
|
1454
|
+
break;
|
|
1455
|
+
}
|
|
1456
|
+
return s;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
export function objectKeysToArray(o) {
|
|
1460
|
+
if (!o) return [];
|
|
1461
|
+
const e = [];
|
|
1462
|
+
return (
|
|
1463
|
+
Object.keys(o).forEach((n) => {
|
|
1464
|
+
e.push(n);
|
|
1465
|
+
}),
|
|
1466
|
+
e
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
//begin
|
|
1471
|
+
export function loopHandleWidget(widgetList, callback) {
|
|
1472
|
+
widgetList &&
|
|
1473
|
+
widgetList.length > 0 &&
|
|
1474
|
+
widgetList.forEach(function (e) {
|
|
1475
|
+
loopHandleWidgetItem(e, null, callback);
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
function loopHandleWidgetItem(e, p, callback) {
|
|
1480
|
+
if ("container" === e.category) {
|
|
1481
|
+
callback(e, p);
|
|
1482
|
+
if ("vf-dialog" === e.type || "vf-drawer" === e.type);
|
|
1483
|
+
else if ("data-table" === e.type) {
|
|
1484
|
+
if (!!e.widgetList) {
|
|
1485
|
+
e.widgetList.forEach((childItem) => {
|
|
1486
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
if (!!e.buttons) {
|
|
1490
|
+
e.buttons.forEach((childItem) => {
|
|
1491
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
} else if ("list-h5" === e.type) {
|
|
1495
|
+
if (!!e.widgetList && e.widgetList.length > 0) {
|
|
1496
|
+
e.widgetList.forEach((childItem) => {
|
|
1497
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
} else if ("grid" === e.type) {
|
|
1501
|
+
e.cols &&
|
|
1502
|
+
e.cols.length > 0 &&
|
|
1503
|
+
e.cols.forEach(function (childItem) {
|
|
1504
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1505
|
+
});
|
|
1506
|
+
} else if ("table" === e.type) {
|
|
1507
|
+
e.rows &&
|
|
1508
|
+
e.rows.length > 0 &&
|
|
1509
|
+
e.rows.forEach(function (rowItem) {
|
|
1510
|
+
rowItem.cols &&
|
|
1511
|
+
rowItem.cols.length > 0 &&
|
|
1512
|
+
rowItem.cols.forEach(function (childItem) {
|
|
1513
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1514
|
+
});
|
|
1515
|
+
});
|
|
1516
|
+
} else if ("h5-table" === e.type) {
|
|
1517
|
+
e.rows &&
|
|
1518
|
+
e.rows.length > 0 &&
|
|
1519
|
+
e.rows.forEach(function (rowItem) {
|
|
1520
|
+
rowItem.cols &&
|
|
1521
|
+
rowItem.cols.length > 0 &&
|
|
1522
|
+
rowItem.cols.forEach(function (childItem) {
|
|
1523
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1524
|
+
});
|
|
1525
|
+
});
|
|
1526
|
+
} else if ("tab" === e.type) {
|
|
1527
|
+
e.tabs &&
|
|
1528
|
+
e.tabs.length > 0 &&
|
|
1529
|
+
e.tabs.forEach(function (tabItem) {
|
|
1530
|
+
tabItem.widgetList &&
|
|
1531
|
+
tabItem.widgetList.length > 0 &&
|
|
1532
|
+
tabItem.widgetList.forEach(function (childItem) {
|
|
1533
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1534
|
+
});
|
|
1535
|
+
});
|
|
1536
|
+
} else if ("detail" === e.type) {
|
|
1537
|
+
if (e.panes) {
|
|
1538
|
+
e.panes.forEach(function (childItem) {
|
|
1539
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
if (e.widgetList) {
|
|
1543
|
+
e.widgetList.forEach(function (childItem) {
|
|
1544
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
} else if ("detail-pane" === e.type) {
|
|
1548
|
+
if (e.widgetList) {
|
|
1549
|
+
e.widgetList.forEach(function (childItem) {
|
|
1550
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
if (e.buttonWidgetList) {
|
|
1554
|
+
e.buttonWidgetList.forEach(function (childItem) {
|
|
1555
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
} else {
|
|
1559
|
+
"grid-col" === e.type || e.type,
|
|
1560
|
+
e.widgetList &&
|
|
1561
|
+
e.widgetList.length > 0 &&
|
|
1562
|
+
e.widgetList.forEach(function (childItem) {
|
|
1563
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
} else {
|
|
1567
|
+
callback && callback(e);
|
|
1568
|
+
if (e.widgetList) {
|
|
1569
|
+
e.widgetList.forEach(function (childItem) {
|
|
1570
|
+
loopHandleWidgetItem(childItem, e, callback);
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
//end
|
|
1577
|
+
|
|
1578
|
+
export function trim(value) {
|
|
1579
|
+
if (isNull(value)) return value;
|
|
1580
|
+
if (value.trim) {
|
|
1581
|
+
return value.trim();
|
|
1582
|
+
} else {
|
|
1583
|
+
return value;
|
|
1584
|
+
}
|
|
1585
|
+
}
|