cloud-web-corejs 1.0.79 → 1.0.81
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 +1 -1
- package/src/components/baseAttachment/index.vue +22 -13
- package/src/components/baseAttachment/mixins.js +1 -1
- package/src/components/fileLibrary/fileObjAuthEditDialog.vue +6 -0
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +328 -203
- package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +27 -23
- package/src/components/table/CellSlot.vue +1 -0
- package/src/components/table/vxeFilter/mixin.js +1 -1
- package/src/components/vb-tabs/x-tabs.vue +3 -2
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +15 -3
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +5 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +2 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +17 -6
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +28 -3
- package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +5 -2
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +138 -6
- package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +4 -7
- package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +80 -0
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +5 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +46 -34
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +6 -0
- package/src/components/xform/form-designer/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +8 -0
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +6 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +125 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +3 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +415 -354
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +7 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +16 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +80 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +30 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +170 -20
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/toolbar-panel/index.vue +0 -4
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +133 -108
- package/src/components/xform/form-render/container-item/containerItemMixin.js +1 -1
- package/src/components/xform/form-render/container-item/data-table-item.vue +43 -21
- package/src/components/xform/form-render/container-item/data-table-mixin.js +3 -3
- package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
- package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +11 -6
- package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
- package/src/components/xform/form-render/container-item/table-item.vue +4 -2
- package/src/components/xform/form-render/indexMixin.js +1 -1
- package/src/components/xform/lang/zh-CN.js +1 -0
- package/src/components/xform/mixins/defaultHandle.js +1 -1
- package/src/components/xform/mixins/scriptHttp.js +3 -1
- package/src/components/xform/utils/util.js +1 -1
- package/src/store/modules/permission.js +1 -1
- package/src/views/bd/setting/table_model/edit.vue +835 -484
- package/src/views/bd/setting/table_model/mixins/edit.js +3 -3
- package/src/views/user/form/vform/designer.vue +772 -753
- package/src/views/user/form/view/list.vue +27 -9
@@ -1,753 +1,772 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<!-- <el-button type="primary" @click="test">Submit</el-button> -->
|
4
|
-
<div class="designer-box" id="containt" style="margin-bottom: 0;">
|
5
|
-
<v-form-designer
|
6
|
-
ref="designer"
|
7
|
-
:reportTemplate.sync="reportTemplate"
|
8
|
-
:designer-config="designerConfig"
|
9
|
-
:field-list-data="fieldListData"
|
10
|
-
@field-widget-used="handleFWU"
|
11
|
-
@field-widget-removed="handleFWR"
|
12
|
-
@form-json-updated="handleFJU"
|
13
|
-
@reflushTemplateList="reflushTemplateList"
|
14
|
-
v-if="showDesinger"
|
15
|
-
:readonly="readonly"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
loadExtension
|
30
|
-
|
31
|
-
|
32
|
-
import
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
this
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
this.
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
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
|
-
"
|
155
|
-
"
|
156
|
-
|
157
|
-
"
|
158
|
-
|
159
|
-
"
|
160
|
-
"
|
161
|
-
"
|
162
|
-
|
163
|
-
"
|
164
|
-
|
165
|
-
"
|
166
|
-
"
|
167
|
-
"
|
168
|
-
|
169
|
-
|
170
|
-
"name": "
|
171
|
-
"label": "
|
172
|
-
"type": "
|
173
|
-
"required": "1"
|
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
|
-
"type": "
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
"label": "
|
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
|
-
|
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
|
-
"name": "
|
274
|
-
"label": "
|
275
|
-
"type": "
|
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
|
-
"name": "
|
338
|
-
"label": "
|
339
|
-
"type": "
|
340
|
-
"required": "
|
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
|
-
|
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
|
-
"label": "
|
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
|
-
|
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
|
-
|
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
|
-
if (
|
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
|
-
this.$
|
740
|
-
|
741
|
-
|
742
|
-
};
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
}
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
}
|
753
|
-
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<!-- <el-button type="primary" @click="test">Submit</el-button> -->
|
4
|
+
<div class="designer-box" id="containt" style="margin-bottom: 0;">
|
5
|
+
<v-form-designer
|
6
|
+
ref="designer"
|
7
|
+
:reportTemplate.sync="reportTemplate"
|
8
|
+
:designer-config="designerConfig"
|
9
|
+
:field-list-data="fieldListData"
|
10
|
+
@field-widget-used="handleFWU"
|
11
|
+
@field-widget-removed="handleFWR"
|
12
|
+
@form-json-updated="handleFJU"
|
13
|
+
@reflushTemplateList="reflushTemplateList"
|
14
|
+
v-if="showDesinger"
|
15
|
+
:readonly="readonly"
|
16
|
+
:columnFlag="columnFlag"
|
17
|
+
@customConfirm="customConfirm"
|
18
|
+
/>
|
19
|
+
</div><!--
|
20
|
+
<el-tabs v-model="activeName" class="tab-boxCard tabCard-sty1" v-if="showDesinger">
|
21
|
+
<el-tab-pane label="设计器" name="first">
|
22
|
+
|
23
|
+
</el-tab-pane>
|
24
|
+
</el-tabs> -->
|
25
|
+
</div>
|
26
|
+
</template>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
import {loadExtension} from '@base/components/xform/extension/extension-loader'
|
30
|
+
|
31
|
+
loadExtension()
|
32
|
+
import VFormDesigner from '@base/components/xform/form-designer/index.vue'
|
33
|
+
import {deepClone, overwriteObj} from "@base/components/xform/utils/util";
|
34
|
+
import {formFieldMapping} from "./formFieldMapping";
|
35
|
+
|
36
|
+
export default {
|
37
|
+
name: 'vform-designer:edit',
|
38
|
+
props: {
|
39
|
+
formCode: String,
|
40
|
+
readonly: Boolean,
|
41
|
+
formTemplate: Object,
|
42
|
+
widgetList: Array,
|
43
|
+
columnFlag: Boolean,
|
44
|
+
},
|
45
|
+
components: {
|
46
|
+
VFormDesigner
|
47
|
+
},
|
48
|
+
data() {
|
49
|
+
return {
|
50
|
+
formJson: {},
|
51
|
+
formData: {},
|
52
|
+
optionData: {},
|
53
|
+
reportTemplate: {},
|
54
|
+
showDesinger: false,
|
55
|
+
activeName: 'first',
|
56
|
+
showRequestaccessList: false,
|
57
|
+
showFunctionScriptList: false,
|
58
|
+
designerConfig: {
|
59
|
+
componentLib: false,
|
60
|
+
formTemplates: false,
|
61
|
+
eventCollapse: true,
|
62
|
+
metadataLib: true,
|
63
|
+
logoHeader: false,
|
64
|
+
exportCodeButton: false,
|
65
|
+
generateSFCButton: false,
|
66
|
+
toolbarMaxWidth: 300,
|
67
|
+
},
|
68
|
+
fieldListData: {},
|
69
|
+
layoutId: null,
|
70
|
+
formOptionData: {},
|
71
|
+
|
72
|
+
meteFieldsResult: null,
|
73
|
+
usedFieldNames: {},
|
74
|
+
entity: null,
|
75
|
+
entityLabel: null
|
76
|
+
};
|
77
|
+
},
|
78
|
+
computed: {},
|
79
|
+
watch: {
|
80
|
+
activeName(val) {
|
81
|
+
if (this.showRequestaccessList === false && val == "second") {
|
82
|
+
this.showRequestaccessList = true;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
mounted() {
|
87
|
+
this.getTemplate();
|
88
|
+
},
|
89
|
+
methods: {
|
90
|
+
test() {
|
91
|
+
let that = this;
|
92
|
+
let designer = this.$refs.designer;
|
93
|
+
let json = designer.getFormJson();
|
94
|
+
designer.setFormJson(this.formJson);
|
95
|
+
},
|
96
|
+
getTemplate() {
|
97
|
+
/* this.showDesinger = true;
|
98
|
+
return */
|
99
|
+
if (this.columnFlag) {
|
100
|
+
this.reportTemplate = this.formTemplate;
|
101
|
+
this.showDesinger = true;
|
102
|
+
this.$nextTick(() => {
|
103
|
+
let formJson = this.$baseLodash.cloneDeep({
|
104
|
+
widgetList: this.widgetList
|
105
|
+
});
|
106
|
+
this.$refs.designer.setFormJson(formJson);
|
107
|
+
})
|
108
|
+
return
|
109
|
+
}
|
110
|
+
this.$http({
|
111
|
+
aes: true,
|
112
|
+
url: USER_PREFIX + `/formTemplate/getByFormCode`,
|
113
|
+
method: `post`,
|
114
|
+
data: {
|
115
|
+
stringOne: this.formCode
|
116
|
+
},
|
117
|
+
isLoading: true,
|
118
|
+
modalStrictly: true,
|
119
|
+
success: res => {
|
120
|
+
let reportTemplate = res.objx || {};
|
121
|
+
this.reportTemplate = reportTemplate;
|
122
|
+
this.showDesinger = true;
|
123
|
+
this.$nextTick(() => {
|
124
|
+
this.$refs.designer.setFormJson(reportTemplate.formViewContent);
|
125
|
+
|
126
|
+
// this.loadFieldListData();
|
127
|
+
|
128
|
+
})
|
129
|
+
}
|
130
|
+
});
|
131
|
+
},
|
132
|
+
loadFieldListData(res) {
|
133
|
+
this.entity = "User";
|
134
|
+
this.entityLabel = "用户";
|
135
|
+
/*res = {
|
136
|
+
"code": 200, "error": null, "message": "success", "data": {
|
137
|
+
"subFormList": [],
|
138
|
+
"storageSetting": [{"cloudStorage": "false"}],
|
139
|
+
"fieldList": [
|
140
|
+
/!*{
|
141
|
+
"name": "userId",
|
142
|
+
"label": "用户Id主键",
|
143
|
+
"type": "PrimaryKey",
|
144
|
+
"required": "1"
|
145
|
+
}, {"name": "createdOn", "label": "创建时间", "type": "DateTime", "required": "1"}, {
|
146
|
+
"searchDialogWidth": "520px",
|
147
|
+
"name": "createdBy",
|
148
|
+
"label": "创建用户",
|
149
|
+
"type": "Reference",
|
150
|
+
"required": "1"
|
151
|
+
},*!/ {
|
152
|
+
"name": "modifiedOn",
|
153
|
+
"label": "最近修改时间",
|
154
|
+
"type": "DateTime",
|
155
|
+
"required": "0"
|
156
|
+
}, /!*{
|
157
|
+
"searchDialogWidth": "520px",
|
158
|
+
"name": "modifiedBy",
|
159
|
+
"label": "修改用户",
|
160
|
+
"type": "Reference",
|
161
|
+
"required": "0"
|
162
|
+
}, {
|
163
|
+
"searchDialogWidth": "520px",
|
164
|
+
"name": "ownerUser",
|
165
|
+
"label": "所属用户",
|
166
|
+
"type": "Reference",
|
167
|
+
"required": "1"
|
168
|
+
}, {
|
169
|
+
"searchDialogWidth": "520px",
|
170
|
+
"name": "ownerDepartment",
|
171
|
+
"label": "所属部门",
|
172
|
+
"type": "Reference",
|
173
|
+
"required": "1"
|
174
|
+
}, {
|
175
|
+
"searchDialogWidth": "510px",
|
176
|
+
"name": "departmentId",
|
177
|
+
"label": "部门",
|
178
|
+
"type": "Reference",
|
179
|
+
"required": "1"
|
180
|
+
},*!/ {"name": "userName", "label": "用户名称", "type": "Text", "required": "1"}, {
|
181
|
+
"name": "loginPwd",
|
182
|
+
"label": "登录密码",
|
183
|
+
"type": "Password",
|
184
|
+
"required": "1"
|
185
|
+
}, {"name": "loginName", "label": "登录账号名", "type": "Text", "required": "1"}, {
|
186
|
+
"name": "jobTitle",
|
187
|
+
"label": "职务",
|
188
|
+
"type": "Option",
|
189
|
+
"required": "1"
|
190
|
+
}, {"name": "roles", "label": "权限角色", "type": "ReferenceList", "required": "0"}, {
|
191
|
+
"name": "disabled",
|
192
|
+
"label": "是否禁用",
|
193
|
+
"type": "Boolean",
|
194
|
+
"required": "1"
|
195
|
+
}, {"name": "mobilePhone", "label": "手机号", "type": "Text", "required": "0"}, {
|
196
|
+
"name": "email",
|
197
|
+
"label": "邮箱",
|
198
|
+
"type": "Text",
|
199
|
+
"required": "0"
|
200
|
+
},/!* {"name": "ownerTeam", "label": "所属团队", "type": "ReferenceList", "required": "0"}, {
|
201
|
+
"name": "avatar",
|
202
|
+
"label": "头像",
|
203
|
+
"type": "Picture",
|
204
|
+
"required": "0"
|
205
|
+
},*!/ {"name": "dingTalkUserId", "label": "钉钉用户ID", "type": "Text", "required": "0"}]
|
206
|
+
}
|
207
|
+
};*/
|
208
|
+
res = {
|
209
|
+
"code": 200, "error": null, "message": "success", "data": {
|
210
|
+
"subFormList": [{"name": "Jinjilianxiren", "label": "员工-紧急联系人"}],
|
211
|
+
"storageSetting": [{"cloudStorage": "false"}],
|
212
|
+
"fieldList": [
|
213
|
+
/*{
|
214
|
+
"name": "yuangongdanganId",
|
215
|
+
"label": "id主键",
|
216
|
+
"type": "PrimaryKey",
|
217
|
+
"required": "1"
|
218
|
+
},*/ {"name": "createdOn", "label": "创建时间", "type": "DateTime", "required": "1"}, /*{
|
219
|
+
"searchDialogWidth": "520px",
|
220
|
+
"name": "createdBy",
|
221
|
+
"label": "创建用户",
|
222
|
+
"type": "Reference",
|
223
|
+
"required": "1"
|
224
|
+
},*/ {
|
225
|
+
"name": "modifiedOn",
|
226
|
+
"label": "最近修改时间",
|
227
|
+
"type": "DateTime",
|
228
|
+
"required": "0"
|
229
|
+
}, /*{
|
230
|
+
"searchDialogWidth": "520px",
|
231
|
+
"name": "modifiedBy",
|
232
|
+
"label": "修改用户",
|
233
|
+
"type": "Reference",
|
234
|
+
"required": "0"
|
235
|
+
}, {
|
236
|
+
"searchDialogWidth": "520px",
|
237
|
+
"name": "ownerUser",
|
238
|
+
"label": "所属用户",
|
239
|
+
"type": "Reference",
|
240
|
+
"required": "1"
|
241
|
+
}, {
|
242
|
+
"searchDialogWidth": "520px",
|
243
|
+
"name": "ownerDepartment",
|
244
|
+
"label": "所属部门",
|
245
|
+
"type": "Reference",
|
246
|
+
"required": "1"
|
247
|
+
},*/ {
|
248
|
+
"name": "gonghao",
|
249
|
+
"label": "工号",
|
250
|
+
"type": "Text",
|
251
|
+
"required": "0",
|
252
|
+
"maxLength": "200"
|
253
|
+
}, {
|
254
|
+
"name": "xingming",
|
255
|
+
"label": "姓名",
|
256
|
+
"type": "Text",
|
257
|
+
"required": "1",
|
258
|
+
"maxLength": "200"
|
259
|
+
}, /*{
|
260
|
+
"searchDialogWidth": "520px",
|
261
|
+
"name": "bumen",
|
262
|
+
"label": "部门",
|
263
|
+
"type": "Reference",
|
264
|
+
"required": "1"
|
265
|
+
},*/ {
|
266
|
+
"name": "gangwei",
|
267
|
+
"label": "岗位",
|
268
|
+
"type": "Text",
|
269
|
+
"required": "1",
|
270
|
+
"maxLength": "200"
|
271
|
+
}, /*{
|
272
|
+
"searchDialogWidth": "520px",
|
273
|
+
"name": "yuangongchengyuan",
|
274
|
+
"label": "员工成员",
|
275
|
+
"type": "Reference",
|
276
|
+
"required": "0"
|
277
|
+
},*/ {
|
278
|
+
"name": "shenfenzhenghao",
|
279
|
+
"label": "身份证号",
|
280
|
+
"type": "Text",
|
281
|
+
"required": "0",
|
282
|
+
"maxLength": "200"
|
283
|
+
}, {"name": "xingbie", "label": "性别", "type": "Option", "required": "1"}, {
|
284
|
+
"name": "chushengriqi",
|
285
|
+
"label": "出生日期",
|
286
|
+
"type": "Date",
|
287
|
+
"required": "0"
|
288
|
+
}, /*{
|
289
|
+
"name": "jiguan",
|
290
|
+
"label": "籍贯",
|
291
|
+
"type": "AreaSelect",
|
292
|
+
"areaDataType": "2",
|
293
|
+
"required": "0"
|
294
|
+
},*/ {
|
295
|
+
"name": "hujisuozaidi",
|
296
|
+
"label": "户籍所在地",
|
297
|
+
"type": "Text",
|
298
|
+
"required": "0",
|
299
|
+
"maxLength": "200"
|
300
|
+
}, {"name": "hujileixing", "label": "户籍类型", "type": "Option", "required": "0"}, {
|
301
|
+
"name": "minzu",
|
302
|
+
"label": "民族",
|
303
|
+
"type": "Text",
|
304
|
+
"required": "0",
|
305
|
+
"maxLength": "200"
|
306
|
+
}, {
|
307
|
+
"name": "hunyinzhuangtai",
|
308
|
+
"label": "婚姻状态",
|
309
|
+
"type": "Option",
|
310
|
+
"required": "0"
|
311
|
+
}, {
|
312
|
+
"name": "zhengzhimianmao",
|
313
|
+
"label": "政治面貌",
|
314
|
+
"type": "Option",
|
315
|
+
"required": "0"
|
316
|
+
}, /*{
|
317
|
+
"name": "yuangongzhaopian",
|
318
|
+
"label": "员工照片",
|
319
|
+
"type": "Picture",
|
320
|
+
"required": "0"
|
321
|
+
},*/ {
|
322
|
+
"name": "pinyongxingshi",
|
323
|
+
"label": "聘用形式",
|
324
|
+
"type": "Option",
|
325
|
+
"required": "0"
|
326
|
+
}, {
|
327
|
+
"name": "yuangongzhuangtai",
|
328
|
+
"label": "员工状态",
|
329
|
+
"type": "Option",
|
330
|
+
"required": "1"
|
331
|
+
}, {"name": "canjiagongzuoriqi", "label": "参加工作日期", "type": "Date", "required": "0"}, {
|
332
|
+
"name": "ruzhiriqi",
|
333
|
+
"label": "入职日期",
|
334
|
+
"type": "Date",
|
335
|
+
"required": "1"
|
336
|
+
}, {
|
337
|
+
"name": "shiyongqitianshu",
|
338
|
+
"label": "试用期天数(天)",
|
339
|
+
"type": "Integer",
|
340
|
+
"required": "1"
|
341
|
+
}, {"name": "zhuanzhengriqi", "label": "转正日期", "type": "Date", "required": "0"}, {
|
342
|
+
"min": "-999999999",
|
343
|
+
"max": "999999999",
|
344
|
+
"precision": "2",
|
345
|
+
"name": "shiyongqixinzi",
|
346
|
+
"label": "试用期薪资",
|
347
|
+
"type": "Money",
|
348
|
+
"required": "0"
|
349
|
+
}, {
|
350
|
+
"min": "-999999999",
|
351
|
+
"max": "999999999",
|
352
|
+
"precision": "2",
|
353
|
+
"name": "zhengshixinzi",
|
354
|
+
"label": "正式薪资",
|
355
|
+
"type": "Money",
|
356
|
+
"required": "0"
|
357
|
+
}, /*{
|
358
|
+
"searchDialogWidth": "520px",
|
359
|
+
"name": "zhijieshangji",
|
360
|
+
"label": "直接上级",
|
361
|
+
"type": "Reference",
|
362
|
+
"required": "0"
|
363
|
+
}, {
|
364
|
+
"searchDialogWidth": "520px",
|
365
|
+
"name": "fuzeHR",
|
366
|
+
"label": "负责HR",
|
367
|
+
"type": "Reference",
|
368
|
+
"required": "0"
|
369
|
+
},*/ {
|
370
|
+
"name": "shebaozhanghao",
|
371
|
+
"label": "社保账号",
|
372
|
+
"type": "Text",
|
373
|
+
"required": "0",
|
374
|
+
"maxLength": "200"
|
375
|
+
}, {
|
376
|
+
"name": "gongjijinzhanghao",
|
377
|
+
"label": "公积金账号",
|
378
|
+
"type": "Text",
|
379
|
+
"required": "0",
|
380
|
+
"maxLength": "200"
|
381
|
+
}, {
|
382
|
+
"name": "yinhangkahao",
|
383
|
+
"label": "银行卡号",
|
384
|
+
"type": "Text",
|
385
|
+
"required": "0",
|
386
|
+
"maxLength": "200"
|
387
|
+
}, {
|
388
|
+
"name": "kaihuxing",
|
389
|
+
"label": "开户行",
|
390
|
+
"type": "Text",
|
391
|
+
"required": "0",
|
392
|
+
"maxLength": "200"
|
393
|
+
}, {
|
394
|
+
"name": "shoujihao",
|
395
|
+
"label": "手机号",
|
396
|
+
"type": "Text",
|
397
|
+
"required": "0",
|
398
|
+
"maxLength": "200"
|
399
|
+
}, /*{
|
400
|
+
"name": "changzhudizhi",
|
401
|
+
"label": "常住地址",
|
402
|
+
"type": "AreaSelect",
|
403
|
+
"areaDataType": "2",
|
404
|
+
"required": "0"
|
405
|
+
},*/ {
|
406
|
+
"name": "jutidizhi",
|
407
|
+
"label": "具体地址",
|
408
|
+
"type": "Text",
|
409
|
+
"required": "0",
|
410
|
+
"maxLength": "200"
|
411
|
+
}, {"name": "zuigaoxueli", "label": "最高学历", "type": "Option", "required": "0"}, {
|
412
|
+
"name": "biyeshijian",
|
413
|
+
"label": "毕业时间",
|
414
|
+
"type": "Date",
|
415
|
+
"required": "0"
|
416
|
+
}, {"name": "aa", "label": "aa", "type": "Integer", "required": "1"}, /*{
|
417
|
+
"detailEntity": "Jinjilianxiren",
|
418
|
+
"name": "jinjilianxirenId",
|
419
|
+
"label": "员工-紧急联系人.id主键",
|
420
|
+
"type": "PrimaryKey",
|
421
|
+
"required": "1"
|
422
|
+
},*/ {
|
423
|
+
"detailEntity": "Jinjilianxiren",
|
424
|
+
"name": "createdOn",
|
425
|
+
"label": "员工-紧急联系人.创建时间",
|
426
|
+
"type": "DateTime",
|
427
|
+
"required": "1"
|
428
|
+
}, /*{
|
429
|
+
"searchDialogWidth": "520px",
|
430
|
+
"detailEntity": "Jinjilianxiren",
|
431
|
+
"name": "createdBy",
|
432
|
+
"label": "员工-紧急联系人.创建用户",
|
433
|
+
"type": "Reference",
|
434
|
+
"required": "1"
|
435
|
+
},*/ {
|
436
|
+
"detailEntity": "Jinjilianxiren",
|
437
|
+
"name": "modifiedOn",
|
438
|
+
"label": "员工-紧急联系人.最近修改时间",
|
439
|
+
"type": "DateTime",
|
440
|
+
"required": "0"
|
441
|
+
}, /*{
|
442
|
+
"searchDialogWidth": "520px",
|
443
|
+
"detailEntity": "Jinjilianxiren",
|
444
|
+
"name": "modifiedBy",
|
445
|
+
"label": "员工-紧急联系人.修改用户",
|
446
|
+
"type": "Reference",
|
447
|
+
"required": "0"
|
448
|
+
}, {
|
449
|
+
"searchDialogWidth": "520px",
|
450
|
+
"detailEntity": "Jinjilianxiren",
|
451
|
+
"name": "mdYuangongdanganId",
|
452
|
+
"label": "员工-紧急联系人.主从关联Id",
|
453
|
+
"type": "Reference",
|
454
|
+
"required": "1"
|
455
|
+
},*/ {
|
456
|
+
"detailEntity": "Jinjilianxiren",
|
457
|
+
"name": "shouji",
|
458
|
+
"label": "员工-紧急联系人.手机",
|
459
|
+
"type": "Text",
|
460
|
+
"required": "0",
|
461
|
+
"maxLength": "200"
|
462
|
+
}, {
|
463
|
+
"detailEntity": "Jinjilianxiren",
|
464
|
+
"name": "jinjilianxirenxingming",
|
465
|
+
"label": "员工-紧急联系人.紧急联系人姓名",
|
466
|
+
"type": "Text",
|
467
|
+
"required": "0",
|
468
|
+
"maxLength": "200"
|
469
|
+
}]
|
470
|
+
}
|
471
|
+
};
|
472
|
+
if (res.data.fieldList) {
|
473
|
+
this.fieldListData.fieldList = res.data.fieldList;
|
474
|
+
if (res.data.subFormList) {
|
475
|
+
this.fieldListData.subFormList =
|
476
|
+
res.data.subFormList;
|
477
|
+
}
|
478
|
+
this.meteFieldsResult = res;
|
479
|
+
const metaFields = this.buildMetaFields(
|
480
|
+
this.meteFieldsResult
|
481
|
+
);
|
482
|
+
this.$refs.designer.setFieldListData(
|
483
|
+
this.fieldListData
|
484
|
+
);
|
485
|
+
this.$refs.designer.setMetaFields(metaFields);
|
486
|
+
}
|
487
|
+
|
488
|
+
},
|
489
|
+
|
490
|
+
buildMetaFields(mdResult) {
|
491
|
+
const result = {
|
492
|
+
main: {
|
493
|
+
entityName: this.entity,
|
494
|
+
entityLabel: this.entityLabel,
|
495
|
+
fieldList: [],
|
496
|
+
},
|
497
|
+
detail: [],
|
498
|
+
};
|
499
|
+
|
500
|
+
if (mdResult && mdResult.data?.fieldList) {
|
501
|
+
mdResult.data.fieldList.forEach((fld) => {
|
502
|
+
if (!fld.detailEntity && fld.type !== "PrimaryKey") {
|
503
|
+
//跳过id主键
|
504
|
+
if (fld.name === "loginPwd") {
|
505
|
+
return;
|
506
|
+
}
|
507
|
+
|
508
|
+
if (
|
509
|
+
fld.type === "AnyReference" ||
|
510
|
+
fld.type === "ReferenceList"
|
511
|
+
) {
|
512
|
+
return;
|
513
|
+
}
|
514
|
+
|
515
|
+
if (this.usedFieldNames.hasOwnProperty(fld.name)) {
|
516
|
+
return; //跳过本次循环
|
517
|
+
}
|
518
|
+
|
519
|
+
const fieldNewProps = deepClone(
|
520
|
+
formFieldMapping[fld.type]
|
521
|
+
);
|
522
|
+
const fieldSchema = deepClone(
|
523
|
+
this.$refs.designer.designer.getFieldWidgetByType(
|
524
|
+
fieldNewProps.type
|
525
|
+
)
|
526
|
+
);
|
527
|
+
overwriteObj(
|
528
|
+
fieldSchema.options,
|
529
|
+
fieldNewProps.options
|
530
|
+
);
|
531
|
+
|
532
|
+
fieldSchema.displayName = fld.label;
|
533
|
+
fieldSchema.nameReadonly = true;
|
534
|
+
fieldSchema.options.name = fld.name;
|
535
|
+
fieldSchema.options.label = fld.label;
|
536
|
+
this.adjustFieldSchema(fieldSchema, fld, mdResult);
|
537
|
+
result.main.fieldList.push(fieldSchema);
|
538
|
+
}
|
539
|
+
});
|
540
|
+
}
|
541
|
+
|
542
|
+
if (mdResult && mdResult.data?.subFormList) {
|
543
|
+
mdResult.data.subFormList.forEach((sf) => {
|
544
|
+
const deName = sf.name;
|
545
|
+
const deLabel = sf.label;
|
546
|
+
const detailDataItem = {
|
547
|
+
entityName: deName,
|
548
|
+
entityLabel: deLabel,
|
549
|
+
fieldList: [],
|
550
|
+
};
|
551
|
+
|
552
|
+
mdResult.data.fieldList.forEach((fld) => {
|
553
|
+
if (
|
554
|
+
fld.detailEntity &&
|
555
|
+
fld.detailEntity === deName &&
|
556
|
+
fld.type !== "PrimaryKey"
|
557
|
+
) {
|
558
|
+
//跳过id主键
|
559
|
+
if (
|
560
|
+
fld.type === "AnyReference" ||
|
561
|
+
fld.type === "ReferenceList"
|
562
|
+
) {
|
563
|
+
return;
|
564
|
+
}
|
565
|
+
|
566
|
+
if (this.usedFieldNames.hasOwnProperty(fld.name)) {
|
567
|
+
return; //跳过本次循环
|
568
|
+
}
|
569
|
+
|
570
|
+
const fieldNewProps = deepClone(
|
571
|
+
formFieldMapping[fld.type]
|
572
|
+
);
|
573
|
+
const fieldSchema = deepClone(
|
574
|
+
this.$refs.designer.designer.getFieldWidgetByType(
|
575
|
+
fieldNewProps.type
|
576
|
+
)
|
577
|
+
);
|
578
|
+
overwriteObj(
|
579
|
+
fieldSchema.options,
|
580
|
+
fieldNewProps.options
|
581
|
+
);
|
582
|
+
|
583
|
+
fieldSchema.displayName = fld.label;
|
584
|
+
fieldSchema.nameReadonly = true;
|
585
|
+
fieldSchema.options.name = fld.name;
|
586
|
+
fieldSchema.options.label = fld.label;
|
587
|
+
this.adjustFieldSchema(fieldSchema, fld, mdResult);
|
588
|
+
detailDataItem.fieldList.push(fieldSchema);
|
589
|
+
}
|
590
|
+
});
|
591
|
+
|
592
|
+
result.detail.push(detailDataItem);
|
593
|
+
});
|
594
|
+
}
|
595
|
+
|
596
|
+
return result;
|
597
|
+
},
|
598
|
+
|
599
|
+
adjustFieldSchema(fieldSchema, fldObj, mdResult) {
|
600
|
+
// 处理图片、文件上传字段!!
|
601
|
+
let cloudStorageFlag = false;
|
602
|
+
let cloudStorageType = "";
|
603
|
+
if (mdResult.data.storageSetting) {
|
604
|
+
cloudStorageFlag =
|
605
|
+
mdResult.data.storageSetting[0].cloudStorage === "true";
|
606
|
+
if (cloudStorageFlag) {
|
607
|
+
cloudStorageType =
|
608
|
+
mdResult.data.storageSetting[0].cloudStorageType;
|
609
|
+
}
|
610
|
+
}
|
611
|
+
|
612
|
+
if (fldObj.type === "Picture" || fldObj.type === "File") {
|
613
|
+
if (cloudStorageFlag) {
|
614
|
+
//设置withCredentials
|
615
|
+
fieldSchema.options.withCredentials = false;
|
616
|
+
|
617
|
+
//设置onBeforeUpload事件代码(还需要生成uuid新文件名)
|
618
|
+
fieldSchema.options.onBeforeUpload =
|
619
|
+
"const gDSV = this.getGlobalDsv();\nconst wType = this.field.type;\nif (wType === 'picture-upload') {\n this.field.options.uploadURL = gDSV.picUploadURL;\n} else if (wType === 'file-upload') {\n this.field.options.uploadURL = gDSV.fileUploadURL;\n}\n\nconst cloudStorage = gDSV.cloudStorage;\nif (cloudStorage === \"true\") {\n this.field.options.withCredentials = false\n const token = gDSV.cloudUploadToken;\n this.setUploadData('token', token);\n \n const randomNum = Math.floor(Math.random() * 100);\n const newFileName = new Date().getTime() + randomNum+ '_' + file.name;\n this.setUploadData('key', newFileName);\n} else {\n //this.field.options.withCredentials = true\n}\n";
|
620
|
+
|
621
|
+
//设置onUploadSuccess事件代码(上传返回结果需要设置QiNiu=前缀)
|
622
|
+
fieldSchema.options.onUploadSuccess =
|
623
|
+
"const gDSV = this.getGlobalDsv();\nconst cloudStorage = gDSV.cloudStorage;\nif (cloudStorage === \"true\") {\n const wType = this.field.type;\n let downloadPrefix = \"\"\n if (wType === 'picture-upload') {\n downloadPrefix = gDSV.picDownloadPrefix;\n } else if (wType === 'file-upload') {\n downloadPrefix = gDSV.fileDownloadPrefix;\n }\n \n let downUrl = downloadPrefix + result.key;\n const paramName = (downUrl.indexOf(\"?\") === -1) ? '?fileName=' : '&fileName=';\n return {\n name: file.name,\n url: downUrl + paramName + file.name\n }\n} else {\n const paramName = (result.url.indexOf(\"?\") === -1) ? '?fileName=' : '&fileName=';\n return {\n name: file.name,\n url: result.url + paramName + file.name\n }\n}\n";
|
624
|
+
}
|
625
|
+
}
|
626
|
+
// 处理图片、文件上传字段 -- 结束
|
627
|
+
|
628
|
+
/* 处理文本、长文本字段 */
|
629
|
+
if (fldObj.type === "Text" || fldObj.type === "TextArea") {
|
630
|
+
fieldSchema.options.maxLength = !fldObj.maxLength
|
631
|
+
? fieldSchema.options.maxLength
|
632
|
+
: fldObj.maxLength * 1;
|
633
|
+
}
|
634
|
+
|
635
|
+
/* 处理精度小数字段 */
|
636
|
+
if (
|
637
|
+
fldObj.type === "Integer" ||
|
638
|
+
fldObj.type === "Percent" ||
|
639
|
+
fldObj.type === "Money" ||
|
640
|
+
fldObj.type === "Decimal"
|
641
|
+
) {
|
642
|
+
fieldSchema.options.precision = !fldObj.precision
|
643
|
+
? fieldSchema.options.precision
|
644
|
+
: fldObj.precision * 1;
|
645
|
+
fieldSchema.options.min = !fldObj.min
|
646
|
+
? fieldSchema.options.min
|
647
|
+
: fldObj.min * 1;
|
648
|
+
fieldSchema.options.max = !fldObj.max
|
649
|
+
? fieldSchema.options.max
|
650
|
+
: fldObj.max * 1;
|
651
|
+
}
|
652
|
+
|
653
|
+
/* 处理地区选择字段 */
|
654
|
+
if (fldObj.type === "AreaSelect") {
|
655
|
+
fieldSchema.optionItemsReadonly = true;
|
656
|
+
fieldSchema.options.areaDataType = !fldObj.areaDataType
|
657
|
+
? fieldSchema.options.areaDataType
|
658
|
+
: fldObj.areaDataType * 1;
|
659
|
+
}
|
660
|
+
|
661
|
+
/* 处理一对一字段 */
|
662
|
+
if (fldObj.type === "Reference") {
|
663
|
+
fieldSchema.options.searchDialogWidth =
|
664
|
+
!fldObj.searchDialogWidth
|
665
|
+
? fieldSchema.options.searchDialogWidth
|
666
|
+
: fldObj.searchDialogWidth;
|
667
|
+
}
|
668
|
+
|
669
|
+
/* 处理单选项字段 */
|
670
|
+
if (fieldSchema.options.hasOwnProperty("optionItems")) {
|
671
|
+
if (
|
672
|
+
this.formOptionData.hasOwnProperty(fieldSchema.options.name)
|
673
|
+
) {
|
674
|
+
fieldSchema.options.optionItems = deepClone(
|
675
|
+
this.formOptionData[fieldSchema.options.name]
|
676
|
+
);
|
677
|
+
}
|
678
|
+
|
679
|
+
if (fldObj.type === "Boolean") {
|
680
|
+
fieldSchema.options.optionItems = [
|
681
|
+
{value: true, label: "是"},
|
682
|
+
{value: false, label: "否"},
|
683
|
+
];
|
684
|
+
}
|
685
|
+
|
686
|
+
fieldSchema.optionItemsReadonly = true;
|
687
|
+
}
|
688
|
+
|
689
|
+
/* 设置字段必填校验 */
|
690
|
+
if (fldObj.hasOwnProperty("required")) {
|
691
|
+
fieldSchema.options.required = fldObj["required"] === "1";
|
692
|
+
}
|
693
|
+
|
694
|
+
/* 取消系统字段的必填校验 */
|
695
|
+
if (fieldSchema.options.name === "createdOn" || fieldSchema.options.name === "createdBy"
|
696
|
+
|| fieldSchema.options.name === "modifiedOn" || fieldSchema.options.name === "modifiedBy"
|
697
|
+
|| fieldSchema.options.name === "ownerUser" || fieldSchema.options.name === "ownerDepartment"
|
698
|
+
|| fieldSchema.options.name === "approvalConfigId" || fieldSchema.options.name === "approvalStatus"
|
699
|
+
|| fieldSchema.options.name === "lastApprovedBy" || fieldSchema.options.name === "lastApprovedOn") {
|
700
|
+
fieldSchema.options.required = false;
|
701
|
+
}
|
702
|
+
|
703
|
+
//
|
704
|
+
},
|
705
|
+
|
706
|
+
handleFWU(fwName) {
|
707
|
+
this.usedFieldNames[fwName] = 1;
|
708
|
+
|
709
|
+
/* 必须延时处理,否则draggable会报错 */
|
710
|
+
setTimeout(() => {
|
711
|
+
const metaFields = this.buildMetaFields(this.meteFieldsResult);
|
712
|
+
this.$refs.designer.setMetaFields(metaFields);
|
713
|
+
}, 800);
|
714
|
+
},
|
715
|
+
|
716
|
+
handleFWR(fwName) {
|
717
|
+
delete this.usedFieldNames[fwName];
|
718
|
+
|
719
|
+
/* 必须延时处理,否则draggable会报错 */
|
720
|
+
setTimeout(() => {
|
721
|
+
const metaFields = this.buildMetaFields(this.meteFieldsResult);
|
722
|
+
this.$refs.designer.setMetaFields(metaFields);
|
723
|
+
}, 800);
|
724
|
+
},
|
725
|
+
|
726
|
+
handleFJU() {
|
727
|
+
this.handleUsedFields();
|
728
|
+
setTimeout(() => {
|
729
|
+
const metaFields = this.buildMetaFields(this.meteFieldsResult);
|
730
|
+
this.$refs.designer.setMetaFields(metaFields);
|
731
|
+
}, 300);
|
732
|
+
},
|
733
|
+
|
734
|
+
/**
|
735
|
+
* 过滤已使用字段组件
|
736
|
+
*/
|
737
|
+
handleUsedFields() {
|
738
|
+
this.usedFieldNames = {};
|
739
|
+
const allFieldWidgets = this.$refs.designer.getFieldWidgets();
|
740
|
+
allFieldWidgets.forEach((fwItem) => {
|
741
|
+
this.usedFieldNames[fwItem.name] = 1;
|
742
|
+
});
|
743
|
+
},
|
744
|
+
initField() {
|
745
|
+
this.$http({
|
746
|
+
aes: true,
|
747
|
+
url: USER_PREFIX + "/szTaMb/listPage",
|
748
|
+
data: {},
|
749
|
+
success: res => {
|
750
|
+
|
751
|
+
}
|
752
|
+
});
|
753
|
+
},
|
754
|
+
reflushTemplateList() {
|
755
|
+
this.$emit("reflushTemplateList");
|
756
|
+
},
|
757
|
+
customConfirm(json) {
|
758
|
+
this.$emit("customConfirm", json);
|
759
|
+
}
|
760
|
+
}
|
761
|
+
};
|
762
|
+
</script>
|
763
|
+
|
764
|
+
<style lang="scss" scoped>
|
765
|
+
body {
|
766
|
+
margin: 0; /* 如果页面出现垂直滚动条,则加入此行CSS以消除之 */
|
767
|
+
}
|
768
|
+
|
769
|
+
#app .main-container {
|
770
|
+
margin-left: 0px;
|
771
|
+
}
|
772
|
+
</style>
|