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/3037.vue |  863 ++++++++++++++++++---------------------------------------
 1 files changed, 278 insertions(+), 585 deletions(-)

diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index ebdda44..1a69e07 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],
@@ -698,30 +703,25 @@
 				check_list: {},
 			}
 		},
+		onReady() {
+			uni.setNavigationBarTitle({
+				title: this.title 
+			}); //璁剧疆椤堕儴鏍囬 
+		},
 		onLoad(options) {
 			// console.log(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 :
 			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 +757,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 +787,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 +812,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 +834,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 +1105,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 +1256,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 +1275,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 +1322,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 +1395,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 +1414,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 +1425,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 +1483,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 +2143,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 +2220,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 +2350,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;
 						}
 					}
@@ -2475,32 +2399,39 @@
 				dataObjCreate(dataInfo).then(result => {
 					console.log(result);
 					uni.hideLoading();
-					if (success.result
-						.action) {
-						var action = JSON
-							.parse(success
-								.result.Action
-							);
-						if (action.ret ==
-							'0') {
-							if (action
-								.result_type ==
-								'0') {
-								uni.showToast({
-									title: action
-										.result,
-									icon: "success",
-									duration: 3000
-								});
+					let data = result.lua_result
+					if (data) {
+						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);
+								}
 							}
-							// "{"ret":0, "result_type":0, "result":"鍒涘缓鎴愬姛123123123","info":""}"
+							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('\n') : '';
+							tip = tip || data.err_info
+							if (tip) {
+								let time = data.info_time || 0
+								if (time)
+									showError(tip, this.translateSys('tip'))
+								else
+									showInfo(tip)
+							} else
+								showInfo(this.translate('create_success'));
 						}
-					} else
-						uni.showToast({
-							title: "鍒涘缓鎴愬姛锛�,
-							icon: "success",
-							duration: 3000
-						});
+
+					}
 					//鍒锋柊
 					uni.redirectTo({
 						url: '../modal/3037?param=' +
@@ -2516,12 +2447,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) {
@@ -2587,59 +2513,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 =
@@ -2751,28 +2655,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
 							}
@@ -2781,12 +2671,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) {
@@ -2870,46 +2755,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
@@ -3008,14 +2878,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 || []
@@ -3230,12 +3094,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
 							}
@@ -3245,12 +3104,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() {
@@ -3351,47 +3205,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 || []
@@ -3448,26 +3286,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,
@@ -3573,59 +3400,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 || []
@@ -3913,12 +3717,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
 							}
@@ -3927,12 +3726,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) {
@@ -3997,59 +3791,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 || []
@@ -4098,12 +3870,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
 								}
@@ -4113,12 +3880,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) {
@@ -4193,47 +3955,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) {
@@ -4410,14 +4156,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 || []
@@ -4838,12 +4578,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
 						}
@@ -4853,12 +4588,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) {
@@ -4901,15 +4631,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;
 					}
 				}
@@ -4957,15 +4679,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;
 						}
 					}
@@ -5028,47 +4742,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)
@@ -5093,12 +4791,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