From effc285be3229af6b77edafcb5ec71b96a35f53a Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 12 七月 2024 17:41:57 +0800 Subject: [PATCH] test --- locale/es.json | 11 pages/modal/3018_2.vue | 361 ++++--- pages/modal/5602.vue | 63 + pages/modal/5601.vue | 925 ++++++++++++++------- pages/modal/3037_2.vue | 76 + pages/modal/ms_classAttr.vue | 51 locale/zh-Hans.json | 11 locale/en.json | 9 locale/zh-Hant.json | 10 pages/modal/3018.vue | 564 ++++++++---- pages.json | 62 + pages/modal/3200.vue | 165 +++ manifest.json | 4 pages/modal/5600.vue | 91 + pages/login/index.vue | 26 pages/modal/classAttr.vue | 93 +- 16 files changed, 1,675 insertions(+), 847 deletions(-) diff --git a/locale/en.json b/locale/en.json index eaaf2f3..ad1702e 100644 --- a/locale/en.json +++ b/locale/en.json @@ -57,7 +57,10 @@ "sys.sorting": "Sorting", "sys.view": "View", "sys.unrealized": "Unrealized", + "sys.select": "Select", + "sys.please": "please", + "page.input_server": "Please enter the server", "page.set_server": "Set up services", "page.tip_app_update": "Is there a new version of the system that needs to be updated?", "page.tip_no_web_server": "Website address not entered, please reconfigure input", @@ -111,7 +114,7 @@ "page.cannot_empty": "Cannot be empty", "page.required": "Required", "page.cannot_rlated_function": "Do not support jumping to function points", - "page.function_not_exist": "Function point does not exist!" - - + "page.function_not_exist": "Function point does not exist!", + "page.function_not_edit_dlg": "This function point does not have an editing window configured!", + "page.no_find_attr_diaplay": "No attributes found to display!" } \ No newline at end of file diff --git a/locale/es.json b/locale/es.json index 1f54263..058cbc4 100644 --- a/locale/es.json +++ b/locale/es.json @@ -56,7 +56,10 @@ "sys.sorting": "Clasificaci贸n", "sys.view": "Navegar", "sys.unrealized": "No logrado", - + "sys.select": "Escoger", + "sys.please": "Por favor.", + + "page.input_server": "Por favor, introduzca el servidor", "page.set_server": "Establecer servicio", "page.tip_app_update": "驴El sistema tiene una nueva versi贸n, 驴 necesita actualizarse?", "page.tip_no_web_server": "No se ha introducido la direcci贸n del sitio web, por favor reconfigurar la entrada", @@ -110,9 +113,9 @@ "page.cannot_empty": "No puede estar vac铆o", "page.required": "Obligatorio", "page.cannot_rlated_function": "No se admite saltar a un punto funcional", - "page.function_not_exist": "隆隆 los puntos funcionales no existen!" - - + "page.function_not_exist": "隆隆 los puntos funcionales no existen!", + "page.function_not_edit_dlg": "隆隆 el punto de funci贸n no est谩 configurado para la ventana de edici贸n!", + "page.no_find_attr_diaplay": "隆隆 no se han encontrado atributos visibles!" diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json index e40cecb..726247e 100644 --- a/locale/zh-Hans.json +++ b/locale/zh-Hans.json @@ -57,8 +57,11 @@ "sys.sorting": "鍒嗘嫞", "sys.view": "娴忚", "sys.unrealized": "鏈疄鐜�, + "sys.select": "璇烽�鎷�, + "sys.please": "璇�, + - + "page.input_server": "璇疯緭鍏ユ湇鍔″湴鍧�, "page.set_server": "璁剧疆鏈嶅姟", "page.tip_app_update": "绯荤粺鏈夋柊鐗堟湰锛屾槸鍚﹂渶瑕佹洿鏂帮紵", "page.tip_no_web_server": "鏈緭鍏ョ綉绔欏湴鍧�紝璇烽噸鏂伴厤缃緭鍏�, @@ -114,6 +117,10 @@ "page.cannot_empty": "涓嶈兘涓虹┖", "page.required": "蹇呭~", "page.cannot_rlated_function": "涓嶆敮鎸佽烦杞埌鍔熻兘鐐�, - "page.function_not_exist": "鍔熻兘鐐逛笉瀛樺湪!" + "page.function_not_exist": "鍔熻兘鐐逛笉瀛樺湪锛�, + "page.function_not_edit_dlg": "璇ュ姛鑳界偣鏈厤缃紪杈戠獥鍙o紒", + "page.no_find_attr_diaplay": "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛� + + } \ No newline at end of file diff --git a/locale/zh-Hant.json b/locale/zh-Hant.json index 8becea6..826afb0 100644 --- a/locale/zh-Hant.json +++ b/locale/zh-Hant.json @@ -56,7 +56,10 @@ "sys.sorting": "鍒嗘弨", "sys.view": "鐎忚", "sys.unrealized": "鏈鐝�, - + "sys.select": "閫夋嫨", + "sys.please": "璇�, + + "page.input_server": "璜嬭几鍏ユ湇鍕欏湴鍧�, "page.set_server": "瑷畾鏈嶅嫏", "page.tip_app_update": "绯荤当鏈夋柊鐗堟湰锛屾槸鍚﹂渶瑕佹洿鏂帮紵", "page.tip_no_web_server": "鏈几鍏ョ恫绔欏湴鍧�紝璜嬮噸鏂伴厤瀵樿几鍏�, @@ -110,8 +113,9 @@ "page.cannot_empty": "涓嶈兘鐐虹┖", "page.required": "蹇呭~", "page.cannot_rlated_function": "涓嶆敮鎸佽烦杞夊埌鍔熻兘榛�, - "page.function_not_exist": "鍔熻兘榛炰笉瀛樺湪锛� - + "page.function_not_exist": "鍔熻兘榛炰笉瀛樺湪锛�, + "page.function_not_edit_dlg": "瑭插姛鑳介粸鏈厤瀵樼法杓绐楋紒", + "page.no_find_attr_diaplay": "鏈壘鍒板彲椤ず鐨勭殑鍐呭锛� diff --git a/manifest.json b/manifest.json index e71ccd0..4b52776 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "MoboxPDA", "appid" : "__UNI__56D451E", "description" : "", - "versionName" : "1.1.01", - "versionCode" : 1101, + "versionName" : "1.1.02", + "versionCode" : 1102, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ "app-plus" : { diff --git a/pages.json b/pages.json index 73a6a2e..b82d64c 100644 --- a/pages.json +++ b/pages.json @@ -14,10 +14,9 @@ "titleNView": { "buttons": [{ //鍙充晶鎿嶄綔鎸夐挳鏍峰紡瀹氫箟,鏄互鏁扮粍褰㈠紡瀹氫箟锛屽彲瀹氫箟澶氫釜 "color": "#000000", + "colorPressed": "#2D8CF0", "fontSize": "24px", - "width": "auto", "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 - // "text": "222" "fontSrc": "/static/uni.ttf", "text": "\ue462" }] @@ -28,13 +27,43 @@ "path": "pages/modal/classAttr", "style": { "navigationBarTitleText": "%sys.add2%", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "app-plus": { + "titleNView": { + "buttons": [ //鍙充晶鎿嶄綔鎸夐挳鏍峰紡瀹氫箟,鏄互鏁扮粍褰㈠紡瀹氫箟锛屽彲瀹氫箟澶氫釜 + { + "color": "#000000", + "colorPressed": "#2D8CF0", + "fontSize": "24px", + "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 + "fontSrc": "/static/uni.ttf", + "text": "\ue462" + } + ] + } + } } }, { "path": "pages/modal/ms_classAttr", "style": { "navigationBarTitleText": "%sys.add2%", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "app-plus": { + "titleNView": { + "buttons": [ //鍙充晶鎿嶄綔鎸夐挳鏍峰紡瀹氫箟,鏄互鏁扮粍褰㈠紡瀹氫箟锛屽彲瀹氫箟澶氫釜 + { + "color": "#000000", + "colorPressed": "#2D8CF0", + "fontSize": "24px", + "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 + "fontSrc": "/static/uni.ttf", + "text": "\ue462" + } + ] + } + } + + } }, { "path": "js/pickerAddress/pickerAddress", @@ -77,14 +106,23 @@ "enablePullDownRefresh": false, "app-plus": { "titleNView": { - "buttons": [{ //鍙充晶鎿嶄綔鎸夐挳鏍峰紡瀹氫箟,鏄互鏁扮粍褰㈠紡瀹氫箟锛屽彲瀹氫箟澶氫釜 - "color": "#000000", - "colorPressed": "#2D8CF0", - "fontSize": "24px", - "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 - "fontSrc": "/static/uni.ttf", - "text": "\ue612" - }] + "buttons": [ //鍙充晶鎿嶄綔鎸夐挳鏍峰紡瀹氫箟,鏄互鏁扮粍褰㈠紡瀹氫箟锛屽彲瀹氫箟澶氫釜 + { + "color": "#000000", + "colorPressed": "#2D8CF0", + "fontSize": "24px", + "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 + "fontSrc": "/static/uni.ttf", + "text": "\ue612" + }, { + "color": "#000000", + "colorPressed": "#2D8CF0", + "fontSize": "24px", + "float": "right", //瀵艰埅鏍忕殑宸﹀彸浣嶇疆 + "fontSrc": "/static/uni.ttf", + "text": "\ue462" + } + ] } } } diff --git a/pages/login/index.vue b/pages/login/index.vue index 1afa975..ec27e9d 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -48,7 +48,7 @@ <!-- 杈撳叆妗嗙ず渚�--> <uni-popup ref="inputDialog" type="dialog"> <uni-popup-dialog ref="inputClose" mode="input" :title="translateSys('set')" :value="userServer" - placeholder="璇疯緭鍏ュ唴瀹� @confirm="dialogInputConfirm"></uni-popup-dialog> + :placeholder="translate('input_server')" @confirm="dialogInputConfirm"></uni-popup-dialog> </uni-popup> <!-- 鐗堟湰鍗囩骇寮圭獥寮� --> <uni-popup ref="promotion" type="center"> @@ -144,9 +144,13 @@ } var ser = this.userServer.toLowerCase().split('/'); var translateSyshis = this; - if (ser[1] == 'mobox3') { //鍒ゆ柇褰撳墠缃戝潃鏄惁鏄痬obox3 - var url = 'http://' + this.userServer + '/Program/version.txt'; - // console.log(url); + var rootUrl = 'http://' + this.userServer + if (this.userServer.includes("://")) { + rootUrl = this.userServer + } + if (ser[ser.length - 1] == 'mobox3') { //鍒ゆ柇褰撳墠缃戝潃鏄惁鏄痬obox3 + var url = rootUrl + '/Program/version.txt'; + console.log(url); uni.request({ url: url, // 鎸囧畾JS鏂囦欢鐨勫畬鏁磋矾寰� method: 'GET', @@ -160,8 +164,8 @@ var VersionCode = versionInfo[2].replace(".apk", "").replace(".", "").replace( ".", ""); //鏈嶅姟绔増鏈彿 // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app涓嬭浇閾炬帴 - translateSyshis.downloadUrl = "http://" + translateSyshis.userServer + - "/Program/" + + + translateSyshis.downloadUrl = rootUrl+ "/Program/" + VersionName; //app涓嬭浇閾炬帴this. var isver = translateSyshis.compare(versionNum, version); if (isver) { @@ -193,7 +197,7 @@ }); } else { var dataInfo = { - server: this.userServer + server: rootUrl }; this.$store.dispatch('GetApkVersionInfo', dataInfo).then(success => { console.log(success); @@ -208,7 +212,7 @@ const VersionCode = resp.VersionCode; //鐗堟湰缂栫爜 const versionNum = resp.Version; //鏈嶅姟绔増鏈彿 // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app涓嬭浇閾炬帴 - translateSyshis.downloadUrl = "http://" + translateSyshis.userServer + + translateSyshis.downloadUrl = rootUrl+ "/Program/" + VersionName; //app涓嬭浇閾炬帴this. var isver = translateSyshis.compare(versionNum, version); @@ -411,9 +415,13 @@ }); return; } + var rootUrl = 'http://' + this.userServer + if (this.userServer.includes("://")) { + rootUrl = this.userServer + } //妫�煡 "鐧诲綍鐘舵�/閿佸睆鐘舵�" 缁撴潫 var loginInfo = { - server: this.userServer, + server:rootUrl, uname: this.userName, pwd: this.userPwd, cname: plus.device.model, diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue index f2eae75..ef69bae 100644 --- a/pages/modal/3018.vue +++ b/pages/modal/3018.vue @@ -275,7 +275,8 @@ </view> <view class="popup-footer"> <button type="default" @tap="popup_sava" class="btn_popup_add">{{translateSys('ok')}}</button> - <button type="default" @tap="popup_cancel" class="btn_popup_cancel">{{translateSys('cancel')}}</button> + <button type="default" @tap="popup_cancel" + class="btn_popup_cancel">{{translateSys('cancel')}}</button> </view> </view> </uni-popup> @@ -350,74 +351,110 @@ console.log(param); if (!param.EditDlgMode) { uni.showModal({ - title: this.translateSys('tip') + "", - content: "璇ュ姛鑳界偣鏈厤缃紪杈戠獥鍙o紝璇烽噸鏂伴厤缃紒", + title: this.translateSys('tip'), + content: this.translate('function_not_edit_dlg'), showCancel: false, confirmText: this.translateSys('cancel') + }); + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }); return; } if (!param.Edit_dlg.Name) { uni.showModal({ - title: this.translateSys('tip') + "", - content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒", + title: this.translateSys('tip') + ", + content: this.translate('function_not_edit_dlg'), showCancel: false, confirmText: this.translateSys('cancel') + }); + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }); return; } this.$data.param = param; - var edit_dlg = { - Model: param.EditDlgMode, - Name: param.Edit_dlg.Name - } - var dataInfo = { - class_id: param.clsid, - class_name: '', - group_name: '' - }; - var $this = this; - $this.$store.state.thisareaFuncID = param.clsid; - // console.log($this.$store.getters.getclassAttrList); - //鑾峰彇 - if ($this.$store.getters.getclassAttrList) { - $this.$data.classAttrList = $this.$store.getters.getclassAttrList; - $this.classGridStyleInfo(); - } else - $this.$store.dispatch('classAttrGetList', dataInfo).then(success => { - // console.log(success); - if (success.err_code == 0) { - $this.$data.classAttrList = success.result; - success.result.forEach(async (group, index) => { - group.attr_list.forEach(async (attr, key) => { - if (utils.classUtils.attrTypeIsDict((attr.type)) { - await $this.DictItemGetList(attr, key, index); - } - }); - }); - setTimeout(function() { - $this.classGridStyleInfo(); - }, 500); - } else { - uni.showModal({ - title: this.translateSys('error') + " 1", - content: success.err_msg, - showCancel: false, - confirmText: this.translateSys('cancel') - }); - } - }).catch(ex => { - // console.log(ex); - uni.showModal({ - title: this.translateSys('error') + " 1.1", - content: ex.errMsg, - showCancel: false, - confirmText: this.translateSys('cancel') - }); - }); + this.loadData() }, + methods: { + setData: function(obj) { + let that = this; + let keys = []; + let val, data; + + Object.keys(obj).forEach(function(key) { + keys = key.split("."); + val = obj[key]; + data = that.$data; + keys.forEach(function(key2, index) { + if (index + 1 == keys.length) { + that.$set(data, key2, val); + } else { + if (!data[key2]) { + that.$set(data, key2, {}); + } + } + data = data[key2]; + }); + }); + }, + async loadData() { + const param = this.param + var edit_dlg = { + Model: param.EditDlgMode, + Name: param.Edit_dlg.Name + } + var dataInfo = { + class_id: this.param.clsid, + class_name: '', + group_name: '' + }; + var $this = this; + $this.$store.state.thisareaFuncID = param.clsid; + // console.log($this.$store.getters.getclassAttrList); + //鑾峰彇 + if ($this.$store.getters.getclassAttrList) { + $this.$data.classAttrList = $this.$store.getters.getclassAttrList; + $this.classGridStyleInfo(); + } else { + $this.$store.dispatch('classAttrGetList', dataInfo) + .then((success) => { + if (success.err_code == 0) { + $this.$data.classAttrList = success.result; + success.result.forEach(async (group, index) => { + group.attr_list.forEach(async (attr, key) => { + if (utils.classUtils.attrTypeIsDict(attr.type)) { + await $this.DictItemGetList(attr, key, + index); + } + }); + }); + setTimeout(function() { + $this.classGridStyleInfo(); + }, 500); + } else { + uni.showModal({ + title: this.translateSys('error') + " 1", + content: success.err_msg, + showCancel: false, + confirmText: this.translateSys('cancel') + }); + } + }).catch(ex => { + // console.log(ex); + uni.showModal({ + title: this.translateSys('error') + " 1.1", + content: ex.errMsg, + showCancel: false, + confirmText: this.translateSys('cancel') + }); + }); + } + console.log(this.$data.param); + }, async DictItemGetList(attr, key, index) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛� this.data = []; var $this = this; @@ -565,7 +602,8 @@ DispName: attr.disp_name, LuaAttr: attr.lua_attr, Desc: attr.desc, - ActionDef: attr.action_def ? Base64.decode(attr.action_def) : '', + ActionDef: attr.action_def ? Base64.decode(attr + .action_def) : '', Multilingual: attr.multilingual, RefCondition: attr.ref_condition, GroupName: data.group, @@ -619,7 +657,8 @@ if (ca.select == true) ca.Value = []; //ca.dictitem[0].CN_S_NAME; else - ca.Value = '璇烽�鎷�; //ca.dictitem[0].CN_S_NAME; + ca.Value = this.translateSys( + "select"); //ca.dictitem[0].CN_S_NAME; var dictitemlist = []; for (var d = 0; d < ca.dictitem.length; d++) { ca.dictitem[d].label = ca.dictitem[d].CN_S_NAME; @@ -629,22 +668,25 @@ ca.Value = ca.dictitem[d].CN_S_NAME; } } - if(utils.classUtils.attrTypeIsDateTime(ca.Type)){ + if (utils.classUtils.attrTypeIsDateTime(ca.Type)) { var nowDate = new Date(); var date = { year: nowDate.getFullYear(), month: nowDate.getMonth() + 1, day: nowDate.getDate() } - ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date - .month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); + ca.Value = date.year + '-' + (date.month >= 10 ? date.month : + '0' + + date + .month) + '-' + (date.day >= 10 ? date.day : '0' + date + .day); } if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) { ca.RelClsList = ca.RelCls; - ca.Value = '璇�; + ca.Value = this.translateSys('please'); } - if(utils.classUtils.attrTypeIsRegion(ca.Type)) - ca.Value = '璇烽�鎷�; + if (utils.classUtils.attrTypeIsRegion(ca.Type)) + ca.Value = this.translateSys("select"); if (utils.classUtils.attrTypeIsBool(ca.Type)) ca.Value = false; @@ -725,8 +767,8 @@ } else { uni.showModal({ - title: this.translateSys('tip') + "", - content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�", + title: this.translateSys('tip'), + content: this.translate('no_find_attr_diaplay'), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -756,12 +798,13 @@ // } // $this.$data.popupParam= popupParam; // return; - var before_click_button = $this.$data.classAttrList[index].Attr[iindex].before_click_button; + var before_click_button = $this.$data.classAttrList[index].Attr[iindex] + .before_click_button; var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback; if (!before_click_button) { uni.showModal({ - title: this.translateSys('tip') + "", - content: "before_click_button-event_id涓虹┖锛�, + title: this.translateSys('tip'), + content: this.translate("icon_click_event_empty"), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -769,14 +812,15 @@ } if (!button_callback) { uni.showModal({ - title: this.translateSys('tip') + "", - content: "button_callback-event_id涓虹┖锛�, + title: this.translateSys('tip'), + content: this.translate("icon_click_event_empty"), showCancel: false, confirmText: this.translateSys('cancel') }); return; } - this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index, iindex); + this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index, + iindex); }, popupChange(e) { console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show); @@ -817,14 +861,16 @@ } if (!$this.$data.popupParam) { uni.showModal({ - title: this.translateSys('tip') + "", + title: this.translateSys('tip'), content: "popupParam涓虹┖锛�, showCancel: false, confirmText: this.translateSys('cancel') }); return; } - $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex].Value = name; + $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex] + .Value = + name; console.log(data); var callback_eventid = $this.$data.popupParam.button_callback.trim(); var info = { @@ -857,7 +903,9 @@ //console.log(e.target) getApp().onScan((result) => { console.log(result); - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + 'iindex']] + .Value = result.decodedata; uni.hideKeyboard(); this.onevent($ele, result.decodedata); @@ -869,20 +917,29 @@ }, ondateTime(e) { //console.log(e.target) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.target + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + .Value = e + .target .value; }, onchange(e) { // console.log(e.target); - var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e - .target.value]; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + 'iindex']] + .dictitem[e + .target.value]; + var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + 'iindex']]; // console.log(data_attr); if (value.Name != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + .Value = + value .Name; // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target + .dataset[ + 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; @@ -893,7 +950,7 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; req.push(this.formatAttr(ar)) - + } } var info = { @@ -955,7 +1012,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (utils.classUtils.attrTypeIsDict(ar.Type)) + if (utils.classUtils.attrTypeIsDict(ar.Type)) req.push({ attr: ar.Name, value: itemvalue.Name @@ -985,12 +1042,16 @@ }, onevent(e, decodedata) { // console.log(e.target); - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + 'iindex']]; // console.log(decodedata); if (e.target.value != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + .Value = decodedata ? decodedata : e.target.value; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target + .dataset[ + 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; @@ -1023,11 +1084,16 @@ oncheck(e) { // console.log(e.target); var ischecked = e.target.dataset.ischeck ? false : true; - var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; + var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ + 'iindex']]; // console.log(data_attr); if (ischecked != data_attr.Value) { - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = ischecked; - var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + .Value = + ischecked; + var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target + .dataset[ + 'iindex']] .action; if (eventid) { // self.event_no_sub = 1; @@ -1065,8 +1131,10 @@ addresschange(e) { // console.log(e.target); console.log(e.data.join(';')) - this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.data.join( - ';'); + this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] + .Value = e.data + .join( + ';'); }, classAttr_AddPer(index, iindex) { var param = { @@ -1080,11 +1148,15 @@ AddPer(data, param) { // console.log(param); console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].Login + ';' + + $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[ + 0].Name; + $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[ + 0] + .Login + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex] + .action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -1112,8 +1184,8 @@ classAttr_AddRef(e) { console.log(e.target); uni.showModal({ - title: this.translateSys('tip') + "", - content: "姝ゅ姛鑳借繕鏈疄鐜帮紒", + title: this.translateSys('tip'), + content: this.translateSys('unrealized'), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -1132,11 +1204,15 @@ AddPer(data, param) { // console.log(param); // console.log(data); - $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[0].ID + ';' + + $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[ + 0].Name; + $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[ + 0].ID + + ';' + data[0].Name; - var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex].action; + var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex] + .action; if (eventid) { eventid = eventid.trim(); if (eventid) { @@ -1170,7 +1246,7 @@ }, add() { uni.showLoading({ - title: "鍔犺浇涓�..", + title: this.translateSys("loading") mask: true }); var req = []; @@ -1179,8 +1255,10 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (utils.classUtils.attrTypeIsDict(ar.Type)) { + if (ar.Value == this.translateSys("select") || ar.Value == '鈥斺�' + this + .translateSys( + "select") + '鈥斺�') ar.Value = ''; + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -1197,23 +1275,25 @@ name: ar.Name, value: ar.Value }); - } else - { + } else { const node = this.formatAttr(ar) req.push({ name: node.attr, value: node.value }); } - + if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ uni.hideLoading(); // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000}); uni.showModal({ - title: this.translateSys('tip') + "", - content: ar.DispName + '涓嶈兘涓虹┖锛�, + title: this.translateSys('tip'), + content: this.translateSys('quotation_mark_left') + ar.DispName + + this + .translateSys('quotation_mark_right') + this.translate( + "cannot_empty"), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -1225,7 +1305,7 @@ 'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom - button_name: '鏂板', + button_name: this.translateSys('add2'), master: { cls_id: this.$data.param.clsid, } @@ -1270,8 +1350,13 @@ if (action.ret == '0') { if (action.ret != 0) { uni.showModal({ - title: this.translateSys('tip') + "", - content: '鎵ц鑴氭湰澶辫触锛� + action.result, + title: this.translateSys('tip'), + content: this.translate('execute_script_failed') + + this + .translateSys('comma') + this.translate( + 'result') + + this + .translateSys('colon') + action.result, showCancel: false, confirmText: this.translateSys('cancel') }); @@ -1279,8 +1364,11 @@ } if (action.info) { uni.showModal({ - title: this.translateSys('tip') + "", - content: '鎵ц鑴氭湰澶辫触锛� + action.info, + title: this.translateSys('tip'), + content: this.translate('execute_script_failed') + + this + .translateSys('comma') + + this.translateSys('colon') + action.info, showCancel: false, confirmText: this.translateSys('cancel') }); @@ -1298,13 +1386,14 @@ } } else uni.showToast({ - title: "鍒涘缓鎴愬姛锛�, + title: this.translate('create_success'), icon: "success", duration: 3000 }); //鍒锋柊 uni.redirectTo({ - url: '../modal/3018?param=' + JSON.stringify(this.$data.param) + + url: '../modal/3018?param=' + JSON.stringify(this.$data + .param) + "&titlename=" + this.$data.title }); // this.cancel(); @@ -1320,7 +1409,7 @@ console.log(ex); uni.hideLoading(); uni.showModal({ - title: this.translateSys('tip') + "", + title: this.translateSys('tip'), content: ex.errMsg, showCancel: false, confirmText: this.translateSys('cancel') @@ -1336,7 +1425,7 @@ 'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom - button_name: '鏂板', + button_name: this.translateSys('add2'), master: { cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -1384,26 +1473,31 @@ if (success.err_code == 0) { var data = success.result; if (data.ret != 0) { - var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data + var tip = data.err_info ? typeof data.err_info == 'string' ? data + .err_info : + data .err_info.join('<br/>') : ''; if (data.ret == 801) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') }); else uni.showModal({ - title: this.translateSys('tip') , - content: tip + ',鎻愮ず:' + data.ret, + title: this.translateSys('tip'), + content: tip + ',' + this.translateSys('tip') + ':' + data + .ret, showCancel: false, confirmText: this.translateSys('cancel') }); return false } else { - var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( - '<br/>') : ''; + var tip = data.info ? typeof data.info == 'string' ? data.info : data + .info + .join( + '<br/>') : ''; if (tip) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') @@ -1420,15 +1514,23 @@ if (value) { console.log(value); for (var i = 0; i < value.length; i++) { - for (var a = 0; a < this.$data.classAttrList.length; a++) { - for (var l = 0; l < this.$data.classAttrList[a].Attr + for (var a = 0; a < this.$data.classAttrList + .length; a++) { + for (var l = 0; l < this.$data + .classAttrList[a] + .Attr .length; l++) { - var ca = this.$data.classAttrList[a].Attr[l]; + var ca = this.$data.classAttrList[a] + .Attr[l]; if (value[i].attr == ca.Name) { - if (utils.classUtils.attrTypeIsDict(ca.Type)) { + if (utils.classUtils + .attrTypeIsDict(ca + .Type)) { var dictItemList = []; - for (var d in value[i].choice_list) { - var list_val = value[i].choice_list[d]; + for (var d in value[i] + .choice_list) { + var list_val = value[i] + .choice_list[d]; dictItemList.push({ "CN_S_NAME": list_val, "Name": list_val, @@ -1447,16 +1549,22 @@ } var length = 0; - if (!this.$data.refdatastore.filter(function(s) { + if (!this.$data.refdatastore.filter(function( + s) { return value[i].attr == s.attr }).length) { length = 1; this.$data.refdatastore.push(value[i]); } if (length == 0) { - for (var j = 0; j < this.$data.refdatastore.length; j++) { - if (this.$data.refdatastore[j].attr == value[i].attr) { - this.$data.refdatastore[j].value = value[i].value; + for (var j = 0; j < this.$data.refdatastore + .length; j++) { + if (this.$data.refdatastore[j].attr == + value[i] + .attr) { + this.$data.refdatastore[j].value = + value[i] + .value; } } } @@ -1466,7 +1574,12 @@ if (action_type == 'open_select_userdlg') { uni.showModal({ title: this.translateSys('error') + " 2.2", - content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�, + content: this.translateSys( + "quotation_mark_left") + + action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed"), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -1502,7 +1615,7 @@ 'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom - button_name: '鏂板', + button_name: this.translateSys('add2'), master: { cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -1567,26 +1680,31 @@ if (success.err_code == 0) { var data = success.result; if (data.ret != 0) { - var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data + var tip = data.err_info ? typeof data.err_info == 'string' ? data + .err_info : + data .err_info.join('<br/>') : ''; if (data.ret == 801) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') }); else uni.showModal({ - title: this.translateSys('tip') , - content: tip + ',鎻愮ず:' + data.ret, + title: this.translateSys('tip'), + content: tip + ',' + this.translateSys('tip') + ':' + data + .ret, showCancel: false, confirmText: this.translateSys('cancel') }); return false } else { - var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( - '<br/>') : ''; + var tip = data.info ? typeof data.info == 'string' ? data.info : data + .info + .join( + '<br/>') : ''; if (tip) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') @@ -1601,14 +1719,19 @@ var result = action.value; for (var i = 0; i < result.length; i++) { if (result[i].choice_list) { - for (var c = 0; c < $this.$data.classAttrList.length; c++) { + for (var c = 0; c < $this.$data.classAttrList + .length; c++) { var attr = $this.$data.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { - if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { + if (utils.classUtils.attrTypeIsDict( + attr[j] + .Type)) { var dictItemList = []; - for (var d in result[i].choice_list) { - var val = result[i].choice_list[d]; + for (var d in result[i] + .choice_list) { + var val = result[i] + .choice_list[d]; dictItemList.push({ "CN_S_NAME": val, "Name": val, @@ -1623,10 +1746,12 @@ } } } - for (var c = 0; c < $this.$data.classAttrList.length; c++) { + for (var c = 0; c < $this.$data.classAttrList + .length; c++) { var attr = $this.$data.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { - console.log(attr[j].Name + '==' + result[i].attr); + console.log(attr[j].Name + '==' + result[i] + .attr); if (attr[j].Name == result[i].attr) { attr[j].Value = result[i].value; } @@ -1640,9 +1765,14 @@ $this.$data.refdatastore.push(result[i]); } if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + for (var j = 0; j < $this.$data.refdatastore + .length; j++) { + if ($this.$data.refdatastore[j].attr == result[ + i] + .attr) { + $this.$data.refdatastore[j].value = result[ + i] + .value; } } } @@ -1674,8 +1804,10 @@ } if (length == 0) { for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; + if ($this.$data.refdatastore[j].attr == result[i] + .attr) { + $this.$data.refdatastore[j].value = result[i] + .value; } } } @@ -1705,7 +1837,7 @@ 'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom - button_name: '鏂板', + button_name: this.translateSys('add2'), master: { cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id @@ -1718,7 +1850,9 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; + if (ar.Value == this.translateSys("select") || ar.Value == '鈥斺�' + this + .translateSys( + "select") + '鈥斺�') ar.Value = ''; req.push(this.formatAttr(ar)); } } @@ -1785,26 +1919,31 @@ if (success.err_code == 0) { var data = success.result; if (data.ret != 0) { - var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data + var tip = data.err_info ? typeof data.err_info == 'string' ? data + .err_info : + data .err_info.join('<br/>') : ''; if (data.ret == 801) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') }); else uni.showModal({ - title: this.translateSys('tip') , - content: tip + ',鎻愮ず:' + data.ret, + title: this.translateSys('tip'), + content: tip + ',' + this.translateSys('tip') + ':' + data + .ret, showCancel: false, confirmText: this.translateSys('cancel') }); return false } else { - var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( - '<br/>') : ''; + var tip = data.info ? typeof data.info == 'string' ? data.info : data + .info + .join( + '<br/>') : ''; if (tip) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') @@ -1854,7 +1993,7 @@ 'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom - button_name: '鏂板', + button_name: this.translateSys('add2'), master: { cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id //obj_id: '' // button=bottom鏃�master鐨刼bj_id @@ -1936,26 +2075,31 @@ if (success.err_code == 0) { var data = success.result; if (data.ret != 0) { - var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data + var tip = data.err_info ? typeof data.err_info == 'string' ? data + .err_info : + data .err_info.join('<br/>') : ''; if (data.ret == 801) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') }); else uni.showModal({ - title: this.translateSys('tip') , - content: tip + ',鎻愮ず:' + data.ret, + title: this.translateSys('tip'), + content: tip + ',' + this.translateSys('tip') + ':' + data + .ret, showCancel: false, confirmText: this.translateSys('cancel') }); return false } else { - var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( - '<br/>') : ''; + var tip = data.info ? typeof data.info == 'string' ? data.info : data + .info + .join( + '<br/>') : ''; if (tip) uni.showModal({ - title: this.translateSys('tip') , + title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('cancel') @@ -1973,8 +2117,14 @@ if (action.action_type == 'open_panel') { var d = dialog({ title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip') , - content: action.action_type + '姝ction灏氭湭澶勭悊锛� + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") }); d.show(); } else if (action.action_type == 'open_select_userdlg') { @@ -1989,13 +2139,16 @@ data_attr: data_attr } uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + JSON.stringify( - param), + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), events: { AddPer(data, param) { // console.log(param); console.log(data); - var callback_eventid = param.button_callback + var callback_eventid = param + .button_callback .trim(); var info = { eventid: callback_eventid, @@ -2004,28 +2157,38 @@ rclsid: '', robjid: '', userlogin: '', - clsid: $this.$data.param.clsid, + clsid: $this.$data.param + .clsid, objid: "", attr: param.req, inputparameter: data, dataJson: [], } - $this.DataObjRunCustomEvent(info, param.data_attr); + $this.DataObjRunCustomEvent(info, + param + .data_attr); } } }); } else if (action.action_type == 'open_data_query_dlg') { var d = dialog({ title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip') , - content: action.action_type + '姝ction灏氭湭澶勭悊锛� + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") }); d.show(); } else if (action.action_type == 'open_common_dlg') { var $this = this; if (val.common_dlg_id == 'check_list') { $this.$data.check_list = val.config; - if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ if (val.config.appear_style == + 'sideslip') //鍒ゆ柇鏄惁鏄晶婊� $this.$data.popupType = 'right'; else $this.$data.popupType = 'center' @@ -2040,7 +2203,8 @@ } $this.$data.popupParam = popupParam; } - } else if (action.action_type == 'open_project_query_dlg') { + } else if (action.action_type == + 'open_project_query_dlg') { //console.log(action.value.select_range); //console.log(action.value.mulit_select); var priRel = '-1'; @@ -2050,7 +2214,8 @@ priRel = '1'; else if (action.value.select_range == '鎴戝垱寤虹殑') priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || action.value + else if (action.value.select_range == '鎴戝弬涓庣殑' || action + .value .select_range == '鎴戝弬鍔犵殑') priRel = '3'; else if (action.value.select_range == '鎴戝叧娉ㄧ殑') @@ -2066,16 +2231,25 @@ req: req } uni.navigateTo({ - url: '../selPrj/index?relation=' + priRel + '¶m=' + + url: '../selPrj/index?relation=' + priRel + + '¶m=' + JSON.stringify(param_), events: { AddPer(data, param) { - $this.$data.classAttrList[param.index].Attr[param - .iindex].Value = data[0].Name; - $this.$data.classAttrList[param.index].Attr[param - .iindex].ValID = data[0].ID + ';' + data[0] + $this.$data.classAttrList[param + .index] + .Attr[param + .iindex].Value = data[0] .Name; - var callback_eventid = param.button_callback + $this.$data.classAttrList[param + .index] + .Attr[param + .iindex].ValID = data[0] + .ID + ';' + + data[0] + .Name; + var callback_eventid = param + .button_callback .trim(); if (callback_eventid) { var info = { @@ -2085,13 +2259,15 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this.$data.param.clsid, + clsid: $this.$data + .param.clsid, objid: "", attr: param.req, dataJson: [], } - $this.DataObjRunCustomEvent(info); + $this.DataObjRunCustomEvent( + info); } } } @@ -2099,8 +2275,14 @@ } else { var d = dialog({ title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip') , - content: action.action_type + '姝ction灏氭湭澶勭悊锛� + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") }); d.show(); } @@ -2109,7 +2291,7 @@ } else { uni.showModal({ title: this.translateSys('tip') + "5.2", - content: '璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' + eventid, + content: this.translate("execute_script_return_empty"), showCancel: false, confirmText: this.translateSys('cancel') }); @@ -2136,7 +2318,7 @@ formatAttr(attr) { if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)') - if (attr.Value == '璇�) ar.Value = ''; + if (attr.Value == this.translateSys('please')) ar.Value = ''; if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰') return { diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue index 29c603a..d460002 100644 --- a/pages/modal/3018_2.vue +++ b/pages/modal/3018_2.vue @@ -1,128 +1,122 @@ <template> <view class="uni-page-modal-3018-2"> <!-- 琛ㄥご鏍峰紡 --> - <view class="v-headStyle" v-for="(item,index) in head_styledef.form.items"> - <!-- 鏅�甯冨眬 --> - <view v-if="item.name!='Layout' && item.show==true"> - <text class="txt_title" :style="{'width':item.labelWidth+'px'}">{{item.label}}锛�/text> - <span class="form-item-span" v-if="item.disabled" - :style="'width: calc(100% - '+item.labelWidth+'px);'">{{item.value}}</span> - <!-- 涓嬫媺妗�鍗曢� item.useDict?item.dict:item.selections--> - <uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled" - :style="'width: calc(100% - '+item.labelWidth-10+'px);'" :class="item.disabled?'input-disabled':''" - v-model="item.value" :localdata="item.dict" @change="onchange(item)" :disabled="item.disabled" - :clear="false"></uni-data-select> - <!-- 涓嬫媺妗�澶氶� --> - <!-- <select-cy v-else-if="attr.select==true" :value="item.value" - :name="item.fieldId" - :options="item.dict" - showClearIcon="true" - @change="onchange2" - :data-index="index" - :disabled="item.disabled" - ></select-cy> --> - <!-- 鏂囨湰妗�鏁板瓧妗�--> - <view class="input-wrapper" v-if="(item.name=='Input' || item.name=='InputNumber') && !item.disabled"> - <text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]" - @change="classAttr_extButton(item)"></text> - <input class="uni-input" :class="item.disabled?'input-disabled':''" - :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="focusFieldId == item.fieldId" @focus="ontap(item)" @click="onClick(item)" - @blur="onevent(item)" /> - <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" - @click="classAttr_extButton(item)"></text> - </view> - <!-- 澶氳鏂囨湰 --> - <view class="input-wrapper" v-if="item.name=='Textarea' && !item.disabled"> - <textarea class="uni-input" :class="item.disabled?'input-disabled':''" :value="item.value" - :focus="focusFieldId == item.fieldId" :placeholder="item.placeholder" @blur="onModelValue(item)" - @click="onClick(item)" :data-index="index" style="height:60px;" :style="{'width':'96%'}" - :disabled="item.disabled"></textarea> - - </view> - <!-- 澶嶉�妗�--> - <checkbox-group class="check_rememberPwd" v-if="item.name=='Checkbox'" - :class="item.disabled?'input-disabled':''" @change="onModelValue(item)" :disabled="item.disabled" - :data-ischeck="item.value"> - <label> - <checkbox :value="item.value" :checked="item.value" /> - <text>{{item.label}}</text> - </label> - </checkbox-group> - <!-- Switch寮�叧 --> - <switch class="input-switch" v-if="item.name=='Switch'" :class="item.disabled?'input-disabled':''" - :disabled="item.disabled" v-model="item.value" @change="onModelValue(item)" /> - <!-- 鏃ユ湡鏃堕棿 --> - <view class="input-wrapper" - v-if="(item.name=='TimePicker' || item.name=='DatePicker') && !item.disabled"> - <picker mode="date" class="date_iput" :class="item.disabled?'input-disabled':''" - :disabled="item.disabled" :value="item.value" @change="onModelValue(item)"> - <view class="picker">{{item.value}}</view> - </picker> - </view> - </view> - <!-- 鏍呮牸甯冨眬 --> - <uni-row class="demo-uni-row" v-if="item.name=='Layout' && item.show==true"> - <uni-col v-for="(cols,key) in item.setting.colList" - :span="item.setting.spanList?item.setting.spanList[key]:24 / item.setting.col"> - <view v-if="cols!=null"> - <text class="txt_title" :style="{'width':cols.labelWidth+'px'}">{{cols.label}}锛�/text> - <span class="form-item-span" v-if="cols.disabled">{{cols.value}}</span> - <view class="input-wrapper" - v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled"> - <text v-if="cols.setting.prefix" class="uni-icon" :class="[cols.setting.prefix]" - @change="onchange(cols)"></text> - <input class="uni-input" :class="cols.disabled?'input-disabled':''" - :type="cols.name=='Input'?'text':cols.name=='InputNumber'?'number':'text'" - 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="focusFieldId == cols.fieldId" @focus="ontap(cols)" @click="onClick(cols)" - @blur="onevent(cols)" /> - <text v-if="cols.setting.suffix" class="uni-icon" :class="[cols.setting.suffix]" - @click="onchange(cols)"></text> - </view> - <!-- 涓嬫媺妗�鍗曢� cols.useDict?cols.dict:cols.selections--> - <uni-data-select id="dv_select" v-if="cols.name=='Select' && !cols.disabled" - :class="cols.disabled?'input-disabled':''" v-model="cols.value" :localdata="cols.dict" - @change="onchange(cols)" :disabled="cols.disabled" :clear="false"></uni-data-select> - <!-- 澶氳鏂囨湰 --> - <view class="input-wrapper" v-if="cols.name=='Textarea' && !cols.disabled"> - <textarea class="uni-input" :value="cols.value" :class="cols.disabled?'input-disabled':''" - :placeholder="cols.placeholder" :focus="focusFieldId == cols.fieldId" - @blur="onModelValue(cols)" @click="onClick(cols)" style="height:60px;" - :style="{'width':'96%'}" :disabled="cols.disabled"></textarea> - </view> - <!-- 澶嶉�妗�--> - <checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'" - :class="cols.disabled?'input-disabled':''" :disabled="item.disabled" - @change="onModelValue(cols)" :data-ischeck="cols.value" :style="{'margin-left':'10rpx'}"> - <label> - <checkbox :value="cols.value" :checked="cols.value" /> - <text>{{cols.label}}</text> - </label> - </checkbox-group> - <!-- Switch寮�叧 --> - <switch v-if="cols.name=='Switch'" :class="cols.disabled?'input-disabled':''" - :disabled="item.disabled" v-model="cols.value" @change="onModelValue(cols)" - :style="{'margin-left':'10rpx'}" /> - <!-- 鏃ユ湡鏃堕棿 --> - <view class="input-wrapper" - v-if="(cols.name=='TimePicker' || cols.name=='DatePicker') && !cols.disabled"> - <picker mode="date" class="date_iput" :class="cols.disabled?'input-disabled':''" - :disabled="item.disabled" :value="cols.value" @change="onModelValue(cols)"> - <view class="picker">{{cols.value}}</view> - </picker> - </view> + <uni-forms ref="baseForm" label-align="right"> + <view class="v-headStyle" v-for="(item,index) in head_styledef.form.items"> + <!-- 鏅�甯冨眬 --> + <uni-forms-item v-if="item.name != 'Layout'&& item.show==true" :label="item.label +'锛� " + :label-width="item.labelWidth+'px'"> + <!-- <text class="txt_title" :style="{'width':item.labelWidth+'px'}">{{item.label}}锛�/text> --> + <span class="form-item-span" v-if="item.disabled" + :style="'width: calc(100% - '+item.labelWidth+'px);'">{{item.value}}</span> + <!-- 涓嬫媺妗�鍗曢� item.useDict?item.dict:item.selections--> + <uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled" + :style="'width: calc(100% - '+item.labelWidth-10+'px);'" + :class="item.disabled?'input-disabled':''" v-model="item.value" :localdata="item.dict" + @change="onchange(item)" :disabled="item.disabled" :clear="false"></uni-data-select> + <!-- 鏂囨湰妗�鏁板瓧妗�--> + <view class="input-wrapper" + v-if="(item.name=='Input' || item.name=='InputNumber') && !item.disabled"> + <text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]" + @change="classAttr_extButton(item)"></text> + <input class="uni-input" :class="item.disabled?'input-disabled':''" + :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="focusFieldId == item.fieldId" @focus="ontap(item)" @click="onClick(item)" + @blur="onevent(item)" /> + <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" + @click="classAttr_extButton(item)"></text> + </view> + <!-- 澶氳鏂囨湰 --> + <view class="input-wrapper" v-if="item.name=='Textarea' && !item.disabled"> + <textarea class="uni-input" :class="item.disabled?'input-disabled':''" :value="item.value" + :focus="focusFieldId == item.fieldId" :placeholder="item.placeholder" + @blur="onModelValue(item)" @click="onClick(item)" :data-index="index" style="height:60px;" + :style="{'width':'96%'}" :disabled="item.disabled"></textarea> </view> - </uni-col> - </uni-row> + <!-- 澶嶉�妗�--> + <checkbox-group class="check_rememberPwd" v-if="item.name=='Checkbox'" + :class="item.disabled?'input-disabled':''" @change="onModelValue(item)" + :disabled="item.disabled" :data-ischeck="item.value"> + <label> + <checkbox :value="item.value" :checked="item.value" /> + <text>{{item.label}}</text> + </label> + </checkbox-group> + <!-- Switch寮�叧 --> + <switch class="input-switch" v-if="item.name=='Switch'" :class="item.disabled?'input-disabled':''" + :disabled="item.disabled" v-model="item.value" @change="onModelValue(item)" /> + <!-- 鏃ユ湡鏃堕棿 --> + <view class="input-wrapper" + v-if="(item.name=='TimePicker' || item.name=='DatePicker') && !item.disabled"> + <picker mode="date" class="date_iput" :class="item.disabled?'input-disabled':''" + :disabled="item.disabled" :value="item.value" @change="onModelValue(item)"> + <view class="picker">{{item.value}}</view> + </picker> + </view> + </uni-forms-item> + <!-- 鏍呮牸甯冨眬 --> + <uni-row class="demo-uni-row" v-if="item.name=='Layout' && item.show==true"> + <uni-col v-for="(cols,key) in item.setting.colList" + :span="item.setting.spanList?item.setting.spanList[key]:24 / item.setting.col"> + <uni-forms-item v-if="cols!=null" :label="col.label +'锛�" :label-width="col.labelWidth+'px'"> + <!-- <text class="txt_title" :style="{'width':cols.labelWidth+'px'}">{{cols.label}}锛�/text> --> + <span class="form-item-span" v-if="cols.disabled">{{cols.value}}</span> + <view class="input-wrapper" + v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled"> + <text v-if="cols.setting.prefix" class="uni-icon" :class="[cols.setting.prefix]" + @change="onchange(cols)"></text> + <input class="uni-input" :class="cols.disabled?'input-disabled':''" + :type="cols.name=='Input'?'text':cols.name=='InputNumber'?'number':'text'" + 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="focusFieldId == cols.fieldId" @focus="ontap(cols)" @click="onClick(cols)" + @blur="onevent(cols)" /> + <text v-if="cols.setting.suffix" class="uni-icon" :class="[cols.setting.suffix]" + @click="onchange(cols)"></text> + </view> + <!-- 涓嬫媺妗�鍗曢� cols.useDict?cols.dict:cols.selections--> + <uni-data-select id="dv_select" v-if="cols.name=='Select' && !cols.disabled" + :class="cols.disabled?'input-disabled':''" v-model="cols.value" :localdata="cols.dict" + @change="onchange(cols)" :disabled="cols.disabled" :clear="false"></uni-data-select> + <!-- 澶氳鏂囨湰 --> + <view class="input-wrapper" v-if="cols.name=='Textarea' && !cols.disabled"> + <textarea class="uni-input" :value="cols.value" + :class="cols.disabled?'input-disabled':''" :placeholder="cols.placeholder" + :focus="focusFieldId == cols.fieldId" @blur="onModelValue(cols)" + @click="onClick(cols)" style="height:60px;" :style="{'width':'96%'}" + :disabled="cols.disabled"></textarea> + </view> + <!-- 澶嶉�妗�--> + <checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'" + :class="cols.disabled?'input-disabled':''" :disabled="item.disabled" + @change="onModelValue(cols)" :data-ischeck="cols.value" + :style="{'margin-left':'10rpx'}"> + <label> + <checkbox :value="cols.value" :checked="cols.value" /> + <text>{{cols.label}}</text> + </label> + </checkbox-group> + <!-- Switch寮�叧 --> + <switch v-if="cols.name=='Switch'" :class="cols.disabled?'input-disabled':''" + :disabled="item.disabled" v-model="cols.value" @change="onModelValue(cols)" + :style="{'margin-left':'10rpx'}" /> + <!-- 鏃ユ湡鏃堕棿 --> + <view class="input-wrapper" + v-if="(cols.name=='TimePicker' || cols.name=='DatePicker') && !cols.disabled"> + <picker mode="date" class="date_iput" :class="cols.disabled?'input-disabled':''" + :disabled="item.disabled" :value="cols.value" @change="onModelValue(cols)"> + <view class="picker">{{cols.value}}</view> + </picker> + </view> - - </view> - + </uni-forms-item> + </uni-col> + </uni-row> + </view> + </uni-forms> <view class="view-floor"> <button type="default" @tap="sava" class="btn_add">{{title}}</button> <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> @@ -194,36 +188,47 @@ }; }, onNavigationBarButtonTap(e) { + if (e.index == 0) { + const $this = this + uni.scanCode({ + scanType: ["qrCode"], + success: function(res) { - const $this = this - uni.scanCode({ - scanType: ["qrCode"], - success: function(res) { - if ($this.focusFieldId) { - const items = $this.head_styledef.form.items || [] - for (let i in items) { - const ele = items[i] - if (ele.name == 'Input' || ele.name == 'InputNumber' || ele.name == 'Textarea') { - if ($this.focusFieldId == ele.fieldId) { - $this.onScanValue(ele, res.result) - break; - } - } else if (ele.name == "Layot") { - let curIndex = (ele.setting.colList || []).findIndex((col, index2, arr) => { - return (col.name == 'Input' || col.name == 'InputNumber' || col - .name == 'Textarea') && $this - .focusFieldId == col.fieldId; - }) - if (curIndex > -1) { - let col = ele.setting.colList[curIndex] - $this.onScanValue(col, res.result) - break + if ($this.focusFieldId) { + const items = $this.head_styledef.form.items || [] + for (let i in items) { + const ele = items[i] + if (ele.name == 'Input' || ele.name == 'InputNumber' || ele.name == + 'Textarea') { + if ($this.focusFieldId == ele.fieldId) { + $this.onScanValue(ele, res.result) + break; + } + } else if (ele.name == "Layot") { + let curIndex = (ele.setting.colList || []).findIndex((col, index2, + arr) => { + return (col.name == 'Input' || col.name == 'InputNumber' || col + .name == 'Textarea') && $this + .focusFieldId == col.fieldId; + }) + if (curIndex > -1) { + let col = ele.setting.colList[curIndex] + $this.onScanValue(col, res.result) + break + } } } } + } - } - }) + }) + } else if (e.index == 1) { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/3018_2?param=' + JSON.stringify(this.$data.param) + + "&titlename=" + this.$data.title + }); + } }, onLoad(options) { // console.log(options); @@ -233,12 +238,7 @@ this.$data.param = JSON.parse(options.param); this.$data.title = this.$data.param.Add_BtnName ? this.$data.param.Add_BtnName : options .titlename; //璁剧疆鎸夐挳鏂囧瓧 - - console.log(this.$data.param); - //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.UI_Style?.ID); - //椤甸潰鍒濆鍖栬幏鍙栫劍鐐�- // this.focusMateria=true; + this.loadData(options.paramValue) }, methods: { @@ -262,6 +262,38 @@ data = data[key2]; }); }); + }, + async loadData(paramValue) { + + //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.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; + } + }); + } + }); + } + }) + } + + console.log(this.$data.param); + }, async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� var $this = this; @@ -414,8 +446,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, @@ -1024,8 +1055,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, @@ -1350,7 +1380,7 @@ var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data .err_info.join('<br/>') : ''; - if (data.ret == 801){ + if (data.ret == 801) { if (this.param.Only_Script_Error) { let pos = tip.indexOf("锛�); if (pos > -1) tip = tip.substring(pos + 1); @@ -1361,8 +1391,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, @@ -1653,9 +1682,8 @@ uni.showModal({ title: this.translateSys("tip"), content: this.translate('execute_script_failed') + this - .translateSys('comma') + this.translate('result') + - this - .translateSys('colon') + action.info, + .translateSys('comma') + + this.translateSys('colon') + action.info, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -1677,7 +1705,7 @@ icon: "success", duration: 3000 }); - if ( !this.$data.param.After_Btn_Not_Refresh) { + if (!this.$data.param.After_Btn_Not_Refresh) { //鍒锋柊 uni.redirectTo({ url: '../modal/3018_2?param=' + JSON.stringify(this.$data.param) + @@ -1823,10 +1851,17 @@ </style> <style lang="scss"> .uni-page-modal-3018-2 { + display: flex; + height: calc(100vh - 30rpx); + width: 720rpx; + flex-direction: column !important; + padding: 15rpx; + .v-headStyle { /* border: 0.1rpx solid red; */ /* line-height: 30rpx; */ - padding: 5rpx 0; + // padding: 5rpx 0; + width: 98%; } .v-headStyle:first-child { @@ -1878,7 +1913,7 @@ .input-wrapper { border: 1px solid #d5d5d5; display: inline-block; - width: 65%; + width: 100%; line-height: 22rpx; vertical-align: middle; } diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index ed1de33..242c987 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -288,15 +288,64 @@ }); //璁剧疆椤堕儴鏍囬 this.$data.title = options.titlename; this.$data.param = JSON.parse(options.param); - console.log(this.$data.param); - //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID); - this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID); + this.loadData(options.paramValue) //椤甸潰鍒濆鍖栬幏鍙栫劍鐐� // this.focusMateria=true; }, methods: { + setData: function(obj) { + let that = this; + let keys = []; + let val, data; + + Object.keys(obj).forEach(function(key) { + keys = key.split("."); + val = obj[key]; + data = that.$data; + keys.forEach(function(key2, index) { + if (index + 1 == keys.length) { + that.$set(data, key2, val); + } else { + if (!data[key2]) { + that.$set(data, key2, {}); + } + } + data = data[key2]; + }); + }); + }, + async loadData(paramValue) { + console.log(this.$data.param); + //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.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; + } + }); + } + }); + } + }) + } + + await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID); + }, async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� var $this = this; var dataInfo = { @@ -491,8 +540,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, @@ -1217,8 +1265,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, @@ -1511,10 +1558,10 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), - content: tip + this.translateSys('comma') + this.translate('result') +this.translateSys('colon') + data.ret, + content: tip + this.translateSys('comma') + this.translate('result') + this + .translateSys('colon') + data.ret, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -1546,7 +1593,7 @@ for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { if (utils.classUtils.attrTypeIsDict(attr[j] - .Type)) { + .Type)) { var dictItemList = []; for (var d in result[i].choice_list) { var val = result[i].choice_list[d]; @@ -1861,7 +1908,7 @@ if (data.ret != 0) { var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data .err_info.join('<br/>') : ''; - if (data.ret == 801){ + if (data.ret == 801) { if (this.param.Only_Script_Error) { let pos = tip.indexOf("锛�); if (pos > -1) tip = tip.substring(pos + 1); @@ -1872,8 +1919,7 @@ showCancel: false, confirmText: this.translateSys("cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys("tip"), content: tip + ',' + this.translateSys('tip') + ':' + data.ret, showCancel: false, diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue index a8f7bac..2a21fda 100644 --- a/pages/modal/3200.vue +++ b/pages/modal/3200.vue @@ -273,7 +273,7 @@ }); //璁剧疆椤堕儴鏍囬 this.$data.title = options.titlename; this.$data.param = JSON.parse(options.param); - this.initial(); + this.initial( options.paramValue); // this.isFilter=true; // if(this.param.ShowFilter) // this.isFilter=false; @@ -303,8 +303,31 @@ // this.focusMateria=true; }, methods: { + // + setData: function(obj) { + let that = this; + let keys = []; + let val, data; + + Object.keys(obj).forEach(function(key) { + keys = key.split("."); + val = obj[key]; + data = that.$data; + keys.forEach(function(key2, index) { + if (index + 1 == keys.length) { + that.$set(data, key2, val); + } else { + if (!data[key2]) { + that.$set(data, key2, {}); + } + } + data = data[key2]; + }); + }); + }, + //鍒濆鍖�- async initial() { + async initial(paramValue) { this.styledef = {}; this.head_styledef = { form: { @@ -332,7 +355,31 @@ this.isFilter = false; //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁� if (this.param.Query_Panel) { - this.Head_UIStyleGetInfo(this.param.DataCls.id, this.param.Query_Panel.id); + await this.Head_UIStyleGetInfo(this.param.DataCls.id, this.param.Query_Panel.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.param.ListPage.ListItem_UIDef?.ui_type == "HTML椤甸潰") { // HTML椤甸潰 @@ -351,6 +398,7 @@ this.query_id = ""; await this.loadDataGetList(); } + }, //婊氬姩鍒板簳閮ㄥ悗鎳掑姞杞芥暟鎹� async scrolltolower(e) { @@ -1053,7 +1101,114 @@ }, //鎵ц浜嬩欢 - TriggerEvent(btn, style, enviroment) {}, + async TriggerEvent(btn, style, enviroment) { //鎵ц瑙﹀彂浜嬩欢 + try { + let obj_attr = { + S_ID: this.styledef.form.objId + }; + style.form.attrs.forEach((attr) => { + obj_attr[attr.name] = attr.value; + }); + + if (!this.ListPageHtml_Show.event.id) { + //鍒ゆ柇娌℃湁HTML椤甸潰浜嬩欢 + // console.log(this.detail2_styledef); + this.detail2_styledef.form.items.forEach(async (ele, index) => { + if (ele.name != "Layout") { + if (!obj_attr[ele.fieldId]) { + obj_attr[ele.fieldId] = ele.value; + } + } else if (ele.name == "Layout") { + ele.setting.colList.forEach(async (col, key) => { + if (col) { + if (!obj_attr[col.fieldId]) { + obj_attr[col.fieldId] = col.value; + } + } + }); + } + }); + } + + const dataInfo = { + ed_type: 0, + start_transaction: true, + class_id: btn.clsId, + event_id: btn.event.id, + data_obj_id: this.styledef.form.objId, + obj_attr: obj_attr, + } + this.$store.dispatch('runCustomEvent', dataInfo).then(ret => { + // console.log(ret); + if (ret.err_code == 0) { + var result = ret.result; + 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 (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, + showCancel: false, + confirmText: this.translateSys("cancel") + }); + return false; + } else { + var tip = result.info ? typeof result.info == 'string' ? result + .info : + result.info.join('<br/>') : ''; + if (tip) uni.showModal({ + title: this.translateSys("tip"), + content: tip, + showCancel: false, + confirmText: this.translateSys("cancel") + }); + + } + } else { + uni.showModal({ + title: this.translateSys("error") + "8", + content: ret.err_msg, + showCancel: false, + confirmText: this.translateSys("cancel") + }); + } + + }).catch(ex => { + // console.log(ex); + uni.showModal({ + title: this.translateSys("error") + "8.1", + content: ex.errMsg, + showCancel: false, + confirmText: this.translateSys("cancel") + }); + }); + } catch (ex) { + var tip = typeof ex == "string" ? ex : ex.message; + uni.showModal({ + title: this.translateSys("error"), + content: tip, + showCancel: false, + confirmText: this.translateSys("cancel") + }); + this.showError(ex); + } + }, //璺宠浆 async RelatedFunction(btn, style, enviroment) { @@ -1102,7 +1257,7 @@ uni.navigateTo({ url: '../modal/' + name + '?param=' + param + "&titlename=" + appName + - "&type=relatedFunction&attrValue=" + JSON.stringify(style + "&type=relatedFunction¶mValue=" + JSON.stringify(style .form), events: { relatedFunction: function(data) { 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, diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue index 1bfc358..d44ca5b 100644 --- a/pages/modal/5601.vue +++ b/pages/modal/5601.vue @@ -1,7 +1,6 @@ <template> <view class="uni-page-modal-5601"> <!-- 琛ㄥご鏍峰紡 --> - <uni-forms ref="baseForm" label-align="right"> <view v-for="(item,index) in head_styledef.form.items" :key="index" class="v-head-style"> <!-- 鏅�甯冨眬 --> @@ -17,8 +16,7 @@ :style="{'padding-left':item.setting.prefix?0 : '8rpx','right':item.setting.suffix?0 : '8rpx'}" :type="item.name=='Input'?'text':'number'" v-model="item.value" :disabled="item.disabled" :placeholder="item.placeholder" :focus="focusFieldId == item.fieldId" @focus="ontap(item)" - @click="onClick(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> @@ -39,9 +37,8 @@ :style="{'padding-left':col.setting.prefix?0 : '8px','right':col.setting.suffix?0 : '8px'}" :type="col.name=='Input'?'text':'number'" v-model="col.value" :disabled="col.disabled" :placeholder="col.placeholder" - :focus="focusFieldId == col.fieldId" @focus="ontap(col)" - @click="onClick(col)" @keyup.enter="onEnterChange(col)" - @blur="onEnterChange(col)" /> + :focus="focusFieldId == col.fieldId" @focus="ontap(col)" @click="onClick(col)" + @keyup.enter="onEnterChange(col)" @blur="onEnterChange(col)" /> <text v-if="col.setting.suffix" class="uni-icon" :class="[col.setting.suffix]" @click="onEnterChange(col)"></text> </view> @@ -188,10 +185,12 @@ }); //璁剧疆椤堕儴鏍囬 this.title = options.titlename; this.param = JSON.parse(options.param); + + //鑾峰彇涓绘暟鎹被ID this.ClsID = this.param.master_cls?.id; if (this.ClsID) { - this.loadData() + this.loadData(options.paramValue) } else { uni.showModal({ title: this.translateSys("error"), @@ -224,10 +223,34 @@ }); }); }, - async loadData() { + async loadData(paramValue) { //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁� await this.Head_UIStyleGetInfo(this.ClsID, this.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, '+'); @@ -248,6 +271,7 @@ this.setData({ pageDetail: pageList }) + console.log(this.pageDetail); }, changeSwiper(evt) { @@ -283,7 +307,8 @@ //mobox2鐨剆tyle_def鏄痡son瀛楃涓� styledef = ret.result.style_def.replace(/\\/g, ""); //mobox3鐨剆tyle_def鏄痓ase64瀛楃涓�- if (!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result + if (!ret.result.style_def.includes('"')) styledef = Base64.decode( + ret.result .style_def); } const styledefHead = styledef ? JSON.parse(styledef) : {}; @@ -292,11 +317,13 @@ if (ele.name != "Layout") { if (ele?.useDict) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 - await this.DictGetInfo(ele.bind.dict, styledefHead.form.model, + await this.DictGetInfo(ele.bind.dict, + styledefHead.form.model, ele); } if ($this.focusFieldId == "") { - if (ele.name == 'Input' || ele.name == 'InputNumber') { + if (ele.name == 'Input' || ele.name == + 'InputNumber') { $this.setData({ focusFieldId: ele.fieldId }) @@ -306,14 +333,18 @@ ele.setting.colList.forEach(async (col) => { if (col?.useDict) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 - await this.DictGetInfo(col.bind.dict, - styledefHead.form.model, col); + await this.DictGetInfo(col.bind + .dict, + styledefHead.form + .model, col); } if ($this.focusFieldId == "") { - if (col.name == 'Input' || col.name == + if (col.name == 'Input' || col + .name == 'InputNumber') { $this.setData({ - focusFieldId: col.fieldId + focusFieldId: col + .fieldId }) } } @@ -356,24 +387,29 @@ //mobox2鐨剆tyle_def鏄痡son瀛楃涓� styledef = ret.result.style_def.replace(/\\/g, ""); //mobox3鐨剆tyle_def鏄痓ase64瀛楃涓�- if (!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result - .style_def); + if (!ret.result.style_def.includes('"')) styledef = Base64 + .decode(ret.result + .style_def); } - const detailstyledef = ret.result.style_def ? JSON.parse(styledef) : {}; + const detailstyledef = ret.result.style_def ? JSON.parse( + styledef) : {}; detailstyledef.SelBut_Checked = true; detailstyledef.form.items.forEach(async (ele, index) => { if (ele.name != "Layout") { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 - await this.DictGetInfo(ele.bind.dict, detailstyledef.form + await this.DictGetInfo(ele.bind.dict, + detailstyledef.form .model, ele); } } else { ele.setting.colList.forEach(async (col) => { if (col?.useDict == true) { - await this.DictGetInfo(col.bind.dict, - detailstyledef.form.model, col); + await this.DictGetInfo(col + .bind.dict, + detailstyledef.form + .model, col); } }) } @@ -462,8 +498,10 @@ var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�- var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠�- var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+ var onSuffixClickCallbackEvent = item.bind + .onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠�+ var onSuffixClickEvent = item.bind + .onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋� var isflag = false; if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�@@ -476,7 +514,8 @@ const ele = $this.head_styledef.form.items[i] if (ele.name != "Layout") { - if (ele.name == 'Input' || ele.name == 'InputNumber') { + if (ele.name == 'Input' || ele.name == + 'InputNumber') { if (attr == ele.fieldId) { findd = true } else { @@ -492,32 +531,39 @@ } } else { if (findd) { - let curIndex = ele.setting.colList.findIndex((col, index2, arr) => { - return (col.name == 'Input' || col.name == 'InputNumber'); + 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] + focusFieldId: ele.setting + .colList[curIndex] .fieldId }) break } } else { - let curIndex = ele.setting.colList.findIndex((col, index2, arr) => { + 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; - }) + 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] + focusFieldId: ele.setting + .colList[curIndex] .fieldId }) break @@ -540,7 +586,8 @@ var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�- var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠�+ var onSuffixClickCallbackEvent = item.bind + .onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠� var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋� var isflag = false; @@ -557,7 +604,8 @@ style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) detail_attr[cols.fieldId] = cols.value; + if (cols != null) detail_attr[cols + .fieldId] = cols.value; }); } else detail_attr[item.fieldId] = item.value; @@ -575,11 +623,14 @@ pageData.DefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { - if (style.form.objId == detailAttrList[key]['id']) { + if (style.form.objId == detailAttrList[key][ + 'id' + ]) { var keys = Object.keys(detailAttrList[key]); var isflag = true; keys.forEach((ele) => { - if (ele == attr.attr) isflag = false; + if (ele == attr.attr) isflag = + false; }); if (isflag) { detailAttrList[attr.attr] = attr.value; @@ -612,7 +663,8 @@ this.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) head_attr[cols.fieldId] = cols.value; + if (cols != null) head_attr[cols + .fieldId] = cols.value; }); } else head_attr[item.fieldId] = item.value; @@ -632,7 +684,8 @@ this.pageDetail.forEach((page) => { jsonList.push({ page_name: page.Name, - item_list: $this.getDetailAttrList(page.DefList, page + item_list: $this.getDetailAttrList(page + .DefList, page .Select_Button), ext_data: page.ExtData || {} }) @@ -664,236 +717,363 @@ if (ret.err_code == 0) { var result = ret.result; 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 (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({ + 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({ title: this.translateSys('tip'), - content: tip + ',' + this.translateSys('tip') + ':' + result + content: tip + ',' + this + .translateSys('tip') + ':' + + result .ret, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); return false; } else { - var tip = result.info ? typeof result.info == 'string' ? result.info : + var tip = result.info ? typeof result.info == + 'string' ? result.info : result.info.join('<br/>') : ''; if (tip) uni.showModal({ title: this.translateSys('tip'), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); if (result.result_type == 0 && result.action) { result.action.forEach(item => { - if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�- $this.$data.param.Show_Welcom_Page = false; + if (item.action_type == + "insert_subtable_page_row" + ) { //鐮佺洏涓�+ $this.$data.param + .Show_Welcom_Page = + false; var value = item.value; $this.viewAceionRow(value); } else if (item.action_type == - "set_subtable_page_content") { //宸茬爜鐩�- $this.$data.param.Show_Welcom_Page = false; + "set_subtable_page_content" + ) { //宸茬爜鐩�+ $this.$data.param + .Show_Welcom_Page = + false; var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); - if (value.clear_confirm != false && value.clear == + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page.Name; + }); + if (value.clear_confirm != + false && value.clear == true && - pageData && pageData.DefList.length > 0 + pageData && pageData + .DefList.length > 0 ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹� uni.showModal({ - title: this.translateSys('tip'), - content: this.translate( - "are_you_sure_clear_first") + - this.translateSys( - "quotation_mark_left") + value - .page_name + this.translateSys( - "sys.quotation_mark_right") + - this.translate( - "are_you_sure_clear_last"), - success: function(res) { - if (res.confirm) { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent( - value); - } else if (res.cancel) { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent( - value); + title: this + .translateSys( + 'tip' + ), + content: this + .translate( + "are_you_sure_clear_first" + ) + + this + .translateSys( + "quotation_mark_left" + ) + + value + .page_name + + this + .translateSys( + "sys.quotation_mark_right" + ) + + this + .translate( + "are_you_sure_clear_last" + ), + success: function( + res + ) { + if (res + .confirm + ) { + if ( + pageData) + pageData + .DefList = []; + $this + .viewAceionContent( + value + ); + } else if ( + res + .cancel + ) { + if ( + pageData) + pageData + .DefList = []; + $this + .viewAceionContent( + value + ); } } }); } else { if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); + pageData + .DefList = []; + $this + .viewAceionContent( + value); } } else if (item.action_type == - "select_subtable_page_row") { + "select_subtable_page_row" + ) { // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}} var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); - if (pageData?.DefList) { - pageData.DefList.forEach(ele => { - $this.activelist[index].active = false; - if (ele.form.objId == value.row.id) { - ele.SelBut_Checked = true; - $this.active_id = ele.form - .htmlobjId; - //鑷姩婊氬姩鍒版寚瀹氬厓绱�- uni.createSelectorQuery() - .select("#tabpanel" + value - .page_name) //瀵瑰簲澶栧眰鑺傜偣 - .boundingClientRect(( - container) => { - uni.createSelectorQuery() - .select( - "#dvpanel" + - ele.form - .htmlobjId - ) //鐩爣鑺傜偣 - .boundingClientRect( - ( - target - ) => { - uni.pageScrollTo({ - scrollTop: target - .top - - container - .top, //婊氬姩鍒板疄闄呰窛绂绘槸鍏冪礌璺濈椤堕儴鐨勮窛绂诲噺鍘绘渶澶栧眰鐩掑瓙鐨勬粴鍔ㄨ窛绂�- }); - }) - .exec(); - }) - .exec(); - } + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page.Name; }); + if (pageData?.DefList) { + pageData.DefList + .forEach(ele => { + $this + .activelist[ + index + ] + .active = + false; + if (ele + .form + .objId == + value + .row.id + ) { + ele.SelBut_Checked = + true; + $this + .active_id = + ele + .form + .htmlobjId; + //鑷姩婊氬姩鍒版寚瀹氬厓绱�+ uni.createSelectorQuery() + .select( + "#tabpanel" + + value + .page_name + ) //瀵瑰簲澶栧眰鑺傜偣 + .boundingClientRect( + ( + container + ) => { + uni.createSelectorQuery() + .select( + "#dvpanel" + + ele + .form + .htmlobjId + ) //鐩爣鑺傜偣 + .boundingClientRect( + ( + target + ) => { + uni.pageScrollTo({ + scrollTop: target + .top - + container + .top, //婊氬姩鍒板疄闄呰窛绂绘槸鍏冪礌璺濈椤堕儴鐨勮窛绂诲噺鍘绘渶澶栧眰鐩掑瓙鐨勬粴鍔ㄨ窛绂�+ }); + } + ) + .exec(); + } + ) + .exec(); + } + }); } } else if (item.action_type == - "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�+ "remove_subtable_page_row" + ) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page.Name; + }); if (pageData ?.DefList ) //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞//娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� { - value.row.forEach(row => { - pageData - .DefList - .forEach((ele, index) => { - if (ele.form.objId == row - .id) { - pageData - .DefList - .splice(index, 1); - } - }); - }); + value.row.forEach( + row => { + pageData + .DefList + .forEach( + (ele, + index + ) => { + if (ele + .form + .objId == + row + .id + ) { + pageData + .DefList + .splice( + index, + 1 + ); + } + }); + }); } - } else if (item.action_type == "set_subtable_page_row") { - $this.viewActionSetRow(item.value) + } else if (item.action_type == + "set_subtable_page_row") { + $this.viewActionSetRow(item + .value) } else if (item.action_type == - "set_subtable_page_ext_data") { + "set_subtable_page_ext_data" + ) { var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page.Name; + }); if (pageData) - pageData.ExtData = value.ext_data + pageData.ExtData = + value.ext_data - } else if (item.action_type == "clear_subpage_rows") { + } else if (item.action_type == + "clear_subpage_rows") { var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page.Name; + }); if (pageData) { pageData.DefList = [] pageData.ExtData = {} } } else if (item.action_type == - "set_dlg_current_edit_attr") { + "set_dlg_current_edit_attr" + ) { - if ($this.focusOldFieldId == item.value) { + if ($this + .focusOldFieldId == + item.value) { $this.setData({ focusFieldId: "" }) } else { $this.setData({ - focusFieldId: $this.focusOldFieldId + focusFieldId: $this + .focusOldFieldId }) } $this.$nextTick(() => { $this.setData({ - focusFieldId: item.value + focusFieldId: item + .value }) }); - } else if (item.action_type == "set_dlg_attr") { + } else if (item.action_type == + "set_dlg_attr") { // value = {"attr":"xxx", "value":"xxx"} var data = item.value; - $this.$data.head_styledef.form.items.forEach(async ( - ele, index) => { - if (ele.name != "Layout") { - data.forEach( - async (ele2, - index - ) => { - if (ele - .fieldId == - ele2 - .attr - ) { - ele.value = - ele2 - .value; - } - }); - } else { - ele.setting.colList.forEach(async ( - col) => { - if (col) { + $this.$data.head_styledef + .form.items.forEach( + async ( + ele, index + ) => { + if (ele + .name != + "Layout" + ) { data.forEach( async (ele2, index ) => { - if (col + if (ele .fieldId == ele2 .attr ) { - col.value = + ele.value = ele2 .value; } }); + } else { + ele.setting + .colList + .forEach( + async ( + col + ) => { + if ( + col) { + data.forEach( + async (ele2, + index + ) => { + if (col + .fieldId == + ele2 + .attr + ) { + col.value = + ele2 + .value; + } + }); + } + + }) } - }) - } - }) } }); @@ -901,10 +1081,12 @@ if (result.info) { uni.showModal({ - title: this.translateSys("error") + "4.3", + title: this.translateSys( + "error") + "4.3", content: result.info, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this + .translateSys("cancel") }); } } @@ -912,10 +1094,12 @@ } } else { uni.showModal({ - title: this.translateSys("error") + "4", + title: this.translateSys("error") + + "4", content: ret.err_msg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); } }).catch(ex => { @@ -932,9 +1116,12 @@ var tip = typeof ex == "string" ? ex : ex.message; uni.showModal({ title: this.translateSys("error") + "4.2", - content: this.translate('execute_after_change_event_failed') + this.translateSys( + content: this.translate( + 'execute_after_change_event_failed') + this + .translateSys( "comma") + - this.translate('reason') + this.translateSys("colon") + tip, + this.translate('reason') + this.translateSys("colon") + + tip, showCancel: false, confirmText: this.translateSys("cancel") }); @@ -975,38 +1162,48 @@ if (ele.form.objId == rowData.id) { rowData.attrs.forEach(attr => { ele.form.items.forEach(ele2 => { - if (ele2.name != 'Layout') { - if (ele2.fieldId == attr + if (ele2.name != + 'Layout') { + if (ele2.fieldId == + attr .attr) { - ele2.value = $this + ele2.value = + $this .operationNumber( - ele2.value, - attr.value, - attr.operation) + ele2 + .value, + attr + .value, + attr + .operation + ) } } else if (ele2.name == 'Layout') { - ele2.setting.colList - .forEach(col => { - if (col) { - if (col - .fieldId == - attr - .attr - ) { - col.value = - $this - .operationNumber( - col - .value, - attr - .value, - attr - .operation - ) + ele2.setting + .colList + .forEach( + col => { + if ( + col) { + if (col + .fieldId == + attr + .attr + ) { + col.value = + $this + .operationNumber( + col + .value, + attr + .value, + attr + .operation + ) + } } - } - }) + }) } }); }); @@ -1032,23 +1229,28 @@ var detailStyle = JSON.parse(styleStr); detailStyle.form.objId = row.id; - detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '').replace( - '{', '').replace('}', - '') : 'null'; + detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '') + .replace( + '{', '').replace('}', + '') : 'null'; detailStyle.form.attrs = row.attrs; row.attrs.forEach(attr => { detailStyle.form.items.forEach(ele => { if (ele.name != 'Layout') { - if (ele.fieldId == attr.attr) ele.value = + if (ele.fieldId == attr.attr) ele + .value = attr.value; } else if (ele.name == 'Layout') { - ele.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == attr - .attr) col.value = attr - .value; - } - }); + ele.setting.colList.forEach( + col => { + if (col) { + if (col.fieldId == + attr + .attr) col + .value = attr + .value; + } + }); } }); }); @@ -1077,23 +1279,28 @@ var detailStyle = JSON.parse(styleStr); detailStyle.SelBut_Checked = data.checkbox ?? true; detailStyle.form.objId = cont.id; - detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g, '') + detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g, + '') .replace('{', '').replace('}', '') : 'null'; detailStyle.form.attrs = cont.attrs; cont.attrs.forEach(attr => { detailStyle.form.items.forEach(ele => { if (ele.name != 'Layout') { - if (ele.fieldId == attr.attr) ele.value = + if (ele.fieldId == attr.attr) ele + .value = attr.value; } else if (ele.name == 'Layout') { - ele.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == attr - .attr) col.value = attr - .value; - } - }); + ele.setting.colList.forEach( + col => { + if (col) { + if (col.fieldId == + attr + .attr) col + .value = attr + .value; + } + }); } }); }); @@ -1101,35 +1308,42 @@ if (data.clear == false) { var isflag = true; pageData.DefList.forEach((style, index) => { - if (style.form.objId == detailStyle.form.objId) { + if (style.form.objId == detailStyle.form + .objId) { cont.attrs.forEach(attr => { - style.form.items.forEach(ele => { - if (ele.name != - 'Layout') { - if (ele.fieldId == - attr.attr) ele - .value = - attr.value; - } else if (ele.name == - 'Layout') { - ele.setting.colList - .forEach( - col => { - if ( - col) { - if (col - .fieldId == - attr - .attr - ) + style.form.items.forEach( + ele => { + if (ele.name != + 'Layout') { + if (ele + .fieldId == + attr.attr) + ele + .value = + attr.value; + } else if (ele + .name == + 'Layout') { + ele.setting + .colList + .forEach( + col => { + if ( col - .value = - attr - .value; - } - }); - } - }); + ) { + if (col + .fieldId == + attr + .attr + ) + col + .value = + attr + .value; + } + }); + } + }); }); isflag = false; } @@ -1173,7 +1387,8 @@ this.$data.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) head_attr[cols.fieldId] = cols.value; + if (cols != null) head_attr[cols.fieldId] = + cols.value; }); } else head_attr[item.fieldId] = item.value; @@ -1185,7 +1400,8 @@ style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) detail_attr[cols.fieldId] = cols + if (cols != null) detail_attr[cols + .fieldId] = cols .value; }); } else @@ -1282,7 +1498,8 @@ content: this.translate( "page.tip_no_data_first") + this.translateSys( - "quotation_mark_left") + pageData.Name + this.translateSys( + "quotation_mark_left") + pageData.Name + this + .translateSys( "sys.quotation_mark_right") + this.translate( "page.tip_no_data_last"), @@ -1296,7 +1513,8 @@ this.$data.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) head_attr[cols.fieldId] = cols.value; + if (cols != null) head_attr[cols.fieldId] = + cols.value; }); } else head_attr[item.fieldId] = item.value; @@ -1309,7 +1527,8 @@ style.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item.setting.colList.forEach(cols => { - if (cols != null) detail_attr[cols + if (cols != null) detail_attr[ + cols .fieldId] = cols.value; }); } else @@ -1329,18 +1548,21 @@ pageData.DefList.forEach(style => { style.form.attrs.forEach(attr => { for (var key in detailAttrList) { - if (style.form.objId == detailAttrList[key][ + if (style.form.objId == detailAttrList[key] + [ 'id' ]) { var keys = Object.keys(detailAttrList[ key]); var isflag = true; keys.forEach((ele) => { - if (ele == attr.attr) isflag = + if (ele == attr.attr) + isflag = false; }); if (isflag) { - detailAttrList[attr.attr] = attr.value; + detailAttrList[attr.attr] = attr + .value; } } } @@ -1425,20 +1647,25 @@ if (result.ret == 801) { if (this.param.Only_Script_Error) { let pos = tip.indexOf("锛�); - if (pos > -1) tip = tip.substring(pos + 1); + if (pos > -1) tip = tip.substring(pos + + 1); } uni.showModal({ - title: this.translateSys("tip"), + title: this.translateSys( + "tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); - } - else uni.showModal({ + } else uni.showModal({ title: this.translateSys('tip'), - content: tip + ',' + this.translateSys('tip') + ':' + result.ret, + content: tip + ',' + this + .translateSys('tip') + ':' + + result.ret, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); return false; } else { @@ -1449,7 +1676,8 @@ title: this.translateSys('tip'), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); if (result.result_type == 0) { if (result.action) { @@ -1461,10 +1689,13 @@ ) { //鐮佺洏涓� var value = item.value; //鍔犺浇宸茬粡鐮佺洏鏁版嵁 - $this.viewAceionRow(value, ); + $this.viewAceionRow( + value, ); //娓呯┖鏉$爜鍐呭 - $this.$data.head_styledef - .form.items.forEach(( + $this.$data + .head_styledef + .form.items + .forEach(( item, index) => { if (item @@ -1475,7 +1706,8 @@ ''; item.oldvalue = ''; - $this.$data + $this + .$data .head_styledef .form .model[ @@ -1487,26 +1719,41 @@ }); uni.showModal({ - title: this.translateSys("tip"), - content: this.translate( - 'execute_event_success'), + title: this + .translateSys( + "tip" + ), + content: this + .translate( + 'execute_event_success' + ), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this + .translateSys( + "cancel" + ) }); - } else if (item.action_type == + } else if (item + .action_type == "remove_subtable_page_row" ) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page + .Name; + }); if (pageData ?.DefList ) { //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹� value.row.forEach( row => { - pageData.DefList + pageData + .DefList .forEach( ( ele, @@ -1518,40 +1765,64 @@ row .id ) { - pageData.DefList.splice( - index, 1); + pageData + .DefList + .splice( + index, + 1 + ); } - }); + } + ); }); } - } else if (item.action_type == - "set_subtable_page_row") { - $this.viewActionSetRow(item + } else if (item + .action_type == + "set_subtable_page_row" + ) { + $this.viewActionSetRow( + item .value) - } else if (item.action_type == + } else if (item + .action_type == "set_subtable_page_ext_data" ) { var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page + .Name; + }); if (pageData) { - pageData.ExtData = value + pageData.ExtData = + value .ext_data } - } else if (item.action_type == + } else if (item + .action_type == "clear_subpage_rows") { var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); + const pageData = $this + .pageDetail.find(( + page) => { + return value + .page_name == + page + .Name; + }); if (pageData) { - pageData.DefList = [] - pageData.ExtData = {} + pageData + .DefList = [] + pageData + .ExtData = {} } - } else if (item.action_type == + } else if (item + .action_type == "set_dlg_current_edit_attr" ) { if ($this @@ -1567,15 +1838,17 @@ }) } $this.$nextTick(() => { - $this.setData({ - focusFieldId: item - .value - }) + $this + .setData({ + focusFieldId: item + .value + }) }); } }); } else { - if ($this.$data.After_OK_Event.ID != event + if ($this.$data.After_OK_Event.ID != + event .ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 $this.sava(pageParam, $this.$data @@ -1587,27 +1860,33 @@ if (result.info) { uni.showModal({ - title: this.translateSys("tip"), + title: this.translateSys( + "tip"), content: result.info, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this + .translateSys("cancel") }); } } } } else { uni.showModal({ - title: this.translateSys("error") + "8", + title: this.translateSys("error") + + "8", content: res.err_msg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys( + "cancel") }); } }).catch(ex => { var tip = typeof ex == "string" ? ex : ex.errMsg; uni.showModal({ title: this.translateSys("error") + "8.1", - content: this.translate("execute_after_ok_event_failed") + this.translateSys( + content: this.translate( + "execute_after_ok_event_failed") + + this.translateSys( "comma") + tip, showCancel: false, diff --git a/pages/modal/5602.vue b/pages/modal/5602.vue index 402cc3a..b1c4342 100644 --- a/pages/modal/5602.vue +++ b/pages/modal/5602.vue @@ -220,29 +220,14 @@ 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.ClsID2, this.$data.param.Sub_Page[1].UI_Style.ID); - - console.log(this.$data.param); + this.loadData(options.paramValue) }, methods: { setData: function(obj) { let that = this; let keys = []; let val, data; - + Object.keys(obj).forEach(function(key) { keys = key.split("."); val = obj[key]; @@ -259,6 +244,50 @@ }); }); }, + + 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.ClsID2, this.$data.param.Sub_Page[1].UI_Style.ID); + + + console.log(this.$data.param); + }, changeSwiper(evt) { let index = evt.target.current || evt.detail.current; this.setData({ diff --git a/pages/modal/classAttr.vue b/pages/modal/classAttr.vue index 244c93b..20f42dc 100644 --- a/pages/modal/classAttr.vue +++ b/pages/modal/classAttr.vue @@ -326,6 +326,14 @@ popupParam: {}, } }, + onNavigationBarButtonTap(e) { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/classAttr?param=' + JSON.stringify(this.param) + + "&titlename=" + this.title + }); + + }, onLoad(options) { // console.log(options); uni.setNavigationBarTitle({ @@ -353,47 +361,51 @@ return; } this.$data.param = param; - var edit_dlg = { - Model: param.EditDlgMode, - Name: param.Edit_dlg.Name - } - var dataInfo = { - class_id: param.clsid - }; - var $this = this; - $this.$store.state.thisareaFuncID = param.clsid; - // console.log($this.$store.getters.getclassAttrList); - //鑾峰彇 - if ($this.$store.getters.getclassAttrList) { - $this.$data.classAttrList = $this.$store.getters.getclassAttrList.data; - $this.classGridStyleInfo(); - } else - $this.$store.dispatch('classAttrList', dataInfo).then(success => { - // console.log(success); - if (success.code == '00000') { - $this.$data.classAttrList = success.data; - $this.classGridStyleInfo(); - } else { + this.loadData() + }, + methods: { + loadData() { + var $this = this; + var edit_dlg = { + Model: $this.param.EditDlgMode, + Name: $this.param.Edit_dlg.Name + } + var dataInfo = { + class_id: $this.param.clsid + }; + $this.$store.state.thisareaFuncID = $this.param.clsid; + // console.log($this.$store.getters.getclassAttrList); + //鑾峰彇 + if ($this.$store.getters.getclassAttrList) { + $this.$data.classAttrList = $this.$store.getters.getclassAttrList.data; + $this.classGridStyleInfo(); + } else { + $this.$store.dispatch('classAttrList', dataInfo).then(success => { + // console.log(success); + if (success.code == '00000') { + $this.$data.classAttrList = success.data; + + $this.classGridStyleInfo(); + } else { + uni.showModal({ + title: "閿欒1", + content: success.msg, + showCancel: false, + confirmText: "鍙栨秷" + }); + } + }).catch(ex => { + // console.log(ex); uni.showModal({ - title: "閿欒1", - content: success.msg, + title: "閿欒1.1", + content: ex.errMsg, showCancel: false, confirmText: "鍙栨秷" }); - } - }).catch(ex => { - // console.log(ex); - uni.showModal({ - title: "閿欒1.1", - content: ex.errMsg, - showCancel: false, - confirmText: "鍙栨秷" }); - }); - - }, - methods: { + } + }, classAttr_extButton(index, iindex) { //寮规灞傛樉绀�type:top bottom center left right var $this = this; $this.$data.popupType = 'right' @@ -986,12 +998,7 @@ icon: "success", duration: 3000 }); - //鍒锋柊 - - // uni.redirectTo({ - // url: '../modal/classAttr?param=' + JSON.stringify(this.$data.param) + - // "&titlename=" + this.$data.title - // }); + // this.class_attr_init(); } else { uni.showModal({ @@ -1116,7 +1123,7 @@ } } var eventlist = this.$data.classGridStyle.StyleDef.event; - + if (eventlist) { if (eventlist.length > 0) { for (var i = 0; i < eventlist.length; i++) { @@ -1150,7 +1157,7 @@ console.log(this.$data.classGridStyle); console.log(this.$data.classAttrList); - + } else { uni.showModal({ title: "鎻愮ず", diff --git a/pages/modal/ms_classAttr.vue b/pages/modal/ms_classAttr.vue index e1c74dd..185e250 100644 --- a/pages/modal/ms_classAttr.vue +++ b/pages/modal/ms_classAttr.vue @@ -670,6 +670,15 @@ check_list: {}, } }, + onNavigationBarButtonTap(e) { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/ms_classAttr?param=' + JSON.stringify(this.param) + + "&titlename=" + this.title + }); + + }, + onLoad(options) { // console.log(options); uni.setNavigationBarTitle({ @@ -1122,7 +1131,7 @@ $this.subClass_attr_init(); } else { //console.log(gridstyleInfo); - + $this.$store.dispatch('subClassGridStyleInfo', gridstyleInfo).then(success => { // console.log(success); if (success.code == '00000') { @@ -1131,7 +1140,7 @@ $this.$data.subClassGridStyle = success.data; $this.subClass_attr_init(); - + } else { uni.showModal({ @@ -1937,11 +1946,11 @@ // "{"ret":0, "result_type":0, "result":"鍒涘缓鎴愬姛123123123","info":""}" } //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify(this.$data.param) + - "&titlename=" + this.$data.title - }); - // this.class_attr_init(); + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify(this.$data.param) + + // "&titlename=" + this.$data.title + // }); + // // this.class_attr_init(); } else { uni.showModal({ title: "閿欒", @@ -3376,13 +3385,13 @@ var result = data.result; if (eventID != $this.$data.param.After_OK_Event.ID) $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); - else { - //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title - }); - } + // else { + // //鍒锋柊 + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + + // "&titlename=" + $this.$data.title + // }); + // } } else { uni.showModal({ title: "閿欒8", @@ -3534,13 +3543,13 @@ var result = data.result; if (eventID != $this.$data.param.After_Trigger_Event.ID) $this.scan_TriggerDataObjRunCustomEvent($this.$data.param.After_Trigger_Event.ID); - else { - //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title - }); - } + // else { + // //鍒锋柊 + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + + // "&titlename=" + $this.$data.title + // }); + // } } else { uni.showModal({ title: "閿欒8", -- Gitblit v1.9.1