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/3018.vue | 1145 +++++++++++++++++++++++---------------------------------
1 files changed, 469 insertions(+), 676 deletions(-)
diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index 5701d19..09fd2ca 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -305,6 +305,13 @@
import {
Base64
} 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 {
@@ -375,13 +382,16 @@
mounted() {
console.log("3018 mounted");
},
+ onReady() {
+ uni.setNavigationBarTitle({
+ title: this.title
+ }); //璁剧疆椤堕儴鏍囬
+ },
onLoad(options) {
console.log("3018", 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 :
if (options.type) {
this.type = options.type;
}
@@ -390,24 +400,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, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
@@ -442,6 +442,7 @@
},
async loadData() {
try {
+ showLoading("loading...")
const param = this.param
var edit_dlg = {
Model: param.EditDlgMode,
@@ -465,18 +466,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寰楀埌瀛楀吀椤瑰垪琛�@@ -491,16 +486,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 []
}
},
@@ -521,17 +508,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) {
@@ -665,16 +643,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() {
@@ -819,24 +789,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'))
+
+
}
},
@@ -867,29 +826,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++) {
@@ -959,12 +909,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]
@@ -1270,14 +1216,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 = {
@@ -1388,16 +1328,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;
}
},
@@ -1434,31 +1366,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 = [];
@@ -1499,16 +1413,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;
}
}
@@ -1547,46 +1454,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
@@ -1598,28 +1498,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) {
@@ -1675,106 +1560,79 @@
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/>') : '';
- tip = tip || data.err_info
- 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_type == 2) {
+ .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) {
- } 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;
- var value = action.value;
- if (action_type == 'set_dlg_attr') {
- if (value) {
- this.setFormValues(value)
- }
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
}
- if (action_type == 'open_select_userdlg') {
- uni.showModal({
- title: this.translateSys('error') + " 2.2",
- content: this.translateSys(
+ }
+ try {
+ var actionlist = data.action || []
+ for (var j = 0; j < actionlist.length; j++) {
+ var action = actionlist[j];
+ var action_type = action.action_type;
+ var value = action.value;
+ if (action_type == 'set_dlg_attr') {
+ if (value) {
+ this.setFormValues(value)
+ }
+ }
+ if (action_type == 'open_select_userdlg') {
+ showInfo(this.translateSys(
"quotation_mark_left") +
action_type + this.translateSys(
"quotation_mark_right") + this
.translate(
- "tip_action_unprocessed"),
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ "tip_action_unprocessed"))
+
+ }
+ // else if (action_type == 'tip_dlg') {
+
+ // }
}
- // 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) {
- 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 => {
- // 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) {
@@ -1845,119 +1703,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/>') : '';
- tip = tip || data.err_info
- 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/>') : '';
- tip = tip || result.err_info
- if (tip) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- 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;
+ .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;
+ }
}
}
}
- 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]);
+
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
}
- 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;
+ }
+ 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'))
- } else if (typeof data.result == 'string') {
- if (data.result) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: data.result,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
+ return
}
}
- 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 => {
- 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() {
@@ -2039,96 +1876,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/>') : '';
- tip = tip || data.err_info
- 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_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;
+ .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)
+
+ }
}
- } 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 => {
- 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) {
@@ -2215,257 +2029,236 @@
// 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/>') : '';
+ .join('\n') : '';
tip = tip || data.err_info
- if (tip) uni.showModal({
- title: this.translateSys('tip'),
- content: tip,
- showCancel: false,
- confirmText: this.translateSys('close')
- });
- if (data.result_type == 2) {
+ 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')
- });
+ } 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;
- var enviroment = JSON.stringify(enviroment);
+ try {
+ var actions = data.action || []
+ for (var i = 0; i < actions.length; i++) {
+ var action = actions[i];
+ var val = action.value;
+ var enviroment = JSON.stringify(enviroment);
- if (action.action_type == 'open_panel') {
- var d = dialog({
- title: '<i class="ace-icon fa fa-info-circle"></i> ' +
- this.translateSys('tip'),
- content: this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed")
- });
- d.show();
- } else if (action.action_type == 'open_select_userdlg') {
- var style = val.style;
- // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
- var $this = this;
- var param = {
- index: index,
- iindex: iindex,
- button_callback: button_callback,
- req: req,
- data_attr: data_attr
- }
- uni.navigateTo({
- url: '../selpsn/index?mulit=false¶m=' +
- JSON
- .stringify(
- param),
- events: {
- AddPer(data, param) {
- // console.log(param);
- console.log(data);
- var callback_eventid = param
- .button_callback
- .trim();
- var info = {
- eventid: callback_eventid,
- edtype: "0",
- projectid: '',
- rclsid: '',
- robjid: '',
- userlogin: '',
- clsid: $this.param
- .clsid,
- objid: "",
- attr: param.req,
- inputparameter: data,
- dataJson: [],
- }
- $this.DataObjRunCustomEvent(info,
- param
- .data_attr);
- }
- }
- });
- } else if (action.action_type == 'open_data_query_dlg') {
- var d = dialog({
- title: '<i class="ace-icon fa fa-info-circle"></i> ' +
- this.translateSys('tip'),
- content: this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed")
- });
- d.show();
- } else if (action.action_type == 'open_common_dlg') {
- var $this = this;
- if (val.common_dlg_id == 'check_list') {
- $this.check_list = val.config;
- if (val.config.appear_style ==
- 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.popupType = 'right';
- else
- $this.popupType = 'center'
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- $this.$refs.popup.open($this.popupType);
- var popupParam = {
+ if (action.action_type == 'open_panel') {
+ var d = dialog({
+ title: '<i class="ace-icon fa fa-info-circle"></i> ' +
+ this.translateSys('tip'),
+ content: this.translateSys(
+ "quotation_mark_left") +
+ action
+ .action_type + this.translateSys(
+ "quotation_mark_right") + this
+ .translate(
+ "tip_action_unprocessed")
+ });
+ d.show();
+ } else if (action.action_type == 'open_select_userdlg') {
+ var style = val.style;
+ // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
+ var $this = this;
+ var param = {
index: index,
iindex: iindex,
button_callback: button_callback,
req: req,
data_attr: data_attr
}
- $this.popupParam = popupParam;
- }
- } else if (action.action_type ==
- 'open_project_query_dlg') {
- //console.log(action.value.select_range);
- //console.log(action.value.mulit_select);
- var priRel = '-1';
- if (action.value.select_range == '鍏ㄩ儴鐩稿叧')
- priRel = '0';
- else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰')
- priRel = '1';
- else if (action.value.select_range == '鎴戝垱寤虹殑')
- priRel = '2';
- else if (action.value.select_range == '鎴戝弬涓庣殑' || action
- .value
- .select_range == '鎴戝弬鍔犵殑')
- priRel = '3';
- else if (action.value.select_range == '鎴戝叧娉ㄧ殑')
- priRel = '4';
- else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰')
- priRel = '5';
-
- var $this = this;
- var param_ = {
- index: index,
- iindex: iindex,
- button_callback: button_callback,
- req: req
- }
- uni.navigateTo({
- url: '../selPrj/index?relation=' + priRel +
- '¶m=' +
- JSON.stringify(param_),
- events: {
- AddPer(data, param) {
- $this.classAttrList[param
- .index]
- .Attr[param
- .iindex].Value = data[0]
- .Name;
- $this.classAttrList[param
- .index]
- .Attr[param
- .iindex].ValID = data[0]
- .ID + ';' +
- data[0]
- .Name;
- var callback_eventid = param
- .button_callback
- .trim();
- if (callback_eventid) {
+ uni.navigateTo({
+ url: '../selpsn/index?mulit=false¶m=' +
+ JSON
+ .stringify(
+ param),
+ events: {
+ AddPer(data, param) {
+ // console.log(param);
+ console.log(data);
+ var callback_eventid = param
+ .button_callback
+ .trim();
var info = {
eventid: callback_eventid,
- edtype: "2",
- projectid: data[0].ID,
- rclsid: "",
- robjid: "",
- userlogin: "",
- clsid: $this.$data
- .param.clsid,
+ edtype: "0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
+ clsid: $this.param
+ .clsid,
objid: "",
attr: param.req,
+ inputparameter: data,
dataJson: [],
}
-
- $this.DataObjRunCustomEvent(
- info);
+ $this.DataObjRunCustomEvent(info,
+ param
+ .data_attr);
}
}
+ });
+ } else if (action.action_type == 'open_data_query_dlg') {
+ var d = dialog({
+ title: '<i class="ace-icon fa fa-info-circle"></i> ' +
+ this.translateSys('tip'),
+ content: this.translateSys(
+ "quotation_mark_left") +
+ action
+ .action_type + this.translateSys(
+ "quotation_mark_right") + this
+ .translate(
+ "tip_action_unprocessed")
+ });
+ d.show();
+ } else if (action.action_type == 'open_common_dlg') {
+ var $this = this;
+ if (val.common_dlg_id == 'check_list') {
+ $this.check_list = val.config;
+ if (val.config.appear_style ==
+ 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.popupType = 'right';
+ else
+ $this.popupType = 'center'
+ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+ $this.$refs.popup.open($this.popupType);
+ var popupParam = {
+ index: index,
+ iindex: iindex,
+ button_callback: button_callback,
+ req: req,
+ data_attr: data_attr
+ }
+ $this.popupParam = popupParam;
}
- });
- } else {
- var d = dialog({
- title: '<i class="ace-icon fa fa-info-circle"></i> ' +
- this.translateSys('tip'),
- content: this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed")
- });
- d.show();
+ } else if (action.action_type ==
+ 'open_project_query_dlg') {
+ //console.log(action.value.select_range);
+ //console.log(action.value.mulit_select);
+ var priRel = '-1';
+ if (action.value.select_range == '鍏ㄩ儴鐩稿叧')
+ priRel = '0';
+ else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰')
+ priRel = '1';
+ else if (action.value.select_range == '鎴戝垱寤虹殑')
+ priRel = '2';
+ else if (action.value.select_range == '鎴戝弬涓庣殑' || action
+ .value
+ .select_range == '鎴戝弬鍔犵殑')
+ priRel = '3';
+ else if (action.value.select_range == '鎴戝叧娉ㄧ殑')
+ priRel = '4';
+ else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰')
+ priRel = '5';
+
+ var $this = this;
+ var param_ = {
+ index: index,
+ iindex: iindex,
+ button_callback: button_callback,
+ req: req
+ }
+ uni.navigateTo({
+ url: '../selPrj/index?relation=' + priRel +
+ '¶m=' +
+ JSON.stringify(param_),
+ events: {
+ AddPer(data, param) {
+ $this.classAttrList[param
+ .index]
+ .Attr[param
+ .iindex].Value = data[0]
+ .Name;
+ $this.classAttrList[param
+ .index]
+ .Attr[param
+ .iindex].ValID = data[0]
+ .ID + ';' +
+ data[0]
+ .Name;
+ var callback_eventid = param
+ .button_callback
+ .trim();
+ if (callback_eventid) {
+ var info = {
+ eventid: callback_eventid,
+ edtype: "2",
+ projectid: data[0].ID,
+ rclsid: "",
+ robjid: "",
+ userlogin: "",
+ clsid: $this.$data
+ .param.clsid,
+ objid: "",
+ attr: param.req,
+ dataJson: [],
+ }
+
+ $this.DataObjRunCustomEvent(
+ info);
+ }
+ }
+ }
+ });
+ } else {
+ var d = dialog({
+ title: '<i class="ace-icon fa fa-info-circle"></i> ' +
+ this.translateSys('tip'),
+ content: this.translateSys(
+ "quotation_mark_left") +
+ action
+ .action_type + this.translateSys(
+ "quotation_mark_right") + this
+ .translate(
+ "tip_action_unprocessed")
+ });
+ 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
}
-
- } 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 => {
- 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")
+
});
},
--
Gitblit v1.9.1