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/5601.vue |  745 +++++++++++++++++++++++++-------------------------------
 1 files changed, 333 insertions(+), 412 deletions(-)

diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index 4e0d95e..31dc2b6 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -118,7 +118,9 @@
 	} from '@/js/Base64.js';
 	import {
 		showInfo,
-		showError
+		showError,
+		showLoading,
+		hideLoading
 	} from "@/js/Page.js"
 	import {
 		dictGetInfo,
@@ -235,63 +237,70 @@
 				});
 			},
 			async loadData(paramValue) {
-				//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�-				await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
-				//浼犲叆鍙傛暟鍊�-				console.log(paramValue)
-				if (paramValue) {
-					this.setFormValues(paramValue)
-				}
-				//鍔犺浇鍒濆鐣岄潰
-				if (this.param.Show_Welcom_Page) {
-					this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+');
-					this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width);
-					this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height);
-				};
-				//鍔犺浇Tab椤电
-				const pageList = this.param.Sub_Page || []
-				for (let i in pageList) {
+				try {
+					showLoading("loading...")
+					//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+					await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
+					//浼犲叆鍙傛暟鍊�+					console.log(paramValue)
+					if (paramValue) {
+						this.setFormValues(paramValue)
+					}
+					//鍔犺浇鍒濆鐣岄潰
+					if (this.param.Show_Welcom_Page) {
+						this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+');
+						this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width);
+						this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height);
+					};
+					//鍔犺浇Tab椤电
+					const pageList = this.param.Sub_Page || []
+					for (let i in pageList) {
 
-					const page = pageList[i]
-					page.DefList = [];
-					page.StyleDef = await this.Detail_UIstyleGetInfo(
-						this.ClsID,
-						page.UI_Style.ID
-					);
-					const buttons = this.pageButtonList(page)
-					page.Button = buttons
-					page.DropDownButton = []
-					if (buttons.length > 3) {
-						let cancelBtn = undefined
-						const btns = []
-						buttons.forEach((btn) => {
-							if (btn.FunCode == "Cancel") {
-								cancelBtn = btn
+						const page = pageList[i]
+						page.DefList = [];
+						page.StyleDef = await this.Detail_UIstyleGetInfo(
+							this.ClsID,
+							page.UI_Style.ID
+						);
+						const buttons = this.pageButtonList(page)
+						page.Button = buttons
+						page.DropDownButton = []
+						if (buttons.length > 3) {
+							let cancelBtn = undefined
+							const btns = []
+							buttons.forEach((btn) => {
+								if (btn.FunCode == "Cancel") {
+									cancelBtn = btn
+								} else {
+									btns.push(btn)
+								}
+							})
+							if (cancelBtn) {
+								if (btns.length > 2) {
+									page.DropDownButton = btns.splice(2)
+									page.Button = btns
+								}
+								page.Button.push(cancelBtn)
 							} else {
-								btns.push(btn)
-							}
-						})
-						if (cancelBtn) {
-							if (btns.length > 2) {
-								page.DropDownButton = btns.splice(2)
-								page.Button = btns
-							}
-							page.Button.push(cancelBtn)
-						} else {
-							if (btns.length > 3) {
-								page.DropDownButton = btns.splice(3)
-								page.Button = btns
+								if (btns.length > 3) {
+									page.DropDownButton = btns.splice(3)
+									page.Button = btns
+								}
 							}
 						}
+						page.Row_Button = this.rowButtonList(page)
 					}
-					page.Row_Button = this.rowButtonList(page)
-				}
 
-				this.setData({
-					pageDetail: pageList
-				})
-				await this.loadInitialEvent();
-				console.log(this.pageDetail);
+					this.setData({
+						pageDetail: pageList
+					})
+					await this.loadInitialEvent();
+					console.log(this.pageDetail);
+					hideLoading()
+				} catch (ex) {
+					hideLoading()
+					showError(ex, this.translateSys("error"));
+				}
 			},
 			async loadInitialEvent() {
 				try {
@@ -928,7 +937,16 @@
 			},
 			onClick(item) {
 				console.log("onClick", item)
-				this.focusFieldId = item.fieldId
+				if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+					this.focusFieldId = item.fieldId
+				} else if (item.name == "ImageButton") {
+					var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+					if (!onClickEvent.id) {
+						showInfo(this.translate('icon_click_event_empty'))
+						return;
+					}
+					this.onChange(onClickEvent);
+				}
 			},
 			ontap(item) { //鎵爜鍔熻兘
 				// var $ele = e;
@@ -1066,9 +1084,7 @@
 				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
 				this.$refs.popup.open(this.popupType);
 
-				this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '',
-					onSuffixClickCallbackEvent.id,
-					item);
+				this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id, item);
 			},
 			onDetailEnterChange(item, style, pageIndex) {
 				let newVal = item.value
@@ -1094,7 +1110,7 @@
 			async runDetailChangeEvent(event, style, pageIndex) {
 				try {
 					const detail_attr = {}
-
+					showLoading("loading...")
 					style.form.items.forEach(item2 => {
 						if (item2.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� 							item2.setting.colList.forEach(col => {
@@ -1134,7 +1150,9 @@
 					};
 					const result = await runCustomEvent(dataInfo)
 					console.log(result)
+					hideLoading()
 					if (result.ret != 0 && result.ret != 1) {
+
 						let cls_name = result.event_info?.cls_name
 						let event_name = result.event_info?.event_name
 						tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info
@@ -1195,6 +1213,7 @@
 
 				} catch (ex) {
 					console.log(ex)
+					hideLoading()
 					showError(ex, this.translateSys('error') + "6.1")
 				}
 
@@ -1270,6 +1289,7 @@
 				try {
 					if (event.id) {
 						//鑾峰彇琛ㄥご灞炴�
+						showLoading("loading...")
 						var head_attr = {};
 						this.head_styledef.form.items.forEach(item => {
 							if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -1328,246 +1348,13 @@
 						};
 						const result = await runCustomEvent(dataInfo)
 						console.log(result);
-						if (result.ret != 0 && result.ret != 1) {
-							let cls_name = result.event_info?.cls_name
-							let event_name = result.event_info?.event_name
-							tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
-								.err_info
-								.join('\n') : ''
-							if (result.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 (result.ret == 801) showInfo(tip)
-							else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
-							this.saving = false
-							return false
-						} else {
-							var tip = result.info ? typeof result.info == 'string' ? result.info :
-								result.info.join('\n') : '';
-							tip = tip || result.err_info
-							let time = result.info_time || 0
-							if (time)
-								showError(tip, this.translateSys('tip'))
-							else
-								showInfo(tip)
-							if ([0, 2, 3, 4, -1].includes(result.result_type)) {
-								if (result.result_type == 2) {
-
-								} else if (typeof result.result == 'string') {
-									showInfo(result.result)
-
-								}
-								try {
-									let actionList = result.action || []
-									actionList.forEach(item => {
-										if (item.action_type ==
-											"insert_subtable_page_row"
-										) { //鐮佺洏涓�-											$this.param.Show_Welcom_Page =
-												false;
-											var value = item.value;
-											$this.viewAceionRow(value);
-										} else if (item.action_type ==
-											"set_subtable_page_content"
-										) { //宸茬爜鐩�-											$this.param.Show_Welcom_Page =
-												false;
-											var value = item.value;
-											const pageData = $this
-												.pageDetail.find((
-													page) => {
-													return value
-														.page_name ==
-														page.Name;
-												});
-											if (value.clear_confirm !=
-												false && value.clear ==
-												true &&
-												pageData && pageData
-												.DefList.length > 0
-											) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�-												uni.showModal({
-													title: this
-														.translateSys(
-															'tip'),
-													content: this
-														.translate(
-															"are_you_sure_clear_first"
-														) +
-														this
-														.translateSys(
-															"quotation_mark_left"
-														) +
-														value
-														.page_name +
-														this
-														.translateSys(
-															"quotation_mark_right"
-														) +
-														this
-														.translate(
-															"are_you_sure_clear_last"
-														),
-													cancelText: $this
-														.translateSys(
-															'ok'),
-													confirmText: $this
-														.translateSys(
-															'cancel'
-														),
-													success: function(
-														res) {
-														if (res
-															.cancel
-														) {
-															if (
-																pageData)
-																pageData
-																.DefList = [];
-															$this
-																.viewAceionContent(
-																	value
-																);
-														} else if (
-															res
-															.confirm
-														) {
-															if (
-																pageData)
-																pageData
-																.DefList = [];
-															$this
-																.viewAceionContent(
-																	value
-																);
-														}
-													}
-												});
-											} else {
-												if (pageData)
-													pageData.DefList = [];
-												$this.viewAceionContent(
-													value);
-											}
-										} else if (item.action_type ==
-											"select_subtable_page") {
-											var value = item.value;
-											const pageIndex = $this
-												.pageDetail.findIndex((
-													page) => {
-													return value
-														.page_name ==
-														page.Name;
-												});
-											if (pageIndex > -1) {
-												$this.setData({
-													current: pageIndex
-												})
-											}
-										} else if (item.action_type ==
-											"select_subtable_page_row") {
-											// value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}}
-											var value = item.value;
-											$this.viewActionSelectRow(
-												value)
-										} else if (item.action_type ==
-											"remove_subtable_page_row"
-										) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�-											var value = item.value;
-											$this.viewActionRemoveRow(
-												value)
-										} else if (item.action_type ==
-											"set_subtable_page_row") {
-											$this.viewActionSetRow(item
-												.value)
-
-										} else if (item.action_type ==
-											"set_subtable_page_ext_data") {
-											var value = item.value;
-											const pageData = $this
-												.pageDetail.find((
-													page) => {
-													return value
-														.page_name ==
-														page.Name;
-												});
-											if (pageData)
-												pageData.ExtData = value
-												.ext_data
-
-										} else if (item.action_type ==
-											"clear_subpage_rows") {
-											var value = item.value;
-											const pageIndex = $this
-												.pageDetail.findIndex((
-													page) => {
-													return value
-														.page_name ==
-														page.Name;
-												});
-											if (pageIndex > -1) {
-												const pageData = $this
-													.pageDetail[pageIndex]
-												pageData.DefList = []
-												pageData.ExtData = {}
-
-												$this.$set(this.pageDetail,
-													pageIndex, pageData
-												)
-											}
-
-										} else if (item.action_type ==
-											"set_dlg_current_edit_attr") {
-
-											if ($this.focusOldFieldId ==
-												item.value) {
-												$this.setData({
-													focusFieldId: ""
-												})
-											} else {
-												$this.setData({
-													focusFieldId: $this
-														.focusOldFieldId
-												})
-											}
-											$this.$nextTick(() => {
-												$this.setData({
-													focusFieldId: item
-														.value
-												})
-											});
-										} else if (item.action_type ==
-											"set_dlg_attr") {
-											// value = {"attr":"xxx", "value":"xxx"}
-											var data = item.value;
-											$this.setFormValues(data)
-										} else if (item.action_type ==
-											'set_dlg_attr_show') {
-											var data = item.value;
-											$this.setFormItemVisible(data)
-										}
-									});
-
-								} catch (ex) {
-									let actionList = (result.action || []).map(a =>
-										a.action_type).join(';')
-									let tip = typeof ex == 'string' ? ex : ex
-										.message
-									tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
-									showError(tip, this.translateSys('tip'))
-									return
-								}
-							}
-
-						}
+						hideLoading()
+						await $this.onFormEventResult(result,"")
 
 					}
 				} catch (ex) {
 					console.log(ex);
+					hideLoading()
 					showError(ex, this.translateSys('error') + "4.2")
 				}
 			},
@@ -2607,6 +2394,9 @@
 
 			async DataObjRunCustomEvent(info, data_attr) {
 				var $this = this;
+				if( !info.eventid)
+					return
+				showLoading("loading...")
 				var enviroment = {
 					'function': '3000', // 鍔熻兘鐐圭紪鍙� 					cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -2673,102 +2463,17 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(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);
-							}
-						}
-						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
-						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) {
-								$this.setFormValues(data.result || [])
-							} else if (typeof data.result ==
-								'string') {
-								showInfo(data.result)
-							}
-							try {
-								var actionlist = data.action || []
-								for (var i = 0; i < actionlist
-									.length; i++) {
-									var action = actionlist[i];
-									if (action.action_type ==
-										'set_dlg_attr') {
-										var result = action.value;
-										$this.setFormValues(result)
-									} else if (action
-										.action_type ==
-										'set_dlg_attr_show') {
-										var result = action.value;
-										$this.setFormItemVisible(
-											result)
-
-										// console.log($this.head_styledef);
-									} else if (action
-										.action_type ==
-										'set_global_attr') {
-										$this.global_attr = action
-											.value || [];
-									} else {
-										showInfo(this
-											.translateSys(
-												"quotation_mark_left"
-											) +
-											action
-											.action_type +
-											this
-											.translateSys(
-												"quotation_mark_right"
-											) +
-											this
-											.translate(
-												"tip_action_unprocessed"
-											))
-
-									}
-								}
-
-
-							} catch (ex) {
-								let actionList = (data.action || []).map(a => a.action_type)
-									.join(';')
-								let tip = typeof ex == 'string' ?
-									ex : ex.message
-								tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
-								showError(tip, this.translateSys('tip'))
-								return
-							}
-						}
-					}
+					hideLoading()
+					$this.onFormEventResult(data,"")
 
 				}).catch(ex => {
 					// console.log(ex);
+					hideLoading()
 					showError(ex, this.translateSys("error") + "3.1")
 				});
 			},
-			dataObjRunCustomEvent_Return(eventid, data_attr,
-				button_callback, item) {
-				console.log("dataObjRunCustomEvent_Return", eventid,
-					data_attr, button_callback)
+			dataObjRunCustomEvent_Return(eventid, button_callback, item) {
+				showLoading("loading...")
 				const $this = this
 				var enviroment = {
 					'function': '3000', // 鍔熻兘鐐圭紪鍙�@@ -2833,7 +2538,29 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
+					hideLoading()
+					$this.onFormEventResult(data, button_callback, item)
+				}).catch(ex => {
+					hideLoading()
+					showError(ex, this.translateSys("error") + "5.1")
+				});
+			},
+
+			async onFormEventResult(data, callbackEventId, item) {
+				try {
+					const $this = this
+					var enviroment = {
+						'function': '3000', // 鍔熻兘鐐圭紪鍙�+						cls_id: $this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+						'button': 'top', // top/bottom
+						button_name: $this.translateSys('add2'),
+						master: {
+							cls_id: $this.ClsID, // button=bottom鏃�master鐨刢ls_id
+							//obj_id: ''  // button=bottom鏃�master鐨刼bj_id
+						}
+					};
 					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
@@ -2867,16 +2594,202 @@
 								showInfo(data.result)
 							}
 							try {
+								var enviroment = JSON.stringify(enviroment);
 								var actions = data.action || []
-								for (var i = 0; i < actions
-									.length; i++) {
+								for (var i = 0; i < actions.length; i++) {
 									var action = actions[i];
 									console.log(action)
-									var val = action.value;
-									var enviroment = JSON
-										.stringify(enviroment);
-
 									if (action.action_type ==
+										"insert_subtable_page_row"
+									) { //鐮佺洏涓�+										$this.param.Show_Welcom_Page =
+											false;
+										var value = action.value;
+										$this.viewAceionRow(value);
+									} else if (action.action_type ==
+										"set_subtable_page_content"
+									) { //宸茬爜鐩�+										$this.param.Show_Welcom_Page =
+											false;
+										var value = action.value;
+										const pageData = $this
+											.pageDetail.find((
+												page) => {
+												return value
+													.page_name ==
+													page.Name;
+											});
+										if (value.clear_confirm !=
+											false && value.clear ==
+											true &&
+											pageData && pageData
+											.DefList.length > 0
+										) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+											uni.showModal({
+												title: this
+													.translateSys(
+														'tip'),
+												content: this
+													.translate(
+														"are_you_sure_clear_first"
+													) +
+													this
+													.translateSys(
+														"quotation_mark_left"
+													) +
+													value
+													.page_name +
+													this
+													.translateSys(
+														"quotation_mark_right"
+													) +
+													this
+													.translate(
+														"are_you_sure_clear_last"
+													),
+												cancelText: $this
+													.translateSys(
+														'ok'),
+												confirmText: $this
+													.translateSys(
+														'cancel'
+													),
+												success: function(
+													res) {
+													if (res
+														.cancel
+													) {
+														if (
+															pageData)
+															pageData
+															.DefList = [];
+														$this
+															.viewAceionContent(
+																value
+															);
+													} else if (
+														res
+														.confirm
+													) {
+														if (
+															pageData)
+															pageData
+															.DefList = [];
+														$this
+															.viewAceionContent(
+																value
+															);
+													}
+												}
+											});
+										} else {
+											if (pageData)
+												pageData.DefList = [];
+											$this.viewAceionContent(
+												value);
+										}
+									} else if (action.action_type ==
+										"select_subtable_page") {
+										var value = action.value;
+										const pageIndex = $this
+											.pageDetail.findIndex((
+												page) => {
+												return value
+													.page_name ==
+													page.Name;
+											});
+										if (pageIndex > -1) {
+											$this.setData({
+												current: pageIndex
+											})
+										}
+									} else if (action.action_type ==
+										"select_subtable_page_row") {
+										// value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}}
+										var value = action.value;
+										$this.viewActionSelectRow(
+											value)
+									} else if (action.action_type ==
+										"remove_subtable_page_row"
+									) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�+										var value = action.value;
+										$this.viewActionRemoveRow(
+											value)
+									} else if (action.action_type ==
+										"set_subtable_page_row") {
+										$this.viewActionSetRow(action
+											.value)
+
+									} else if (action.action_type ==
+										"set_subtable_page_ext_data") {
+										var value = action.value;
+										const pageData = $this
+											.pageDetail.find((
+												page) => {
+												return value
+													.page_name ==
+													page.Name;
+											});
+										if (pageData)
+											pageData.ExtData = value
+											.ext_data
+
+									} else if (action.action_type ==
+										"clear_subpage_rows") {
+										var value = action.value;
+										const pageIndex = $this
+											.pageDetail.findIndex((
+												page) => {
+												return value
+													.page_name ==
+													page.Name;
+											});
+										if (pageIndex > -1) {
+											const pageData = $this
+												.pageDetail[pageIndex]
+											pageData.DefList = []
+											pageData.ExtData = {}
+
+											$this.$set(this.pageDetail,
+												pageIndex, pageData
+											)
+										}
+
+									} else if (action.action_type ==
+										"set_dlg_current_edit_attr") {
+
+										if ($this.focusOldFieldId ==
+											action.value) {
+											$this.setData({
+												focusFieldId: ""
+											})
+										} else {
+											$this.setData({
+												focusFieldId: $this
+													.focusOldFieldId
+											})
+										}
+										$this.$nextTick(() => {
+											$this.setData({
+												focusFieldId: action
+													.value
+											})
+										});
+									} else if (action.action_type ==
+										"set_dlg_attr") {
+										// value = {"attr":"xxx", "value":"xxx"}
+										var data = action.value;
+										$this.setFormValues(data)
+									} else if (action.action_type ==
+										'set_dlg_attr_show') {
+										var data = action.value;
+										$this.setFormItemVisible(data)
+									} else if (action
+										.action_type ==
+										'set_global_attr') {
+										$this.global_attr = action
+											.value || [];
+									} else if (action.action_type ==
 										'open_panel') {
 										var d = dialog({
 											title: '<i class="ace-icon fa fa-info-circle"></i> ' +
@@ -2906,9 +2819,9 @@
 										// style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
 										var param = {
 											item: item,
-											button_callback: button_callback,
+											button_callback: callbackEventId,
 											req: req,
-											data_attr: data_attr
+											data_attr: ""
 										}
 										uni.navigateTo({
 											url: '../selpsn/index?mulit=false&param=' +
@@ -3008,9 +2921,9 @@
 											);
 											var popupParam = {
 												item: item,
-												button_callback: button_callback,
+												button_callback: callbackEventId,
 												req: req,
-												data_attr: data_attr
+												data_attr: ""
 											}
 											$this.setData({
 												popupParam: popupParam
@@ -3051,7 +2964,7 @@
 											priRel = '5';
 										var param_ = {
 											item: item,
-											button_callback: button_callback,
+											button_callback: callbackEventId,
 											req: req
 										}
 										uni.navigateTo({
@@ -3155,12 +3068,10 @@
 
 					}
 
-				}).catch(ex => {
-					showError(ex, this.translateSys("error") + "5.1")
-				});
+				} catch (ex) {
+					showError(ex, this.translateSys("error") + "10.1")
+				}
 			},
-
-
 			onPanelClick(value, id) {
 				// console.log(value);
 				this.active_id = id;
@@ -3769,9 +3680,9 @@
 				// });
 			},
 			//鎵ц纭畾鑴氭湰
-			async runCustomEvent(pageParam, event, input_param, json,
-				type) {
+			async runCustomEvent(pageParam, event, input_param, json, type) {
 				var $this = this;
+				showLoading("loading...")
 				var data_json = Base64.encode(
 					JSON.stringify(json)
 				);
@@ -3797,10 +3708,13 @@
 				console.log(dataInfo);
 				runCustomEvent(dataInfo).then(result => {
 					console.log(result);
+					hideLoading()
 					if (result.ret != 0 && result.ret != 1) {
+
 						let cls_name = result.event_info?.cls_name
 						let event_name = result.event_info?.event_name
-						tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
+						tip = result.err_info ? typeof result.err_info == 'string' ? result
+							.err_info : result
 							.err_info
 							.join('\n') : ''
 						if (result.ret == 801) {
@@ -3809,7 +3723,8 @@
 								if (pos > -1) tip = tip.substring(pos + 1);
 							}
 						}
-						if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+						if (cls_name && event_name) tip =
+							`鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
 						if (result.ret == 801) showInfo(tip)
 						else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
 						this.saving = false
@@ -4150,15 +4065,22 @@
 												.setFormItemVisible(
 													data
 												)
-										} else if (item.action_type == 'get_pre_page_subtable_next_row') {
+										} else if (item.action_type ==
+											'get_pre_page_subtable_next_row') {
 											var data = item.value;
-											const eventChannel = this.getOpenerEventChannel();
-											eventChannel.emit('get_pre_page_subtable_next_row', data);
-										} else if (item.action_type == 'remove_pre_page_subtable_row') {
+											const eventChannel = this
+												.getOpenerEventChannel();
+											eventChannel.emit(
+												'get_pre_page_subtable_next_row', data);
+										} else if (item.action_type ==
+											'remove_pre_page_subtable_row') {
 											var data = item.value;
-											const eventChannel = this.getOpenerEventChannel();
-											eventChannel.emit('remove_pre_page_subtable_row', data);
-										} else if (item.action_type == "goback_to_pre_page") {
+											const eventChannel = this
+												.getOpenerEventChannel();
+											eventChannel.emit(
+												'remove_pre_page_subtable_row', data);
+										} else if (item.action_type ==
+											"goback_to_pre_page") {
 											//杩斿洖涓婁竴椤� 											uni.navigateBack({
 												delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -4191,9 +4113,8 @@
 					}
 
 				}).catch(ex => {
+					hideLoading()
 					showError(ex, this.translateSys("error") + "8.1")
-
-
 				});
 			},
 

--
Gitblit v1.9.1