ocpview-plus 1.2.0 → 1.2.2

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.
@@ -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,11 +382,6 @@ 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
-
390
385
  column.title = column.label;
391
386
  if (!column.headClassName) {
392
387
  if (this.myConfig.headClassName !== undefined) {
@@ -395,7 +390,7 @@ export default {
395
390
  } else {
396
391
  column.className = column.headClassName;
397
392
  }
398
-
393
+
399
394
  if (obj.children && obj.children.length > 0) {
400
395
  column.children = [];
401
396
  for (let i=0;i<obj.children.length; i++) {
@@ -420,7 +415,7 @@ export default {
420
415
  }
421
416
 
422
417
  this.setColumnPro(column,type,summaryColumn,newRow);
423
-
418
+
424
419
  if (type !== 'render') {
425
420
  if (column.render === undefined) {
426
421
  if (this.setCustomColumn) {
@@ -435,13 +430,13 @@ export default {
435
430
  if (type === 'picturebox') {
436
431
  if (column.height === undefined) {
437
432
  column.height = 40;
438
- }
433
+ }
439
434
  column.isGrid = true;
440
435
  }
441
436
  if (type === 'videobox') {
442
437
  if (column.height === undefined) {
443
438
  column.height = 60;
444
- }
439
+ }
445
440
  }
446
441
  if (this.myConfig.readOnly) {
447
442
  column.readOnly = true;
@@ -450,14 +445,14 @@ export default {
450
445
  column.readOnly = false;
451
446
  }
452
447
  }
453
-
448
+
454
449
  }
455
450
  if (column.required) {
456
451
  if (!column.className) {
457
452
  column.className = 'efuture-grid-head-required';
458
453
  }
459
454
  }
460
-
455
+
461
456
  // 事件绑定
462
457
  if (column.valueChanged) {
463
458
  column.valueChanged = this.valueChanged;
@@ -478,7 +473,7 @@ export default {
478
473
  },
479
474
  setColumn(i) {
480
475
  let column = this.$Method.copy(this.myConfig.items[i]);
481
-
476
+
482
477
  column.title = column.label;
483
478
  let type = '';
484
479
  if (column.type) {
@@ -487,7 +482,7 @@ export default {
487
482
  if (!type) {
488
483
  return;
489
484
  }
490
-
485
+
491
486
  column.key = column.name;
492
487
  if (Number(column.width)) {
493
488
  column.width = Number(column.width);
@@ -496,7 +491,7 @@ export default {
496
491
  }
497
492
 
498
493
  this.setColumnPro(column,type);
499
-
494
+
500
495
  if (type !== 'render') {
501
496
  if (column.render === undefined) {
502
497
  if (this.setCustomColumn) {
@@ -511,31 +506,31 @@ export default {
511
506
  if (type === 'picturebox') {
512
507
  if (column.height === undefined) {
513
508
  column.height = 40;
514
- }
509
+ }
515
510
  }
516
511
  if (type === 'videobox') {
517
512
  if (column.height === undefined) {
518
513
  column.height = 60;
519
- }
514
+ }
520
515
  }
521
516
  if (this.myConfig.readOnly) {
522
517
  column.readOnly = true;
523
518
  } else {
524
519
  column.readOnly = false;
525
520
  }
526
-
521
+
527
522
  }
528
523
  if (column.required) {
529
524
  if (!column.className) {
530
525
  column.className = 'efuture-grid-head-required';
531
526
  }
532
527
  }
533
-
528
+
534
529
  if (!column.contentAlign) {
535
530
  if (!column.align) {
536
531
  column.contentAlign = column.align;
537
532
  }
538
-
533
+
539
534
  }
540
535
  // 事件绑定
541
536
  if (this.myConfig.items[i].valueChanged) {
@@ -585,13 +580,13 @@ export default {
585
580
  }
586
581
  } else {
587
582
  if (!column.contentAlign) {
588
- column.contentAlign = 'center';
583
+ column.contentAlign = 'center';
589
584
  }
590
585
  if (!column.align) {
591
586
  column.align = 'center';
592
587
  }
593
588
  }
594
-
589
+
595
590
  } else {
596
591
  if (!column.contentAlign) {
597
592
  column.contentAlign = 'left';
@@ -607,9 +602,9 @@ export default {
607
602
  dictkey = column.customDictkey;
608
603
  }
609
604
  column.data = this.currentDictData[dictkey];
610
- }
605
+ }
611
606
  }
612
-
607
+
613
608
  // 处理默认值
614
609
  if (column.defaultValue !== undefined) {
615
610
  newRow[column.name] = column.defaultValue;
@@ -618,7 +613,7 @@ export default {
618
613
  let min = '';
619
614
  if (column.min !== undefined) {
620
615
  min = column.min;
621
- }
616
+ }
622
617
  if (column.smin !== undefined) {
623
618
  min = column.smin;
624
619
  }
@@ -633,7 +628,7 @@ export default {
633
628
  column.defaultValue = '';
634
629
  }
635
630
  }
636
-
631
+
637
632
  } else {
638
633
  if (newRow !== undefined) {
639
634
  if (column.type === 'poptagbox') {
@@ -643,7 +638,7 @@ export default {
643
638
  }
644
639
  }
645
640
  }
646
- }
641
+ }
647
642
  },
648
643
  expandRendel(h, params) {
649
644
  return h('div', [
@@ -656,7 +651,7 @@ export default {
656
651
  this.editIndex = params.index;
657
652
  this.input(val);
658
653
  //this.editValueChanged(params,val);
659
- }
654
+ }
660
655
  })
661
656
  ]);
662
657
  },
@@ -669,7 +664,7 @@ export default {
669
664
  return this.myConfig.indexMethod(row, index);
670
665
  } else {
671
666
  return index;
672
- }
667
+ }
673
668
  },
674
669
  actionRender (h, params) {
675
670
  return h('div', [
@@ -678,7 +673,7 @@ export default {
678
673
  tooltype:'row',
679
674
  moduleMethod:this.globalConfig.moduleMethod,
680
675
  row:params.row,
681
- onDoAction:(val) => {
676
+ onDoAction:(val) => {
682
677
  val.rowinfo = params;
683
678
  if (val.name === 'editRowForm') {
684
679
  if (this.initRowForm) {
@@ -704,7 +699,7 @@ export default {
704
699
  if (this.data[_index].flag === undefined || this.data[_index].flag === 'U') {
705
700
  this.data[_index].flag = 'D';
706
701
  const row = this.$Method.copy(this.data[_index]);
707
- this.delData.push(row);
702
+ this.delData.push(row);
708
703
  }
709
704
  this.data.splice(_index, 1);
710
705
  }
@@ -772,7 +767,7 @@ export default {
772
767
  if (btnList) {
773
768
  this.globalConfig.moduleMethod = btnList.modulemethod;
774
769
  }
775
- }
770
+ }
776
771
  },
777
772
  getSelection() {
778
773
  return this.$refs.table.getSelection();
@@ -799,11 +794,11 @@ export default {
799
794
  if (obj.evalue !== undefined) {
800
795
  tempRow[obj.ename] = obj.evalue;
801
796
  }
802
-
797
+
803
798
  if (this.data[index].flag === undefined) {
804
799
  tempRow.flag = 'U';
805
800
  }
806
-
801
+
807
802
  if (obj.customRows && obj.customRows.length > 0){
808
803
  let self = this;
809
804
  // 处理更新行
@@ -827,9 +822,9 @@ export default {
827
822
  } else {
828
823
  let newRow = Object.assign({},this.data[index],tempRow);
829
824
  this.$nextTick(() => {
830
- this.data.splice(index,1,newRow);
825
+ this.data.splice(index,1,newRow);
831
826
  });
832
-
827
+
833
828
  }
834
829
 
835
830
  },
@@ -858,14 +853,14 @@ export default {
858
853
  if (this.myConfig.checkByHighlight) {
859
854
  el._highlight = flag;
860
855
  }
861
- }
856
+ }
862
857
  } else {
863
858
  el._checked = false;
864
859
  el._highlight = false;
865
- }
860
+ }
866
861
  });
867
862
  this.$nextTick(() => {
868
- this.data = data;
863
+ this.data = data;
869
864
  });
870
865
  // 多选
871
866
  } else {
@@ -878,16 +873,16 @@ export default {
878
873
  if (this.myConfig.onSetRowCheckBefore) {
879
874
  if (this.myConfig.onSetRowCheckBefore(index,flag)) {
880
875
  this.$nextTick(() => {
881
- this.data.splice(index,1,newRow);
876
+ this.data.splice(index,1,newRow);
882
877
  this.tempData.splice(index,1,newRow);
883
878
  });
884
879
  }
885
880
  } else {
886
881
  this.$nextTick(() => {
887
- this.data.splice(index,1,newRow);
882
+ this.data.splice(index,1,newRow);
888
883
  this.tempData.splice(index,1,newRow);
889
884
  });
890
- }
885
+ }
891
886
  }
892
887
  }
893
888
  },
@@ -900,7 +895,7 @@ export default {
900
895
  }
901
896
  });
902
897
  this.$nextTick(() => {
903
- this.data = data;
898
+ this.data = data;
904
899
  });
905
900
  },
906
901
  setRowDisabled(index , flag) {
@@ -908,8 +903,8 @@ export default {
908
903
  let newRow = Object.assign({},this.data[index],{});
909
904
  newRow._disabled = flag;
910
905
  this.$nextTick(() => {
911
- this.data.splice(index,1,newRow);
912
- this.tempData.splice(index,1,newRow);
906
+ this.data.splice(index,1,newRow);
907
+ this.tempData.splice(index,1,newRow);
913
908
  });
914
909
  }
915
910
  },
@@ -919,7 +914,7 @@ export default {
919
914
  el._disabled = flag;
920
915
  });
921
916
  this.$nextTick(() => {
922
- this.data = data;
917
+ this.data = data;
923
918
  });
924
919
  },
925
920
  setRowHighlight(index , flag) {
@@ -927,7 +922,7 @@ export default {
927
922
  let newRow = Object.assign({},this.data[index],{});
928
923
  newRow._highlight = flag;
929
924
  this.$nextTick(() => {
930
- this.data.splice(index,1,newRow);
925
+ this.data.splice(index,1,newRow);
931
926
  this.tempData.splice(index,1,newRow);
932
927
  });
933
928
  }
@@ -938,7 +933,7 @@ export default {
938
933
  el._highlight = flag;
939
934
  });
940
935
  this.$nextTick(() => {
941
- this.data = data;
936
+ this.data = data;
942
937
  });
943
938
  },
944
939
  commonRendel(h, params) {
@@ -955,11 +950,11 @@ export default {
955
950
  },
956
951
  onDoAction:(val) =>{
957
952
  this.doAction(val);
958
- }
953
+ }
959
954
  })
960
955
  ]);
961
956
  },
962
-
957
+
963
958
  setExtraHeight () {
964
959
  let height = 0;
965
960
  if (this.$refs.head) {
@@ -991,7 +986,7 @@ export default {
991
986
  }
992
987
  }
993
988
  }
994
- }
989
+ }
995
990
  },
996
991
  findColumnConfig(name,config) {
997
992
  if (name) {
@@ -1036,7 +1031,7 @@ export default {
1036
1031
  }
1037
1032
  }
1038
1033
  }
1039
- }
1034
+ }
1040
1035
  },
1041
1036
  openHelp () {
1042
1037
  window.open(this.curHelpUrl);
@@ -1053,16 +1048,16 @@ export default {
1053
1048
  },
1054
1049
  makeTableColumns(val) {
1055
1050
  this.total_summary = {};
1056
- this.newRow = deepCopy(val.newRow);
1057
- this.summaryColumn = deepCopy(val.summaryColumn);
1051
+ this.newRow = deepCopy(val.newRow);
1052
+ this.summaryColumn = deepCopy(val.summaryColumn);
1058
1053
  this.tableColumns = deepCopy(val.columns);
1059
1054
  let soltTableColumns = [];
1060
1055
  this.getSoltTableColumns(val.columns, soltTableColumns);
1061
1056
  this.soltTableColumns = soltTableColumns;
1062
1057
  }
1063
1058
  },
1064
- mounted () {
1065
-
1059
+ mounted () {
1060
+
1066
1061
  }
1067
1062
  };
1068
- </script>
1063
+ </script>
@@ -77,6 +77,7 @@ export default {
77
77
  this.uiconfig = config;
78
78
  Object.assign(this,obj);
79
79
  this.init();
80
+ // this.loadDynamicConfig();
80
81
  if (this.customInit) {
81
82
  this.customInit();
82
83
  }
@@ -193,7 +194,7 @@ export default {
193
194
  }
194
195
  this.setDictData();
195
196
  this.importReset = false;
196
- // this.loadDynamicConfig();
197
+ console.log('---------- base 执行完毕')
197
198
  this.$nextTick(() => {
198
199
  this.importReset = true;
199
200
 
@@ -376,7 +377,11 @@ export default {
376
377
  data
377
378
  );
378
379
  }
379
- );
380
+ ,function(data) {
381
+ console.error(data)
382
+ },function(data) {
383
+ console.error(data)
384
+ });
380
385
  } catch (e) {
381
386
  console.error('动态配置加载失败', e);
382
387
  }
@@ -472,9 +477,12 @@ export default {
472
477
 
473
478
  serverItems.forEach(serverItem => {
474
479
  const localItem = fieldMap.get(serverItem.name);
480
+ console.log(serverItem.name, localItem)
475
481
  if (localItem) {
476
- console.log('合并', localItem)
482
+ console.log('合并前', localItem)
477
483
  Object.assign(localItem, serverItem);
484
+ console.log('merge后', JSON.stringify(this.uiconfig))
485
+ this.uiconfig = Object.assign({}, this.uiconfig);
478
486
  }
479
487
  });
480
488
  },
@@ -165,149 +165,9 @@ export default {
165
165
 
166
166
  this.billApprovalConfig.resources = this.myConfig.resources;
167
167
  this.billApprovalConfig.classPrefix = this.myConfig.classPrefix;
168
- // this.loadDynamicConfig();
169
-
168
+ console.log('------------- listdetail执行完毕')
170
169
  },
171
170
  methods:{
172
- loadDynamicConfig() {
173
- try {
174
- const modulecode = this.$Method.getUrlParam("modulecode")
175
- const postData = {
176
- modulecode: modulecode,
177
- moduleid: modulecode
178
- };
179
-
180
- this.asyncPost(
181
- this.myConfig.resources,
182
- "uiconfigs.getPageConfig",
183
- postData,
184
- (data) => {
185
- if (!data || !this.myConfig) {
186
- console.log('1 没有配置数据')
187
- return;
188
- }
189
-
190
- this.mergeDynamicConfig(
191
- this.myConfig,
192
- data
193
- );
194
- }
195
- );
196
- } catch (e) {
197
- console.error('动态配置加载失败', e);
198
- }
199
- },
200
- mergeDynamicConfig(localConfig, serverConfig) {
201
- if (!localConfig || !serverConfig) {
202
- console.log('1 没有配置数据')
203
- return;
204
- }
205
-
206
- // ✅ 1️⃣ 处理 billQueryConfig
207
- if (
208
- localConfig.billQueryConfig.gridConfig.items &&
209
- serverConfig.billQueryConfig.gridConfig.items
210
- ) {
211
- this.mergeFlatItems(
212
- localConfig.billQueryConfig.gridConfig.items,
213
- serverConfig.billQueryConfig.gridConfig.items
214
- );
215
- }
216
-
217
- // ✅ 2️⃣ 处理 detailConfig
218
- if (localConfig.detailConfig && serverConfig.detailConfig) {
219
- this.mergeDetailConfig(
220
- localConfig.detailConfig,
221
- serverConfig.detailConfig
222
- );
223
- }
224
- },
225
-
226
- mergeDetailConfig(localDetail, serverDetail) {
227
-
228
- // ✅ formsConfig
229
- if (
230
- localDetail.formsConfig.items &&
231
- serverDetail.formsConfig.items
232
- ) {
233
- this.mergeContainerItems(
234
- localDetail.formsConfig.items,
235
- serverDetail.formsConfig.items
236
- );
237
- }
238
-
239
- // ✅ billDetailConfig
240
- if (
241
- localDetail.billDetailConfig.items &&
242
- serverDetail.billDetailConfig.items
243
- ) {
244
- this.mergeContainerItems(
245
- localDetail.billDetailConfig.items,
246
- serverDetail.billDetailConfig.items
247
- );
248
- }
249
- },
250
-
251
- mergeContainerItems(localContainers, serverContainers) {
252
-
253
- const containerMap = this.buildItemMap(localContainers);
254
-
255
- serverContainers.forEach(serverContainer => {
256
-
257
- const localContainer = containerMap.get(serverContainer.name);
258
- if (!localContainer) {
259
- console.log('2 没有配置localcontainer')
260
- return;
261
- }
262
-
263
- // ✅ 合并容器自身属性
264
- Object.assign(localContainer, serverContainer);
265
-
266
- // ✅ 如果有子字段
267
- if (
268
- Array.isArray(localContainer.items) &&
269
- Array.isArray(serverContainer.items)
270
- ) {
271
- this.mergeFlatItems(
272
- localContainer.items,
273
- serverContainer.items
274
- );
275
- }
276
- });
277
- },
278
-
279
- mergeFlatItems(localItems, serverItems) {
280
- const fieldMap = this.buildItemMap(localItems);
281
-
282
- serverItems.forEach(serverItem => {
283
- const localItem = fieldMap.get(serverItem.name);
284
- if (localItem) {
285
- console.log('合并', localItem)
286
- Object.assign(localItem, serverItem);
287
- }
288
- });
289
- },
290
-
291
- buildItemMap(items, map = new Map()) {
292
- if (!Array.isArray(items)) return map;
293
-
294
- items.forEach(item => {
295
- if (!item) {
296
- console.log('3 没有配置数据')
297
- return;
298
- }
299
-
300
- if (item.name) {
301
- map.set(item.name, item);
302
- }
303
-
304
- if (Array.isArray(item.items)) {
305
- this.buildItemMap(item.items, map);
306
- }
307
- });
308
-
309
- return map;
310
- },
311
171
  setLogName() {
312
172
  this.logName.push({code:this.myConfig.detailConfig.response,name:'主表'});
313
173
  this.myConfig.detailConfig.formsConfig.items.forEach(el => {
@@ -892,7 +752,6 @@ export default {
892
752
  }
893
753
  },
894
754
  mounted () {
895
- this.loadDynamicConfig();
896
755
  let billno = this.$Method.getUrlParam('billno');
897
756
  if (billno) {
898
757
  let para = {};