From e540e5b44f56ce8e8edc377dfa4c5b343b1a9eef Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 14 八月 2025 16:12:15 +0800
Subject: [PATCH] paramvalue

---
 pages/modal/5600.vue |   95 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 71 insertions(+), 24 deletions(-)

diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue
index 86bba78..e25414e 100644
--- a/pages/modal/5600.vue
+++ b/pages/modal/5600.vue
@@ -301,28 +301,8 @@
 				await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
 				//浼犲叆鍙傛暟鍊� 				if (paramValue) {
-					const attrs = paramValue.attrs || [];
-					(this.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;
-										}
-									});
-								}
-							});
-						}
-					})
-				}
+					this.setFormValues(paramValue)
+					}
 
 				//鍔犺浇鍒濆鐣岄潰
 				if (this.param.Show_Welcom_Page) {
@@ -1114,7 +1094,75 @@
 					return 0;
 				}
 			},
+setFormValues(attrs) {
+				const head_styledef = this.head_styledef
+				if (JSON.stringify(attrs) == '{}') {
+					return;
+				}
+				console.log(attrs)
+				attrs.forEach(async (attr, key) => {
+					if (attr.choice_list) {
+						var dictItemList = [];
+						attr.choice_list.forEach(async (val, index) => {
+							dictItemList.push({
+								text: val,
+								value: val
+							});
+						});
 
+						head_styledef.form.items.forEach(async (attr_item, index) => {
+							if (attr_item.name != "Layout") {
+								if (attr_item.fieldId == attr.attr) {
+									if (attr_item.useDict) {
+										attr_item.dict = dictItemList;
+									} else {
+										attr_item.selections = dictItemList;
+									}
+								}
+							} else if (attr_item.name == "Layout") {
+								attr_item.setting.colList.forEach((col) => {
+									if (col) {
+										if (col.fieldId == attr.attr) {
+											if (col.useDict) {
+												col.dict = dictItemList;
+											} else {
+												col.selections = dictItemList;
+											}
+										}
+									}
+								});
+							}
+						});
+					}
+					if (!head_styledef.form.model[attr.attr]) {
+						head_styledef.form.model[attr.attr] = attr.value;
+					}
+					head_styledef.form.items.forEach(async (ele) => {
+						if (ele.name != "Layout") {
+							if (ele.fieldId == attr.attr) {
+								ele.value = attr.value;
+								ele.oldvalue = attr.value;
+							}
+						} else if (ele.name == "Layout") {
+							ele.setting.colList.forEach((col) => {
+								if (col) {
+									if (col.fieldId == attr.attr) {
+										col.value = attr.value;
+										col.oldvalue = attr.value;
+									}
+								}
+							});
+						}
+
+					})
+					//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+				})
+				console.log(head_styledef)
+				this.setData({
+					head_styledef: head_styledef
+				})
+			}, //鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭
+			
 			//鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭
 			viewActionSetRow(value) {
 				const $this = this
@@ -2207,8 +2255,7 @@
 					});
 				});
 			},
-
-
+			
 			//纭畾
 			ok() {
 				this.Before_OK_Event = this.param.Sub_Page[0].Before_ok;

--
Gitblit v1.9.1