From de0f1b7995ee559f19e27ea07da0091d4ae189d5 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期一, 04 十一月 2024 16:39:37 +0800 Subject: [PATCH] 3018 --- pages/modal/3018_2.vue | 202 +++++++++++++++++++++++++++++++++------- pages/modal/3037_2.vue | 21 +-- pages/login/index.vue | 21 ++- api/index.js | 3 4 files changed, 187 insertions(+), 60 deletions(-) diff --git a/api/index.js b/api/index.js index 79459df..7cbf336 100644 --- a/api/index.js +++ b/api/index.js @@ -72,7 +72,8 @@ dldUrl }); } else { - return reject("璁块棶澶辫触锛岀姸鎬佺爜锛� + res.statusCode); + // return reject("璁块棶澶辫触锛岀姸鎬佺爜锛� + res.statusCode); + resolve({}) } }, diff --git a/pages/login/index.vue b/pages/login/index.vue index c05f07b..7958b0d 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -152,12 +152,15 @@ // var ser = this.userServer.toLowerCase().split('/'); const res = await getApkVersionInfo(this.userServer) this.downloadUrl = res.dldUrl || "" - var isver = this.compare(res.verNum, version); - if (isver) { - this.$refs.promotion.open(); - } else { - console.log('褰撳墠宸叉槸鏈�柊鐗堟湰') + if (this.downloadUrl) { + var isver = this.compare(res.verNum || "", version); + if (isver) { + this.$refs.promotion.open(); + } else { + console.log('褰撳墠宸叉槸鏈�柊鐗堟湰') + } } + } catch (ex) { // console.log(ex); let exStr = JSON.stringify(ex) @@ -172,7 +175,7 @@ }); } - + }, compare(curV, reqV) { var arr1 = curV.toString().split('.'); @@ -377,7 +380,7 @@ pwd: this.userPwd } hideLoading() - + uni.navigateTo({ url: '../index/index?args=9999999999' }) @@ -395,7 +398,7 @@ confirmText: this.translateSys("cancel") }); } - + }, translate(t) { if (typeof this.$t == "function") return this.$t(`page.${t}`) @@ -411,7 +414,7 @@ var url = utils.session.getValue('server'); var username = utils.session.getValue('account'); var userpwd = utils.session.getValue('password'); - + var ischecked = false; if (!this.userServer) this.userServer = url; diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue index f91a918..230a47d 100644 --- a/pages/modal/3018_2.vue +++ b/pages/modal/3018_2.vue @@ -239,7 +239,7 @@ $this.onScanValue(ele, res.result) break; } - } else if (ele.name == "Layot") { + } else if (ele.name == "Layout") { let curIndex = (ele.setting.colList || []).findIndex((col, index2, arr) => { return (col.name == 'Input' || col.name == 'InputNumber' || col @@ -482,12 +482,19 @@ formItem.dict = list; } catch (ex) { // console.log(ex); + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr + uni.showModal({ title: this.translateSys("error") + "1.3", - content: ex.errMsg, + content: tip, showCancel: false, confirmText: this.translateSys("cancel") }); + + } }, @@ -546,11 +553,31 @@ if (action.action_type == 'set_dlg_attr') { var result = action.value; $this.setFormValues(result) - } else if (data.action[i].action_type == 'set_dlg_attr_show') { + } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; $this.hideFormItems(result) - // console.log($this.$data.head_styledef); + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); } else { uni.showModal({ title: this.translateSys("tip"), @@ -961,6 +988,27 @@ // console.log($this.$data.head_styledef); } else if (action.action_type == 'set_global_attr') { $this.$data.global_attr = action.value || []; + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); } else { uni.showModal({ title: this.translateSys("tip"), @@ -1470,12 +1518,15 @@ showCancel: false, confirmText: this.translateSys("cancel") }); + else { - uni.showToast({ - title: this.translate('create_success'), - icon: "success", - duration: 3000 - }); + uni.showToast({ + title: this.translate('create_success'), + icon: "success", + duration: 3000 + }); + } + if (!this.$data.param.After_Btn_Not_Refresh) { //鍒锋柊 @@ -1492,28 +1543,50 @@ var action = actionlist[i]; if (action.action_type == 'set_dlg_attr') { $this.setFormValues(action.value) - } else if (data.action[i].action_type == 'set_dlg_attr_show') { + } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; $this.hideFormItems(result) + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); } } } } } - - // this.class_attr_init(); this.saving = false }).catch(ex => { - console.log(ex); this.saving = false uni.hideLoading(); + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr uni.showModal({ title: this.translateSys("tip"), - content: ex.errMsg, + content: tip, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -1762,10 +1835,32 @@ var action = actionlist[i]; if (action.action_type == 'set_dlg_attr') { $this.setFormValues(action.value) - } else if (data.action[i].action_type == 'set_dlg_attr_show') { + } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; $this.hideFormItems(result) + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); } + } } } @@ -1775,9 +1870,13 @@ }).catch(ex => { // console.log(ex); this.saving = false + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr uni.showModal({ title: this.translateSys('tip') + "7.1", - content: ex.errMsg, + content: tip, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -1893,28 +1992,61 @@ showCancel: false, confirmText: this.translateSys("cancel") }); + if (!this.$data.param.After_Btn_Not_Refresh) { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/3018_2?param=' + JSON.stringify(this.$data + .param) + + "&titlename=" + this.$data.title + }); + } else { + var actionlist = data.action; + if (actionlist) { + console.log(actionlist); + for (var i = 0; i < actionlist.length; i++) { + var action = actionlist[i]; + if (action.action_type == 'set_dlg_attr') { + $this.setFormValues(action.value) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.hideFormItems(result) + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); + } - var actionlist = data.action; - if (actionlist) { - console.log(actionlist); - for (var i = 0; i < actionlist.length; i++) { - var action = actionlist[i]; - if (action.action_type == 'set_dlg_attr') { - $this.setFormValues(action.value) - } else if (data.action[i].action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.hideFormItems(result) } } } - } }).catch(ex => { // console.log(ex); + let exStr = JSON.stringify(ex) + if (exStr == "{}") + exStr = ex + let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr uni.showModal({ title: this.translateSys('tip') + "7.1", - content: ex.errMsg, + content: tip, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -1933,7 +2065,6 @@ const url = '../modal/3018?param=' + JSON.stringify(data) + "&titlename=" + btn.Edit_dlg .Name + "&type=addDataObj" - console.log("showAddSmallDialog", url); var $this = this; uni.navigateTo({ url: url, @@ -1942,13 +2073,12 @@ addDataObj: function(resData) { console.log(resData); //鍒锋柊 - if (!this.$data.param.After_Btn_Not_Refresh) { - uni.redirectTo({ - url: '../modal/3018_2?param=' + JSON.stringify(this - .$data.param) + - "&titlename=" + this.$data.title - }); - } + uni.redirectTo({ + url: '../modal/3018_2?param=' + JSON.stringify(this + .$data.param) + + "&titlename=" + this.$data.title + }); + }, } }); diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index c0053a2..3c4dbe2 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -26,7 +26,7 @@ :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'" 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="focusMateria" @focus="ontap(item)" @blur="onevent(item)" :maxlength="-1"/> + :focus="focusMateria" @focus="ontap(item)" @blur="onevent(item)" :maxlength="-1" /> <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" @click="onchange(item)"></text> </view> @@ -78,7 +78,8 @@ <!-- 宸﹀彸甯冨眬 --> <p class="tx_title2">{{param.Scan_Code.Name}}:</p> <input type="text" class="attr_field" :value="scanCodeVal" @focus="scan_ontap" @blur="scan_onevent" - :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'" :maxlength="-1"> + :style="param.Scan_Code.Have_Select_Button==true?'width: '+(100-(param.Scan_Code.Name.length * 5)-14)+'%;':'width: '+(100-(param.Scan_Code.Name.length * 5)-5)+'%;'" + :maxlength="-1"> <div class="text-right2" v-if="param.Scan_Code.Have_Select_Button==true"> <a @tap="scan_classAttr_extButton()"><i class="ace-icon fa" :class="param.Scan_Code.Img?param.Scan_Code.Img:'fa-plus-circle'"></i></a> @@ -110,7 +111,7 @@ :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'" 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="focusMateria" @focus="ontap(item)" @blur="onevent(item)" :maxlength="-1"/> + :focus="focusMateria" @focus="ontap(item)" @blur="onevent(item)" :maxlength="-1" /> <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" @click="onchange(item)"></text> </view> @@ -173,7 +174,8 @@ v-model="cols.value" :disabled="cols.disabled" :placeholder="cols.placeholder" :style="{'width':cols.setting.prefix && cols.setting.suffix?'78%':cols.setting.prefix || cols.setting.suffix?'87%':'96%'}" - :focus="focusMateria" @focus="ontap(cols)" @blur="onevent(cols)" :maxlength="-1"/> + :focus="focusMateria" @focus="ontap(cols)" @blur="onevent(cols)" + :maxlength="-1" /> <text v-if="cols.setting.suffix" class="uni-icon" :class="[cols.setting.suffix]" @click="onchange(cols)"></text> </view> @@ -1395,17 +1397,8 @@ // console.log($this.$data.head_styledef); } else if (action.action_type == 'set_global_attr') { $this.$data.global_attr = action.value || []; - } else { - uni.showModal({ - title: this.translateSys("tip"), - content: this.translateSys("quotation_mark_left") + action - .action_type + this.translateSys( - "quotation_mark_right") + this.translate( - "tip_action_unprocessed"), - showCancel: false, - confirmText: this.translateSys("cancel") - }); } + } } -- Gitblit v1.9.1