From c380a8d6e114ff623832d2b34fca52b10537a1d0 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 14 六月 2024 17:03:22 +0800
Subject: [PATCH] 5600 onchange run +json

---
 pages/modal/3037_2.vue |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index 989eed7..7765a23 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -1547,7 +1547,7 @@
 							if (action.action_type == 'set_dlg_attr') {
 								var result = action.value;
 								for (var i = 0; i < result.length; i++) {
-										if (result[i].choice_list) {
+									if (result[i].choice_list) {
 										for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
 											var attr = $this.head_styledef.form.items[c];
 											if(attr.name!='Layout'){
@@ -1616,9 +1616,35 @@
 										}
 									}
 								}
-							} else if (data.action[i].action_type == 'set_global_attr') {
-								$this.$data.global_attr = data.action[i].value || [];
-							}
+							} else if (action.action_type == 'set_dlg_attr_show') {
+								var result = action.value;
+								result.forEach(async (attr,key) => {
+								  $this.$data.head_styledef.form.items.forEach(async (ele,index) => {
+								    //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+									if(ele.name!='Layout'){
+										if(ele.fieldId==attr.attr){
+											ele.show=attr.show;
+										}
+									} else if(ele.name=='Layout'){
+										ele.setting.colList.forEach(col=>{
+											if(col){
+												if(col.fieldId==attr.attr){
+													col.show=attr.show;
+												}
+											}
+										});
+									}
+								  });
+								});
+								var head_styledef = JSON.parse(JSON.stringify($this.$data.head_styledef));
+								$this.$data.head_styledef =[];
+								$this.$data.head_styledef = head_styledef;
+								// console.log($this.$data.head_styledef);
+							} else if (action.action_type == 'set_global_attr') {
+								$this.$data.global_attr = action.value || [];
+							} else {
+								uni.showModal({title:"鎻愮ず",content:action.action_type + '姝ction灏氭湭澶勭悊锛�,showCancel:false,confirmText:"鍙栨秷"});
+							} 
 						}
 					}
 					
@@ -1882,7 +1908,9 @@
 										}
 									}
 								}
-							}
+							} else {
+								uni.showModal({title:"鎻愮ず",content:action.action_type + '姝ction灏氭湭澶勭悊锛�,showCancel:false,confirmText:"鍙栨秷"});
+							} 
 						}
 					}
 					

--
Gitblit v1.9.1