From fe10cf437b17a2ea0ef63373cae2e5790ebc3930 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 31 七月 2025 18:22:52 +0800
Subject: [PATCH] action 处理

---
 pages/modal/3018.vue |   90 +++++++++++++++++++++++++++++++-------------
 1 files changed, 63 insertions(+), 27 deletions(-)

diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index 93a00e0..b365f5b 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -1,5 +1,5 @@
 <template>
-	<view class="uni-page-modal-3018">
+	<view class="uni-page-modal-3018" :class="largeMode?'large-mode':''">
 		<view class="v-area" v-for="(classattr,index) in classAttrList">
 			<div class="class_attr_title" style="display: none;">
 				<div class="title_line"></div>
@@ -304,7 +304,7 @@
 <script>
 	import {
 		Base64
-	} from  '@/js/Base64.js';
+	} from '@/js/Base64.js';
 	import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
 	import utils from "@/js/utils.js"
 	import {
@@ -338,6 +338,7 @@
 		},
 		data() {
 			return {
+				largeMode: getApp().globalData.largeMode || false,
 				title: this.translateSys('ok'),
 				editMode: false,
 				objAttr: {},
@@ -1001,12 +1002,9 @@
 				//console.log(e.target)
 				getApp().onScan((result) => {
 					console.log(result);
-					this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
-							'iindex']]
-						.Value =
-						result.decodedata;
+					this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result;
 					uni.hideKeyboard();
-					this.onevent($ele, result.decodedata);
+					this.onevent($ele, result);
 				})
 			},
 			onarrow(index, open) {
@@ -1136,14 +1134,14 @@
 
 
 			},
-			onevent(e, decodedata) {
+			onevent(e, value) {
 				// console.log(e.target);
 				var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
 					'iindex']];
-				// console.log(decodedata);
+				// console.log(value);
 				if (e.detail.value != data_attr.Value) {
 					this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value =
-						decodedata ? decodedata : e.detail.value;
+						value ? value : e.detail.value;
 					var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
 					if (eventid) {
 						// self.event_no_sub = 1;
@@ -1847,29 +1845,15 @@
 							.info
 							.join(
 								'<br/>') : '';
+						tip = tip || result.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys('tip'),
 							content: tip,
 							showCancel: false,
 							confirmText: this.translateSys('close')
 						});
-
-						var actionlist = data.action;
-						if (actionlist) {
-							console.log(actionlist);
-							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(action.value)
-								} else if (data.action[i].action_type == 'set_global_attr') {
-									$this.global_attr = data.action[i].value || [];
-								}
-							}
-						}
-
-						if (data.result_type == 2 && data.result) {
-							var result = data.result;
+						if (data.result_type == 2) {
+							var result = data.result || []
 							for (var i = 0; i < result.length; i++) {
 								for (var c = 0; c < $this.classAttrList.length; c++) {
 									var attr = $this.classAttrList[c].Attr;
@@ -1897,7 +1881,45 @@
 									}
 								}
 							}
+
+						} else if (typeof data.result == 'string') {
+							if (data.result) {
+							uni.showModal({
+								title: this.translateSys('tip'),
+								content: data.result,
+								showCancel: false,
+								confirmText: this.translateSys('close')
+							});
+							}
 						}
+						try {
+							var actionlist = data.action || [];
+							if (actionlist) {
+								console.log(actionlist);
+								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(action.value)
+									} else if (data.action[i].action_type == 'set_global_attr') {
+										$this.global_attr = data.action[i].value || [];
+									}
+								}
+							}
+						} 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')
+							});
+							console.log(ex)
+							return
+						}
+
 					}
 
 				}).catch(ex => {
@@ -2814,4 +2836,18 @@
 			transform: translateX(0);
 		}
 	}
+
+	.uni-page-modal-3018.large-mode {
+		font-size: 24px;
+
+		.tx_title,
+		.tx_title2 {
+			font-size: 24px;
+		}
+
+		.class_attr_title {
+			font-size: 24px;
+		}
+
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1