From 9b8282bcf5c5fbc22858bbfa15934b7f8a0ab753 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期三, 10 七月 2024 18:24:55 +0800
Subject: [PATCH] smallwnd

---
 pages/modal/5602.vue |   75 ++++++++++++++++++++++++++++++-------
 1 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/pages/modal/5602.vue b/pages/modal/5602.vue
index 670fc9c..fcb74fd 100644
--- a/pages/modal/5602.vue
+++ b/pages/modal/5602.vue
@@ -24,7 +24,7 @@
 						:type="item.name=='Input'?'text':'number'" v-model="item.value" :disabled="item.disabled"
 						:placeholder="item.placeholder"
 						:style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}"
-						:focus="focusFieldId == item.fieldId" @focus="ontap(index,item)"
+						:focus="focusFieldId == item.fieldId" @focus="ontap(index,item)" @click="onClick(item)" 
 						@keyup.enter="onEnterChange(item)" @blur="onEnterChange(item)" />
 					<text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]"
 						@click="onEnterChange(item)">&#xe568;</text>
@@ -493,7 +493,9 @@
 					});
 				});
 			},
-
+	onClick(item) {
+				this.focusFieldId = item.fieldId
+			},
 			ontap(index, item) { //鎵爜鍔熻兘
 				// var $ele = e;
 				this.focusOldFieldId = item.fieldId
@@ -516,21 +518,66 @@
 						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠� 							$this.onChange(onChangeEvent);
 						}
-						if (item.value) { //杈撳叆妗嗕笉涓虹┖
+						if (item.value) { //绗竴涓緭鍏ユ涓嶄负绌� 							//鍒濆鍖栵紝涓嬩釜杈撳叆妗唂ocus灞炴�
-							const curIndex = $this.head_styledef.form.items.findIndex((ele, index2, arr) => {
-								return (ele.name == 'Input' || ele.name == 'InputNumber') && index2 >
-									index;
-							})
-							if (curIndex > -1) {
-								$this.setData({
-									focusFieldId: $this.head_styledef.form.items[curIndex].fieldId
-								})
+							var findd = false
+							for (let i in $this.head_styledef.form.items) {
+								const ele = $this.head_styledef.form.items[i]
+						
+								if (ele.name != "Layout") {
+									if (ele.name == 'Input' || ele.name == 'InputNumber') {
+										if (attr == ele.fieldId) {
+											findd = true
+										} else {
+											if (findd) {
+												$this.setData({
+													focusFieldId: ele.fieldId
+												})
+												break
+											}
+						
+										}
+						
+									}
+								} else {
+									if (findd) {
+										let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+											return (col.name == 'Input' || col.name == 'InputNumber');
+										})
+										if (curIndex > -1) {
+											$this.setData({
+												focusFieldId: ele.setting.colList[curIndex]
+													.fieldId
+											})
+											break
+										}
+						
+									} else {
+										let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+											return attr == col.fieldId;
+										})
+										if (curIndex > -1) {
+											findd = true
+											let curIndex2 = ele.setting.colList.findIndex((col, index2, arr) => {
+												return (col.name == 'Input' || col.name ==
+														'InputNumber') &&
+													index2 >
+													curIndex;
+											})
+											if (curIndex2 > -1) {
+												$this.setData({
+													focusFieldId: ele.setting.colList[curIndex]
+														.fieldId
+												})
+												break
+											}
+										}
+									}
+						
+								}
 							}
-							// setTimeout(function(){
-							// 	uni.hideKeyboard();
-							// },1000);
 						}
+						
 						// if(onSuffixClickCallbackEvent.id){   //鍚庡浘鏍囩偣鍑讳簨浠� 						//   this.onSuffixClick(onSuffixClickCallbackEvent);
 						// }

--
Gitblit v1.9.1