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/3018.vue | 764 ++++++++++++++++++++++++----------------------------------
1 files changed, 321 insertions(+), 443 deletions(-)
diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index 93a00e0..7cea2aa 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,14 @@
<script>
import {
Base64
- } from '@/js/Base64.js';
+ } 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 {
@@ -338,6 +345,7 @@
},
data() {
return {
+ largeMode: getApp().globalData.largeMode || false,
title: this.translateSys('ok'),
editMode: false,
objAttr: {},
@@ -389,24 +397,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, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
@@ -441,6 +439,7 @@
},
async loadData() {
try {
+ showLoading("loading...")
const param = this.param
var edit_dlg = {
Model: param.EditDlgMode,
@@ -464,18 +463,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寰楀埌瀛楀吀椤瑰垪琛�@@ -490,16 +483,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 []
}
},
@@ -520,17 +505,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) {
@@ -664,16 +640,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() {
@@ -818,24 +786,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'))
+
+
}
},
@@ -866,29 +823,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++) {
@@ -958,12 +906,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]
@@ -1001,12 +945,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 +1077,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;
@@ -1272,14 +1213,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 = {
@@ -1390,16 +1325,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;
}
},
@@ -1436,31 +1363,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 = [];
@@ -1501,16 +1410,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;
}
}
@@ -1549,46 +1451,39 @@
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 && 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
+ if (tip) {
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ } else
+ showInfo(this.translate('create_success'))
+ }
+
}
-
-
-
-
//鍒锋柊
uni.redirectTo({
url: '../modal/3018?param=' + JSON.stringify(this.$data
@@ -1600,28 +1495,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,40 +1557,42 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(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
+ 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) {
- if (data.action) {
- var actionlist = data.action;
- if (actionlist) {
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
+ }
+ }
+ try {
+ var actionlist = data.action || []
for (var j = 0; j < actionlist.length; j++) {
var action = actionlist[j];
var action_type = action.action_type;
@@ -1721,38 +1603,33 @@
}
}
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') {
// }
}
+
+ } 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
}
}
}
}).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) {
@@ -1823,94 +1700,98 @@
// 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 + ',' + 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) {
+ 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) {
+ showInfo(data.result)
+
}
}
- }
+ 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}`
+ showError(tip, this.translateSys('tip'))
- 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;
- }
- }
- }
- 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;
- }
- }
- }
+ 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() {
@@ -1992,85 +1873,73 @@
// 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 + ',' + 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')
- });
- 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;
+ .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 || [];
+ 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) {
+ showInfo(data.result)
+
+ }
}
- }
- this.add();
+ this.add();
+ }
}
}).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) {
@@ -2157,41 +2026,43 @@
// 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 + ',' + 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) {
- if (data != "") {
- var actions = data.action;
- console.log(actions);
- if (actions) {
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
+ }
+ }
+ try {
+ var actions = data.action || []
for (var i = 0; i < actions.length; i++) {
var action = actions[i];
var val = action.value;
@@ -2370,28 +2241,21 @@
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}`
+ showError(tip, this.translateSys('tip'))
+
+ return
}
- } else {
- uni.showModal({
- title: this.translateSys('tip') + "5.2",
- content: this.translate("execute_script_return_empty"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
}
}
}).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")
+
});
},
@@ -2814,4 +2678,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