From 0df15ed47f6e2aa5eb0610890bed7dcbaabc7c92 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期四, 11 七月 2024 17:32:07 +0800 Subject: [PATCH] test --- pages/modal/5600.vue | 112 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 85 insertions(+), 27 deletions(-) diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue index b73e1f3..13cfe4c 100644 --- a/pages/modal/5600.vue +++ b/pages/modal/5600.vue @@ -19,7 +19,8 @@ :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)" - @keyup.enter="onEnterChange(item)" @blur="onEnterChange(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)"></text> </view> @@ -490,7 +491,9 @@ }); }); }, - + onClick(item) { + this.focusFieldId = item.fieldId + }, ontap(index, item) { //鎵爜鍔熻兘 // var $ele = e; //console.log(e.target) @@ -533,19 +536,62 @@ } 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 - }) - } - // setTimeout(function() { - // uni.hideKeyboard(); - // }, 1000); + 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 + } + } + } + + } + } } // if(onSuffixClickCallbackEvent.id){ //鍚庡浘鏍囩偣鍑讳簨浠� // this.onSuffixClick(onSuffixClickCallbackEvent); @@ -696,12 +742,18 @@ if (result.ret != 0) { var tip = result.err_info ? typeof result.err_info == 'string' ? result .err_info : result.err_info.join('<br/>') : ''; - if (result.ret == 801) uni.showModal({ - title: this.translateSys("tip"), - content: tip, - showCancel: false, - confirmText: this.translateSys("cancel") - }); + if (result.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') + ':' + result @@ -1516,7 +1568,7 @@ item_list: jsonlist, ext_data: $this.detail1ExtData }) - + // console.log(jsonlist); $this.runCustomEvent(event, input_param, list, '1'); // jsonlist.forEach(async (json,key)=>{ @@ -1670,12 +1722,18 @@ if (result.ret != 0) { var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : ''; - if (result.ret == 801) uni.showModal({ - title: this.translateSys("tip"), - content: tip, - showCancel: false, - confirmText: this.translateSys("cancel") - }); + if (result.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') + ':' + result.ret, -- Gitblit v1.9.1