@zscreate/zhxy-app-component 1.0.299 → 1.0.300

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.
@@ -315,7 +315,8 @@ export default {
315
315
  zjfmFormDesign: false,
316
316
  thrqDataModalShow: '',
317
317
  formDesignFlag: false,
318
- unwatch:null
318
+ unwatch:null,
319
+ publish_linkage_array:[],
319
320
  }
320
321
  },
321
322
  watch: {
@@ -409,6 +410,7 @@ export default {
409
410
  this.dataObj._currObjId = this._currObjId = Math.random()
410
411
  this.rules = {};
411
412
  this.generateModle(this.data.list);
413
+ this.initFormLinkage();
412
414
  this.updateFormDataToModels()
413
415
  console.log(JSON.stringify(this.models))
414
416
  }
@@ -450,8 +452,7 @@ export default {
450
452
  // },
451
453
  // }
452
454
  },
453
- created() {
454
- },
455
+ created() {},
455
456
  updated() {
456
457
 
457
458
  },
@@ -479,6 +480,27 @@ export default {
479
480
  // this.initPo();
480
481
  },
481
482
  methods: {
483
+ // 表单联动部分组件并未放入evanFormItem,所以并未订阅相关事件,此方法将相关组件放入订阅模式
484
+ initFormLinkage() {
485
+ if(this.data?.list){
486
+ this.data.list.forEach(item=>{
487
+ if(['verify', 'hnkj-verify', 'hnkj-confirm'].includes(item.type)){
488
+ this.publish_linkage_array.push(Pubsub.subscribe('formLinkage_' + item.model, (key, data) => {
489
+ let onlyKey = key.replace("formLinkage_","");
490
+ if (data.type === 'show') {
491
+ this.data.list = this.data.list.map(l=>{
492
+ if(l.model == onlyKey){
493
+ this.$set(l.options,"canView",data.updateValue);
494
+ }
495
+ return l;
496
+ })
497
+ // this.widget.options.canView = data.updateValue
498
+ }
499
+ }))
500
+ }
501
+ })
502
+ }
503
+ },
482
504
  changedate(key,value) {
483
505
  if(key == 'thrq') {
484
506
  this.getThrqList(value)
@@ -1422,7 +1444,15 @@ export default {
1422
1444
  hideReqired() {
1423
1445
  this.hideRequiredAsterisk = !this.hideRequiredAsterisk
1424
1446
  },
1425
- }
1447
+ },
1448
+ destroyed() {
1449
+ if(this.publish_linkage_array.length > 0){
1450
+ this.publish_linkage_array.forEach(item=>{
1451
+ Pubsub.unsubscribe(item);
1452
+ })
1453
+ this.publish_linkage_array = [];
1454
+ }
1455
+ },
1426
1456
  }
1427
1457
  </script>
1428
1458
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.299",
3
+ "version": "1.0.300",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",