cloud-web-corejs 1.0.54-dev.120 → 1.0.54-dev.121
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/table/tableForm.vue +36 -2
- package/src/components/table/tableFormMixin.js +222 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +519 -320
- package/src/components/xform/form-render/container-item/data-table-item.vue +1 -1
- package/src/components/xform/form-render/container-item/data-table-mixin.js +2122 -1943
- package/src/views/bd/setting/table_model/mixins/edit.js +901 -901
@@ -1,1943 +1,2122 @@
|
|
1
|
-
import emitter from
|
2
|
-
import i18n from
|
3
|
-
import refMixin from
|
4
|
-
import containerItemMixin from
|
5
|
-
|
6
|
-
import * as formatUtil from
|
7
|
-
import tableConfig from
|
8
|
-
import {extendDeeply} from "../../../../utils/index.js";
|
9
|
-
import {
|
10
|
-
assembleAxiosConfig,
|
11
|
-
getReportGlobalMap,
|
12
|
-
generateId
|
13
|
-
} from
|
14
|
-
import {tableTreeMixins} from
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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
|
-
let
|
153
|
-
|
154
|
-
|
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
|
-
|
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
|
-
this.
|
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
|
-
|
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
|
-
if (
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
let
|
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
|
-
|
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
|
-
},
|
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
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
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
|
-
return
|
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
|
-
let
|
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
|
-
return
|
1241
|
-
},
|
1242
|
-
|
1243
|
-
let
|
1244
|
-
let
|
1245
|
-
let
|
1246
|
-
let
|
1247
|
-
let
|
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
|
-
} else {
|
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
|
-
let
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
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
|
-
delete
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
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
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
let
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
})
|
1762
|
-
}
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
}
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
let
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
let
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1
|
+
import emitter from "../../../../components/xform/utils/emitter";
|
2
|
+
import i18n from "../../../../components/xform/utils/i18n";
|
3
|
+
import refMixin from "../../../../components/xform/form-render/refMixin";
|
4
|
+
import containerItemMixin from "./containerItemMixin";
|
5
|
+
|
6
|
+
import * as formatUtil from "../../../../components/xform/utils/format.js";
|
7
|
+
import tableConfig from "../../../../components/table/config.js";
|
8
|
+
import { extendDeeply } from "../../../../utils/index.js";
|
9
|
+
import {
|
10
|
+
assembleAxiosConfig,
|
11
|
+
getReportGlobalMap,
|
12
|
+
generateId,
|
13
|
+
} from "../../../../components/xform/utils/util";
|
14
|
+
import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
|
15
|
+
import ItemEdit from "@/views/user/form/form_template/itemEdit.vue";
|
16
|
+
|
17
|
+
let modules = {};
|
18
|
+
const baseRefUtil = {
|
19
|
+
emitter,
|
20
|
+
i18n,
|
21
|
+
refMixin,
|
22
|
+
containerItemMixin,
|
23
|
+
formatUtil,
|
24
|
+
assembleAxiosConfig,
|
25
|
+
tableConfig,
|
26
|
+
getReportGlobalMap,
|
27
|
+
};
|
28
|
+
|
29
|
+
modules = {
|
30
|
+
mixins: [
|
31
|
+
baseRefUtil.emitter,
|
32
|
+
baseRefUtil.i18n,
|
33
|
+
baseRefUtil.refMixin,
|
34
|
+
baseRefUtil.containerItemMixin,
|
35
|
+
tableTreeMixins,
|
36
|
+
],
|
37
|
+
componentName: "ContainerItem",
|
38
|
+
props: {
|
39
|
+
widget: Object,
|
40
|
+
parentWidget: Object,
|
41
|
+
parentList: Array,
|
42
|
+
indexOfParentList: Number,
|
43
|
+
subFormRowIndex: {
|
44
|
+
type: Number,
|
45
|
+
default: -1,
|
46
|
+
},
|
47
|
+
subFormColIndex: {
|
48
|
+
type: Number,
|
49
|
+
default: -1,
|
50
|
+
},
|
51
|
+
subFormRowId: {
|
52
|
+
type: String,
|
53
|
+
default: "",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
inject: [
|
57
|
+
"refList",
|
58
|
+
"sfRefList",
|
59
|
+
"globalModel",
|
60
|
+
"getFormConfig",
|
61
|
+
"getGlobalDsv",
|
62
|
+
"previewState",
|
63
|
+
],
|
64
|
+
data: function () {
|
65
|
+
let that = this;
|
66
|
+
return {
|
67
|
+
fieldModel: [],
|
68
|
+
selectedIndices: [],
|
69
|
+
pageSize: this.widget.options.pagination.pageSize,
|
70
|
+
pageSizes: this.widget.options.pagination.pageSizes,
|
71
|
+
currentPage: this.widget.options.pagination.currentPage,
|
72
|
+
total: this.widget.options.pagination.total,
|
73
|
+
formData: {
|
74
|
+
saleOrgName: "",
|
75
|
+
loginAccount: "",
|
76
|
+
mobile: "",
|
77
|
+
enabled: 1,
|
78
|
+
},
|
79
|
+
vxeOption: {},
|
80
|
+
requestAccess: null,
|
81
|
+
columnFormatMap: {
|
82
|
+
editInput: "input",
|
83
|
+
editNumber: "number",
|
84
|
+
editDate: "date",
|
85
|
+
editSelect: "select",
|
86
|
+
editSearch: "vabsearch",
|
87
|
+
editAttachment: "baseAttachment",
|
88
|
+
editStatus: "status",
|
89
|
+
aText: "a-text",
|
90
|
+
aLink: "a-link",
|
91
|
+
editDelete: "a-link",
|
92
|
+
editButton: "a-link",
|
93
|
+
button: "button",
|
94
|
+
addSiblingEditRow: "a-link",
|
95
|
+
addChildTreeRow: "a-link",
|
96
|
+
moveUpRow: "a-link",
|
97
|
+
moveDownRow: "a-link",
|
98
|
+
removeTreeRow: "a-link",
|
99
|
+
},
|
100
|
+
dataTableConfig: {},
|
101
|
+
widgets: [],
|
102
|
+
editWidgets: [],
|
103
|
+
|
104
|
+
sortParentRow: null,
|
105
|
+
sortRows: [],
|
106
|
+
showTreeMoveDialog: false,
|
107
|
+
tableConfig: {},
|
108
|
+
};
|
109
|
+
},
|
110
|
+
watch: {
|
111
|
+
fieldModel(val) {
|
112
|
+
this.formModel[this.fieldKeyName] = val || [];
|
113
|
+
},
|
114
|
+
},
|
115
|
+
computed: {
|
116
|
+
hasWf() {
|
117
|
+
return this.getFormRef().hasWf || false;
|
118
|
+
},
|
119
|
+
tableDatas: {
|
120
|
+
cache: !1,
|
121
|
+
get: function () {
|
122
|
+
return this.globalModel.formModel[this.fieldKeyName] || [];
|
123
|
+
},
|
124
|
+
},
|
125
|
+
formConfig: function () {
|
126
|
+
return this.getFormConfig();
|
127
|
+
},
|
128
|
+
paginationLayout: function () {
|
129
|
+
return this.widget.options.smallPagination
|
130
|
+
? "prev, pager, next"
|
131
|
+
: "total, sizes, prev, pager, next, jumper";
|
132
|
+
},
|
133
|
+
customClass: function () {
|
134
|
+
return this.widget.options.customClass || "";
|
135
|
+
},
|
136
|
+
singleRowSelectFlag: function () {
|
137
|
+
return !this.widget.options.showCheckBox;
|
138
|
+
},
|
139
|
+
buttonsColumnFixed: function () {
|
140
|
+
return void 0 === this.widget.options.buttonsColumnFixed
|
141
|
+
? "right"
|
142
|
+
: !!this.widget.options.buttonsColumnFixed &&
|
143
|
+
this.widget.options.buttonsColumnFixed;
|
144
|
+
},
|
145
|
+
formModel: {
|
146
|
+
cache: !1,
|
147
|
+
get: function () {
|
148
|
+
return this.globalModel.formModel;
|
149
|
+
},
|
150
|
+
},
|
151
|
+
formDataId() {
|
152
|
+
let formRef = this.getFormRef();
|
153
|
+
return formRef.dataId;
|
154
|
+
},
|
155
|
+
},
|
156
|
+
created: function () {
|
157
|
+
if (!this.formModel[this.fieldKeyName])
|
158
|
+
this.formModel[this.fieldKeyName] = [];
|
159
|
+
this.initRefList();
|
160
|
+
this.handleOnCreated();
|
161
|
+
},
|
162
|
+
mounted: async function () {
|
163
|
+
this.handleOnMounted();
|
164
|
+
this.initTableList();
|
165
|
+
},
|
166
|
+
beforeDestroy: function () {
|
167
|
+
this.unregisterFromRefList();
|
168
|
+
},
|
169
|
+
methods: {
|
170
|
+
getGridTableName() {
|
171
|
+
let formCode = this.getFormRef().reportTemplate.formCode;
|
172
|
+
let tableName = formCode + "_" + this.widget.options.name;
|
173
|
+
return tableName;
|
174
|
+
},
|
175
|
+
updateFormField: function () {
|
176
|
+
let rows = this.fieldModel || [];
|
177
|
+
let formRows = this.formModel[this.fieldKeyName];
|
178
|
+
if (formRows) {
|
179
|
+
this.formModel[this.fieldKeyName].splice(0, formRows.length);
|
180
|
+
this.formModel[this.fieldKeyName].push(...rows);
|
181
|
+
} else {
|
182
|
+
this.formModel[this.fieldKeyName] = rows;
|
183
|
+
}
|
184
|
+
},
|
185
|
+
setValue(val) {
|
186
|
+
// console.log("rows:",val);
|
187
|
+
let rows = val || [];
|
188
|
+
this.formModel[this.fieldKeyName] = rows;
|
189
|
+
let $grid = this.getGridTable();
|
190
|
+
this.fieldModel = rows;
|
191
|
+
// $grid.loadData(rows);
|
192
|
+
},
|
193
|
+
getValue() {
|
194
|
+
return this.formModel[this.fieldKeyName];
|
195
|
+
},
|
196
|
+
getFieldKeyName(widget) {
|
197
|
+
let o = widget.options.name;
|
198
|
+
return (widget.options.keyNameEnabled && widget.options.keyName) || o;
|
199
|
+
},
|
200
|
+
selectWidget: function (e) {
|
201
|
+
this.designer.setSelected(e);
|
202
|
+
},
|
203
|
+
formatterValue: function ({ cellValue, row, column }) {
|
204
|
+
if (cellValue === null || cellValue === undefined) return cellValue;
|
205
|
+
|
206
|
+
if (column.params && column.params.formatS)
|
207
|
+
switch (column.params.formatS) {
|
208
|
+
case "d1":
|
209
|
+
return baseRefUtil.formatUtil.formatDate1(cellValue);
|
210
|
+
case "d2":
|
211
|
+
return baseRefUtil.formatUtil.formatDate2(cellValue);
|
212
|
+
case "d3":
|
213
|
+
return baseRefUtil.formatUtil.formatDate3(cellValue);
|
214
|
+
case "d4":
|
215
|
+
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
216
|
+
case "d5":
|
217
|
+
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
218
|
+
case "n1":
|
219
|
+
return baseRefUtil.formatUtil.formatNumber1(cellValue);
|
220
|
+
case "n2":
|
221
|
+
return baseRefUtil.formatUtil.formatNumber2(cellValue);
|
222
|
+
case "n3":
|
223
|
+
return baseRefUtil.formatUtil.formatNumber3(cellValue);
|
224
|
+
case "n4":
|
225
|
+
return baseRefUtil.formatUtil.formatNumber4(cellValue);
|
226
|
+
case "n5":
|
227
|
+
return baseRefUtil.formatUtil.formatNumber5(cellValue);
|
228
|
+
case "n6":
|
229
|
+
return baseRefUtil.formatUtil.formatNumber6(cellValue);
|
230
|
+
case "n7":
|
231
|
+
return baseRefUtil.formatUtil.formatNumber7(cellValue);
|
232
|
+
}
|
233
|
+
return cellValue;
|
234
|
+
},
|
235
|
+
getRowIndex: function (e) {
|
236
|
+
return this.widget.options.tableData.lastIndexOf(e);
|
237
|
+
},
|
238
|
+
setTableColumns: function (e) {
|
239
|
+
var t = this;
|
240
|
+
(this.widget.options.tableColumns = e),
|
241
|
+
this.$nextTick(function () {
|
242
|
+
t.$refs.dataTable.doLayout();
|
243
|
+
});
|
244
|
+
},
|
245
|
+
setTableColumn: function (e) {
|
246
|
+
this.setTableColumns(e);
|
247
|
+
},
|
248
|
+
getTableData: function () {
|
249
|
+
return this.widget.options.tableData;
|
250
|
+
},
|
251
|
+
resetForm(options) {
|
252
|
+
let formData = this.formModel;
|
253
|
+
let ignoreFields = options?.ignoreFields || [];
|
254
|
+
this.widget.widgetList.forEach((subWidget) => {
|
255
|
+
if (
|
256
|
+
!ignoreFields.length ||
|
257
|
+
!ignoreFields.includes(subWidget.options.name)
|
258
|
+
) {
|
259
|
+
let widgetRef = this.getWidgetRef(subWidget.options.name);
|
260
|
+
if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
|
261
|
+
}
|
262
|
+
});
|
263
|
+
},
|
264
|
+
searchEvent() {
|
265
|
+
this.getGridTable().commitProxy("reload");
|
266
|
+
},
|
267
|
+
async resetEvent(options) {
|
268
|
+
this.resetForm(options);
|
269
|
+
this.getGridTable().commitProxy("reload");
|
270
|
+
},
|
271
|
+
handleSearchClick() {
|
272
|
+
if (this.widget.options.onSearchTable) {
|
273
|
+
this.handleCustomEvent(this.widget.options.onSearchTable);
|
274
|
+
return;
|
275
|
+
}
|
276
|
+
this.searchEvent();
|
277
|
+
},
|
278
|
+
handleResetClick() {
|
279
|
+
if (this.widget.options.onResetTable) {
|
280
|
+
this.handleCustomEvent(this.widget.options.onResetTable);
|
281
|
+
return;
|
282
|
+
}
|
283
|
+
this.resetEvent();
|
284
|
+
},
|
285
|
+
openEditDialog(row, param) {
|
286
|
+
let formRef = this.getFormRef();
|
287
|
+
let parentTarget = formRef.$attrs["parent-target"];
|
288
|
+
parentTarget &&
|
289
|
+
parentTarget.$attrs.openEditDialog &&
|
290
|
+
parentTarget.$attrs.openEditDialog(row, param);
|
291
|
+
},
|
292
|
+
importExcel() {},
|
293
|
+
getGrid(that, tableRef) {
|
294
|
+
var $grid;
|
295
|
+
if (Array.isArray(that.$refs[tableRef])) {
|
296
|
+
$grid = that.$refs[tableRef][0];
|
297
|
+
} else {
|
298
|
+
$grid = that.$refs[tableRef];
|
299
|
+
}
|
300
|
+
return $grid;
|
301
|
+
},
|
302
|
+
getTableCondition: function () {
|
303
|
+
if (this.widget.options.tableCondition) {
|
304
|
+
var e = new Function(this.widget.options.tableCondition);
|
305
|
+
return e.call(this);
|
306
|
+
}
|
307
|
+
},
|
308
|
+
getSearchCondition: function () {
|
309
|
+
let extraAccessData = this.extraAccessData || {};
|
310
|
+
let searchFormData = this.getSearchFormData();
|
311
|
+
let defaultData = {};
|
312
|
+
|
313
|
+
// let globalReqData = baseRefUtil.getReportGlobalMap();//全局请求参数
|
314
|
+
let tableCondition = this.getTableCondition();
|
315
|
+
let conditions = {
|
316
|
+
...defaultData,
|
317
|
+
...tableCondition,
|
318
|
+
...searchFormData,
|
319
|
+
...extraAccessData,
|
320
|
+
// ...globalReqData
|
321
|
+
};
|
322
|
+
return conditions;
|
323
|
+
},
|
324
|
+
createColumns() {
|
325
|
+
let tableColumns = this.widget.options.tableColumns;
|
326
|
+
let newColumns = [];
|
327
|
+
newColumns.push({
|
328
|
+
type: "checkbox",
|
329
|
+
width: 48,
|
330
|
+
resizable: false,
|
331
|
+
fixed: "left",
|
332
|
+
});
|
333
|
+
|
334
|
+
const createColumn = (t, isChild) => {
|
335
|
+
let col = {
|
336
|
+
fixed: !!t.fixed && t.fixed,
|
337
|
+
field: t.prop,
|
338
|
+
title: this.getI18nLabel(t.label),
|
339
|
+
sortable: t.sortable,
|
340
|
+
align: t.align ? t.align : "center",
|
341
|
+
formatter: this.formatterValue,
|
342
|
+
params: {
|
343
|
+
formatS: t.formatS,
|
344
|
+
columnId: t.columnId,
|
345
|
+
exportType: t.exportType,
|
346
|
+
isItemLine: t.isItemLine,
|
347
|
+
footerDataType: t.footerDataType,
|
348
|
+
footerMethodConfg: t.footerMethodConfg,
|
349
|
+
},
|
350
|
+
visible: t.show,
|
351
|
+
slots: {},
|
352
|
+
};
|
353
|
+
if (t.treeNode) {
|
354
|
+
col.treeNode = true;
|
355
|
+
}
|
356
|
+
if (t.children && t.children.length) {
|
357
|
+
col.align = "center";
|
358
|
+
delete col.field;
|
359
|
+
let childColumns = t.children.map((child) => {
|
360
|
+
return createColumn(child, true);
|
361
|
+
});
|
362
|
+
col.children = childColumns;
|
363
|
+
|
364
|
+
col.sortable = false;
|
365
|
+
col.filterType = false;
|
366
|
+
} else {
|
367
|
+
col.width = t.width;
|
368
|
+
if (isChild) {
|
369
|
+
if (col.title && col.field) {
|
370
|
+
col.filters = [
|
371
|
+
{
|
372
|
+
data: {},
|
373
|
+
},
|
374
|
+
];
|
375
|
+
col.filterRender = {
|
376
|
+
name: "FilterContent",
|
377
|
+
};
|
378
|
+
}
|
379
|
+
}
|
380
|
+
}
|
381
|
+
col = addColumProperty(col, t);
|
382
|
+
return col;
|
383
|
+
};
|
384
|
+
|
385
|
+
const addColumProperty = (col, t) => {
|
386
|
+
let columnOption;
|
387
|
+
let widget;
|
388
|
+
let columnWidgetConfig = this.getColumnWidgetConfig(t);
|
389
|
+
let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
|
390
|
+
if (columnSelectedWidget) {
|
391
|
+
widget = columnSelectedWidget;
|
392
|
+
columnOption = widget.options;
|
393
|
+
} else {
|
394
|
+
columnOption = {};
|
395
|
+
}
|
396
|
+
|
397
|
+
let { columnSelectedWidget: editWidget } = this.getColumnWidgetConfig(
|
398
|
+
t,
|
399
|
+
true
|
400
|
+
);
|
401
|
+
|
402
|
+
let params = {
|
403
|
+
...columnOption,
|
404
|
+
widget: widget,
|
405
|
+
formatS: t.formatS,
|
406
|
+
required: t.required || false,
|
407
|
+
columnConfig: t,
|
408
|
+
editWidget,
|
409
|
+
};
|
410
|
+
Object.assign(col.params, params);
|
411
|
+
if (!col.children || !col.children.length) {
|
412
|
+
if (t.formatS == "render") {
|
413
|
+
let r = t.render ? new Function("params", "h", t.render) : null;
|
414
|
+
col.slots.default = (params, h) => {
|
415
|
+
return r ? r.call(this, params, h) : "";
|
416
|
+
};
|
417
|
+
} else if (columnSelectedWidget) {
|
418
|
+
// col.slots.default = columnSelectedWidget.id;
|
419
|
+
col.slots.default = "widget";
|
420
|
+
} else if (t.formatS == "editTreeButtonGroup") {
|
421
|
+
col.slots.default = "editTreeButtonGroup";
|
422
|
+
}
|
423
|
+
|
424
|
+
if (editWidget) {
|
425
|
+
col.editRender = { name: "input" };
|
426
|
+
// col.slots.edit = editWidget.id;
|
427
|
+
col.slots.edit = "editWidget";
|
428
|
+
}
|
429
|
+
}
|
430
|
+
if (t.tableColumnConfig) {
|
431
|
+
let tableColumnConfig =
|
432
|
+
this.handleCustomEvent(t.tableColumnConfig) || {};
|
433
|
+
col = extendDeeply(col, tableColumnConfig);
|
434
|
+
}
|
435
|
+
return col;
|
436
|
+
};
|
437
|
+
|
438
|
+
let formRef = this.getFormRef();
|
439
|
+
tableColumns.forEach((t) => {
|
440
|
+
let col = createColumn(t);
|
441
|
+
newColumns.push(col);
|
442
|
+
});
|
443
|
+
|
444
|
+
if (
|
445
|
+
baseRefUtil.tableConfig &&
|
446
|
+
baseRefUtil.tableConfig.className == "list-table"
|
447
|
+
) {
|
448
|
+
if (tableColumns.length) {
|
449
|
+
let tableColumn = [tableColumns.length - 1];
|
450
|
+
if (tableColumn.fixed != "right") {
|
451
|
+
newColumns.push({
|
452
|
+
width: 47,
|
453
|
+
title: "",
|
454
|
+
fixed: "right",
|
455
|
+
sortable: false,
|
456
|
+
});
|
457
|
+
}
|
458
|
+
}
|
459
|
+
}
|
460
|
+
return this.$baseLodash.cloneDeep(newColumns);
|
461
|
+
},
|
462
|
+
initTableList() {
|
463
|
+
let that = this;
|
464
|
+
let path = null;
|
465
|
+
let paramFun = null;
|
466
|
+
// let mainDataSetDTO = null;
|
467
|
+
let requestAccess = this.requestAccess;
|
468
|
+
let tableRef = this.getTableRef();
|
469
|
+
let formDataModel = this.getFormRef().formDataModel;
|
470
|
+
let isQueryTable = this.widget.options.isQueryTable || false;
|
471
|
+
let isDataPage = this.widget.options.accessReturnType == "2";
|
472
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
473
|
+
let formCode = reportTemplate.formCode;
|
474
|
+
let dataId = this.formDataId;
|
475
|
+
let accessScript = this.widget.options.accessScript;
|
476
|
+
let searchColumns = null;
|
477
|
+
if (isQueryTable) {
|
478
|
+
path = "#";
|
479
|
+
paramFun = () => {
|
480
|
+
let conditions = this.getSearchCondition();
|
481
|
+
let $grid = this.getGridTable();
|
482
|
+
if (this.widget.options.showPagination) {
|
483
|
+
let proxyInfo = $grid.getProxyInfo();
|
484
|
+
let searchCount = true;
|
485
|
+
let isQueryAllPage = $grid.isQueryAllPage;
|
486
|
+
if (isQueryAllPage == false) {
|
487
|
+
searchCount = false;
|
488
|
+
}
|
489
|
+
let pager = proxyInfo ? proxyInfo.pager : null;
|
490
|
+
if (pager) {
|
491
|
+
conditions.current = pager.currentPage;
|
492
|
+
conditions.size = pager.pageSize;
|
493
|
+
conditions.searchCount = searchCount;
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
/*let formData = {
|
498
|
+
accessCode: requestAccess.accessCode,
|
499
|
+
conditions: conditions
|
500
|
+
};*/
|
501
|
+
let formData = conditions;
|
502
|
+
return formData;
|
503
|
+
};
|
504
|
+
|
505
|
+
searchColumns = [];
|
506
|
+
let widgetList = this.widget.widgetList;
|
507
|
+
|
508
|
+
let getDateItem = (widget) => {
|
509
|
+
let options = widget.options;
|
510
|
+
|
511
|
+
let dateConfig = {
|
512
|
+
format: options.format,
|
513
|
+
valueFormat: options.valueFormat,
|
514
|
+
isRange: widget.type == "time-range",
|
515
|
+
};
|
516
|
+
let typeMap = {
|
517
|
+
input: { type: "input" },
|
518
|
+
number: { type: "number" },
|
519
|
+
inputBatch: { type: "inputBatch" },
|
520
|
+
date: {
|
521
|
+
type: "date",
|
522
|
+
widgetType: options.type,
|
523
|
+
widgetConfig: dateConfig,
|
524
|
+
},
|
525
|
+
time: { type: "time", isRange: false, widgetConfig: dateConfig },
|
526
|
+
"date-range": {
|
527
|
+
type: "date",
|
528
|
+
widgetType: "daterange",
|
529
|
+
widgetConfig: dateConfig,
|
530
|
+
},
|
531
|
+
"time-range": {
|
532
|
+
type: "time",
|
533
|
+
widgetConfig: dateConfig,
|
534
|
+
},
|
535
|
+
};
|
536
|
+
let item = typeMap[widget.type] || {};
|
537
|
+
return item;
|
538
|
+
};
|
539
|
+
|
540
|
+
widgetList.forEach((widget) => {
|
541
|
+
if ("container" !== widget.category) {
|
542
|
+
let options = widget.options;
|
543
|
+
let item = getDateItem(widget);
|
544
|
+
let type = item.type ?? null;
|
545
|
+
// let widgetType = item.widgetType ?? widgetType;
|
546
|
+
// let isRange = item.isRange || false;
|
547
|
+
searchColumns.push({
|
548
|
+
title: this.getI18nLabel(options.label),
|
549
|
+
field: this.getFieldKeyName(widget),
|
550
|
+
// type,
|
551
|
+
// widgetType,
|
552
|
+
// isRange,
|
553
|
+
common: true,
|
554
|
+
disabled: options.disabled,
|
555
|
+
defaultValueEnabled: !!type,
|
556
|
+
slot: options.name,
|
557
|
+
widget: widget,
|
558
|
+
formItem: false,
|
559
|
+
...item,
|
560
|
+
});
|
561
|
+
}
|
562
|
+
});
|
563
|
+
}
|
564
|
+
|
565
|
+
let formRef = this.getFormRef();
|
566
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
567
|
+
this.dataTableConfig = dataTableConfig;
|
568
|
+
|
569
|
+
let columns = this.createColumns();
|
570
|
+
this.widgets = columns
|
571
|
+
.filter((column) => !!column?.params?.widget)
|
572
|
+
.map((column) => column.params.widget);
|
573
|
+
this.editWidgets = columns
|
574
|
+
.filter((column) => !!column?.params?.editWidget)
|
575
|
+
.map((column) => column.params.editWidget);
|
576
|
+
|
577
|
+
let height =
|
578
|
+
this.widget.options.tableHeight || (isQueryTable ? "auto" : null);
|
579
|
+
if (
|
580
|
+
!this.widget.options.tableHeight &&
|
581
|
+
isQueryTable &&
|
582
|
+
this.previewState
|
583
|
+
) {
|
584
|
+
height = "550px";
|
585
|
+
}
|
586
|
+
|
587
|
+
let formConfig = this.formConfig;
|
588
|
+
let scriptCode = this.getScriptCode();
|
589
|
+
|
590
|
+
let otherParam = {};
|
591
|
+
let attachmentType = this.getAttachmentType();
|
592
|
+
if (attachmentType.length) {
|
593
|
+
otherParam.attachmentType = attachmentType;
|
594
|
+
}
|
595
|
+
let thirdtabm = this.getThirdtabm();
|
596
|
+
if (thirdtabm.length) {
|
597
|
+
otherParam.thirdtabm = thirdtabm;
|
598
|
+
}
|
599
|
+
|
600
|
+
let pagerConfig = {};
|
601
|
+
let editDefaultRow, treeNodeParam, treeConfig;
|
602
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
603
|
+
if (isTreeTable) {
|
604
|
+
pagerConfig.pagerClass = "is--hidden";
|
605
|
+
if (this.widget.options.editDefaultRow) {
|
606
|
+
editDefaultRow = this.handleCustomEvent(
|
607
|
+
this.widget.options.editDefaultRow
|
608
|
+
);
|
609
|
+
}
|
610
|
+
treeNodeParam = (row) => {
|
611
|
+
return {
|
612
|
+
[this.widget.options.parentField]: row.id,
|
613
|
+
};
|
614
|
+
};
|
615
|
+
treeConfig = {
|
616
|
+
lazy: false,
|
617
|
+
children: "f_children",
|
618
|
+
hasChild: "f_has_child", // 设置是否有子节点标识
|
619
|
+
parentField: "f_parent",
|
620
|
+
transform: true,
|
621
|
+
expandAll: true,
|
622
|
+
loadMethod({ $table, row }) {
|
623
|
+
// 模拟后台接口
|
624
|
+
let $grid = that.getGridTable();
|
625
|
+
let parentField = $grid.treeConfig.parentField;
|
626
|
+
return new Promise((resolve, reject) => {
|
627
|
+
let treeParam = that.widget.options.tableConfig?.treeNodeParam;
|
628
|
+
let reqPram = {};
|
629
|
+
if (treeParam) {
|
630
|
+
reqPram = treeParam(row) || {};
|
631
|
+
}
|
632
|
+
Object.assign(reqPram, {
|
633
|
+
[parentField]: row.id,
|
634
|
+
});
|
635
|
+
let accessParam = this.getAccessParam() || {};
|
636
|
+
let defaultOption = that.getHttpConfigForUser();
|
637
|
+
that.formHttp({
|
638
|
+
scriptCode: scriptCode,
|
639
|
+
data: {
|
640
|
+
formCode: formCode,
|
641
|
+
formVersion: reportTemplate.formVersion,
|
642
|
+
taBm: that.fieldKeyName,
|
643
|
+
data: {
|
644
|
+
...reqPram,
|
645
|
+
...otherParam,
|
646
|
+
...accessParam,
|
647
|
+
},
|
648
|
+
},
|
649
|
+
callback: (res) => {
|
650
|
+
if (res.type == "success") {
|
651
|
+
let rows = res.objx
|
652
|
+
? res.objx.records || res.objx || []
|
653
|
+
: [];
|
654
|
+
|
655
|
+
let hasChildField = $grid.treeConfig.hasChild;
|
656
|
+
if (row[hasChildField] && !rows.length) {
|
657
|
+
row[hasChildField] = false;
|
658
|
+
}
|
659
|
+
|
660
|
+
resolve(rows);
|
661
|
+
let treeCallback =
|
662
|
+
that.widget.options.tableConfig?.treeCallback;
|
663
|
+
if (treeCallback) {
|
664
|
+
that.$nextTick(() => {
|
665
|
+
setTimeout(function () {
|
666
|
+
treeCallback(rows);
|
667
|
+
}, 0);
|
668
|
+
});
|
669
|
+
}
|
670
|
+
} else {
|
671
|
+
reject(res);
|
672
|
+
}
|
673
|
+
},
|
674
|
+
});
|
675
|
+
});
|
676
|
+
},
|
677
|
+
};
|
678
|
+
}
|
679
|
+
let editOpts = {};
|
680
|
+
if (this.widget.options.isEditTable) {
|
681
|
+
editOpts = {
|
682
|
+
keepSource: true,
|
683
|
+
editConfig: {
|
684
|
+
trigger: "manual",
|
685
|
+
mode: "row",
|
686
|
+
showStatus: true,
|
687
|
+
autoClear: false,
|
688
|
+
},
|
689
|
+
};
|
690
|
+
}
|
691
|
+
let showFooter = this.widget.options.showGridFooter || false;
|
692
|
+
let tableOption = {
|
693
|
+
// vue: this,
|
694
|
+
tableRef: tableRef,
|
695
|
+
tableName: this.getGridTableName(),
|
696
|
+
param: paramFun,
|
697
|
+
columns: columns,
|
698
|
+
searchColumns: searchColumns,
|
699
|
+
vform: true,
|
700
|
+
config: {
|
701
|
+
height: height,
|
702
|
+
showFooter,
|
703
|
+
pagerConfig,
|
704
|
+
treeConfig,
|
705
|
+
...editOpts,
|
706
|
+
...dataTableConfig.config,
|
707
|
+
},
|
708
|
+
exportAjax: (param) => {
|
709
|
+
let $grid = this.getGridTable();
|
710
|
+
let pageSize = param.size;
|
711
|
+
let currentPage = param.current;
|
712
|
+
let page = { pageSize, currentPage };
|
713
|
+
let customParam = {
|
714
|
+
config: {
|
715
|
+
modal: false,
|
716
|
+
},
|
717
|
+
};
|
718
|
+
return $grid.$options.propsData.proxyConfig.ajax.query.call(this, {
|
719
|
+
page,
|
720
|
+
param,
|
721
|
+
customParam,
|
722
|
+
});
|
723
|
+
},
|
724
|
+
// treeNodeUrl,
|
725
|
+
editDefaultRow,
|
726
|
+
treeNodeParam,
|
727
|
+
};
|
728
|
+
|
729
|
+
if (isQueryTable) {
|
730
|
+
/*if(this.widget.options.isTreeTable){
|
731
|
+
tableOption.config.pagerConfig.autoHidden = false;
|
732
|
+
}*/
|
733
|
+
tableOption.path = path;
|
734
|
+
tableOption.config.proxyConfig = {
|
735
|
+
props: {
|
736
|
+
result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
|
737
|
+
total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
|
738
|
+
},
|
739
|
+
ajax: {
|
740
|
+
// 接收 Promise 对象
|
741
|
+
query: ({ page, sorts, filters, form, param, customParam }) => {
|
742
|
+
let formData = tableOption.param ? tableOption.param() || {} : {};
|
743
|
+
const queryParams = Object.assign({}, formData);
|
744
|
+
|
745
|
+
// 处理排序条件
|
746
|
+
/*if (sorts) {
|
747
|
+
const firstSort = sorts[0];
|
748
|
+
if (firstSort) {
|
749
|
+
queryParams.sort = firstSort.property;
|
750
|
+
queryParams.order = firstSort.order;
|
751
|
+
}
|
752
|
+
}*/
|
753
|
+
|
754
|
+
// 处理筛选条件
|
755
|
+
if (filters) {
|
756
|
+
filters.forEach(({ property, values }) => {
|
757
|
+
queryParams[property] = values.join(",");
|
758
|
+
});
|
759
|
+
}
|
760
|
+
|
761
|
+
if (page.pageSize !== undefined) {
|
762
|
+
queryParams["size"] = page.pageSize;
|
763
|
+
queryParams["current"] = page.currentPage;
|
764
|
+
}
|
765
|
+
|
766
|
+
let $grid = this.getGridTable();
|
767
|
+
let isQueryAllPage = $grid.isQueryAllPage;
|
768
|
+
let pathStr1 = "";
|
769
|
+
if (isQueryAllPage === false) {
|
770
|
+
queryParams.searchCount = false;
|
771
|
+
}
|
772
|
+
Object.assign(queryParams, param);
|
773
|
+
|
774
|
+
var reqPath = typeof path == "function" ? path() : path;
|
775
|
+
let accessReturnType = this.widget.options.accessReturnType || 2;
|
776
|
+
let scriptCode = this.getScriptCode();
|
777
|
+
return new Promise((resolve, reject) => {
|
778
|
+
/*let items = [
|
779
|
+
{
|
780
|
+
"create_by": "admin",
|
781
|
+
"object_foreign_id": 224,
|
782
|
+
"f_code": "202501068569",
|
783
|
+
"f_grade": "1",
|
784
|
+
"f_name": "呃呃呃呃呃呃俄文",
|
785
|
+
"company_code": "mk1",
|
786
|
+
"id": 95,
|
787
|
+
"modify_by": "admin",
|
788
|
+
"create_date": "2025-01-06 17:53:34",
|
789
|
+
"f_flag": "A",
|
790
|
+
"modify_date": "2025-01-16 21:11:44"
|
791
|
+
},
|
792
|
+
{
|
793
|
+
"create_by": "admin",
|
794
|
+
"object_foreign_id": 224,
|
795
|
+
"f_code": "202501068569",
|
796
|
+
"f_grade": "1",
|
797
|
+
"f_name": "呃呃呃呃呃呃俄文",
|
798
|
+
"company_code": "mk1",
|
799
|
+
"id": 10095,
|
800
|
+
"modify_by": "admin",
|
801
|
+
"create_date": "2025-01-06 17:53:34",
|
802
|
+
"f_flag": "A",
|
803
|
+
"modify_date": "2025-01-16 21:11:44"
|
804
|
+
},
|
805
|
+
{
|
806
|
+
"create_by": "admin",
|
807
|
+
"object_foreign_id": 221,
|
808
|
+
"f_code": "202501037347",
|
809
|
+
"f_grade": "1",
|
810
|
+
"f_name": "张三",
|
811
|
+
"company_code": "mk1",
|
812
|
+
"id": 92,
|
813
|
+
"modify_by": "admin",
|
814
|
+
"create_date": "2025-01-03 17:49:55",
|
815
|
+
"f_flag": "A",
|
816
|
+
"modify_date": "2025-01-05 17:21:46"
|
817
|
+
},
|
818
|
+
{
|
819
|
+
"create_by": "admin",
|
820
|
+
"object_foreign_id": 222,
|
821
|
+
"f_code": "202501037348",
|
822
|
+
"f_grade": "2",
|
823
|
+
"f_name": "李四",
|
824
|
+
"company_code": "mk1",
|
825
|
+
"id": 93,
|
826
|
+
"modify_by": "admin",
|
827
|
+
"create_date": "2025-01-03 17:49:55",
|
828
|
+
"f_flag": "A",
|
829
|
+
"modify_date": "2025-01-03 17:49:55"
|
830
|
+
},
|
831
|
+
{
|
832
|
+
"create_by": "admin",
|
833
|
+
"object_foreign_id": 222,
|
834
|
+
"f_code": "202501037348",
|
835
|
+
"f_grade": "2",
|
836
|
+
"f_name": "李四",
|
837
|
+
"company_code": "mk1",
|
838
|
+
"id": 10093,
|
839
|
+
"modify_by": "admin",
|
840
|
+
"create_date": "2025-01-03 17:49:55",
|
841
|
+
"f_flag": "A",
|
842
|
+
"modify_date": "2025-01-03 17:49:55"
|
843
|
+
},
|
844
|
+
{
|
845
|
+
"create_by": "admin",
|
846
|
+
"object_foreign_id": 223,
|
847
|
+
"f_code": "202501037349",
|
848
|
+
"f_grade": "3",
|
849
|
+
"f_name": "王五",
|
850
|
+
"company_code": "mk1",
|
851
|
+
"id": 94,
|
852
|
+
"modify_by": "admin",
|
853
|
+
"create_date": "2025-01-03 17:49:55",
|
854
|
+
"f_flag": "A",
|
855
|
+
"modify_date": "2025-01-03 17:49:55"
|
856
|
+
},
|
857
|
+
{
|
858
|
+
"create_by": "admin",
|
859
|
+
"object_foreign_id": 218,
|
860
|
+
"f_code": "202501037340",
|
861
|
+
"f_grade": "4",
|
862
|
+
"f_name": "林一",
|
863
|
+
"company_code": "mk1",
|
864
|
+
"id": 89,
|
865
|
+
"modify_by": "admin",
|
866
|
+
"create_date": "2025-01-03 15:02:31",
|
867
|
+
"f_flag": "A",
|
868
|
+
"modify_date": "2025-01-03 15:02:31"
|
869
|
+
},
|
870
|
+
{
|
871
|
+
"create_by": "admin",
|
872
|
+
"object_foreign_id": 219,
|
873
|
+
"f_code": "202501037341",
|
874
|
+
"f_grade": "3",
|
875
|
+
"f_name": "林二",
|
876
|
+
"company_code": "mk1",
|
877
|
+
"id": 90,
|
878
|
+
"modify_by": "admin",
|
879
|
+
"create_date": "2025-01-03 15:02:31",
|
880
|
+
"f_flag": "A",
|
881
|
+
"modify_date": "2025-01-03 15:02:31"
|
882
|
+
}
|
883
|
+
];
|
884
|
+
let currentId = 0;
|
885
|
+
let records = [];
|
886
|
+
for(let i=0;i<50;i++){
|
887
|
+
let newItems = items.map((item,index)=>{
|
888
|
+
let flag = (index+1)%2!=0;
|
889
|
+
let line = flag ? index : (index-1)
|
890
|
+
let f_code = '10000'+i+''+line;
|
891
|
+
currentId++
|
892
|
+
return {
|
893
|
+
...item,
|
894
|
+
id:currentId,
|
895
|
+
f_code
|
896
|
+
};
|
897
|
+
})
|
898
|
+
records.push(...newItems)
|
899
|
+
}
|
900
|
+
|
901
|
+
let res = {
|
902
|
+
"time": "2025-03-21 11:24:55",
|
903
|
+
"type": "success",
|
904
|
+
"content": "success",
|
905
|
+
"objx": {
|
906
|
+
"records": [],
|
907
|
+
"total": 77,
|
908
|
+
"size": 100,
|
909
|
+
"current": 1,
|
910
|
+
"orders": [],
|
911
|
+
"optimizeCountSql": true,
|
912
|
+
"hitCount": false,
|
913
|
+
"countId": null,
|
914
|
+
"maxLimit": null,
|
915
|
+
"searchCount": true,
|
916
|
+
"pages": 1
|
917
|
+
},
|
918
|
+
"rmid": null
|
919
|
+
};
|
920
|
+
res.objx.records = records
|
921
|
+
resolve(res);
|
922
|
+
return*/
|
923
|
+
let reqData = {
|
924
|
+
...queryParams,
|
925
|
+
};
|
926
|
+
if (scriptCode) {
|
927
|
+
let index = 0;
|
928
|
+
let toDo = () => {
|
929
|
+
// let f = new Function("dataId", "formCode", "param", "done", accessScript);
|
930
|
+
let done = (res) => {
|
931
|
+
resolve(res);
|
932
|
+
if (res.type == "success") {
|
933
|
+
let rows = res.objx
|
934
|
+
? res.objx.records || res.objx || []
|
935
|
+
: [];
|
936
|
+
if (that.widget.options.isTreeTable) {
|
937
|
+
if (rows.length > 0) {
|
938
|
+
let fullAllDataRowMap =
|
939
|
+
$grid.$refs.xTable.fullAllDataRowMap;
|
940
|
+
let parentField = $grid.treeConfig.parentField;
|
941
|
+
let expandAll = $grid.treeConfig.expandAll || false;
|
942
|
+
let isLazy = $grid.treeConfig.lazy;
|
943
|
+
let expandIds = rows
|
944
|
+
.filter((item) => item[parentField])
|
945
|
+
.map((item) => item[parentField]);
|
946
|
+
let expandRows = expandIds.length
|
947
|
+
? rows.filter((item) =>
|
948
|
+
expandIds.includes(item.id)
|
949
|
+
)
|
950
|
+
: [];
|
951
|
+
if (expandAll && expandRows.length) {
|
952
|
+
that.$nextTick(() => {
|
953
|
+
setTimeout(function () {
|
954
|
+
$grid.treeConfig.lazy = false;
|
955
|
+
$grid.setTreeExpand(expandRows, true);
|
956
|
+
expandRows.forEach((lineData) => {
|
957
|
+
if (
|
958
|
+
$grid.$refs.xTable.isTreeExpandByRow(
|
959
|
+
lineData
|
960
|
+
)
|
961
|
+
) {
|
962
|
+
let rest =
|
963
|
+
fullAllDataRowMap.get(lineData);
|
964
|
+
rest.treeLoaded = true;
|
965
|
+
}
|
966
|
+
});
|
967
|
+
|
968
|
+
$grid.treeConfig.lazy = isLazy;
|
969
|
+
}, 0);
|
970
|
+
});
|
971
|
+
}
|
972
|
+
|
973
|
+
let row = rows.find((item) => !item[parentField]);
|
974
|
+
if (
|
975
|
+
row &&
|
976
|
+
(!expandAll || !expandIds.includes(row.id))
|
977
|
+
) {
|
978
|
+
let hasChild = $grid.treeConfig.hasChild;
|
979
|
+
if (row[hasChild]) {
|
980
|
+
that.$nextTick(() => {
|
981
|
+
setTimeout(function () {
|
982
|
+
$grid.setTreeExpand(row, true);
|
983
|
+
}, 0);
|
984
|
+
});
|
985
|
+
}
|
986
|
+
}
|
987
|
+
}
|
988
|
+
}
|
989
|
+
that.$nextTick(() => {
|
990
|
+
setTimeout(function () {
|
991
|
+
tableOption.callback && tableOption.callback(rows);
|
992
|
+
that.handleCustomEvent(
|
993
|
+
that.widget.options.formScriptCallback,
|
994
|
+
["rows"],
|
995
|
+
[rows]
|
996
|
+
);
|
997
|
+
}, 0);
|
998
|
+
});
|
999
|
+
}
|
1000
|
+
};
|
1001
|
+
this.loadDefaultQueryList(reqData, done, customParam);
|
1002
|
+
};
|
1003
|
+
let loopHandle = () => {
|
1004
|
+
if (index < 500 && $grid.tableFormStop === true) {
|
1005
|
+
//阻塞列表查询,或者次数达到500时,自动释放
|
1006
|
+
index++;
|
1007
|
+
setTimeout(() => {
|
1008
|
+
loopHandle();
|
1009
|
+
}, 10);
|
1010
|
+
} else {
|
1011
|
+
if ($grid.tableFormStop) $grid.tableFormStop = false;
|
1012
|
+
toDo();
|
1013
|
+
}
|
1014
|
+
};
|
1015
|
+
loopHandle();
|
1016
|
+
} else {
|
1017
|
+
resolve();
|
1018
|
+
}
|
1019
|
+
});
|
1020
|
+
},
|
1021
|
+
},
|
1022
|
+
};
|
1023
|
+
tableOption.callback = (rows) => {
|
1024
|
+
// this.fieldModel = rows;
|
1025
|
+
this.formModel[this.fieldKeyName] = rows;
|
1026
|
+
};
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
if (isTreeTable) {
|
1030
|
+
tableOption.filterType = false;
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
if (this.widget.options.tableConfig) {
|
1034
|
+
let tableConfig =
|
1035
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
1036
|
+
tableOption = extendDeeply(tableOption, tableConfig);
|
1037
|
+
this.tableConfig = tableConfig;
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
if (tableOption.config.showFooter && !tableOption.config.footerMethod) {
|
1041
|
+
let footerColumnIds = columns
|
1042
|
+
.filter((item) => !!item.params?.footerDataType)
|
1043
|
+
.map((item) => item.params.columnId);
|
1044
|
+
if (footerColumnIds.length) {
|
1045
|
+
tableOption.config.footerMethod = (param) => {
|
1046
|
+
let { columns: column1s, data } = param;
|
1047
|
+
return [
|
1048
|
+
column1s.map((column, columnIndex) => {
|
1049
|
+
let columnId = column.params?.columnId;
|
1050
|
+
if (columnId && footerColumnIds.includes(columnId)) {
|
1051
|
+
let footerDataType = column.params.footerDataType;
|
1052
|
+
if (footerDataType == "1") {
|
1053
|
+
//求和
|
1054
|
+
return this.sumNum(data, column.field);
|
1055
|
+
} else if (footerDataType == "2") {
|
1056
|
+
//求平均值
|
1057
|
+
return this.meanNum(data, column.field);
|
1058
|
+
} else if (footerDataType == "3") {
|
1059
|
+
if (column.params.footerMethodConfg) {
|
1060
|
+
let n = new Function(
|
1061
|
+
"dataId",
|
1062
|
+
"formCode",
|
1063
|
+
"param",
|
1064
|
+
column.params.footerMethodConfg
|
1065
|
+
);
|
1066
|
+
return n.call(this, dataId, formCode, param) ?? null;
|
1067
|
+
}
|
1068
|
+
}
|
1069
|
+
}
|
1070
|
+
return null;
|
1071
|
+
}),
|
1072
|
+
];
|
1073
|
+
};
|
1074
|
+
}
|
1075
|
+
}
|
1076
|
+
tableOption.vue = this;
|
1077
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
1078
|
+
this.vxeOption = opts;
|
1079
|
+
if (!isQueryTable) {
|
1080
|
+
setTimeout(() => {
|
1081
|
+
this.loadAccessData(1);
|
1082
|
+
}, 20);
|
1083
|
+
}
|
1084
|
+
});
|
1085
|
+
},
|
1086
|
+
meanNum(list, field) {
|
1087
|
+
let count = this.sumNum(list, field);
|
1088
|
+
return this.$baseDiv(count, list.length);
|
1089
|
+
},
|
1090
|
+
sumNum(list, field) {
|
1091
|
+
let count = 0;
|
1092
|
+
list.forEach((item) => {
|
1093
|
+
count = this.$baseAdd(count, item[field]);
|
1094
|
+
});
|
1095
|
+
return count;
|
1096
|
+
},
|
1097
|
+
getSearchFormData() {
|
1098
|
+
let map = { condition: [] };
|
1099
|
+
let formData = this.globalModel.formModel;
|
1100
|
+
let widgetList = this.widget.widgetList;
|
1101
|
+
if (!!widgetList && widgetList.length > 0) {
|
1102
|
+
let loop = (wItem) => {
|
1103
|
+
if (wItem.category === "container") {
|
1104
|
+
loop(wItem);
|
1105
|
+
} else {
|
1106
|
+
let formField = this.getFieldKeyName(wItem);
|
1107
|
+
let vaule = formData[formField];
|
1108
|
+
if (vaule !== null && vaule !== undefined && vaule !== "") {
|
1109
|
+
if (!Array.isArray(vaule) || vaule.length > 0) {
|
1110
|
+
let item = {
|
1111
|
+
value: vaule,
|
1112
|
+
field: formField,
|
1113
|
+
filter: null,
|
1114
|
+
};
|
1115
|
+
let wType = wItem.type;
|
1116
|
+
if (["date-range", "time-range"].includes(wType)) {
|
1117
|
+
item.filter = "between";
|
1118
|
+
} else if (
|
1119
|
+
["input-batch", "checkbox"].includes(wType) ||
|
1120
|
+
(wType == "select" && wItem.options.multiple)
|
1121
|
+
) {
|
1122
|
+
item.filter = "in";
|
1123
|
+
} else if (
|
1124
|
+
["radio", "time", "date"].includes(wType) ||
|
1125
|
+
(wType == "select" && !wItem.options.multiple)
|
1126
|
+
) {
|
1127
|
+
item.filter = "eq";
|
1128
|
+
} else {
|
1129
|
+
item.filter = "like";
|
1130
|
+
}
|
1131
|
+
map.condition.push(item);
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
};
|
1136
|
+
widgetList.forEach((wItem) => {
|
1137
|
+
loop(wItem);
|
1138
|
+
});
|
1139
|
+
}
|
1140
|
+
return map;
|
1141
|
+
},
|
1142
|
+
getUrl() {
|
1143
|
+
let accessUrl = this.widget.options.accessUrl;
|
1144
|
+
return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
|
1145
|
+
},
|
1146
|
+
getAttachmentType() {
|
1147
|
+
let vailColumns = this.widget.options.tableColumns.filter(
|
1148
|
+
(item) => item.prop && item.label
|
1149
|
+
);
|
1150
|
+
let result = vailColumns
|
1151
|
+
.filter((item) => {
|
1152
|
+
return item.formatS == "editAttachment";
|
1153
|
+
})
|
1154
|
+
.map((item) => item.prop);
|
1155
|
+
return result;
|
1156
|
+
},
|
1157
|
+
getThirdtabm() {
|
1158
|
+
let vailColumns = this.widget.options.tableColumns.filter(
|
1159
|
+
(item) => item.prop && item.label
|
1160
|
+
);
|
1161
|
+
let result = vailColumns
|
1162
|
+
.filter((item) => {
|
1163
|
+
return (
|
1164
|
+
item.formatS == "editSearch" && item.columnOption.multipleChoices
|
1165
|
+
);
|
1166
|
+
})
|
1167
|
+
.map((item) => item.prop);
|
1168
|
+
return result;
|
1169
|
+
},
|
1170
|
+
|
1171
|
+
loadDefaultViewList() {
|
1172
|
+
let dataId = this.formDataId;
|
1173
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
1174
|
+
let formCode = reportTemplate.formCode;
|
1175
|
+
let accessParam = this.getAccessParam() || {};
|
1176
|
+
let otherParam = {};
|
1177
|
+
let attachmentType = this.getAttachmentType();
|
1178
|
+
if (attachmentType.length) {
|
1179
|
+
otherParam.attachmentType = attachmentType;
|
1180
|
+
}
|
1181
|
+
let thirdtabm = this.getThirdtabm();
|
1182
|
+
if (thirdtabm.length) {
|
1183
|
+
otherParam.thirdtabm = thirdtabm;
|
1184
|
+
}
|
1185
|
+
let scriptCode = this.getScriptCode();
|
1186
|
+
return this.formHttp({
|
1187
|
+
/*url: "/" + reportTemplate.serviceName + "/form_ins/getList",*/
|
1188
|
+
scriptCode: scriptCode,
|
1189
|
+
data: {
|
1190
|
+
formCode: formCode,
|
1191
|
+
formVersion: reportTemplate.formVersion,
|
1192
|
+
taBm: this.fieldKeyName,
|
1193
|
+
data: {
|
1194
|
+
id: dataId,
|
1195
|
+
...otherParam,
|
1196
|
+
...accessParam,
|
1197
|
+
},
|
1198
|
+
},
|
1199
|
+
callback: (res) => {
|
1200
|
+
let $grid = this.getGridTable();
|
1201
|
+
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
1202
|
+
let defaultRow = this.createNewTableData();
|
1203
|
+
rows = rows.map((row) => {
|
1204
|
+
return {
|
1205
|
+
...defaultRow,
|
1206
|
+
...row,
|
1207
|
+
};
|
1208
|
+
});
|
1209
|
+
this.setValue(rows);
|
1210
|
+
this.$nextTick(() => {
|
1211
|
+
/*if (this.widget.options.isTreeTable) {
|
1212
|
+
let $grid = this.getGridTable();
|
1213
|
+
$grid.treeConfig.lazy = false;
|
1214
|
+
$grid.setAllTreeExpand(true);
|
1215
|
+
}*/
|
1216
|
+
this.tableConfig.callback && this.tableConfig.callback(rows);
|
1217
|
+
this.handleCustomEvent(
|
1218
|
+
this.widget.options.formScriptCallback,
|
1219
|
+
["rows"],
|
1220
|
+
[rows]
|
1221
|
+
);
|
1222
|
+
this.$forceUpdate();
|
1223
|
+
});
|
1224
|
+
},
|
1225
|
+
});
|
1226
|
+
},
|
1227
|
+
getAccessParam() {
|
1228
|
+
if (!this.widget.options.formScriptParam) return;
|
1229
|
+
return this.handleCustomEvent(this.widget.options.formScriptParam);
|
1230
|
+
},
|
1231
|
+
getScriptCode() {
|
1232
|
+
let accessReturnType = this.widget.options.accessReturnType;
|
1233
|
+
let defaultScriptCode = "getList";
|
1234
|
+
if (accessReturnType == 1) {
|
1235
|
+
defaultScriptCode = "getList";
|
1236
|
+
} else if (accessReturnType == 2) {
|
1237
|
+
defaultScriptCode = "getPage";
|
1238
|
+
}
|
1239
|
+
let scriptCode = this.widget.options.formScriptCode || defaultScriptCode;
|
1240
|
+
return scriptCode;
|
1241
|
+
},
|
1242
|
+
loadDefaultQueryList(reqData, done, customParam) {
|
1243
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
1244
|
+
let prefix = "/" + reportTemplate.serviceName;
|
1245
|
+
let formCode = reportTemplate.formCode;
|
1246
|
+
let formConfig = this.formConfig;
|
1247
|
+
let accessReturnType = this.widget.options.accessReturnType;
|
1248
|
+
let scriptCode = this.getScriptCode();
|
1249
|
+
let accessParam = this.getAccessParam() || {};
|
1250
|
+
|
1251
|
+
let otherParam = {};
|
1252
|
+
let attachmentType = this.getAttachmentType();
|
1253
|
+
if (attachmentType.length) {
|
1254
|
+
otherParam.attachmentType = attachmentType;
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
let defaultOption = this.getHttpConfigForUser();
|
1258
|
+
|
1259
|
+
let ajaxConfig = customParam?.config || {};
|
1260
|
+
|
1261
|
+
return this.formHttp({
|
1262
|
+
// url: prefix + "/form_ins/getPage",
|
1263
|
+
scriptCode: scriptCode,
|
1264
|
+
data: {
|
1265
|
+
formCode: formCode,
|
1266
|
+
formVersion: reportTemplate.formVersion,
|
1267
|
+
taBm: this.fieldKeyName,
|
1268
|
+
data: {
|
1269
|
+
...reqData,
|
1270
|
+
...otherParam,
|
1271
|
+
...accessParam,
|
1272
|
+
},
|
1273
|
+
},
|
1274
|
+
...defaultOption,
|
1275
|
+
...ajaxConfig,
|
1276
|
+
callback: (res) => {
|
1277
|
+
done(res);
|
1278
|
+
},
|
1279
|
+
});
|
1280
|
+
},
|
1281
|
+
loadAccessData(flag) {
|
1282
|
+
if (flag === 1) {
|
1283
|
+
let tableConfig = this.tableConfig;
|
1284
|
+
let accessEnabled = tableConfig.accessEnabled ?? true;
|
1285
|
+
if (accessEnabled === false) {
|
1286
|
+
return;
|
1287
|
+
}
|
1288
|
+
if (this.formConfig.isLoadEntity && !this.formDataId) {
|
1289
|
+
return;
|
1290
|
+
}
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
let scriptCode = this.getScriptCode();
|
1294
|
+
if (scriptCode) {
|
1295
|
+
this.loadDefaultViewList();
|
1296
|
+
}
|
1297
|
+
},
|
1298
|
+
getReqParam(item, dataId, billData) {
|
1299
|
+
let param = {};
|
1300
|
+
if (item.accessParam) {
|
1301
|
+
if (typeof item.accessParam === "string") {
|
1302
|
+
let n = new Function("billData", item.accessParam);
|
1303
|
+
param = n.call(this, billData);
|
1304
|
+
} else {
|
1305
|
+
param = item.accessParam;
|
1306
|
+
}
|
1307
|
+
} else {
|
1308
|
+
param = { id: dataId };
|
1309
|
+
}
|
1310
|
+
return param;
|
1311
|
+
},
|
1312
|
+
getTableRef() {
|
1313
|
+
let tableRef = this.widget.id;
|
1314
|
+
return tableRef;
|
1315
|
+
},
|
1316
|
+
exportData(option) {
|
1317
|
+
let tableRef = this.getTableRef();
|
1318
|
+
let serviceName = this.getFormRef().reportTemplate.serviceName;
|
1319
|
+
option.prefix = option.prefix || "/" + serviceName;
|
1320
|
+
this.$excelExport({ targetRef: tableRef, ...option });
|
1321
|
+
},
|
1322
|
+
async deleteRow(row, rowIndex) {
|
1323
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
1324
|
+
if (isTreeTable) {
|
1325
|
+
this.removeTreeRow({ row });
|
1326
|
+
return;
|
1327
|
+
}
|
1328
|
+
let $grid = this.getGridTable();
|
1329
|
+
$grid.remove(row);
|
1330
|
+
let tableData = $grid.getTableData();
|
1331
|
+
let isEditTable = this.widget.options.isEditTable;
|
1332
|
+
let fullData = !isEditTable ? tableData.fullData : tableData.tableData;
|
1333
|
+
await this.$nextTick(() => {
|
1334
|
+
this.formModel[this.fieldKeyName] = fullData;
|
1335
|
+
this.fieldModel = fullData;
|
1336
|
+
});
|
1337
|
+
this.$nextTick(() => {
|
1338
|
+
this.handleWbs();
|
1339
|
+
});
|
1340
|
+
},
|
1341
|
+
createNewTableData(isEdit) {
|
1342
|
+
let vailColumns = this.widget.options.tableColumns.filter(
|
1343
|
+
(item) => item.prop && item.label
|
1344
|
+
);
|
1345
|
+
let newData = {};
|
1346
|
+
vailColumns.forEach((item) => {
|
1347
|
+
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
1348
|
+
let columnOption = !isEdit ? item.columnOption : item.editColumnOption;
|
1349
|
+
if (formatS == "editSearch") {
|
1350
|
+
newData[item.prop] = null;
|
1351
|
+
let vabSearchName = item?.columnOption?.vabSearchName;
|
1352
|
+
if (vabSearchName) newData[vabSearchName] = null;
|
1353
|
+
}
|
1354
|
+
if (formatS == "editAttachment") {
|
1355
|
+
newData[item.prop] = [];
|
1356
|
+
} else {
|
1357
|
+
newData[item.prop] = null;
|
1358
|
+
if (
|
1359
|
+
columnOption &&
|
1360
|
+
columnOption.defaultValue !== undefined &&
|
1361
|
+
columnOption.defaultValue !== null &&
|
1362
|
+
columnOption.defaultValue !== ""
|
1363
|
+
) {
|
1364
|
+
newData[item.prop] = columnOption.defaultValue;
|
1365
|
+
}
|
1366
|
+
}
|
1367
|
+
});
|
1368
|
+
return newData;
|
1369
|
+
},
|
1370
|
+
addTableData(rows, field) {
|
1371
|
+
let $grid = this.getGridTable();
|
1372
|
+
let formDataModel = this.formModel;
|
1373
|
+
let tableRows = formDataModel[this.fieldKeyName] || [];
|
1374
|
+
let fullData = $grid.getTableData().fullData;
|
1375
|
+
let items;
|
1376
|
+
if (field) {
|
1377
|
+
let keys = fullData.map((item) => {
|
1378
|
+
return item[field] + "";
|
1379
|
+
});
|
1380
|
+
items = rows.filter((item) => {
|
1381
|
+
let value = item[field] + "";
|
1382
|
+
return !keys.includes(value);
|
1383
|
+
});
|
1384
|
+
} else {
|
1385
|
+
items = rows;
|
1386
|
+
}
|
1387
|
+
if (items) {
|
1388
|
+
if (items.length) {
|
1389
|
+
items.forEach((row) => {
|
1390
|
+
let newData = this.createNewTableData();
|
1391
|
+
Object.assign(newData, row);
|
1392
|
+
|
1393
|
+
tableRows.push(newData);
|
1394
|
+
});
|
1395
|
+
}
|
1396
|
+
} else {
|
1397
|
+
let newData = this.createNewTableData();
|
1398
|
+
tableRows.push(newData);
|
1399
|
+
}
|
1400
|
+
// this.formModel[this.fieldKeyName] = this.$baseLodash(this.fieldModel)
|
1401
|
+
// this.fieldModel = tableRows
|
1402
|
+
this.setValue(tableRows);
|
1403
|
+
this.$nextTick(() => {
|
1404
|
+
this.handleWbs();
|
1405
|
+
});
|
1406
|
+
// $grid.loadData(tableRows);
|
1407
|
+
},
|
1408
|
+
getColumnWidgetConfig(row, isEdit) {
|
1409
|
+
let formatS = isEdit ? row.editFormatS : row.formatS;
|
1410
|
+
let formRef = this.getFormRef();
|
1411
|
+
let columnSelectedWidget = null;
|
1412
|
+
let columnEditFields = null;
|
1413
|
+
|
1414
|
+
let type = this.columnFormatMap[formatS];
|
1415
|
+
/*if (type == 'date') {
|
1416
|
+
columnEditFields = ['type', 'format', 'valueFormat']
|
1417
|
+
} else if (type == 'select') {
|
1418
|
+
|
1419
|
+
}
|
1420
|
+
if (type == 'vabsearch') {
|
1421
|
+
columnEditFields = ['vabSearchField', 'formCode', 'formVersion', 'required', 'showFormField', 'onSearchConfirm', 'onSearchClear']
|
1422
|
+
}*/
|
1423
|
+
|
1424
|
+
if (type) {
|
1425
|
+
columnSelectedWidget = this.$baseLodash.cloneDeep(
|
1426
|
+
formRef.getFieldWidgetByType(type)
|
1427
|
+
);
|
1428
|
+
let tmpId = generateId();
|
1429
|
+
let idVal = row.prop ? row.prop : type + tmpId;
|
1430
|
+
columnSelectedWidget.id = idVal;
|
1431
|
+
columnSelectedWidget.options.name = idVal;
|
1432
|
+
|
1433
|
+
let columnOption;
|
1434
|
+
if (!isEdit) {
|
1435
|
+
columnOption = row.columnOption;
|
1436
|
+
} else {
|
1437
|
+
columnOption = row.editColumnOption;
|
1438
|
+
}
|
1439
|
+
|
1440
|
+
if (columnOption && Object.keys(columnOption).length) {
|
1441
|
+
columnOption.required = row.required || false;
|
1442
|
+
columnSelectedWidget.options = columnOption;
|
1443
|
+
if ("editDelete" == formatS) {
|
1444
|
+
columnSelectedWidget.options.hiddenByWf =
|
1445
|
+
columnSelectedWidget.options.hiddenByWf ?? true;
|
1446
|
+
columnSelectedWidget.options.prefixIcon =
|
1447
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-delete";
|
1448
|
+
} else if ("editButton" == formatS) {
|
1449
|
+
columnSelectedWidget.options.prefixIcon =
|
1450
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-edit";
|
1451
|
+
}
|
1452
|
+
} else {
|
1453
|
+
columnSelectedWidget.options.required = row.required || false;
|
1454
|
+
if ("editDelete" == formatS) {
|
1455
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
1456
|
+
columnSelectedWidget.options.label = "删除";
|
1457
|
+
columnSelectedWidget.options.labelHidden = true;
|
1458
|
+
columnSelectedWidget.options.hiddenByWf = true;
|
1459
|
+
columnSelectedWidget.options.onClick =
|
1460
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
|
1461
|
+
} else if ("editButton" == formatS) {
|
1462
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-edit";
|
1463
|
+
columnSelectedWidget.options.label = "查看";
|
1464
|
+
columnSelectedWidget.options.labelHidden = true;
|
1465
|
+
columnSelectedWidget.options.onClick =
|
1466
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
|
1467
|
+
} else if ("addSiblingEditRow" == formatS) {
|
1468
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
1469
|
+
columnSelectedWidget.options.label = "新增兄弟节点";
|
1470
|
+
columnSelectedWidget.options.labelHidden = false;
|
1471
|
+
columnSelectedWidget.options.onClick =
|
1472
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
|
1473
|
+
} else if ("addChildTreeRow" == formatS) {
|
1474
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
1475
|
+
columnSelectedWidget.options.label = "新增子节点";
|
1476
|
+
columnSelectedWidget.options.labelHidden = false;
|
1477
|
+
columnSelectedWidget.options.onClick =
|
1478
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
|
1479
|
+
} else if ("moveUpRow" == formatS) {
|
1480
|
+
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
1481
|
+
columnSelectedWidget.options.label = "↑上移";
|
1482
|
+
columnSelectedWidget.options.labelHidden = false;
|
1483
|
+
columnSelectedWidget.options.onClick =
|
1484
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
|
1485
|
+
} else if ("moveDownRow" == formatS) {
|
1486
|
+
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
1487
|
+
columnSelectedWidget.options.label = "↓下移";
|
1488
|
+
columnSelectedWidget.options.labelHidden = false;
|
1489
|
+
columnSelectedWidget.options.onClick =
|
1490
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
|
1491
|
+
} else if ("removeTreeRow" == formatS) {
|
1492
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
1493
|
+
columnSelectedWidget.options.label = "删除";
|
1494
|
+
columnSelectedWidget.options.labelHidden = true;
|
1495
|
+
columnSelectedWidget.options.onClick =
|
1496
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
|
1497
|
+
}
|
1498
|
+
columnOption = columnSelectedWidget.options;
|
1499
|
+
}
|
1500
|
+
if (columnSelectedWidget.options.hasOwnProperty("keyName")) {
|
1501
|
+
columnSelectedWidget.options.keyName = row.prop;
|
1502
|
+
columnSelectedWidget.options.keyNameEnabled = true;
|
1503
|
+
} else {
|
1504
|
+
columnSelectedWidget.options.name = row.prop;
|
1505
|
+
}
|
1506
|
+
if (type != "button" && type != "a-link") {
|
1507
|
+
columnSelectedWidget.options.label = row.label;
|
1508
|
+
columnSelectedWidget.options.labelHidden = true;
|
1509
|
+
}
|
1510
|
+
}
|
1511
|
+
return { columnSelectedWidget, columnEditFields };
|
1512
|
+
},
|
1513
|
+
getColumnProp(widget, obj, isEdit) {
|
1514
|
+
if (!widget) {
|
1515
|
+
return "false";
|
1516
|
+
}
|
1517
|
+
/*if(isEdit){
|
1518
|
+
return "false"
|
1519
|
+
}*/
|
1520
|
+
|
1521
|
+
let fieldKeyName = this.getFieldKeyName(widget);
|
1522
|
+
let rowIndex = Math.max(obj.rowIndex, 0);
|
1523
|
+
let isQueryTable = this.widget.options.isQueryTable || false;
|
1524
|
+
if (isEdit || !isQueryTable) {
|
1525
|
+
let propName =
|
1526
|
+
fieldKeyName + "." + rowIndex + "." + obj.column.property;
|
1527
|
+
let lineWidget = !isEdit
|
1528
|
+
? obj.column.params.widget
|
1529
|
+
: obj.column.params.editWidget;
|
1530
|
+
if (!lineWidget) {
|
1531
|
+
return "false";
|
1532
|
+
}
|
1533
|
+
if (lineWidget?.type == "vabsearch") {
|
1534
|
+
let fieldName =
|
1535
|
+
lineWidget.options.vabSearchName ||
|
1536
|
+
this.getFieldKeyName(lineWidget);
|
1537
|
+
propName = fieldKeyName + "." + rowIndex + "." + fieldName;
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
return propName;
|
1541
|
+
} else {
|
1542
|
+
return "false";
|
1543
|
+
}
|
1544
|
+
},
|
1545
|
+
getColumnWidgetName(e) {
|
1546
|
+
if (e && e.type) {
|
1547
|
+
return e.type + "-widget";
|
1548
|
+
}
|
1549
|
+
},
|
1550
|
+
getGridTable() {
|
1551
|
+
let $grid = this.$refs[this.getTableRef()];
|
1552
|
+
return $grid;
|
1553
|
+
},
|
1554
|
+
getContainerWidgetName: function (e) {
|
1555
|
+
return "grid" === e.type ? "grid-item" : e.type + "-item";
|
1556
|
+
},
|
1557
|
+
getWidgetName: function (e) {
|
1558
|
+
return (e.targetType || e.type) + "-widget";
|
1559
|
+
},
|
1560
|
+
handleCheckboxChange(param) {
|
1561
|
+
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
1562
|
+
let mergeRowKey = this.widget.options.mergeRowKey;
|
1563
|
+
if (mergeRowEnabled && mergeRowKey) {
|
1564
|
+
let grid = this.getGridTable();
|
1565
|
+
let fullData = grid.getTableData().fullData;
|
1566
|
+
let row = param.row;
|
1567
|
+
let val = row[mergeRowKey];
|
1568
|
+
let items = fullData.filter((item) => item[mergeRowKey] === val);
|
1569
|
+
if (items.length) {
|
1570
|
+
grid.setCheckboxRow(items, param.checked);
|
1571
|
+
}
|
1572
|
+
}
|
1573
|
+
if (this.widget.options.onCheckboxChange) {
|
1574
|
+
let t = new Function("param", this.widget.options.onCheckboxChange);
|
1575
|
+
t.call(this, param);
|
1576
|
+
}
|
1577
|
+
let formRef = this.getFormRef();
|
1578
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
1579
|
+
dataTableConfig.onCheckboxChange &&
|
1580
|
+
dataTableConfig.onCheckboxChange(param);
|
1581
|
+
},
|
1582
|
+
handleCheckboxAll(param) {
|
1583
|
+
if (this.widget.options.onCheckboxAll) {
|
1584
|
+
let t = new Function("param", this.widget.options.onCheckboxAll);
|
1585
|
+
t.call(this, param);
|
1586
|
+
}
|
1587
|
+
let formRef = this.getFormRef();
|
1588
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
1589
|
+
dataTableConfig.onCheckboxAll && dataTableConfig.onCheckboxAll(param);
|
1590
|
+
},
|
1591
|
+
handleCellDblclick(param) {
|
1592
|
+
if (this.widget.options.onCellDblclick) {
|
1593
|
+
let t = new Function("param", this.widget.options.onCellDblclick);
|
1594
|
+
t.call(this, param);
|
1595
|
+
}
|
1596
|
+
let formRef = this.getFormRef();
|
1597
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
1598
|
+
dataTableConfig.onCellDblclick && dataTableConfig.onCellDblclick(param);
|
1599
|
+
},
|
1600
|
+
advancedClear() {
|
1601
|
+
let formModel = this.formModel;
|
1602
|
+
this.getFormRef().setFormData(formModel);
|
1603
|
+
},
|
1604
|
+
tableFormSettingConfirm() {
|
1605
|
+
let formModel = this.formModel;
|
1606
|
+
this.getFormRef().setFormData(formModel);
|
1607
|
+
},
|
1608
|
+
|
1609
|
+
//editTable begin
|
1610
|
+
saveEditRow(obj) {
|
1611
|
+
let formRef = this.getFormRef();
|
1612
|
+
let formConfig = this.formConfig;
|
1613
|
+
let entity = formConfig.entity;
|
1614
|
+
if (!entity) return;
|
1615
|
+
let dataId = formRef?.dataId;
|
1616
|
+
let reportTemplate = formRef?.reportTemplate;
|
1617
|
+
let formCode = reportTemplate?.formCode;
|
1618
|
+
let scriptCode = formConfig.saveScriptCode || "saveUpdate";
|
1619
|
+
|
1620
|
+
let that = this;
|
1621
|
+
let $grid = obj.$table.$xegrid;
|
1622
|
+
let originOption = $grid.originOption;
|
1623
|
+
|
1624
|
+
let formModel = this.formModel;
|
1625
|
+
let dataMap = this.getGridTable().getTableData();
|
1626
|
+
|
1627
|
+
formRef.validate((valid) => {
|
1628
|
+
if (valid) {
|
1629
|
+
$grid.clearActived().then(() => {
|
1630
|
+
$grid.setActiveRow(obj.row);
|
1631
|
+
let mainData = commonDataUtil.handleForm(obj.row);
|
1632
|
+
|
1633
|
+
delete mainData._createNickName;
|
1634
|
+
delete mainData._createMobile;
|
1635
|
+
delete mainData._modifyNickName;
|
1636
|
+
delete mainData._modifyMobile;
|
1637
|
+
delete mainData._createBy;
|
1638
|
+
delete mainData._modifyBy;
|
1639
|
+
|
1640
|
+
let formData = {
|
1641
|
+
[entity]: mainData,
|
1642
|
+
};
|
1643
|
+
|
1644
|
+
let reqData = {
|
1645
|
+
formCode: formCode,
|
1646
|
+
formVersion: reportTemplate.formVersion,
|
1647
|
+
taBm: entity,
|
1648
|
+
data: formData,
|
1649
|
+
};
|
1650
|
+
|
1651
|
+
this.formHttp({
|
1652
|
+
scriptCode: scriptCode,
|
1653
|
+
data: reqData,
|
1654
|
+
successMsg: true,
|
1655
|
+
isConfirm: true,
|
1656
|
+
confirmText: "您确定要保存吗?",
|
1657
|
+
success: (res0) => {
|
1658
|
+
this.getRowData(res0.objx, (res) => {
|
1659
|
+
if (obj.row.id == res.objx.id) {
|
1660
|
+
$grid.clearActived().then(() => {
|
1661
|
+
Object.assign(obj.row, res.objx);
|
1662
|
+
});
|
1663
|
+
} else {
|
1664
|
+
$grid.remove(obj.row);
|
1665
|
+
$grid.insertAt(res.objx);
|
1666
|
+
}
|
1667
|
+
delete obj.$table.editCloneRow;
|
1668
|
+
});
|
1669
|
+
},
|
1670
|
+
});
|
1671
|
+
});
|
1672
|
+
}
|
1673
|
+
});
|
1674
|
+
},
|
1675
|
+
getRowData(dataId, callback) {
|
1676
|
+
let reportTemplate = this.getFormRef()?.reportTemplate;
|
1677
|
+
let formCode = reportTemplate.formCode;
|
1678
|
+
let formConfig = this.formConfig;
|
1679
|
+
// let isLoadEntity = formConfig.isLoadEntity;
|
1680
|
+
let entity = formConfig.entity;
|
1681
|
+
let scriptCode = formConfig.formScriptCode || "getOne";
|
1682
|
+
let defaultOption = this.getHttpConfigForUser();
|
1683
|
+
this.formHttp({
|
1684
|
+
scriptCode: scriptCode,
|
1685
|
+
data: {
|
1686
|
+
formCode: formCode,
|
1687
|
+
formVersion: reportTemplate.formVersion,
|
1688
|
+
taBm: entity,
|
1689
|
+
data: {
|
1690
|
+
id: dataId,
|
1691
|
+
},
|
1692
|
+
},
|
1693
|
+
...defaultOption,
|
1694
|
+
success: (res) => {
|
1695
|
+
callback && callback(res);
|
1696
|
+
},
|
1697
|
+
});
|
1698
|
+
},
|
1699
|
+
addChildTreeRow(rowData, obj, toTop) {
|
1700
|
+
let toEnd = !toTop;
|
1701
|
+
this.addTreeRow(rowData, obj, toEnd, null);
|
1702
|
+
},
|
1703
|
+
addTopTreeRow(rowData, toTop) {
|
1704
|
+
let toEnd = !toTop;
|
1705
|
+
this.addTreeRow(rowData, null, toEnd, null);
|
1706
|
+
},
|
1707
|
+
addSiblingTreeRow(rowData, obj) {
|
1708
|
+
this.addTreeRow(rowData, obj, null, true);
|
1709
|
+
},
|
1710
|
+
addTreeRow(rowData, obj, toEnd, toSibling) {
|
1711
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
1712
|
+
let parent = obj?.row;
|
1713
|
+
let $grid = this.getGridTable();
|
1714
|
+
if (isEditTable && this.hasEditingRow($grid, 1)) {
|
1715
|
+
return false;
|
1716
|
+
}
|
1717
|
+
let parentField = $grid.treeConfig.parentField;
|
1718
|
+
let newRow = {};
|
1719
|
+
let originOption = $grid.originOption;
|
1720
|
+
let editDefaultRow;
|
1721
|
+
if (originOption.editDefaultRow) {
|
1722
|
+
if (typeof originOption.editDefaultRow == "function") {
|
1723
|
+
editDefaultRow = originOption.editDefaultRow() || {};
|
1724
|
+
} else {
|
1725
|
+
editDefaultRow = originOption.editDefaultRow || {};
|
1726
|
+
}
|
1727
|
+
}
|
1728
|
+
// Object.assign(newRow, editDefaultRow, rowData);
|
1729
|
+
newRow.id =
|
1730
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
1731
|
+
if (!toSibling) {
|
1732
|
+
newRow[parentField] = parent?.id || 0;
|
1733
|
+
} else {
|
1734
|
+
newRow[parentField] = obj?.row[parentField] || 0;
|
1735
|
+
}
|
1736
|
+
|
1737
|
+
let newData = this.createNewTableData(isEditTable);
|
1738
|
+
newRow = Object.assign({}, newData, newRow, editDefaultRow, rowData);
|
1739
|
+
|
1740
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
1741
|
+
if (!parent) {
|
1742
|
+
if (toEnd === true) {
|
1743
|
+
tableRows.push(newRow);
|
1744
|
+
} else if (toSibling === true) {
|
1745
|
+
let addIndex =
|
1746
|
+
tableRows.findIndex(
|
1747
|
+
(item) => item._X_ROW_KEY == obj.row._X_ROW_KEY
|
1748
|
+
) + 1;
|
1749
|
+
tableRows.splice(addIndex, 0, newRow);
|
1750
|
+
} else {
|
1751
|
+
tableRows.splice(0, 0, newRow);
|
1752
|
+
}
|
1753
|
+
this.setValue(tableRows);
|
1754
|
+
this.$nextTick(() => {
|
1755
|
+
this.handleWbs();
|
1756
|
+
if (isEditTable) {
|
1757
|
+
$grid.setActiveRow(newRow);
|
1758
|
+
}
|
1759
|
+
});
|
1760
|
+
|
1761
|
+
// $grid.insert(newRow).then(({row}) => $grid.setActiveRow(row));
|
1762
|
+
} else {
|
1763
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
1764
|
+
if (toEnd === true) {
|
1765
|
+
tableRows.push(newRow);
|
1766
|
+
} else if (toSibling === true) {
|
1767
|
+
let addIndex =
|
1768
|
+
tableRows.findIndex(
|
1769
|
+
(item) => item._X_ROW_KEY == obj.row._X_ROW_KEY
|
1770
|
+
) + 1;
|
1771
|
+
tableRows.splice(addIndex, 0, newRow);
|
1772
|
+
} else {
|
1773
|
+
tableRows.splice(0, 0, newRow);
|
1774
|
+
}
|
1775
|
+
this.setValue(tableRows);
|
1776
|
+
this.$nextTick(() => {
|
1777
|
+
this.handleWbs();
|
1778
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
1779
|
+
if (isEditTable) {
|
1780
|
+
$grid.setActiveRow(newRow);
|
1781
|
+
}
|
1782
|
+
});
|
1783
|
+
});
|
1784
|
+
});
|
1785
|
+
}
|
1786
|
+
},
|
1787
|
+
removeTreeRow(obj) {
|
1788
|
+
let row = obj.row;
|
1789
|
+
let $grid = this.getGridTable();
|
1790
|
+
let childrenField = $grid.treeConfig.children;
|
1791
|
+
let tableRows = this.formModel[this.fieldKeyName];
|
1792
|
+
// let index = tableRows.findIndex(item => item.id === row.id)
|
1793
|
+
let delIds = [];
|
1794
|
+
if (row[childrenField]) {
|
1795
|
+
let loopDo = (item) => {
|
1796
|
+
if (item.id) delIds.push(item.id);
|
1797
|
+
item[childrenField] &&
|
1798
|
+
item[childrenField].forEach((subItem) => {
|
1799
|
+
loopDo(subItem);
|
1800
|
+
});
|
1801
|
+
};
|
1802
|
+
loopDo(row);
|
1803
|
+
}
|
1804
|
+
delIds.forEach((id) => {
|
1805
|
+
let index = tableRows.findIndex((item) => item.id === id);
|
1806
|
+
tableRows.splice(index, 1);
|
1807
|
+
});
|
1808
|
+
this.$nextTick(() => {
|
1809
|
+
this.handleWbs();
|
1810
|
+
});
|
1811
|
+
},
|
1812
|
+
addSiblingEditRow(rowData, obj) {
|
1813
|
+
this.addEditRow(rowData, obj, null, true);
|
1814
|
+
},
|
1815
|
+
addEditRow(rowData, obj, toEnd, toSibling) {
|
1816
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
1817
|
+
let parent = obj?.row;
|
1818
|
+
let $grid = this.getGridTable();
|
1819
|
+
if (isEditTable && this.hasEditingRow($grid, 1)) {
|
1820
|
+
return false;
|
1821
|
+
}
|
1822
|
+
let parentField = $grid.treeConfig.parentField;
|
1823
|
+
let newRow = {};
|
1824
|
+
let originOption = $grid.originOption;
|
1825
|
+
let editDefaultRow;
|
1826
|
+
if (originOption.editDefaultRow) {
|
1827
|
+
if (typeof originOption.editDefaultRow == "function") {
|
1828
|
+
editDefaultRow = originOption.editDefaultRow() || {};
|
1829
|
+
} else {
|
1830
|
+
editDefaultRow = originOption.editDefaultRow || {};
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
// Object.assign(newRow, editDefaultRow, rowData);
|
1834
|
+
newRow.id =
|
1835
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
1836
|
+
if (!toSibling) {
|
1837
|
+
newRow[parentField] = parent?.id || 0;
|
1838
|
+
} else {
|
1839
|
+
newRow[parentField] = obj?.row[parentField] || 0;
|
1840
|
+
}
|
1841
|
+
|
1842
|
+
let newData = this.createNewTableData(isEditTable);
|
1843
|
+
newRow = Object.assign({}, newData, newRow, editDefaultRow, rowData);
|
1844
|
+
|
1845
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
1846
|
+
if (!parent) {
|
1847
|
+
if (toEnd === true) {
|
1848
|
+
tableRows.push(newRow);
|
1849
|
+
} else if (toSibling === true) {
|
1850
|
+
let addIndex =
|
1851
|
+
tableRows.findIndex(
|
1852
|
+
(item) => item._X_ROW_KEY == obj.row._X_ROW_KEY
|
1853
|
+
) + 1;
|
1854
|
+
tableRows.splice(addIndex, 0, newRow);
|
1855
|
+
} else {
|
1856
|
+
tableRows.splice(0, 0, newRow);
|
1857
|
+
}
|
1858
|
+
this.setValue(tableRows);
|
1859
|
+
this.$nextTick(() => {
|
1860
|
+
this.handleWbs();
|
1861
|
+
if (isEditTable) {
|
1862
|
+
$grid.setActiveRow(newRow);
|
1863
|
+
}
|
1864
|
+
});
|
1865
|
+
|
1866
|
+
// $grid.insert(newRow).then(({row}) => $grid.setActiveRow(row));
|
1867
|
+
} else {
|
1868
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
1869
|
+
if (toEnd === true) {
|
1870
|
+
tableRows.push(newRow);
|
1871
|
+
} else if (toSibling === true) {
|
1872
|
+
let addIndex =
|
1873
|
+
tableRows.findIndex(
|
1874
|
+
(item) => item._X_ROW_KEY == obj.row._X_ROW_KEY
|
1875
|
+
) + 1;
|
1876
|
+
tableRows.splice(addIndex, 0, newRow);
|
1877
|
+
} else {
|
1878
|
+
tableRows.splice(0, 0, newRow);
|
1879
|
+
}
|
1880
|
+
this.setValue(tableRows);
|
1881
|
+
this.$nextTick(() => {
|
1882
|
+
this.handleWbs();
|
1883
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
1884
|
+
if (isEditTable) {
|
1885
|
+
$grid.setActiveRow(newRow);
|
1886
|
+
}
|
1887
|
+
});
|
1888
|
+
});
|
1889
|
+
});
|
1890
|
+
}
|
1891
|
+
},
|
1892
|
+
async removeEditRow(obj) {
|
1893
|
+
this.removeTreeRow(obj);
|
1894
|
+
},
|
1895
|
+
//editTable end
|
1896
|
+
getHttpConfigForUser() {
|
1897
|
+
let defaultOption = {
|
1898
|
+
addCreateInfo: true,
|
1899
|
+
queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
|
1900
|
+
};
|
1901
|
+
return defaultOption;
|
1902
|
+
},
|
1903
|
+
handleWbs() {
|
1904
|
+
if (this.widget.options.wbsEnabled) {
|
1905
|
+
this.updateWbs();
|
1906
|
+
}
|
1907
|
+
},
|
1908
|
+
updateWbs() {
|
1909
|
+
let that = this;
|
1910
|
+
let $grid = that.getGridTable();
|
1911
|
+
let childrenField = $grid.treeConfig.children;
|
1912
|
+
let fullData = $grid.getTableData().fullData;
|
1913
|
+
let tableRows = this.formModel[that.fieldKeyName] || [];
|
1914
|
+
let map = {};
|
1915
|
+
let loopDo = (item, wbs) => {
|
1916
|
+
item.f_wbs = wbs;
|
1917
|
+
map[item._X_ROW_KEY] = wbs;
|
1918
|
+
item[childrenField] &&
|
1919
|
+
item[childrenField].forEach((subitem, subindex) => {
|
1920
|
+
let sub_wbs = wbs + "." + (subindex + 1) + "";
|
1921
|
+
loopDo(subitem, sub_wbs);
|
1922
|
+
});
|
1923
|
+
};
|
1924
|
+
fullData.forEach((item, index) => {
|
1925
|
+
let wbs = index + 1 + "";
|
1926
|
+
loopDo(item, wbs);
|
1927
|
+
});
|
1928
|
+
$grid.updateData();
|
1929
|
+
},
|
1930
|
+
moveUpRow(obj) {
|
1931
|
+
let row = obj.row;
|
1932
|
+
let $grid = this.getGridTable();
|
1933
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
1934
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
1935
|
+
if (isTreeTable) {
|
1936
|
+
let parentField = $grid.treeConfig.parentField;
|
1937
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
1938
|
+
let paretValue = row[parentField];
|
1939
|
+
let siblingRows = tableRows.filter(
|
1940
|
+
(item) => item[parentField] === paretValue
|
1941
|
+
);
|
1942
|
+
if (siblingRows.length > 1) {
|
1943
|
+
let currentIndex = tableRows.findIndex(
|
1944
|
+
(item) => item[rowField] == row[rowField]
|
1945
|
+
);
|
1946
|
+
let index1 = siblingRows.findIndex(
|
1947
|
+
(item) => item[rowField] == row[rowField]
|
1948
|
+
);
|
1949
|
+
if (index1 > 0) {
|
1950
|
+
let prevRow = siblingRows[index1 - 1];
|
1951
|
+
let prevIndex = tableRows.findIndex(
|
1952
|
+
(item) => item[rowField] == prevRow[rowField]
|
1953
|
+
);
|
1954
|
+
tableRows.splice(currentIndex, 1);
|
1955
|
+
tableRows.splice(prevIndex, 0, row);
|
1956
|
+
this.setValue(tableRows);
|
1957
|
+
this.$nextTick(() => {
|
1958
|
+
this.handleWbs();
|
1959
|
+
});
|
1960
|
+
}
|
1961
|
+
}
|
1962
|
+
} else {
|
1963
|
+
let rowIndex = $grid.getRowIndex(row);
|
1964
|
+
if (rowIndex >= 0) {
|
1965
|
+
tableRows.splice(rowIndex, 1);
|
1966
|
+
tableRows.splice(rowIndex - 1, 0, row);
|
1967
|
+
this.setValue(tableRows);
|
1968
|
+
this.$nextTick(() => {
|
1969
|
+
this.handleWbs();
|
1970
|
+
});
|
1971
|
+
}
|
1972
|
+
}
|
1973
|
+
},
|
1974
|
+
moveDownRow(obj) {
|
1975
|
+
let row = obj.row;
|
1976
|
+
let $grid = this.getGridTable();
|
1977
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
1978
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
1979
|
+
if (isTreeTable) {
|
1980
|
+
let parentField = $grid.treeConfig.parentField;
|
1981
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
1982
|
+
let paretValue = row[parentField];
|
1983
|
+
let siblingRows = tableRows.filter(
|
1984
|
+
(item) => item[parentField] === paretValue
|
1985
|
+
);
|
1986
|
+
if (siblingRows.length > 1) {
|
1987
|
+
let currentIndex = tableRows.findIndex(
|
1988
|
+
(item) => item[rowField] == row[rowField]
|
1989
|
+
);
|
1990
|
+
let index1 = siblingRows.findIndex(
|
1991
|
+
(item) => item[rowField] == row[rowField]
|
1992
|
+
);
|
1993
|
+
if (index1 < siblingRows.length - 1) {
|
1994
|
+
let nextRow = siblingRows[index1 + 1];
|
1995
|
+
let nextIndex = tableRows.findIndex(
|
1996
|
+
(item) => item[rowField] == nextRow[rowField]
|
1997
|
+
);
|
1998
|
+
tableRows.splice(currentIndex, 1);
|
1999
|
+
tableRows.splice(nextIndex, 0, row);
|
2000
|
+
this.setValue(tableRows);
|
2001
|
+
this.$nextTick(() => {
|
2002
|
+
this.handleWbs();
|
2003
|
+
});
|
2004
|
+
}
|
2005
|
+
}
|
2006
|
+
} else {
|
2007
|
+
let rowIndex = $grid.getRowIndex(row);
|
2008
|
+
if (rowIndex < tableRows.length - 1) {
|
2009
|
+
tableRows.splice(rowIndex, 1);
|
2010
|
+
tableRows.splice(rowIndex + 1, 0, row);
|
2011
|
+
this.setValue(tableRows);
|
2012
|
+
this.$nextTick(() => {
|
2013
|
+
this.handleWbs();
|
2014
|
+
});
|
2015
|
+
}
|
2016
|
+
}
|
2017
|
+
},
|
2018
|
+
|
2019
|
+
openSortRowDialog(obj) {
|
2020
|
+
let $grid = this.getGridTable();
|
2021
|
+
let parentField = $grid.treeConfig.parentField;
|
2022
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
2023
|
+
let row = obj.row;
|
2024
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
2025
|
+
|
2026
|
+
let sortParentRow = tableRows.find(
|
2027
|
+
(item) => item[rowField] === row[parentField]
|
2028
|
+
);
|
2029
|
+
let sortRows = tableRows.filter(
|
2030
|
+
(item) => item[parentField] === row[parentField]
|
2031
|
+
);
|
2032
|
+
this.sortRows = sortRows;
|
2033
|
+
this.sortParentRow = sortParentRow;
|
2034
|
+
this.showTreeMoveDialog = true;
|
2035
|
+
},
|
2036
|
+
confirmTreeMoveDialog(rows) {
|
2037
|
+
if (this.widget.options.isEditTable) {
|
2038
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
2039
|
+
let formConfig = this.formConfig;
|
2040
|
+
let entity = formConfig.entity;
|
2041
|
+
let reqData = {
|
2042
|
+
formCode: reportTemplate.formCode,
|
2043
|
+
formVersion: reportTemplate.formVersion,
|
2044
|
+
taBm: entity,
|
2045
|
+
data: rows,
|
2046
|
+
};
|
2047
|
+
let scriptCode = this.widget.options.sortScriptCode;
|
2048
|
+
this.formHttp({
|
2049
|
+
scriptCode: scriptCode,
|
2050
|
+
data: reqData,
|
2051
|
+
successMsg: true,
|
2052
|
+
isConfirm: true,
|
2053
|
+
confirmText: "您确定要保存排序吗?",
|
2054
|
+
success: (res) => {
|
2055
|
+
this.getGridTable().reloadTreeExpand(this.sortParentRow);
|
2056
|
+
},
|
2057
|
+
});
|
2058
|
+
} else {
|
2059
|
+
let $grid = this.getGridTable();
|
2060
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
2061
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
2062
|
+
|
2063
|
+
let ids = rows.map((item) => item[rowField]);
|
2064
|
+
let index = tableRows.findIndex((item) => ids.includes(item[rowField]));
|
2065
|
+
let items = tableRows.filter((item) => !ids.includes(item[rowField]));
|
2066
|
+
rows.forEach((row, index1) => {
|
2067
|
+
items.splice(index + index1, 0, row);
|
2068
|
+
});
|
2069
|
+
this.setValue(items);
|
2070
|
+
this.$nextTick(() => {
|
2071
|
+
this.handleWbs();
|
2072
|
+
});
|
2073
|
+
}
|
2074
|
+
},
|
2075
|
+
// 通用行合并函数(将相同多列数据合并为一行)
|
2076
|
+
mergeRowMethod(tableParam) {
|
2077
|
+
let { row, _rowIndex, column, visibleData } = tableParam;
|
2078
|
+
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
2079
|
+
let unikey = this.widget.options.mergeRowKey;
|
2080
|
+
const cellValue = row[unikey];
|
2081
|
+
let isItemLine = column.params?.isItemLine || false;
|
2082
|
+
if (mergeRowEnabled && unikey && !isItemLine) {
|
2083
|
+
const prevRow = visibleData[_rowIndex - 1];
|
2084
|
+
let nextRow = visibleData[_rowIndex + 1];
|
2085
|
+
if (prevRow && prevRow[unikey] === cellValue) {
|
2086
|
+
return { rowspan: 0, colspan: 0 };
|
2087
|
+
} else {
|
2088
|
+
let countRowspan = 1;
|
2089
|
+
while (nextRow && nextRow[unikey] === cellValue) {
|
2090
|
+
nextRow = visibleData[++countRowspan + _rowIndex];
|
2091
|
+
}
|
2092
|
+
if (countRowspan > 1) {
|
2093
|
+
return { rowspan: countRowspan, colspan: 1 };
|
2094
|
+
}
|
2095
|
+
}
|
2096
|
+
} else {
|
2097
|
+
// return { rowspan: 1, colspan: 1 }
|
2098
|
+
}
|
2099
|
+
},
|
2100
|
+
mergeRowMethod2({ row, _rowIndex, column, visibleData }) {
|
2101
|
+
const fields = ["key"];
|
2102
|
+
const cellValue = row[column.field];
|
2103
|
+
if (cellValue && fields.includes(column.field)) {
|
2104
|
+
const prevRow = visibleData[_rowIndex - 1];
|
2105
|
+
let nextRow = visibleData[_rowIndex + 1];
|
2106
|
+
if (prevRow && prevRow[column.field] === cellValue) {
|
2107
|
+
return { rowspan: 0, colspan: 0 };
|
2108
|
+
} else {
|
2109
|
+
let countRowspan = 1;
|
2110
|
+
while (nextRow && nextRow[column.field] === cellValue) {
|
2111
|
+
nextRow = visibleData[++countRowspan + _rowIndex];
|
2112
|
+
}
|
2113
|
+
if (countRowspan > 1) {
|
2114
|
+
return { rowspan: countRowspan, colspan: 1 };
|
2115
|
+
}
|
2116
|
+
}
|
2117
|
+
}
|
2118
|
+
},
|
2119
|
+
},
|
2120
|
+
};
|
2121
|
+
|
2122
|
+
export default modules;
|