From c094d4a32180130de0c26c75a5abc414128a5ec1 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 20 三月 2025 18:31:33 +0800
Subject: [PATCH] test

---
 pages/modal/3018_2.vue |   68 +++-------------------------------
 1 files changed, 6 insertions(+), 62 deletions(-)

diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue
index 462bf79..5cd0d43 100644
--- a/pages/modal/3018_2.vue
+++ b/pages/modal/3018_2.vue
@@ -3,8 +3,8 @@
 		<view class="view-content">
 			<!-- 琛ㄥご鏍峰紡 -->
 			<OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :focusId="focusFieldId"
-				@click="onClick" @focus="ontap" @change="onEnterChange" @click-prefix="classAttr_extButton"
-				@click-suffix="classAttr_extButton"></OIForm>
+				@on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton"
+				@on-click-suffix="classAttr_extButton"></OIForm>
 
 		</view>
 		<view class="view-bottom">
@@ -579,13 +579,11 @@
 				const $this = this;
 				//console.log("onScanValue", item);
 				item.value = value
-				let newVal = item.value 
+				let newVal = item.value
 				if (typeof item.value == "string") {
 					newVal = item.value.trim()
-					if (!newVal)
-						return
 				}
-				if (item.oldvalue != newVal) {
+				if (newVal) {
 					item.oldvalue = newVal;
 					var attr = item.fieldId;
 					$this.head_styledef.form.model[attr] = newVal;
@@ -687,6 +685,7 @@
 					var attr = item.fieldId;
 					this.head_styledef.form.model[attr] = newVal;
 					var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�+					// this.onScanValue(this.head_styledef.form.items[2].setting.colList[0], "test")
 					if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 						this.onChange(onChangeEvent);
 					}
@@ -980,44 +979,8 @@
 
 						if (data.result) {
 							var result = data.result;
+							$this.setFormValues(data.result)
 							for (var i = 0; i < result.length; i++) {
-								for (var c = 0; c < $this.$data.head_styledef.form.items
-									.length; c++) {
-									var attr = $this.$data.head_styledef.form.items[c];
-									//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�-									if ($this.head_styledef.form.model[result[i].attr] ==
-										undefined) {
-										$this.head_styledef.form.model[result[i].attr] =
-											result[i]
-											.value;
-									}
-									//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�-									if (attr.name != 'Layout') {
-										if (attr.fieldId == result[i].attr) {
-											attr.value = '';
-											attr.oldvalue = '';
-											attr.value = result[i].value;
-											attr.oldvalue = result[i].value;
-											$this.head_styledef.form.model[attr.fieldId] =
-												result[i]
-												.value;
-										}
-									} else if (attr.name == 'Layout') {
-										attr.setting.colList.forEach(col => {
-											if (col) {
-												if (col.fieldId == result[i].attr) {
-													col.value = '';
-													col.oldvalue = '';
-													col.value = result[i].value;
-													col.oldvalue = result[i].value;
-													$this.head_styledef.form.model[col
-															.fieldId] =
-														result[i].value;
-												}
-											}
-										});
-									}
-								}
 
 								var length = 0;
 								if (!$this.$data.refdatastore.filter(function(s) {
@@ -1633,25 +1596,6 @@
 									}
 								}
 							});
-						}
-					}
-					var length = 0;
-					if (!$this.$data.refdatastore.filter(function(s) {
-							return data[i].attr == s.attr
-						}).length) {
-						length = 1;
-						$this.$data.refdatastore.push(data[i]);
-					}
-					if (length == 0) {
-						for (var j = 0; j < $this.$data.refdatastore
-							.length; j++) {
-							if ($this.$data.refdatastore[j].attr == data[
-									i]
-								.attr) {
-								$this.$data.refdatastore[j].value = data[
-										i]
-									.value;
-							}
 						}
 					}
 				}

--
Gitblit v1.9.1