From effc285be3229af6b77edafcb5ec71b96a35f53a Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 12 七月 2024 17:41:57 +0800 Subject: [PATCH] test --- pages/modal/5600.vue | 91 ++++++++++++++++++++++++++++----------------- 1 files changed, 57 insertions(+), 34 deletions(-) diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue index 13cfe4c..042ff3e 100644 --- a/pages/modal/5600.vue +++ b/pages/modal/5600.vue @@ -18,9 +18,8 @@ :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)" - @click="onClick(item)" @keyup.enter="onEnterChange(item)" - @blur="onEnterChange(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)"></text> </view> @@ -217,22 +216,7 @@ this.$data.title = options.titlename; this.$data.param = JSON.parse(options.param); // console.log(this.$data.param); - //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- this.Head_UIStyleGetInfo(this.$data.ClsID, this.$data.param.Input_UI_Style.ID); - - //鍔犺浇鍒濆鐣岄潰 - if (this.$data.param.Show_Welcom_Page) { - this.$data.param.Welcome_Page.Img = this.$data.param.Welcome_Page.Img.replace(/ /g, '+'); - this.$data.param.Welcome_Page.Width = parseInt(this.$data.param.Welcome_Page.Width); - this.$data.param.Welcome_Page.Height = parseInt(this.$data.param.Welcome_Page.Height); - } - //鍔犺浇Tab椤电 - this.$data.items.push(this.$data.param.Sub_Page[0].Name); - this.$data.items.push(this.$data.param.Sub_Page[1].Name); - this.Detail1_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[0].UI_Style.ID); - this.Detail2_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[1].UI_Style.ID); - - console.log(this.$data.param); + this.loadData(options.paramValue) }, //椤甸潰鍒濆鍖栬幏鍙栫劍鐐� methods: { @@ -256,6 +240,47 @@ data = data[key2]; }); }); + }, + async loadData(paramValue) { + //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.$data.ClsID, this.$data.param.Input_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; + } + }); + } + }); + } + }) + } + + //鍔犺浇鍒濆鐣岄潰 + if (this.$data.param.Show_Welcom_Page) { + this.$data.param.Welcome_Page.Img = this.$data.param.Welcome_Page.Img.replace(/ /g, '+'); + this.$data.param.Welcome_Page.Width = parseInt(this.$data.param.Welcome_Page.Width); + this.$data.param.Welcome_Page.Height = parseInt(this.$data.param.Welcome_Page.Height); + } + //鍔犺浇Tab椤电 + this.$data.items.push(this.$data.param.Sub_Page[0].Name); + this.$data.items.push(this.$data.param.Sub_Page[1].Name); + await this.Detail1_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[0].UI_Style.ID); + await this.Detail2_UIstyleGetInfo(this.ClsID, this.$data.param.Sub_Page[1].UI_Style.ID); + console.log(this.$data.param); }, changeSwiper(evt) { let index = evt.target.current || evt.detail.current; @@ -743,18 +768,17 @@ var tip = result.err_info ? typeof result.err_info == 'string' ? result .err_info : result.err_info.join('<br/>') : ''; 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({ + 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, @@ -1722,7 +1746,7 @@ 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){ + if (result.ret == 801) { if (this.param.Only_Script_Error) { let pos = tip.indexOf("锛�); if (pos > -1) tip = tip.substring(pos + 1); @@ -1733,8 +1757,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + result.ret, showCancel: false, -- Gitblit v1.9.1