ocpview-plus 1.2.3 → 1.2.4
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 +6 -0
- package/dist/ocpviewplus.min.esm.js +2 -113
- package/dist/ocpviewplus.min.js +2 -2
- package/package.json +1 -1
- package/src/components/masterplate/base.vue +1 -156
package/package.json
CHANGED
|
@@ -77,7 +77,6 @@ export default {
|
|
|
77
77
|
this.uiconfig = config;
|
|
78
78
|
Object.assign(this,obj);
|
|
79
79
|
this.init();
|
|
80
|
-
// this.loadDynamicConfig();
|
|
81
80
|
if (this.customInit) {
|
|
82
81
|
this.customInit();
|
|
83
82
|
}
|
|
@@ -194,10 +193,8 @@ export default {
|
|
|
194
193
|
}
|
|
195
194
|
this.setDictData();
|
|
196
195
|
this.importReset = false;
|
|
197
|
-
console.log('---------- base 执行完毕')
|
|
198
196
|
this.$nextTick(() => {
|
|
199
197
|
this.importReset = true;
|
|
200
|
-
|
|
201
198
|
});
|
|
202
199
|
},
|
|
203
200
|
initUiConfig(obj,tmp) {
|
|
@@ -316,7 +313,6 @@ export default {
|
|
|
316
313
|
});
|
|
317
314
|
|
|
318
315
|
},
|
|
319
|
-
|
|
320
316
|
commonUiCustomConfig(obj,items) {
|
|
321
317
|
let index = items.findIndex(el => el.name === obj.fieldname || el.sname === obj.fieldname);
|
|
322
318
|
if (index > -1) {
|
|
@@ -355,158 +351,6 @@ export default {
|
|
|
355
351
|
Object.assign(items[index], tmp);
|
|
356
352
|
}
|
|
357
353
|
},
|
|
358
|
-
loadDynamicConfig() {
|
|
359
|
-
try {
|
|
360
|
-
const postData = {
|
|
361
|
-
modulecode: this.globalConfig.modulecode,
|
|
362
|
-
moduleid: this.globalConfig.modulecode
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
this.asyncPost(
|
|
366
|
-
this.uiconfig.resources,
|
|
367
|
-
"uiconfigs.getPageConfig",
|
|
368
|
-
postData,
|
|
369
|
-
(data) => {
|
|
370
|
-
if (!data || !this.uiconfig) {
|
|
371
|
-
console.log('1 没有配置数据')
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
this.mergeDynamicConfig(
|
|
376
|
-
this.uiconfig,
|
|
377
|
-
data
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
,function(data) {
|
|
381
|
-
console.error(data)
|
|
382
|
-
},function(data) {
|
|
383
|
-
console.error(data)
|
|
384
|
-
});
|
|
385
|
-
} catch (e) {
|
|
386
|
-
console.error('动态配置加载失败', e);
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* 通用递归合并配置
|
|
392
|
-
* @param {Object} localConfig 本地 config(this.uiconfig)
|
|
393
|
-
* @param {Object} serverConfig 接口返回 config
|
|
394
|
-
*/
|
|
395
|
-
|
|
396
|
-
mergeDynamicConfig(localConfig, serverConfig) {
|
|
397
|
-
if (!localConfig || !serverConfig) {
|
|
398
|
-
console.log('1 没有配置数据')
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// ✅ 1️⃣ 处理 billQueryConfig
|
|
403
|
-
if (
|
|
404
|
-
localConfig.billQueryConfig.gridConfig.items &&
|
|
405
|
-
serverConfig.billQueryConfig.gridConfig.items
|
|
406
|
-
) {
|
|
407
|
-
this.mergeFlatItems(
|
|
408
|
-
localConfig.billQueryConfig.gridConfig.items,
|
|
409
|
-
serverConfig.billQueryConfig.gridConfig.items
|
|
410
|
-
);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// ✅ 2️⃣ 处理 detailConfig
|
|
414
|
-
if (localConfig.detailConfig && serverConfig.detailConfig) {
|
|
415
|
-
this.mergeDetailConfig(
|
|
416
|
-
localConfig.detailConfig,
|
|
417
|
-
serverConfig.detailConfig
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
|
|
422
|
-
mergeDetailConfig(localDetail, serverDetail) {
|
|
423
|
-
|
|
424
|
-
// ✅ formsConfig
|
|
425
|
-
if (
|
|
426
|
-
localDetail.formsConfig.items &&
|
|
427
|
-
serverDetail.formsConfig.items
|
|
428
|
-
) {
|
|
429
|
-
this.mergeContainerItems(
|
|
430
|
-
localDetail.formsConfig.items,
|
|
431
|
-
serverDetail.formsConfig.items
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
// ✅ billDetailConfig
|
|
436
|
-
if (
|
|
437
|
-
localDetail.billDetailConfig.items &&
|
|
438
|
-
serverDetail.billDetailConfig.items
|
|
439
|
-
) {
|
|
440
|
-
this.mergeContainerItems(
|
|
441
|
-
localDetail.billDetailConfig.items,
|
|
442
|
-
serverDetail.billDetailConfig.items
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
mergeContainerItems(localContainers, serverContainers) {
|
|
448
|
-
|
|
449
|
-
const containerMap = this.buildItemMap(localContainers);
|
|
450
|
-
|
|
451
|
-
serverContainers.forEach(serverContainer => {
|
|
452
|
-
|
|
453
|
-
const localContainer = containerMap.get(serverContainer.name);
|
|
454
|
-
if (!localContainer) {
|
|
455
|
-
console.log('2 没有配置localcontainer')
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// ✅ 合并容器自身属性
|
|
460
|
-
Object.assign(localContainer, serverContainer);
|
|
461
|
-
|
|
462
|
-
// ✅ 如果有子字段
|
|
463
|
-
if (
|
|
464
|
-
Array.isArray(localContainer.items) &&
|
|
465
|
-
Array.isArray(serverContainer.items)
|
|
466
|
-
) {
|
|
467
|
-
this.mergeFlatItems(
|
|
468
|
-
localContainer.items,
|
|
469
|
-
serverContainer.items
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
},
|
|
474
|
-
|
|
475
|
-
mergeFlatItems(localItems, serverItems) {
|
|
476
|
-
const fieldMap = this.buildItemMap(localItems);
|
|
477
|
-
|
|
478
|
-
serverItems.forEach(serverItem => {
|
|
479
|
-
const localItem = fieldMap.get(serverItem.name);
|
|
480
|
-
console.log(serverItem.name, localItem)
|
|
481
|
-
if (localItem) {
|
|
482
|
-
console.log('合并前', localItem)
|
|
483
|
-
Object.assign(localItem, serverItem);
|
|
484
|
-
console.log('merge后', JSON.stringify(this.uiconfig))
|
|
485
|
-
this.uiconfig = Object.assign({}, this.uiconfig);
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
buildItemMap(items, map = new Map()) {
|
|
491
|
-
if (!Array.isArray(items)) return map;
|
|
492
|
-
|
|
493
|
-
items.forEach(item => {
|
|
494
|
-
if (!item) {
|
|
495
|
-
console.log('3 没有配置数据')
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
if (item.name) {
|
|
500
|
-
map.set(item.name, item);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
if (Array.isArray(item.items)) {
|
|
504
|
-
this.buildItemMap(item.items, map);
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
return map;
|
|
509
|
-
},
|
|
510
354
|
_isFun (pro) {
|
|
511
355
|
let index = this.eventObject.findIndex(el => el === pro);
|
|
512
356
|
if (index > -1) {
|
|
@@ -567,6 +411,7 @@ export default {
|
|
|
567
411
|
return;
|
|
568
412
|
}
|
|
569
413
|
this.$refs.detailappendix.setData(obj.billno,obj.billmoduleid,obj.idkey);
|
|
414
|
+
this.$refs.detailappendix.setReadOnly(e.readOnly);
|
|
570
415
|
this.$nextTick(() => {
|
|
571
416
|
if (e.readOnly) {
|
|
572
417
|
let data = this.$refs.detailappendix.getData();
|