From 9ae83a12c2b9c764e28760fb9c3c09fe697c8990 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期一, 22 七月 2024 14:56:00 +0800
Subject: [PATCH] 3018 按钮修改

---
 pages/modal/3037_2.vue |  138 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 104 insertions(+), 34 deletions(-)

diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index da8388a..242c987 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -288,15 +288,64 @@
 			}); //璁剧疆椤堕儴鏍囬 
 			this.$data.title = options.titlename;
 			this.$data.param = JSON.parse(options.param);
-			console.log(this.$data.param);
-			//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�-			this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
-			this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
+			this.loadData(options.paramValue)
 
 			//椤甸潰鍒濆鍖栬幏鍙栫劍鐐� 			// this.focusMateria=true; 
 		},
 		methods: {
+			setData: function(obj) {
+				let that = this;
+				let keys = [];
+				let val, data;
+
+				Object.keys(obj).forEach(function(key) {
+					keys = key.split(".");
+					val = obj[key];
+					data = that.$data;
+					keys.forEach(function(key2, index) {
+						if (index + 1 == keys.length) {
+							that.$set(data, key2, val);
+						} else {
+							if (!data[key2]) {
+								that.$set(data, key2, {});
+							}
+						}
+						data = data[key2];
+					});
+				});
+			},
+			async loadData(paramValue) {
+				console.log(this.$data.param);
+				//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+				await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
+				//浼犲叆鍙傛暟鍊�+				if (paramValue) {
+					const attrs = paramValue.attrs || [];
+					(this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => {
+						if (ele.name != "Layout") {
+							attrs.forEach(async (ele2, index2) => {
+								if (ele.fieldId == ele2.name) {
+									ele.value = ele2.value;
+								}
+							});
+						} else {
+							ele.setting.colList.forEach(async (col) => {
+								if (col) {
+									attrs.forEach(async (ele2,
+										index2) => {
+										if (col.fieldId == ele2.name) {
+											col.value = ele2.value;
+										}
+									});
+								}
+							});
+						}
+					})
+				}
+
+				await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
+			},
 			async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� 				var $this = this;
 				var dataInfo = {
@@ -480,13 +529,18 @@
 						if (data.ret != 0) {
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
-							if (data.ret == 801) uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys("cancel")
-							});
-							else uni.showModal({
+							if (data.ret == 801) {
+								if (this.param.Only_Script_Error) {
+									let pos = tip.indexOf("锛�);
+									if (pos > -1) tip = tip.substring(pos + 1);
+								}
+								uni.showModal({
+									title: this.translateSys("tip"),
+									content: tip,
+									showCancel: false,
+									confirmText: this.translateSys("cancel")
+								});
+							} else uni.showModal({
 								title: this.translateSys("tip"),
 								content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
 								showCancel: false,
@@ -1200,13 +1254,18 @@
 						if (data.ret != 0) {
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
-							if (data.ret == 801) uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys("cancel")
-							});
-							else uni.showModal({
+							if (data.ret == 801) {
+								if (this.param.Only_Script_Error) {
+									let pos = tip.indexOf("锛�);
+									if (pos > -1) tip = tip.substring(pos + 1);
+								}
+								uni.showModal({
+									title: this.translateSys("tip"),
+									content: tip,
+									showCancel: false,
+									confirmText: this.translateSys("cancel")
+								});
+							} else uni.showModal({
 								title: this.translateSys("tip"),
 								content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
 								showCancel: false,
@@ -1488,15 +1547,21 @@
 						if (data.ret != 0) {
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
-							if (data.ret == 801) uni.showModal({
+							if (data.ret == 801) {
+								if (this.param.Only_Script_Error) {
+									let pos = tip.indexOf("锛�);
+									if (pos > -1) tip = tip.substring(pos + 1);
+								}
+								uni.showModal({
+									title: this.translateSys("tip"),
+									content: tip,
+									showCancel: false,
+									confirmText: this.translateSys("cancel")
+								});
+							} else uni.showModal({
 								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys("cancel")
-							});
-							else uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip + this.translateSys('comma')  + this.translate('result') +this.translateSys('colon')  + data.ret,
+								content: tip + this.translateSys('comma') + this.translate('result') + this
+									.translateSys('colon') + data.ret,
 								showCancel: false,
 								confirmText: this.translateSys("cancel")
 							});
@@ -1528,7 +1593,7 @@
 														for (var j = 0; j < attr.length; j++) {
 															if (attr[j].Name == result[i].attr) {
 																if (utils.classUtils.attrTypeIsDict(attr[j]
-																	.Type)) {
+																		.Type)) {
 																	var dictItemList = [];
 																	for (var d in result[i].choice_list) {
 																		var val = result[i].choice_list[d];
@@ -1843,13 +1908,18 @@
 						if (data.ret != 0) {
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
-							if (data.ret == 801) uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys("cancel")
-							});
-							else uni.showModal({
+							if (data.ret == 801) {
+								if (this.param.Only_Script_Error) {
+									let pos = tip.indexOf("锛�);
+									if (pos > -1) tip = tip.substring(pos + 1);
+								}
+								uni.showModal({
+									title: this.translateSys("tip"),
+									content: tip,
+									showCancel: false,
+									confirmText: this.translateSys("cancel")
+								});
+							} else uni.showModal({
 								title: this.translateSys("tip"),
 								content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
 								showCancel: false,

--
Gitblit v1.9.1