From 49dfdd3bf265db28d38167f34e9aabfdd3e8e5db Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 17 十月 2025 10:16:58 +0800
Subject: [PATCH] imagebutton
---
pages/modal/3037.vue | 855 +++++++++++++++++---------------------------------------
1 files changed, 265 insertions(+), 590 deletions(-)
diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index a811383..900baf4 100644
--- a/pages/modal/3037.vue
+++ b/pages/modal/3037.vue
@@ -670,7 +670,12 @@
classAttrList,
} from "@/api/index.js"
import buttonClickMixin from '@/mixins/button-click.js';
-
+ import {
+ showInfo,
+ showError,
+ showLoading,
+ hideLoading
+ } from "@/js/Page.js"
export default {
mixins: [buttonClickMixin],
@@ -707,21 +712,13 @@
this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
console.log(param);
if (!param.Master_Cls.View_Style) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃晫闈㈢獥鍙o紝璇烽噸鏂伴厤缃紒")
+
return;
}
if (!param.Master_Cls.View_Style.Name) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒")
+
return;
}
this.param = param;
@@ -757,15 +754,23 @@
async loadData() {
//涓绘暟鎹被鑾峰彇
- const param = this.param
- this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
- this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
- ?.View_Style?.Name)
- this.viewParam('Mast');
- this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
- this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
- ?.Name)
- this.viewParam('Sub');
+ try {
+ showLoading("loading...")
+ const param = this.param
+ this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
+ ?.View_Style?.Name)
+ this.viewParam('Mast');
+ this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
+ ?.Name)
+ this.viewParam('Sub');
+ } catch (ex) {
+ // console.log(ex);
+ hideLoading()
+ showError(ex, this.translateSys('error') + " 1")
+
+ }
},
async DictItemGetList(attr) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛� try {
@@ -779,12 +784,8 @@
return result?.dict_item_list || []
} catch (ex) {
- uni.showModal({
- title: this.translateSys('error') + " 1.2",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('error') + " 1.2")
+
return []
}
@@ -808,17 +809,8 @@
}
return result
} catch (ex) {
- // console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("error") + " 1.1",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + " 1.1")
+
return []
};
},
@@ -839,16 +831,8 @@
} catch (ex) {
// console.log(ex);
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
- uni.showModal({
- title: this.translateSys("error") + " 1.2",
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys("error") + " 1.2")
+
return {}
};
},
@@ -1118,12 +1102,8 @@
console.log(this.classAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
subClass_attr_init() {
@@ -1273,24 +1253,16 @@
console.log(this.subClassAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�锛�)
+
}
},
scan_classAttr_extButton(e) { //閫夋嫨鎸夐挳鍓� var $this = this;
var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event;
if (!Before_Select_Event) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "閫夋嫨鍓嶄簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("閫夋嫨鍓嶄簨浠朵负绌猴紒")
+
return;
}
var mast_attr = [];
@@ -1300,12 +1272,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1351,13 +1319,7 @@
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 + '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -1430,12 +1392,8 @@
var $this = this;
var After_Select_Event = $this.param.Scan_Code.After_Select_Event;
if (!After_Select_Event) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "閫夋嫨鍚庝簨浠朵负绌猴紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("閫夋嫨鍚庝簨浠朵负绌猴紒")
+
return;
}
var items = $this.check_list.items;
@@ -1453,12 +1411,8 @@
}
}
if (data.length == 0) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鏈�鎷╂暟鎹紒")
+
return;
}
var mast_attr = [];
@@ -1468,12 +1422,8 @@
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
if (ar.Value == '璇烽�鎷�) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ar.DispName + "鏈�鎷╂暟鎹紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + "鏈�鎷╂暟鎹紒")
+
return;
}
mast_attr.push(this.formatAttr(ar))
@@ -1530,22 +1480,13 @@
// console.log(success);
uni.hideLoading();
$this.subPanelList.splice(index, 1);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "鍒犻櫎鎴愬姛锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("鍒犻櫎鎴愬姛锛�)
+
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "9.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "9.1")
});
}
},
@@ -2199,21 +2140,13 @@
var button_callback = $this.classAttrList[index].Attr[iindex]
.button_callback;
if (!before_click_button) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "before_click_button-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("before_click_button-event_id涓虹┖锛�)
+
return;
}
if (!button_callback) {
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "button_callback-event_id涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("button_callback-event_id涓虹┖锛�)
+
return;
}
var data_attr = this.classAttrList[
@@ -2284,12 +2217,8 @@
},
classAttr_AddRef(e) {
console.log(e.target);
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: "姝ゅ姛鑳借繕鏈疄鐜帮紒",
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo("姝ゅ姛鑳借繕鏈疄鐜帮紒")
+
// var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value];
// this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
},
@@ -2418,15 +2347,7 @@
.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 +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -2477,42 +2398,34 @@
uni.hideLoading();
let data = result.lua_result
if (data) {
- 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) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- uni.showToast({
- title: this.translate('create_success'),
- icon: "success",
- duration: 3000
- });
+ if (tip) {
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ } else
+ showInfo(this.translate('create_success'));
}
}
@@ -2531,12 +2444,7 @@
}).catch(ex => {
console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('tip') + "",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip'))
});
},
ini_DataObjRunCustomEvent(info) {
@@ -2602,59 +2510,37 @@
runCustomEvent(
dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
+
}
try {
var actionlist =
@@ -2766,28 +2652,14 @@
}
}
}
- if (action_type ==
- 'open_select_userdlg'
- ) {
- uni.showModal({
- title: this.translateSys('error') + " 2.2",
- content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+
}
}
} catch (ex) {
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(tip, this.translateSys('tip'))
console.log(ex)
return
}
@@ -2796,12 +2668,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 2.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "2.1")
});
},
DataObjRunCustomEvent(info, data_attr) {
@@ -2885,46 +2752,31 @@
runCustomEvent(
dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
return false
} else {
- var tip = data.info ?
- typeof data.info ==
- 'string' ? data
- .info : data.info
- .join('<br/>') :
- '';
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ var tip = data.info ? typeof data.info == 'string' ? data.info :
+ data.info.join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
var result = data
@@ -3023,14 +2875,8 @@
}
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
+
}
try {
var actionlist = data.action || []
@@ -3245,12 +3091,7 @@
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(tip, this.translateSys('tip'))
console.log(ex)
return
}
@@ -3260,12 +3101,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 3.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "3.1")
});
},
OKDataObjRunCustomEvent() {
@@ -3366,47 +3202,31 @@
runCustomEvent(dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
var result = data.result || []
@@ -3463,26 +3283,15 @@
this.add();
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
+
}
}
}
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 4.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "4.1")
});
},
DataObjRunCustomEvent_Return(eventid,
@@ -3588,59 +3397,36 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
}
try {
var actions = data.action || []
@@ -3928,12 +3714,7 @@
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(tip, this.translateSys('tip'))
console.log(ex)
return
}
@@ -3942,12 +3723,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('tip') + "5.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "5.1")
});
},
scan_ini_DataObjRunCustomEvent(info) {
@@ -4012,59 +3788,37 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip) uni
- .showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
+
}
try {
var actionlist = data.action || []
@@ -4113,12 +3867,7 @@
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(tip, this.translateSys('tip'))
console.log(ex)
return
}
@@ -4128,12 +3877,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 6.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "6.1")
});
},
scan_DataObjRunCustomEvent(info, data_attr) {
@@ -4208,47 +3952,31 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(data.result_type)) {
if (data.result_type == 2) {
if (data.result) {
@@ -4425,14 +4153,8 @@
}
} else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- }
+ showInfo(data.result)
+
}
try {
var actionlist = data.action || []
@@ -4853,12 +4575,7 @@
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(tip, this.translateSys('tip'))
console.log(ex)
return
}
@@ -4868,12 +4585,7 @@
}).catch(ex => {
// console.log(ex);
- uni.showModal({
- title: this.translateSys('error') + " 7.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "7.1")
});
},
scan_OKDataObjRunCustomEvent(eventID) {
@@ -4916,15 +4628,7 @@
.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 +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -4972,15 +4676,7 @@
.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 +
- '涓嶈兘涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showInfo(ar.DispName + '涓嶈兘涓虹┖锛�)
return;
}
}
@@ -5043,47 +4739,31 @@
runCustomEvent(dataInfo).then(data => {
console.log(data);
uni.hideLoading();
- 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)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip +
- ',鎻愮ず:' +
- data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ if (data.ret != 0 && data.ret != 1) {
+ let cls_name = data.event_info?.cls_name
+ let event_name = data.event_info?.event_name
+ tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+ .join('\n') : ''
+ if (data.ret == 801) {
+ if (this.param.Only_Script_Error) {
+ let pos = tip.indexOf("锛�);
+ if (pos > -1) tip = tip.substring(pos + 1);
+ }
+ }
+ if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (data.ret == 801) showInfo(tip)
+ else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+ this.saving = false
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('\n') : '';
tip = tip || data.err_info
- if (tip)
- uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
// var result = data.result;
if (eventID != $this.param.After_OK_Event.ID)
@@ -5108,12 +4788,7 @@
}).catch(ex => {
// console.log(ex);
uni.hideLoading();
- uni.showModal({
- title: this.translateSys('error') + " 8.1",
- content: ex.errMsg,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ showError(ex, this.translateSys('tip') + "8.1")
});
},
--
Gitblit v1.9.1