ocpview-plus 1.1.9 → 1.2.0
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/README.md +3 -0
- package/dist/ocpviewplus.min.esm.js +482 -159
- package/dist/ocpviewplus.min.js +14 -14
- package/package.json +1 -1
- package/src/components/conditionbox/conditionfilterbox.vue +20 -18
- package/src/components/form/baseform.vue +36 -35
- package/src/components/grid/basegrid.vue +65 -60
- package/src/components/masterplate/base.vue +148 -0
- package/src/components/masterplate/lefttreerightdetails.vue +32 -25
- package/src/components/masterplate/listdetails.vue +168 -26
- package/src/components/masterplate/simpletree.vue +21 -13
- package/src/components/tree/CompatTree.vue +52 -0
- package/src/components/tree/basetree.vue +185 -61
- package/src/components/tree/treedata.vue +7 -5
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
cellbeginedit:'',
|
|
11
11
|
showHeader: true,
|
|
12
12
|
showIndex: true,
|
|
13
|
-
showStripe:false,
|
|
13
|
+
showStripe:false,
|
|
14
14
|
showBorder: true,
|
|
15
15
|
showCheckBox: false,
|
|
16
16
|
showCondition:false,
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
config: {
|
|
90
90
|
type: Object,
|
|
91
91
|
default: () => {
|
|
92
|
-
return {};
|
|
92
|
+
return {};
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
dictData: {
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
toolConfig: {
|
|
100
100
|
type: Object,
|
|
101
101
|
default: () => {
|
|
102
|
-
return {};
|
|
102
|
+
return {};
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
isPop:{
|
|
@@ -128,7 +128,7 @@ export default {
|
|
|
128
128
|
currentHeight = currentHeight - Number(this.outsideHeight);
|
|
129
129
|
}
|
|
130
130
|
if (this.myConfig.showSummary) {
|
|
131
|
-
currentHeight = currentHeight - 50;
|
|
131
|
+
currentHeight = currentHeight - 50;
|
|
132
132
|
}
|
|
133
133
|
return currentHeight;
|
|
134
134
|
} else {
|
|
@@ -139,14 +139,14 @@ export default {
|
|
|
139
139
|
if (this.myConfig.dynamicHeight) {
|
|
140
140
|
let currentHeight = this.currentHeight - this.extraHeight - this.outsideHeight;
|
|
141
141
|
if (this.myConfig.showSummary) {
|
|
142
|
-
currentHeight = currentHeight - 50;
|
|
142
|
+
currentHeight = currentHeight - 50;
|
|
143
143
|
}
|
|
144
144
|
return currentHeight;
|
|
145
145
|
} else {
|
|
146
146
|
return null;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
},
|
|
151
151
|
methods: {
|
|
152
152
|
init() {
|
|
@@ -209,7 +209,7 @@ export default {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
this.operFixedFlag = this.myConfig.operFixedFlag;
|
|
214
214
|
if (this.myConfig.items && this.myConfig.items.length > 0) {
|
|
215
215
|
this.myConfig.items.some(el => {
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
action.width = 120;
|
|
294
294
|
if (this.myToolConfig.items.length === 1) {
|
|
295
295
|
action.width = 80;
|
|
296
|
-
}
|
|
296
|
+
}
|
|
297
297
|
action.align = 'center';
|
|
298
298
|
if (this.customInitOperColumn) {
|
|
299
299
|
this.customInitOperColumn(action, columns);
|
|
@@ -353,7 +353,7 @@ export default {
|
|
|
353
353
|
const length = this.myConfig.items.length;
|
|
354
354
|
for (let i = 0; i < length; i++) {
|
|
355
355
|
if (this.myConfig.items[i].visible !== false) {
|
|
356
|
-
//this.setColumn(i);
|
|
356
|
+
//this.setColumn(i);
|
|
357
357
|
// 添加复杂列项的支持
|
|
358
358
|
this.initCommonColumn(this.myConfig.items[i],columns,summaryColumn,newRow);
|
|
359
359
|
} else {
|
|
@@ -382,6 +382,11 @@ export default {
|
|
|
382
382
|
if (!column.contentAlign) {
|
|
383
383
|
column.contentAlign = column.align;
|
|
384
384
|
}
|
|
385
|
+
// column.label 判空
|
|
386
|
+
/*if (column.label && column.label.trim() !== '') {
|
|
387
|
+
column.label += ":::";
|
|
388
|
+
}*/
|
|
389
|
+
|
|
385
390
|
column.title = column.label;
|
|
386
391
|
if (!column.headClassName) {
|
|
387
392
|
if (this.myConfig.headClassName !== undefined) {
|
|
@@ -390,7 +395,7 @@ export default {
|
|
|
390
395
|
} else {
|
|
391
396
|
column.className = column.headClassName;
|
|
392
397
|
}
|
|
393
|
-
|
|
398
|
+
|
|
394
399
|
if (obj.children && obj.children.length > 0) {
|
|
395
400
|
column.children = [];
|
|
396
401
|
for (let i=0;i<obj.children.length; i++) {
|
|
@@ -415,7 +420,7 @@ export default {
|
|
|
415
420
|
}
|
|
416
421
|
|
|
417
422
|
this.setColumnPro(column,type,summaryColumn,newRow);
|
|
418
|
-
|
|
423
|
+
|
|
419
424
|
if (type !== 'render') {
|
|
420
425
|
if (column.render === undefined) {
|
|
421
426
|
if (this.setCustomColumn) {
|
|
@@ -430,13 +435,13 @@ export default {
|
|
|
430
435
|
if (type === 'picturebox') {
|
|
431
436
|
if (column.height === undefined) {
|
|
432
437
|
column.height = 40;
|
|
433
|
-
}
|
|
438
|
+
}
|
|
434
439
|
column.isGrid = true;
|
|
435
440
|
}
|
|
436
441
|
if (type === 'videobox') {
|
|
437
442
|
if (column.height === undefined) {
|
|
438
443
|
column.height = 60;
|
|
439
|
-
}
|
|
444
|
+
}
|
|
440
445
|
}
|
|
441
446
|
if (this.myConfig.readOnly) {
|
|
442
447
|
column.readOnly = true;
|
|
@@ -445,14 +450,14 @@ export default {
|
|
|
445
450
|
column.readOnly = false;
|
|
446
451
|
}
|
|
447
452
|
}
|
|
448
|
-
|
|
453
|
+
|
|
449
454
|
}
|
|
450
455
|
if (column.required) {
|
|
451
456
|
if (!column.className) {
|
|
452
457
|
column.className = 'efuture-grid-head-required';
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
|
-
|
|
460
|
+
|
|
456
461
|
// 事件绑定
|
|
457
462
|
if (column.valueChanged) {
|
|
458
463
|
column.valueChanged = this.valueChanged;
|
|
@@ -473,7 +478,7 @@ export default {
|
|
|
473
478
|
},
|
|
474
479
|
setColumn(i) {
|
|
475
480
|
let column = this.$Method.copy(this.myConfig.items[i]);
|
|
476
|
-
|
|
481
|
+
|
|
477
482
|
column.title = column.label;
|
|
478
483
|
let type = '';
|
|
479
484
|
if (column.type) {
|
|
@@ -482,7 +487,7 @@ export default {
|
|
|
482
487
|
if (!type) {
|
|
483
488
|
return;
|
|
484
489
|
}
|
|
485
|
-
|
|
490
|
+
|
|
486
491
|
column.key = column.name;
|
|
487
492
|
if (Number(column.width)) {
|
|
488
493
|
column.width = Number(column.width);
|
|
@@ -491,7 +496,7 @@ export default {
|
|
|
491
496
|
}
|
|
492
497
|
|
|
493
498
|
this.setColumnPro(column,type);
|
|
494
|
-
|
|
499
|
+
|
|
495
500
|
if (type !== 'render') {
|
|
496
501
|
if (column.render === undefined) {
|
|
497
502
|
if (this.setCustomColumn) {
|
|
@@ -506,31 +511,31 @@ export default {
|
|
|
506
511
|
if (type === 'picturebox') {
|
|
507
512
|
if (column.height === undefined) {
|
|
508
513
|
column.height = 40;
|
|
509
|
-
}
|
|
514
|
+
}
|
|
510
515
|
}
|
|
511
516
|
if (type === 'videobox') {
|
|
512
517
|
if (column.height === undefined) {
|
|
513
518
|
column.height = 60;
|
|
514
|
-
}
|
|
519
|
+
}
|
|
515
520
|
}
|
|
516
521
|
if (this.myConfig.readOnly) {
|
|
517
522
|
column.readOnly = true;
|
|
518
523
|
} else {
|
|
519
524
|
column.readOnly = false;
|
|
520
525
|
}
|
|
521
|
-
|
|
526
|
+
|
|
522
527
|
}
|
|
523
528
|
if (column.required) {
|
|
524
529
|
if (!column.className) {
|
|
525
530
|
column.className = 'efuture-grid-head-required';
|
|
526
531
|
}
|
|
527
532
|
}
|
|
528
|
-
|
|
533
|
+
|
|
529
534
|
if (!column.contentAlign) {
|
|
530
535
|
if (!column.align) {
|
|
531
536
|
column.contentAlign = column.align;
|
|
532
537
|
}
|
|
533
|
-
|
|
538
|
+
|
|
534
539
|
}
|
|
535
540
|
// 事件绑定
|
|
536
541
|
if (this.myConfig.items[i].valueChanged) {
|
|
@@ -580,13 +585,13 @@ export default {
|
|
|
580
585
|
}
|
|
581
586
|
} else {
|
|
582
587
|
if (!column.contentAlign) {
|
|
583
|
-
column.contentAlign = 'center';
|
|
588
|
+
column.contentAlign = 'center';
|
|
584
589
|
}
|
|
585
590
|
if (!column.align) {
|
|
586
591
|
column.align = 'center';
|
|
587
592
|
}
|
|
588
593
|
}
|
|
589
|
-
|
|
594
|
+
|
|
590
595
|
} else {
|
|
591
596
|
if (!column.contentAlign) {
|
|
592
597
|
column.contentAlign = 'left';
|
|
@@ -602,9 +607,9 @@ export default {
|
|
|
602
607
|
dictkey = column.customDictkey;
|
|
603
608
|
}
|
|
604
609
|
column.data = this.currentDictData[dictkey];
|
|
605
|
-
}
|
|
610
|
+
}
|
|
606
611
|
}
|
|
607
|
-
|
|
612
|
+
|
|
608
613
|
// 处理默认值
|
|
609
614
|
if (column.defaultValue !== undefined) {
|
|
610
615
|
newRow[column.name] = column.defaultValue;
|
|
@@ -613,7 +618,7 @@ export default {
|
|
|
613
618
|
let min = '';
|
|
614
619
|
if (column.min !== undefined) {
|
|
615
620
|
min = column.min;
|
|
616
|
-
}
|
|
621
|
+
}
|
|
617
622
|
if (column.smin !== undefined) {
|
|
618
623
|
min = column.smin;
|
|
619
624
|
}
|
|
@@ -628,7 +633,7 @@ export default {
|
|
|
628
633
|
column.defaultValue = '';
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
|
-
|
|
636
|
+
|
|
632
637
|
} else {
|
|
633
638
|
if (newRow !== undefined) {
|
|
634
639
|
if (column.type === 'poptagbox') {
|
|
@@ -638,7 +643,7 @@ export default {
|
|
|
638
643
|
}
|
|
639
644
|
}
|
|
640
645
|
}
|
|
641
|
-
}
|
|
646
|
+
}
|
|
642
647
|
},
|
|
643
648
|
expandRendel(h, params) {
|
|
644
649
|
return h('div', [
|
|
@@ -651,7 +656,7 @@ export default {
|
|
|
651
656
|
this.editIndex = params.index;
|
|
652
657
|
this.input(val);
|
|
653
658
|
//this.editValueChanged(params,val);
|
|
654
|
-
}
|
|
659
|
+
}
|
|
655
660
|
})
|
|
656
661
|
]);
|
|
657
662
|
},
|
|
@@ -664,7 +669,7 @@ export default {
|
|
|
664
669
|
return this.myConfig.indexMethod(row, index);
|
|
665
670
|
} else {
|
|
666
671
|
return index;
|
|
667
|
-
}
|
|
672
|
+
}
|
|
668
673
|
},
|
|
669
674
|
actionRender (h, params) {
|
|
670
675
|
return h('div', [
|
|
@@ -673,7 +678,7 @@ export default {
|
|
|
673
678
|
tooltype:'row',
|
|
674
679
|
moduleMethod:this.globalConfig.moduleMethod,
|
|
675
680
|
row:params.row,
|
|
676
|
-
onDoAction:(val) => {
|
|
681
|
+
onDoAction:(val) => {
|
|
677
682
|
val.rowinfo = params;
|
|
678
683
|
if (val.name === 'editRowForm') {
|
|
679
684
|
if (this.initRowForm) {
|
|
@@ -699,7 +704,7 @@ export default {
|
|
|
699
704
|
if (this.data[_index].flag === undefined || this.data[_index].flag === 'U') {
|
|
700
705
|
this.data[_index].flag = 'D';
|
|
701
706
|
const row = this.$Method.copy(this.data[_index]);
|
|
702
|
-
this.delData.push(row);
|
|
707
|
+
this.delData.push(row);
|
|
703
708
|
}
|
|
704
709
|
this.data.splice(_index, 1);
|
|
705
710
|
}
|
|
@@ -767,7 +772,7 @@ export default {
|
|
|
767
772
|
if (btnList) {
|
|
768
773
|
this.globalConfig.moduleMethod = btnList.modulemethod;
|
|
769
774
|
}
|
|
770
|
-
}
|
|
775
|
+
}
|
|
771
776
|
},
|
|
772
777
|
getSelection() {
|
|
773
778
|
return this.$refs.table.getSelection();
|
|
@@ -794,11 +799,11 @@ export default {
|
|
|
794
799
|
if (obj.evalue !== undefined) {
|
|
795
800
|
tempRow[obj.ename] = obj.evalue;
|
|
796
801
|
}
|
|
797
|
-
|
|
802
|
+
|
|
798
803
|
if (this.data[index].flag === undefined) {
|
|
799
804
|
tempRow.flag = 'U';
|
|
800
805
|
}
|
|
801
|
-
|
|
806
|
+
|
|
802
807
|
if (obj.customRows && obj.customRows.length > 0){
|
|
803
808
|
let self = this;
|
|
804
809
|
// 处理更新行
|
|
@@ -822,9 +827,9 @@ export default {
|
|
|
822
827
|
} else {
|
|
823
828
|
let newRow = Object.assign({},this.data[index],tempRow);
|
|
824
829
|
this.$nextTick(() => {
|
|
825
|
-
this.data.splice(index,1,newRow);
|
|
830
|
+
this.data.splice(index,1,newRow);
|
|
826
831
|
});
|
|
827
|
-
|
|
832
|
+
|
|
828
833
|
}
|
|
829
834
|
|
|
830
835
|
},
|
|
@@ -853,14 +858,14 @@ export default {
|
|
|
853
858
|
if (this.myConfig.checkByHighlight) {
|
|
854
859
|
el._highlight = flag;
|
|
855
860
|
}
|
|
856
|
-
}
|
|
861
|
+
}
|
|
857
862
|
} else {
|
|
858
863
|
el._checked = false;
|
|
859
864
|
el._highlight = false;
|
|
860
|
-
}
|
|
865
|
+
}
|
|
861
866
|
});
|
|
862
867
|
this.$nextTick(() => {
|
|
863
|
-
this.data = data;
|
|
868
|
+
this.data = data;
|
|
864
869
|
});
|
|
865
870
|
// 多选
|
|
866
871
|
} else {
|
|
@@ -873,16 +878,16 @@ export default {
|
|
|
873
878
|
if (this.myConfig.onSetRowCheckBefore) {
|
|
874
879
|
if (this.myConfig.onSetRowCheckBefore(index,flag)) {
|
|
875
880
|
this.$nextTick(() => {
|
|
876
|
-
this.data.splice(index,1,newRow);
|
|
881
|
+
this.data.splice(index,1,newRow);
|
|
877
882
|
this.tempData.splice(index,1,newRow);
|
|
878
883
|
});
|
|
879
884
|
}
|
|
880
885
|
} else {
|
|
881
886
|
this.$nextTick(() => {
|
|
882
|
-
this.data.splice(index,1,newRow);
|
|
887
|
+
this.data.splice(index,1,newRow);
|
|
883
888
|
this.tempData.splice(index,1,newRow);
|
|
884
889
|
});
|
|
885
|
-
}
|
|
890
|
+
}
|
|
886
891
|
}
|
|
887
892
|
}
|
|
888
893
|
},
|
|
@@ -895,7 +900,7 @@ export default {
|
|
|
895
900
|
}
|
|
896
901
|
});
|
|
897
902
|
this.$nextTick(() => {
|
|
898
|
-
this.data = data;
|
|
903
|
+
this.data = data;
|
|
899
904
|
});
|
|
900
905
|
},
|
|
901
906
|
setRowDisabled(index , flag) {
|
|
@@ -903,8 +908,8 @@ export default {
|
|
|
903
908
|
let newRow = Object.assign({},this.data[index],{});
|
|
904
909
|
newRow._disabled = flag;
|
|
905
910
|
this.$nextTick(() => {
|
|
906
|
-
this.data.splice(index,1,newRow);
|
|
907
|
-
this.tempData.splice(index,1,newRow);
|
|
911
|
+
this.data.splice(index,1,newRow);
|
|
912
|
+
this.tempData.splice(index,1,newRow);
|
|
908
913
|
});
|
|
909
914
|
}
|
|
910
915
|
},
|
|
@@ -914,7 +919,7 @@ export default {
|
|
|
914
919
|
el._disabled = flag;
|
|
915
920
|
});
|
|
916
921
|
this.$nextTick(() => {
|
|
917
|
-
this.data = data;
|
|
922
|
+
this.data = data;
|
|
918
923
|
});
|
|
919
924
|
},
|
|
920
925
|
setRowHighlight(index , flag) {
|
|
@@ -922,7 +927,7 @@ export default {
|
|
|
922
927
|
let newRow = Object.assign({},this.data[index],{});
|
|
923
928
|
newRow._highlight = flag;
|
|
924
929
|
this.$nextTick(() => {
|
|
925
|
-
this.data.splice(index,1,newRow);
|
|
930
|
+
this.data.splice(index,1,newRow);
|
|
926
931
|
this.tempData.splice(index,1,newRow);
|
|
927
932
|
});
|
|
928
933
|
}
|
|
@@ -933,7 +938,7 @@ export default {
|
|
|
933
938
|
el._highlight = flag;
|
|
934
939
|
});
|
|
935
940
|
this.$nextTick(() => {
|
|
936
|
-
this.data = data;
|
|
941
|
+
this.data = data;
|
|
937
942
|
});
|
|
938
943
|
},
|
|
939
944
|
commonRendel(h, params) {
|
|
@@ -950,11 +955,11 @@ export default {
|
|
|
950
955
|
},
|
|
951
956
|
onDoAction:(val) =>{
|
|
952
957
|
this.doAction(val);
|
|
953
|
-
}
|
|
958
|
+
}
|
|
954
959
|
})
|
|
955
960
|
]);
|
|
956
961
|
},
|
|
957
|
-
|
|
962
|
+
|
|
958
963
|
setExtraHeight () {
|
|
959
964
|
let height = 0;
|
|
960
965
|
if (this.$refs.head) {
|
|
@@ -986,7 +991,7 @@ export default {
|
|
|
986
991
|
}
|
|
987
992
|
}
|
|
988
993
|
}
|
|
989
|
-
}
|
|
994
|
+
}
|
|
990
995
|
},
|
|
991
996
|
findColumnConfig(name,config) {
|
|
992
997
|
if (name) {
|
|
@@ -1031,7 +1036,7 @@ export default {
|
|
|
1031
1036
|
}
|
|
1032
1037
|
}
|
|
1033
1038
|
}
|
|
1034
|
-
}
|
|
1039
|
+
}
|
|
1035
1040
|
},
|
|
1036
1041
|
openHelp () {
|
|
1037
1042
|
window.open(this.curHelpUrl);
|
|
@@ -1048,16 +1053,16 @@ export default {
|
|
|
1048
1053
|
},
|
|
1049
1054
|
makeTableColumns(val) {
|
|
1050
1055
|
this.total_summary = {};
|
|
1051
|
-
this.newRow = deepCopy(val.newRow);
|
|
1052
|
-
this.summaryColumn = deepCopy(val.summaryColumn);
|
|
1056
|
+
this.newRow = deepCopy(val.newRow);
|
|
1057
|
+
this.summaryColumn = deepCopy(val.summaryColumn);
|
|
1053
1058
|
this.tableColumns = deepCopy(val.columns);
|
|
1054
1059
|
let soltTableColumns = [];
|
|
1055
1060
|
this.getSoltTableColumns(val.columns, soltTableColumns);
|
|
1056
1061
|
this.soltTableColumns = soltTableColumns;
|
|
1057
1062
|
}
|
|
1058
1063
|
},
|
|
1059
|
-
mounted () {
|
|
1060
|
-
|
|
1064
|
+
mounted () {
|
|
1065
|
+
|
|
1061
1066
|
}
|
|
1062
1067
|
};
|
|
1063
|
-
</script>
|
|
1068
|
+
</script>
|
|
@@ -193,8 +193,10 @@ export default {
|
|
|
193
193
|
}
|
|
194
194
|
this.setDictData();
|
|
195
195
|
this.importReset = false;
|
|
196
|
+
// this.loadDynamicConfig();
|
|
196
197
|
this.$nextTick(() => {
|
|
197
198
|
this.importReset = true;
|
|
199
|
+
|
|
198
200
|
});
|
|
199
201
|
},
|
|
200
202
|
initUiConfig(obj,tmp) {
|
|
@@ -313,6 +315,7 @@ export default {
|
|
|
313
315
|
});
|
|
314
316
|
|
|
315
317
|
},
|
|
318
|
+
|
|
316
319
|
commonUiCustomConfig(obj,items) {
|
|
317
320
|
let index = items.findIndex(el => el.name === obj.fieldname || el.sname === obj.fieldname);
|
|
318
321
|
if (index > -1) {
|
|
@@ -351,6 +354,151 @@ export default {
|
|
|
351
354
|
Object.assign(items[index], tmp);
|
|
352
355
|
}
|
|
353
356
|
},
|
|
357
|
+
loadDynamicConfig() {
|
|
358
|
+
try {
|
|
359
|
+
const postData = {
|
|
360
|
+
modulecode: this.globalConfig.modulecode,
|
|
361
|
+
moduleid: this.globalConfig.modulecode
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
this.asyncPost(
|
|
365
|
+
this.uiconfig.resources,
|
|
366
|
+
"uiconfigs.getPageConfig",
|
|
367
|
+
postData,
|
|
368
|
+
(data) => {
|
|
369
|
+
if (!data || !this.uiconfig) {
|
|
370
|
+
console.log('1 没有配置数据')
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
this.mergeDynamicConfig(
|
|
375
|
+
this.uiconfig,
|
|
376
|
+
data
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
} catch (e) {
|
|
381
|
+
console.error('动态配置加载失败', e);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* 通用递归合并配置
|
|
387
|
+
* @param {Object} localConfig 本地 config(this.uiconfig)
|
|
388
|
+
* @param {Object} serverConfig 接口返回 config
|
|
389
|
+
*/
|
|
390
|
+
|
|
391
|
+
mergeDynamicConfig(localConfig, serverConfig) {
|
|
392
|
+
if (!localConfig || !serverConfig) {
|
|
393
|
+
console.log('1 没有配置数据')
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// ✅ 1️⃣ 处理 billQueryConfig
|
|
398
|
+
if (
|
|
399
|
+
localConfig.billQueryConfig.gridConfig.items &&
|
|
400
|
+
serverConfig.billQueryConfig.gridConfig.items
|
|
401
|
+
) {
|
|
402
|
+
this.mergeFlatItems(
|
|
403
|
+
localConfig.billQueryConfig.gridConfig.items,
|
|
404
|
+
serverConfig.billQueryConfig.gridConfig.items
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// ✅ 2️⃣ 处理 detailConfig
|
|
409
|
+
if (localConfig.detailConfig && serverConfig.detailConfig) {
|
|
410
|
+
this.mergeDetailConfig(
|
|
411
|
+
localConfig.detailConfig,
|
|
412
|
+
serverConfig.detailConfig
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
|
|
417
|
+
mergeDetailConfig(localDetail, serverDetail) {
|
|
418
|
+
|
|
419
|
+
// ✅ formsConfig
|
|
420
|
+
if (
|
|
421
|
+
localDetail.formsConfig.items &&
|
|
422
|
+
serverDetail.formsConfig.items
|
|
423
|
+
) {
|
|
424
|
+
this.mergeContainerItems(
|
|
425
|
+
localDetail.formsConfig.items,
|
|
426
|
+
serverDetail.formsConfig.items
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// ✅ billDetailConfig
|
|
431
|
+
if (
|
|
432
|
+
localDetail.billDetailConfig.items &&
|
|
433
|
+
serverDetail.billDetailConfig.items
|
|
434
|
+
) {
|
|
435
|
+
this.mergeContainerItems(
|
|
436
|
+
localDetail.billDetailConfig.items,
|
|
437
|
+
serverDetail.billDetailConfig.items
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
|
|
442
|
+
mergeContainerItems(localContainers, serverContainers) {
|
|
443
|
+
|
|
444
|
+
const containerMap = this.buildItemMap(localContainers);
|
|
445
|
+
|
|
446
|
+
serverContainers.forEach(serverContainer => {
|
|
447
|
+
|
|
448
|
+
const localContainer = containerMap.get(serverContainer.name);
|
|
449
|
+
if (!localContainer) {
|
|
450
|
+
console.log('2 没有配置localcontainer')
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// ✅ 合并容器自身属性
|
|
455
|
+
Object.assign(localContainer, serverContainer);
|
|
456
|
+
|
|
457
|
+
// ✅ 如果有子字段
|
|
458
|
+
if (
|
|
459
|
+
Array.isArray(localContainer.items) &&
|
|
460
|
+
Array.isArray(serverContainer.items)
|
|
461
|
+
) {
|
|
462
|
+
this.mergeFlatItems(
|
|
463
|
+
localContainer.items,
|
|
464
|
+
serverContainer.items
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
},
|
|
469
|
+
|
|
470
|
+
mergeFlatItems(localItems, serverItems) {
|
|
471
|
+
const fieldMap = this.buildItemMap(localItems);
|
|
472
|
+
|
|
473
|
+
serverItems.forEach(serverItem => {
|
|
474
|
+
const localItem = fieldMap.get(serverItem.name);
|
|
475
|
+
if (localItem) {
|
|
476
|
+
console.log('合并', localItem)
|
|
477
|
+
Object.assign(localItem, serverItem);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
},
|
|
481
|
+
|
|
482
|
+
buildItemMap(items, map = new Map()) {
|
|
483
|
+
if (!Array.isArray(items)) return map;
|
|
484
|
+
|
|
485
|
+
items.forEach(item => {
|
|
486
|
+
if (!item) {
|
|
487
|
+
console.log('3 没有配置数据')
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (item.name) {
|
|
492
|
+
map.set(item.name, item);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
if (Array.isArray(item.items)) {
|
|
496
|
+
this.buildItemMap(item.items, map);
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
return map;
|
|
501
|
+
},
|
|
354
502
|
_isFun (pro) {
|
|
355
503
|
let index = this.eventObject.findIndex(el => el === pro);
|
|
356
504
|
if (index > -1) {
|