From c9ecd7684e6ada47de4669885e66dc564128e89b Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 15 八月 2025 18:45:05 +0800
Subject: [PATCH] test
---
pages/modal/3018.vue | 314 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 199 insertions(+), 115 deletions(-)
diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index b6cb0e0..020e93f 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -888,8 +888,8 @@
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++) {
@@ -1002,7 +1002,7 @@
//console.log(e.target)
getApp().onScan((result) => {
console.log(result);
- this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value =result;
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result;
uni.hideKeyboard();
this.onevent($ele, result);
})
@@ -1547,46 +1547,48 @@
console.log(res);
uni.hideLoading();
let data = res.lua_result
- 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')
- });
- 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')
- });
- uni.showToast({
- title: this.translate('create_success'),
- icon: "success",
- duration: 3000
- });
+ 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')
+ });
+ return false
+ } else {
+ var tip = data.info ? typeof data.info == 'string' ? data.info : data
+ .info
+ .join(
+ '<br/>') : '';
+ 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
+ });
+ }
+
+
+
}
-
-
-
-
//鍒锋柊
uni.redirectTo({
url: '../modal/3018?param=' + JSON.stringify(this.$data
@@ -1675,11 +1677,12 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
- if (data.ret != 0) {
+ 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,
@@ -1705,10 +1708,21 @@
showCancel: false,
confirmText: this.translateSys('close')
});
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- if (data.action) {
- var actionlist = data.action;
- if (actionlist) {
+ } 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 || []
for (var j = 0; j < actionlist.length; j++) {
var action = actionlist[j];
var action_type = action.action_type;
@@ -1735,6 +1749,19 @@
// }
}
+
+ } 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
}
}
}
@@ -1821,11 +1848,12 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
+ 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,
@@ -1845,55 +1873,80 @@
.info
.join(
'<br/>') : '';
+ tip = tip || result.err_info
if (tip) uni.showModal({
title: this.translateSys('tip'),
content: tip,
showCancel: false,
confirmText: this.translateSys('close')
});
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ 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;
+ for (var j = 0; j < attr.length; j++) {
+ if (attr[j].Name == result[i].attr) {
+ attr[j].Value = result[i].value;
+ }
+ }
+ }
+ console.log($this.refdatastore)
+ var length = 0;
+ if (!$this.refdatastore.filter(function(s) {
+ return result[i].attr == s.attr
+ }).length) {
+ length = 1;
+ $this.refdatastore.push(result[i]);
+ }
+ if (length == 0) {
+ for (var j = 0; j < $this.refdatastore.length; j++) {
+ if ($this.refdatastore[j].attr == result[i]
+ .attr) {
+ $this.refdatastore[j].value = result[i]
+ .value;
+ }
+ }
+ }
+ }
- 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 || [];
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ uni.showModal({
+ title: this.translateSys('tip'),
+ content: data.result,
+ showCancel: false,
+ confirmText: this.translateSys('close')
+ });
}
}
- }
-
- if (data.result_type == 2 && data.result) {
- 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;
- for (var j = 0; j < attr.length; j++) {
- if (attr[j].Name == result[i].attr) {
- attr[j].Value = result[i].value;
+ 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 || [];
}
}
}
- console.log($this.refdatastore)
- var length = 0;
- if (!$this.refdatastore.filter(function(s) {
- return result[i].attr == s.attr
- }).length) {
- length = 1;
- $this.refdatastore.push(result[i]);
- }
- if (length == 0) {
- for (var j = 0; j < $this.refdatastore.length; j++) {
- if ($this.refdatastore[j].attr == result[i]
- .attr) {
- $this.refdatastore[j].value = result[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
}
}
}
@@ -1990,11 +2043,12 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
+ 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,
@@ -2014,36 +2068,49 @@
.info
.join(
'<br/>') : '';
+ tip = tip || data.err_info
if (tip) uni.showModal({
title: this.translateSys('tip'),
content: tip,
showCancel: false,
confirmText: this.translateSys('close')
});
- if (data.result) {
- var result = data.result;
- console.log(this.refdatastore)
- for (var i = 0; i < result.length; i++) {
- // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
- var length = 0;
- if (!this.refdatastore.filter(function(s) {
- return result[i].attr == s.attr
- }).length) {
- length = 1;
- this.refdatastore.push(result[i]);
- }
- if (length == 0) {
- for (var j = 0; j < this.refdatastore.length; j++) {
- if (this.refdatastore[j].attr == result[i].attr) {
- this.refdatastore[j].value = result[i].value;
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+ var result = data.result || [];
+ console.log(this.refdatastore)
+ for (var i = 0; i < result.length; i++) {
+ // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
+ var length = 0;
+ if (!this.refdatastore.filter(function(s) {
+ return result[i].attr == s.attr
+ }).length) {
+ length = 1;
+ this.refdatastore.push(result[i]);
+ }
+ if (length == 0) {
+ for (var j = 0; j < this.refdatastore.length; j++) {
+ if (this.refdatastore[j].attr == result[i].attr) {
+ this.refdatastore[j].value = result[i].value;
+ }
}
}
}
+
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ uni.showModal({
+ title: this.translateSys('tip'),
+ content: data.result,
+ showCancel: false,
+ confirmText: this.translateSys('close')
+ });
+ }
}
- }
- this.add();
+ this.add();
+ }
}
}).catch(ex => {
@@ -2155,7 +2222,7 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- if (data.ret != 0) {
+ if (data.ret != 0&& data.ret != 1) {
var tip = data.err_info ? typeof data.err_info == 'string' ? data
.err_info :
data
@@ -2179,17 +2246,28 @@
.info
.join(
'<br/>') : '';
+ tip = tip || data.err_info
if (tip) uni.showModal({
title: this.translateSys('tip'),
content: tip,
showCancel: false,
confirmText: this.translateSys('close')
});
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
- if (data != "") {
- var actions = data.action;
- console.log(actions);
- if (actions) {
+ } 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 actions = data.action || []
for (var i = 0; i < actions.length; i++) {
var action = actions[i];
var val = action.value;
@@ -2368,14 +2446,20 @@
d.show();
}
}
+
+ } 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
}
- } else {
- uni.showModal({
- title: this.translateSys('tip') + "5.2",
- content: this.translate("execute_script_return_empty"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
}
}
--
Gitblit v1.9.1