From 07925905f1a596e20e980de6d42db217abb753b0 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:06:11 +0800
Subject: [PATCH] plugin

---
 pages/modal/3018.vue |  607 +++++++++++++++++-------------------------------------
 1 files changed, 196 insertions(+), 411 deletions(-)

diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index 4857e76..09fd2ca 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -305,6 +305,13 @@
 	import {
 		Base64
 	} from '@/js/Base64.js';
+	import {
+		showInfo,
+		showError,
+		showModal,
+		showLoading,
+		hideLoading
+	} from "@/js/Page.js"
 	import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
 	import utils from "@/js/utils.js"
 	import {
@@ -375,13 +382,16 @@
 		mounted() {
 			console.log("3018 mounted");
 		},
+		onReady() {
+			uni.setNavigationBarTitle({
+				title: this.title 
+			}); //璁剧疆椤堕儴鏍囬 
+		},
 		onLoad(options) {
 			console.log("3018", options);
-			uni.setNavigationBarTitle({
-				title: options.titlename
-			}); //璁剧疆椤堕儴鏍囬 
+			
 			var param = JSON.parse(options.param);
-			this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
+			this.title =  options.titlename; //璁剧疆鎸夐挳鏂囧瓧param.Add_BtnName ? param.Add_BtnName :
 			if (options.type) {
 				this.type = options.type;
 			}
@@ -390,24 +400,14 @@
 				this.objAttr = JSON.parse(options.objAttr);
 			console.log(param);
 			if (!param.EditDlgMode) {
-				uni.showModal({
-					title: this.translateSys('tip'),
-					content: this.translate('function_not_edit_dlg'),
-					showCancel: false,
-					confirmText: this.translateSys('close')
-				});
+				showError(this.translate('function_not_edit_dlg'), this.translateSys("tip"))
 				uni.navigateBack({
 					delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
 				});
 				return;
 			}
 			if (!param.Edit_dlg.Name) {
-				uni.showModal({
-					title: this.translateSys('tip'),
-					content: this.translate('function_not_edit_dlg'),
-					showCancel: false,
-					confirmText: this.translateSys('close')
-				});
+				showError(this.translate('function_not_edit_dlg'), this.translateSys("tip"))
 				uni.navigateBack({
 					delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
 				});
@@ -442,6 +442,7 @@
 			},
 			async loadData() {
 				try {
+						showLoading("loading...")
 					const param = this.param
 					var edit_dlg = {
 						Model: param.EditDlgMode,
@@ -465,18 +466,12 @@
 					}
 					$this.classAttrList = result;
 					await $this.classGridStyleInfo();
+					hideLoading()
 				} 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",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					hideLoading()
+					showError(ex, this.translateSys('error') + " 1")
+
 				}
 			},
 			async DictItemGetList(attr) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛�@@ -491,16 +486,8 @@
 					return res?.dict_item_list || []
 
 				} catch (ex) {
-					let exStr = JSON.stringify(ex)
-					if (exStr == "{}")
-						exStr = ex
-					let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
-					uni.showModal({
-						title: this.translateSys('error') + " 1.3",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 1.3")
+
 					return []
 				}
 			},
@@ -521,17 +508,8 @@
 					$this.viewParam();
 
 				} 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.4",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 1.4")
+
 				}
 			},
 			async loadFormData(objAttr) {
@@ -665,16 +643,8 @@
 
 					await this.class_attr_init();
 				} catch (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"),
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error'))
+
 				}
 			},
 			async class_attr_init() {
@@ -819,24 +789,13 @@
 						console.log(this.classAttrList);
 
 					} else {
-						uni.showModal({
-							title: this.translateSys('tip'),
-							content: this.translate('no_find_attr_diaplay'),
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						showInfo(this.translate('no_find_attr_diaplay'))
+
 					}
 				} catch (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"),
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error'))
+
+
 				}
 			},
 
@@ -867,29 +826,20 @@
 					.before_click_button;
 				var button_callback = $this.classAttrList[index].Attr[iindex].button_callback;
 				if (!before_click_button) {
-					uni.showModal({
-						title: this.translateSys('tip'),
-						content: this.translate("icon_click_event_empty"),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("icon_click_event_empty"))
+
 					return;
 				}
 				if (!button_callback) {
-					uni.showModal({
-						title: this.translateSys('tip'),
-						content: this.translate("icon_click_event_empty"),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("icon_click_event_empty"))
 					return;
 				}
 				this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index,
 					iindex);
 			},
 			setFormValues(data) {
-				if (JSON.stringify(data) == '{}') {
-					return;
+				if (!Array.isArray(data)) {
+					return
 				}
 				for (var a = 0; a < this.classAttrList.length; a++) {
 					for (var l = 0; l < this.classAttrList[a].Attr.length; l++) {
@@ -959,12 +909,8 @@
 					}
 				}
 				if (!$this.popupParam) {
-					uni.showModal({
-						title: this.translateSys('tip'),
-						content: "popupParam涓虹┖锛�,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo("popupParam涓虹┖锛�)
+
 					return;
 				}
 				$this.classAttrList[$this.popupParam.index].Attr[$this.popupParam.iindex]
@@ -1270,14 +1216,8 @@
 			},
 			classAttr_AddRef(e) {
 				console.log(e.target);
-				uni.showModal({
-					title: this.translateSys('tip'),
-					content: this.translateSys('unrealized'),
-					showCancel: false,
-					confirmText: this.translateSys('close')
-				});
-				// 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;
+				showInfo(this.translateSys('unrealized'))
+
 			},
 			classAttr_AddPrj(index, iindex) {
 				var param = {
@@ -1388,16 +1328,8 @@
 
 					uni.navigateBack()
 				} catch (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') + " 6.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 6.1")
+
 					return false;
 				}
 			},
@@ -1434,31 +1366,13 @@
 					}
 					return true;
 				} catch (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') + " 5.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 5.1")
 					return false;
 				}
 
 			},
 
-			// async sava() {
-			// 	try {
-			// 		if (this.edit_ok_event)
-			// 			this.OKDataObjRunCustomEvent();
-			// 		else
-			// 			this.add();
-			// 	} catch (ex) {
-			// 		return false;
-			// 	}
-			// },
+
 			async add() {
 				try {
 					var req = [];
@@ -1499,16 +1413,9 @@
 							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: this.translateSys('quotation_mark_left') + ar.DispName +
-										this
-										.translateSys('quotation_mark_right') + this.translate(
-											"cannot_empty"),
-									showCancel: false,
-									confirmText: this.translateSys('close')
-								});
+								showInfo(this.translateSys('quotation_mark_left') + ar.DispName +
+									this.translateSys('quotation_mark_right') + this.translate("cannot_empty"))
+
 								return;
 							}
 						}
@@ -1548,45 +1455,36 @@
 						uni.hideLoading();
 						let data = res.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'))
 							}
-
-
 
 						}
 						//鍒锋柊
@@ -1600,28 +1498,13 @@
 					}).catch(ex => {
 						console.log(ex);
 						uni.hideLoading();
-						let exStr = JSON.stringify(ex)
-						if (exStr == "{}")
-							exStr = ex
-						let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
-						uni.showModal({
-							title: this.translateSys('tip'),
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						showError(ex, this.translateSys('tip'))
+
+
 					});
 				} catch (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') + " 4.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 4.1")
+
 				}
 			},
 			ini_DataObjRunCustomEvent(info) {
@@ -1677,48 +1560,38 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
-					if (data.ret != 0&&  data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data
-							.err_info :
-							data
-							.err_info.join('<br/>') : '';
-						tip = tip || data.err_info
-						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
+						let 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'))
 						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')
-						});
+							.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) {
 
 							} 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 {
@@ -1733,17 +1606,13 @@
 										}
 									}
 									if (action_type == 'open_select_userdlg') {
-										uni.showModal({
-											title: this.translateSys('error') + " 2.2",
-											content: this.translateSys(
-													"quotation_mark_left") +
-												action_type + this.translateSys(
-													"quotation_mark_right") + this
-												.translate(
-													"tip_action_unprocessed"),
-											showCancel: false,
-											confirmText: this.translateSys('close')
-										});
+										showInfo(this.translateSys(
+												"quotation_mark_left") +
+											action_type + this.translateSys(
+												"quotation_mark_right") + this
+											.translate(
+												"tip_action_unprocessed"))
+
 									}
 									// else if (action_type == 'tip_dlg') {
 
@@ -1754,30 +1623,16 @@
 								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')
-								});
-								console.log(ex)
+								showError(tip, this.translateSys('tip'))
+
 								return
 							}
 						}
 					}
 
 				}).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') + " 2.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 2.1")
+
 				});
 			},
 			DataObjRunCustomEvent(info, data_attr) {
@@ -1848,38 +1703,32 @@
 				// return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-					if (data.ret != 0&& data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data
-							.err_info :
-							data
-							.err_info.join('<br/>') : '';
-						tip = tip || data.err_info
-						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
+						let 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'))
+
 						return false
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data
 							.info
-							.join(
-								'<br/>') : '';
-						tip = tip || result.err_info
-						if (tip) uni.showModal({
-							title: this.translateSys('tip'),
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+							.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.result || []
@@ -1913,12 +1762,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 {
@@ -1939,29 +1784,17 @@
 								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')
-								});
-								console.log(ex)
+								showError(tip, this.translateSys('tip'))
+
 								return
 							}
 						}
 					}
 
 				}).catch(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') + " 3.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+
+					showError(ex, this.translateSys('error') + " 3.1")
+
 				});
 			},
 			async OKDataObjRunCustomEvent() {
@@ -2043,38 +1876,33 @@
 					// return;
 					runCustomEvent(dataInfo).then(data => {
 						console.log(data);
-						if (data.ret != 0&& data.ret != 1) {
-							var tip = data.err_info ? typeof data.err_info == 'string' ? data
-								.err_info :
-								data
-								.err_info.join('<br/>') : '';
-							tip = tip || data.err_info
-							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
+							let 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'))
 							return false
 						} else {
 							var tip = data.info ? typeof data.info == 'string' ? data.info : data
 								.info
-								.join(
-									'<br/>') : '';
+								.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 || [];
@@ -2099,12 +1927,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)
+
 									}
 								}
 
@@ -2114,28 +1938,11 @@
 						}
 
 					}).catch(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') + " 4.1",
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						showError(ex, this.translateSys('error') + " 4.1")
+
 					});
 				} catch (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') + " 4.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 4.1")
 				}
 			},
 			DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
@@ -2222,48 +2029,39 @@
 				// return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-					if (data.ret != 0&& data.ret != 1) {
-						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
+						let 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'))
+
 						return false
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data
 							.info
-							.join(
-								'<br/>') : '';
+							.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 {
@@ -2451,29 +2249,16 @@
 								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')
-								});
-								console.log(ex)
+								showError(tip, this.translateSys('tip'))
+
 								return
 							}
 						}
 					}
 
 				}).catch(ex => {
-					let exStr = JSON.stringify(ex)
-					if (exStr == "{}")
-						exStr = ex
-					let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
-					uni.showModal({
-						title: this.translateSys('tip') + "5.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('tip') + "5.1")
+
 				});
 			},
 

--
Gitblit v1.9.1