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 | 1249 +++++++++++++++++++++++++++--------------------------------
1 files changed, 567 insertions(+), 682 deletions(-)
diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index b910323..09fd2ca 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>
@@ -22,18 +22,20 @@
<a @tap="classAttr_extButton(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input
+ <input
:type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'"
- :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'"
- :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
- :disabled="attr.edit?false:true">
+ :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap"
+ @blur="onevent" v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex"
+ :style="{'width':attr.Width}" :disabled="attr.edit?false:true">
<!-- =='flase'?true:false -->
<textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'"
- :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" style="height:60px;"
- :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea>
+ :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex"
+ style="height:60px;" :style="{'width':attr.Width}"
+ :disabled="attr.edit?false:true"></textarea>
<textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'"
- :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" style="height:90px;"
- :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea>
+ :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex"
+ style="height:90px;" :style="{'width':attr.Width}"
+ :disabled="attr.edit?false:true"></textarea>
<!-- 鎵爜鍚庝簨浠惰繑鍥�-->
<div class="input_vallist">
<ul v-for="(inputval,vindex) in inputValList">
@@ -47,18 +49,19 @@
<p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
<input
:type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float' ?'number':'text'"
- class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent"
- v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex"
+ class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index"
+ :data-iindex="iindex"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
:disabled="attr.edit?false:true">
- <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent"
- v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex"
- style="height:60px;"
+ <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index"
+ :data-iindex="iindex" style="height:60px;"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
:disabled="attr.edit?false:true"></textarea>
- <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value" @focus="ontap" @blur="onevent"
- v-else-if="attr.Height=='3'" :data-index="index" :data-iindex="iindex"
- style="height:90px;"
+ <textarea class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index"
+ :data-iindex="iindex" style="height:90px;"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
:disabled="attr.edit?false:true"></textarea>
<div class="text-right2" v-if="attr.ext_button==true">
@@ -153,7 +156,8 @@
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
- <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex"
+ <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"
+ :data-index="index" :data-iindex="iindex"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
disabled="true" :maxlength="-1">
<div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'">
@@ -179,12 +183,13 @@
<a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
- :maxlength="-1">
+ <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ :style="{'width':attr.Width}" disabled="true" :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
- <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"
+ :value="attr.Value"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
disabled="true" :maxlength="-1">
<div class="text-right2">
@@ -203,12 +208,13 @@
<a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i
class="ace-icon fa fa-plus-circle"></i></a>
</div>
- <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
- :maxlength="-1">
+ <input type="text" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ :style="{'width':attr.Width}" disabled="true" :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
- <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :value="attr.Value"
+ <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"
+ :value="attr.Value"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
disabled="true" :maxlength="-1">
<div class="text-right2">
@@ -223,12 +229,14 @@
<view v-if="classattr.control_style=='涓婁笅甯冨眬'">
<text class="tx_title">{{attr.DispName}}:<i class="i_tishi"
v-if="attr.notempty==true">*</i></text>
- <input type="text" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
- :disabled="attr.edit?false:true" :maxlength="-1">
+ <input type="text" :class="attr.edit?'':'input-disabled'" :data-index="index"
+ :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"
+ :maxlength="-1">
</view>
<view v-if="classattr.control_style=='宸﹀彸甯冨眬'">
<p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
- <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'" :data-index="index" :data-iindex="iindex"
+ <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"
+ :data-index="index" :data-iindex="iindex"
:style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"
:disabled="attr.edit?false:true" :maxlength="-1">
<i class="i_tishi" v-if="attr.notempty==true">*</i>
@@ -257,7 +265,8 @@
</view>
- <view class="v-bottom"><button type="primary" @tap="ok" class="btn_add">{{title}}</button>
+ <view class="v-bottom">
+ <button type="default" @click="onClickOK" class="btn_add">{{title}}</button>
<button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button>
</view>
@@ -266,8 +275,9 @@
<uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange">
<view class="popup-header">{{check_list.title}}</view>
<view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }"
- :style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}">
- <view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}">
+ :style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}">
+ <view class="popup-cont"
+ :style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}">
<view class="view_popup_CheckList" v-for="(item,index) in check_list.items">
<checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check"
:data-index="index" :style="{'margin-left': '10rpx'}">
@@ -292,7 +302,16 @@
</template>
<script>
- import Base64 from '../../components/js-base64/base64.js'
+ 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 {
@@ -309,24 +328,24 @@
classAttrList,
} from "@/api/index.js"
+ import buttonClickMixin from '@/mixins/button-click.js';
export default {
- modules: {
- Base64,
- },
+ mixins: [buttonClickMixin],
components: {
pickerAddress
},
onBackPress(e) {
// console.log("鐩戝惉杩斿洖鎸夐挳浜嬩欢",e);
if (this.type) {
- var eventChannel = this.$scope.eventChannel;
+ const eventChannel = this.getOpenerEventChannel();
// const eventChannel = this.getOpenerEventChannel();
eventChannel.emit(this.type, "");
}
},
data() {
return {
+ largeMode: getApp().globalData.largeMode || false,
title: this.translateSys('ok'),
editMode: false,
objAttr: {},
@@ -363,45 +382,38 @@
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.$data.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //璁剧疆鎸夐挳鏂囧瓧
+ this.title = options.titlename; //璁剧疆鎸夐挳鏂囧瓧param.Add_BtnName ? param.Add_BtnName :
if (options.type) {
- this.$data.type = options.type;
+ this.type = options.type;
}
this.editMode = options.editMode ? true : false;
if (options.objAttr)
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('cancel')
- });
+ 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('cancel')
- });
+ showError(this.translate('function_not_edit_dlg'), this.translateSys("tip"))
uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
return;
}
- this.$data.param = param;
+ this.param = param;
this.loadData()
},
@@ -430,6 +442,7 @@
},
async loadData() {
try {
+ showLoading("loading...")
const param = this.param
var edit_dlg = {
Model: param.EditDlgMode,
@@ -451,20 +464,14 @@
}
}
}
- $this.$data.classAttrList = result;
+ $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("cancel")
- });
+ hideLoading()
+ showError(ex, this.translateSys('error') + " 1")
+
}
},
async DictItemGetList(attr) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛�@@ -479,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('cancel')
- });
+ showError(ex, this.translateSys('error') + " 1.3")
+
return []
}
},
@@ -505,21 +504,12 @@
const result = await getUIStyleInfo(gridstyleInfo)
var styledef = Base64.decode(result.style_def);
result.style_def = JSON.parse(styledef);
- $this.$data.classGridStyle = result
+ $this.classGridStyle = result
$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('cancel')
- });
+ showError(ex, this.translateSys('error') + " 1.4")
+
}
},
async loadFormData(objAttr) {
@@ -536,13 +526,10 @@
attr: "state",
value: info.state
}]
- info.attr_list.forEach(({
- name,
- value
- }) => {
+ info.attr_list.forEach((attr) => {
attrs.push({
- attr: name,
- value: value
+ attr: attr.name,
+ value: attr.value
})
});
this.setFormValues(attrs)
@@ -561,15 +548,15 @@
async viewParam() { //灏唌obox3灏忓啓鍙傛暟杞崲涓簃obox2澶у啓鍙傛暟
try {
var class_gridStyle = {
- ID: this.$data.classGridStyle.id,
- Name: this.$data.classGridStyle.name,
- Type: this.$data.classGridStyle.type,
- IsDefault: this.$data.classGridStyle.is_defaul,
- StyleDef: this.$data.classGridStyle.style_def,
+ ID: this.classGridStyle.id,
+ Name: this.classGridStyle.name,
+ Type: this.classGridStyle.type,
+ IsDefault: this.classGridStyle.is_defaul,
+ StyleDef: this.classGridStyle.style_def,
};
- this.$data.classGridStyle = class_gridStyle;
+ this.classGridStyle = class_gridStyle;
var class_attrList = [];
- this.$data.classAttrList.forEach(data => {
+ this.classAttrList.forEach(data => {
var attrs = [];
if (data.attr_list) {
data.attr_list.forEach(attr => {
@@ -650,35 +637,27 @@
Attr: attrs
});
});
- this.$data.classAttrList = class_attrList;
- // console.log(this.$data.classGridStyle);
- // console.log(this.$data.classAttrList);
+ this.classAttrList = class_attrList;
+ // console.log(this.classGridStyle);
+ // console.log(this.classAttrList);
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("cancel")
- });
+ showError(ex, this.translateSys('error'))
+
}
},
async class_attr_init() {
try {
- var attrlist = this.$data.classGridStyle.StyleDef.show_style
+ var attrlist = this.classGridStyle.StyleDef.show_style
var newattrlist = [];
- if (this.$data.classAttrList.length > 0) {
+ if (this.classAttrList.length > 0) {
for (var i = 0; i < attrlist.length; i++) {
var open = attrlist[i].open;
var name = attrlist[i].attrgroup_name;
var attrs = attrlist[i].attrs;
- for (var s = 0; s < this.$data.classAttrList.length; s++) {
- var clsattr = this.$data.classAttrList[s];
+ for (var s = 0; s < this.classAttrList.length; s++) {
+ var clsattr = this.classAttrList[s];
// if (name == clsattr.Name) {
var attr = [];
for (var j = 0; j < attrs.length; j++) {
@@ -745,19 +724,19 @@
Order: clsattr.Order,
Open: open,
Attr: attr,
- control_style: this.$data.classGridStyle.StyleDef.control_style,
- title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith
+ control_style: this.classGridStyle.StyleDef.control_style,
+ title_p_wdith: this.classGridStyle.StyleDef.title_p_wdith
})
// }
}
}
if (newattrlist.length > 0) {
- this.$data.classAttrList = newattrlist;
+ this.classAttrList = newattrlist;
}
var req = [];
- if (this.$data.classGridStyle.StyleDef) {
- if (this.$data.classGridStyle.StyleDef.show_style.length > 0) {
- var attrlist = this.$data.classGridStyle.StyleDef.show_style
+ if (this.classGridStyle.StyleDef) {
+ if (this.classGridStyle.StyleDef.show_style.length > 0) {
+ var attrlist = this.classGridStyle.StyleDef.show_style
// $el.find('.attr_field').prop('readonly', true);
// $el.find('.attr_field').prop('disabled', true);
for (var i = 0; i < attrlist.length; i++) {
@@ -773,26 +752,26 @@
}
}
- var eventlist = this.$data.classGridStyle.StyleDef.event;
+ var eventlist = this.classGridStyle.StyleDef.event;
// console.log(eventlist);
if (eventlist) {
if (eventlist.length > 0) {
for (var i = 0; i < eventlist.length; i++) {
if (eventlist[i].event_id == 'before_ok') {
- this.$data.edit_ok_event = eventlist[i];
+ this.edit_ok_event = eventlist[i];
} else if (eventlist[i].event_id == 'initial') {
- this.$data.edit_inital_event = eventlist[i];
+ this.edit_inital_event = eventlist[i];
} else if (eventlist[i].event_id == 'before_select_compose') {
- this.$data.edit_select_compose_event = eventlist[i].scrip_id;
- this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id;
+ this.edit_select_compose_event = eventlist[i].scrip_id;
+ this.edit_compose_cls_id = eventlist[i].compose_cls_id;
}
}
}
}
await this.loadFormData(this.objAttr)
// console.log(req);
- if (this.$data.edit_inital_event) {
- var eventid = this.$data.edit_inital_event.scrip_id;
+ if (this.edit_inital_event) {
+ var eventid = this.edit_inital_event.scrip_id;
var info = {
eventid: eventid,
edtype: "0",
@@ -800,49 +779,38 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
+ clsid: this.param.clsid,
objid: "",
attr: req,
}
this.ini_DataObjRunCustomEvent(info);
}
- console.log(this.$data.classGridStyle);
- console.log(this.$data.classAttrList);
+ console.log(this.classGridStyle);
+ console.log(this.classAttrList);
} else {
- uni.showModal({
- title: this.translateSys('tip'),
- content: this.translate('no_find_attr_diaplay'),
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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("cancel")
- });
+ showError(ex, this.translateSys('error'))
+
+
}
},
classAttr_extButton(index, iindex) { //寮规灞傛樉绀�type:top bottom center left right
var $this = this;
- $this.$data.popupType = 'right'
+ $this.popupType = 'right'
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
$this.$refs.popup.open($this.popupType);
- var data_attr = $this.$data.classAttrList[index].Attr[iindex];
+ var data_attr = $this.classAttrList[index].Attr[iindex];
// var value = action.value;
// var action ={"action_type":"open_common_dlg","value":{"common_dlg_id":"check_list","config":{"title":"鐢熶骇宸ュ崟","appear_style":"sideslip","width":250,"multiple_choice":"1","items":[{"id":"133D50D7-D798-4D2E-A15F-308365092DF5","name":"5100691673", "check":false},{"id":"22992021-7D3B-4959-86B7-EF184B596AC6","name":"5100691674", "check":false},{"id":"48FBBE8E-594D-45D5-8C24-385C661C4A1C","name":"5100691675", "check":false},{"id":"4E429C60-325A-42ED-BEA3-B3397C07CCA1","name":"5100691668", "check":false}]}}}
// if (action.action_type == 'open_common_dlg') {
// var value = action.value;
// if(value.common_dlg_id == 'check_list'){
- // $this.$data.check_list= value.config;
+ // $this.check_list= value.config;
// }
// }
// var popupParam={
@@ -852,57 +820,39 @@
// req:"",
// data_attr:data_attr
// }
- // $this.$data.popupParam= popupParam;
+ // $this.popupParam= popupParam;
// return;
- var before_click_button = $this.$data.classAttrList[index].Attr[iindex]
+ var before_click_button = $this.classAttrList[index].Attr[iindex]
.before_click_button;
- var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback;
+ 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('cancel')
- });
+ 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('cancel')
- });
+ 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.$data.classAttrList
- .length; a++) {
- for (var l = 0; l < this.$data
- .classAttrList[a]
- .Attr
- .length; l++) {
- var ca = this.$data.classAttrList[a]
- .Attr[l];
+ for (var a = 0; a < this.classAttrList.length; a++) {
+ for (var l = 0; l < this.classAttrList[a].Attr.length; l++) {
+ var ca = this.classAttrList[a].Attr[l];
let curIndex = data.findIndex((attr) => {
return attr.attr == ca.Name;
})
if (curIndex > -1) {
const attr = data[curIndex]
- if (utils.classUtils
- .attrTypeIsDict(ca
- .Type)) {
+ if (utils.classUtils.attrTypeIsDict(ca.Type)) {
var dictItemList = [];
- for (var d in attr
- .choice_list) {
- var list_val = attr
- .choice_list[d];
+ for (var d in attr.choice_list) {
+ var list_val = attr.choice_list[d];
dictItemList.push({
"CN_S_NAME": list_val,
"Name": list_val,
@@ -916,35 +866,8 @@
} else {
ca.Value = attr.value;
}
-
-
-
}
- }
- }
-
- for (var i = 0; i < value.length; i++) {
-
- var length = 0;
- if (!this.$data.refdatastore.filter(function(
- s) {
- return data[i].attr == s.attr
- }).length) {
- length = 1;
- this.$data.refdatastore.push(data[i]);
- }
- if (length == 0) {
- for (var j = 0; j < this.$data.refdatastore
- .length; j++) {
- if (this.$data.refdatastore[j].attr ==
- data[i]
- .attr) {
- this.$data.refdatastore[j].value =
- data[i]
- .value;
- }
- }
}
}
},
@@ -955,15 +878,15 @@
// console.log(e.target.dataset);
var index = e.target.dataset.index;
var ischeck = e.target.dataset.ischeck;
- var data = this.$data.check_list.items;
- // this.$data.check_list.items=[];
- if (this.$data.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫�+ var data = this.check_list.items;
+ // this.check_list.items=[];
+ if (this.check_list.multiple_choice == "0") { //鍒ゆ柇鏃跺崟閫夎繕鏄閫� for (var i in data) {
data[i].check = false;
}
}
data[index].check = ischeck ? false : true;
- this.$data.check_list.items = data;
+ this.check_list.items = data;
},
popup_cancel(e) { //寮规鍙栨秷
@@ -971,7 +894,7 @@
},
popup_sava(e) { //寮规纭畾
var $this = this;
- var items = $this.$data.check_list.items;
+ var items = $this.check_list.items;
var data = [];
var name = "";
for (var i = 0; i < items.length; i++) {
@@ -985,20 +908,16 @@
});
}
}
- if (!$this.$data.popupParam) {
- uni.showModal({
- title: this.translateSys('tip'),
- content: "popupParam涓虹┖锛�,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ if (!$this.popupParam) {
+ showInfo("popupParam涓虹┖锛�)
+
return;
}
- $this.$data.classAttrList[$this.$data.popupParam.index].Attr[$this.$data.popupParam.iindex]
+ $this.classAttrList[$this.popupParam.index].Attr[$this.popupParam.iindex]
.Value =
name;
console.log(data);
- var callback_eventid = $this.$data.popupParam.button_callback.trim();
+ var callback_eventid = $this.popupParam.button_callback.trim();
var info = {
eventid: callback_eventid,
edtype: "0",
@@ -1006,17 +925,17 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: $this.$data.param.clsid,
+ clsid: $this.param.clsid,
objid: "",
- attr: $this.$data.popupParam.req,
+ attr: $this.popupParam.req,
dataJson: data
}
- $this.DataObjRunCustomEvent(info, $this.$data.popupParam.data_attr);
+ $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr);
this.$refs.popup.close();
},
cancel(e) {
if (this.type) {
- var eventChannel = this.$scope.eventChannel;
+ const eventChannel = this.getOpenerEventChannel();
// const eventChannel = this.getOpenerEventChannel();
eventChannel.emit(this.type, "");
}
@@ -1029,48 +948,44 @@
//console.log(e.target)
getApp().onScan((result) => {
console.log(result);
- this.$data.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) {
// console.log(index+'--'+open);
- this.$data.classAttrList[index].Open = open == true ? false : true;
+ this.classAttrList[index].Open = open == true ? false : true;
},
ondateTime(e) {
//console.log(e.target)
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
.Value = e
.target
.value;
},
onchange(e) {
// console.log(e.target);
- var value = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ var value = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']]
- .dictitem[e
- .target.value];
- var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ .dictitem[e.detail.value];
+ var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']];
// console.log(data_attr);
if (value.Name != data_attr.Value) {
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
.Value =
value
.Name;
- // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
- var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target
+ // console.log(this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
+ var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target
.dataset[
'iindex']]
.action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1085,7 +1000,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
+ clsid: this.param.clsid,
objid: "",
attr: req,
dataJson: []
@@ -1102,10 +1017,10 @@
//涓虹┖鏃讹紝娓呯┖灞炴�value
if (item.length == 0) {
var index, iindex, dindex = 0;
- for (var i in this.$data.classAttrList) {
- for (var j in this.$data.classAttrList[i].Attr) {
- if (delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name) {
- this.$data.classAttrList[i].Attr[j].Value = "";
+ for (var i in this.classAttrList) {
+ for (var j in this.classAttrList[i].Attr) {
+ if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) {
+ this.classAttrList[i].Attr[j].Value = "";
}
}
}
@@ -1113,26 +1028,26 @@
for (var v in item) {
var index, iindex, dindex = 0;
- for (var i in this.$data.classAttrList) {
- for (var j in this.$data.classAttrList[i].Attr) {
- if (item[v].attr == this.$data.classAttrList[i].Attr[j].Name) {
+ for (var i in this.classAttrList) {
+ for (var j in this.classAttrList[i].Attr) {
+ if (item[v].attr == this.classAttrList[i].Attr[j].Name) {
index = i;
iindex = j;
}
}
}
var itemvalue = item[v];
- var data_attr = this.$data.classAttrList[index].Attr[iindex];
+ var data_attr = this.classAttrList[index].Attr[iindex];
// console.log(data_attr);
if (itemvalue.Name != data_attr.Value) {
- this.$data.classAttrList[index].Attr[iindex].Value = value;
- // console.log(this.$data.classAttrList[index].Attr[iindex].Value);
- var eventid = this.$data.classAttrList[index].Attr[iindex].action;
+ this.classAttrList[index].Attr[iindex].Value = value;
+ // console.log(this.classAttrList[index].Attr[iindex].Value);
+ var eventid = this.classAttrList[index].Attr[iindex].action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1153,7 +1068,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
+ clsid: this.param.clsid,
objid: "",
attr: req,
dataJson: [],
@@ -1165,23 +1080,19 @@
},
- onevent(e, decodedata) {
+ onevent(e, value) {
// console.log(e.target);
- var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']];
- // console.log(decodedata);
- if (e.target.value != data_attr.Value) {
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
- .Value =
- decodedata ? decodedata : e.target.value;
- var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target
- .dataset[
- 'iindex']]
- .action;
+ // console.log(value);
+ if (e.detail.value != data_attr.Value) {
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].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;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1196,7 +1107,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
+ clsid: this.param.clsid,
objid: "",
attr: req,
dataJson: [],
@@ -1209,21 +1120,18 @@
oncheck(e) {
// console.log(e.target);
var ischecked = e.target.dataset.ischeck ? false : true;
- var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
+ var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
'iindex']];
// console.log(data_attr);
if (ischecked != data_attr.Value) {
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
.Value =
ischecked;
- var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target
- .dataset[
- 'iindex']]
- .action;
+ var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
if (eventid) {
// self.event_no_sub = 1;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1238,7 +1146,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
+ clsid: this.param.clsid,
objid: "",
attr: req,
dataJson: [],
@@ -1250,13 +1158,13 @@
},
inputValListIsDel(index) {
// console.log(index);
- this.$data.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�- // console.log(this.$data.inputValList);
+ this.inputValList.splice(index, 1); //鍒犻櫎tabPagejson鐨勫唴瀹�+ // console.log(this.inputValList);
},
addresschange(e) {
// console.log(e.target);
console.log(e.data.join(';'))
- this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
+ this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]
.Value = e.data
.join(
';');
@@ -1273,14 +1181,14 @@
AddPer(data, param) {
// console.log(param);
console.log(data);
- $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[
+ $this.classAttrList[param.index].Attr[param.iindex].Value = data[
0].Name;
- $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[
+ $this.classAttrList[param.index].Attr[param.iindex].ValID = data[
0]
.Login + ';' +
data[0].Name;
- var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex]
+ var eventid = $this.classAttrList[param.index].Attr[param.iindex]
.action;
if (eventid) {
eventid = eventid.trim();
@@ -1292,13 +1200,13 @@
rclsid: "",
robjid: "",
userlogin: data[0].Login,
- clsid: $this.$data.param.clsid,
+ clsid: $this.param.clsid,
objid: "",
attr: [],
dataJson: [],
}
- // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex];
+ // var data_attr = $this.classAttrList[param.index].Attr[param.iindex];
$this.DataObjRunCustomEvent(info);
}
}
@@ -1308,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('cancel')
- });
- // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value];
- // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
+ showInfo(this.translateSys('unrealized'))
+
},
classAttr_AddPrj(index, iindex) {
var param = {
@@ -1329,14 +1231,14 @@
AddPer(data, param) {
// console.log(param);
// console.log(data);
- $this.$data.classAttrList[param.index].Attr[param.iindex].Value = data[
+ $this.classAttrList[param.index].Attr[param.iindex].Value = data[
0].Name;
- $this.$data.classAttrList[param.index].Attr[param.iindex].ValID = data[
+ $this.classAttrList[param.index].Attr[param.iindex].ValID = data[
0].ID +
';' +
data[0].Name;
- var eventid = $this.$data.classAttrList[param.index].Attr[param.iindex]
+ var eventid = $this.classAttrList[param.index].Attr[param.iindex]
.action;
if (eventid) {
eventid = eventid.trim();
@@ -1348,13 +1250,13 @@
rclsid: "",
robjid: "",
userlogin: "",
- clsid: $this.$data.param.clsid,
+ clsid: $this.param.clsid,
objid: "",
attr: [],
dataJson: [],
}
- // var data_attr = $this.$data.classAttrList[param.index].Attr[param.iindex];
+ // var data_attr = $this.classAttrList[param.index].Attr[param.iindex];
$this.DataObjRunCustomEvent(info);
}
}
@@ -1364,36 +1266,45 @@
},
getPostDataObjAttr() {
var req = [];
- var attrlist = this.$data.classAttrList;
+ const $this = this
+ var attrlist = $this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
var ar = attr[j];
- if (ar.Value == this.translateSys("select") || ar.Value == '鈥斺�' + this
- .translateSys(
- "select") + '鈥斺�') ar.Value = '';
- req.push(this.formatAttr(ar));
+ if (ar.Value == $this.translateSys("select") ||
+ ar.Value == '鈥斺�' + $this.translateSys("select") + '鈥斺�')
+ ar.Value = '';
+ req.push($this.formatAttr(ar));
}
}
- if (this.$data.refdatastore.length > 0) {
- for (var i = 0; i < this.$data.refdatastore.length; i++) {
- if (!req.filter(function(s) {
- return this.$data.refdatastore[i].attr == s.name
- }).length) {
- length = 1;
+
+ if ($this.refdatastore.length > 0) {
+ for (var i = 0; i < $this.refdatastore.length; i++) {
+ if (!req.filter((s) => {
+ return $this.refdatastore[i].attr == s.name;
+ }).length > 0) {
req.push({
- 'attr': this.$data.refdatastore[i].attr,
- 'val': this.$data.refdatastore[i].value
+ 'attr': $this.refdatastore[i].attr,
+ 'val': $this.refdatastore[i].value
});
}
}
}
-
+ console.log(req, $this.refdatastore)
var obj_attr = {};
req.forEach(item => {
obj_attr[item.attr] = item.value;
});
+
+ console.log(obj_attr)
return obj_attr
+ },
+ onClickOK() {
+ this.handleButtonClick(async (done) => {
+ await this.ok()
+ done(); // 閲嶇疆鐘舵�
+ });
},
//纭畾
async ok() {
@@ -1403,18 +1314,22 @@
mask: true
});
this.okLoading = true
+
var obj_attr = this.getPostDataObjAttr();
+ console.log(obj_attr)
let ret = await this.sava();
this.okLoading = false
uni.hideLoading();
if (!ret) return;
- obj_attr.id = this.objId;
- const eventChannel = this.$scope.eventChannel;
+ obj_attr.id = this.objId || "";
+ const eventChannel = this.getOpenerEventChannel();
// const eventChannel = this.getOpenerEventChannel();
eventChannel.emit(this.type, obj_attr);
uni.navigateBack()
} catch (ex) {
+ showError(ex, this.translateSys('error') + " 6.1")
+
return false;
}
},
@@ -1425,7 +1340,7 @@
// let ret = await this.OKDataObjRunCustomEvent();
// if (!ret) return false;
- if (this.$data.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚�+ if (this.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚� ret = await this.OKDataObjRunCustomEvent();
if (!ret) return false;
@@ -1440,7 +1355,7 @@
} else {
// let ret = await this.OKDataObjRunCustomEvent();
// if (!ret) return false;
- if (this.$data.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚�+ if (this.edit_ok_event) { // 鐐瑰嚮纭畾鎸夐挳鍚� ret = await this.OKDataObjRunCustomEvent();
if (!ret) return false;
} else {
@@ -1451,25 +1366,17 @@
}
return true;
} catch (ex) {
+ showError(ex, this.translateSys('error') + " 5.1")
return false;
}
},
- // async sava() {
- // try {
- // if (this.$data.edit_ok_event)
- // this.OKDataObjRunCustomEvent();
- // else
- // this.add();
- // } catch (ex) {
- // return false;
- // }
- // },
+
async add() {
try {
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1506,27 +1413,20 @@
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('cancel')
- });
+ showInfo(this.translateSys('quotation_mark_left') + ar.DispName +
+ this.translateSys('quotation_mark_right') + this.translate("cannot_empty"))
+
return;
}
}
}
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: this.translateSys('add2'),
master: {
- cls_id: this.$data.param.clsid,
+ cls_id: this.param.clsid,
}
};
@@ -1536,7 +1436,7 @@
obj_attr[item.name] = item.value;
});
var dataInfo = {
- class_id: this.$data.param.clsid,
+ class_id: this.param.clsid,
class_name: '',
master_cls_id: '',
master_obj_id: '',
@@ -1554,93 +1454,71 @@
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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
- 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('cancel')
- });
- 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
.param) +
- "&titlename=" + this.$data.title
+ "&titlename=" + this.title
});
// this.cancel();
}).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('cancel')
- });
+ 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('cancel')
- });
+ showError(ex, this.translateSys('error') + " 4.1")
+
}
},
ini_DataObjRunCustomEvent(info) {
var param = {
- EditStyle: this.$data.param.Edit_dlg.Name,
- ViewStyle: this.$data.param.Edit_dlg.Name,
+ EditStyle: this.param.Edit_dlg.Name,
+ ViewStyle: this.param.Edit_dlg.Name,
NotTriggerSysEvent: 0,
enviroment: {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: this.translateSys('add2'),
master: {
- cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id
+ cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
}
}
@@ -1682,40 +1560,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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ .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;
@@ -1726,56 +1606,51 @@
}
}
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('cancel')
- });
+ 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('cancel')
- });
+ showError(ex, this.translateSys('error') + " 2.1")
+
});
},
DataObjRunCustomEvent(info, data_attr) {
var $this = this;
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: this.translateSys('add2'),
master: {
- cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id
+ cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
}
};
if (data_attr) {
enviroment.edit_dlg = {
type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d
+ class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d
}
if (data_attr) {
enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -1794,10 +1669,10 @@
// edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''),
// rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid,
// attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: "",
- // global_attr: JSON.stringify(this.$data.global_attr), dataJson:JSON.stringify(info.dataJson)
+ // global_attr: JSON.stringify(this.global_attr), dataJson:JSON.stringify(info.dataJson)
// }
enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
if (info.dataJson)
info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var obj_attr = {};
@@ -1828,111 +1703,115 @@
// 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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ .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.$data.global_attr = data.action[i].value || [];
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
}
}
- }
-
- if (data.result) {
- var result = data.result;
- for (var i = 0; i < result.length; i++) {
- for (var c = 0; c < $this.$data.classAttrList.length; c++) {
- var attr = $this.$data.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 || [];
}
}
}
+ } 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'))
- var length = 0;
- if (!$this.$data.refdatastore.filter(function(s) {
- return result[i].attr == s.attr
- }).length) {
- length = 1;
- $this.$data.refdatastore.push(result[i]);
- }
- if (length == 0) {
- for (var j = 0; j < $this.$data.refdatastore.length; j++) {
- if ($this.$data.refdatastore[j].attr == result[i]
- .attr) {
- $this.$data.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('cancel')
- });
+
+ showError(ex, this.translateSys('error') + " 3.1")
+
});
},
async OKDataObjRunCustomEvent() {
try {
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: this.translateSys('add2'),
master: {
- cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id
+ cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id
}
};
- var eventid = this.$data.edit_ok_event.scrip_id;
+ var eventid = this.edit_ok_event.scrip_id;
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -1943,15 +1822,15 @@
req.push(this.formatAttr(ar));
}
}
- if (this.$data.refdatastore.length > 0) {
- for (var i = 0; i < this.$data.refdatastore.length; i++) {
+
+ if (this.refdatastore.length > 0) {
+ for (var i = 0; i < this.refdatastore.length; i++) {
if (!req.filter(function(s) {
- return this.$data.refdatastore[i].attr == s.name
+ return this.refdatastore[i].attr == s.name
}).length) {
- length = 1;
req.push({
- 'attr': this.$data.refdatastore[i].attr,
- 'val': this.$data.refdatastore[i].value
+ 'attr': this.refdatastore[i].attr,
+ 'val': this.refdatastore[i].value
});
}
}
@@ -1963,12 +1842,12 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: this.$data.param.clsid,
- objid: this.$data.param.objid,
+ clsid: this.param.clsid,
+ objid: this.param.objid,
attr: req,
}
enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var obj_attr = {};
info.attr.forEach(item => {
obj_attr[item.attr] = item.value;
@@ -1997,97 +1876,88 @@
// 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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ .join('\n') : '';
+ tip = tip || data.err_info
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
- var result = data.result;
- 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.$data.refdatastore.filter(function(s) {
- return result[i].attr == s.attr
- }).length) {
- length = 1;
- this.$data.refdatastore.push(result[i]);
- }
- if (length == 0) {
- for (var j = 0; j < this.$data.refdatastore.length; j++) {
- if (this.$data.refdatastore[j].attr == result[i].attr) {
- this.$data.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;
+ }
+ }
}
}
- }
- }
- this.add();
+ } else if (typeof data.result == 'string') {
+ if (data.result) {
+ showInfo(data.result)
+
+ }
+ }
+
+
+ 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('cancel')
- });
+ 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('cancel')
- });
+ showError(ex, this.translateSys('error') + " 4.1")
}
},
DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.$data.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ cls_id: this.param.clsid, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇� 'button': 'top', // top/bottom
button_name: this.translateSys('add2'),
master: {
- cls_id: this.$data.param.clsid, // button=bottom鏃�master鐨刢ls_id
+ cls_id: this.param.clsid, // button=bottom鏃�master鐨刢ls_id
//obj_id: '' // button=bottom鏃�master鐨刼bj_id
}
};
var req = [];
- var attrlist = this.$data.classAttrList;
+ var attrlist = this.classAttrList;
for (var i = 0; i < attrlist.length; i++) {
var attr = attrlist[i].Attr;
for (var j = 0; j < attr.length; j++) {
@@ -2095,15 +1965,15 @@
req.push(this.formatAttr(ar))
}
}
- if (this.$data.refdatastore.length > 0) {
- for (var i = 0; i < this.$data.refdatastore.length; i++) {
+ if (this.refdatastore.length > 0) {
+ for (var i = 0; i < this.refdatastore.length; i++) {
if (!req.filter(function(s) {
- return this.$data.refdatastore[i].attr == s.name
+ return this.refdatastore[i].attr == s.name
}).length) {
length = 1;
req.push({
- 'attr': this.$data.refdatastore[i].attr,
- 'val': this.$data.refdatastore[i].value
+ 'attr': this.refdatastore[i].attr,
+ 'val': this.refdatastore[i].value
});
}
}
@@ -2111,7 +1981,7 @@
var extinfo = enviroment;
extinfo.edit_dlg = {
type: 'small', //灏忕獥鍙�- class_id: this.$data.param.clsid, //褰撳墠鏁版嵁绫籭d
+ class_id: this.param.clsid, //褰撳墠鏁版嵁绫籭d
}
if (data_attr) {
extinfo.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�@@ -2126,11 +1996,11 @@
}
// var dataInfo = {
// edtype: "0", eventid: eventid, projectid: '',rclsid: '', robjid: '', userlogin: '',
- // clsid: this.$data.param.clsid, objid: '',attr: JSON.stringify(req),
- // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.$data.global_attr)
+ // clsid: this.param.clsid, objid: '',attr: JSON.stringify(req),
+ // extinfo: JSON.stringify(extinfo), global_attr: JSON.stringify(this.global_attr)
// }
extinfo = Base64.encode(JSON.stringify(extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var global_attr = Base64.encode(JSON.stringify(this.global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
var obj_attr = {};
req.forEach(item => {
obj_attr[item.attr] = item.value;
@@ -2139,7 +2009,7 @@
var dataInfo = {
ed_type: "0",
start_transaction: '',
- class_id: this.$data.param.clsid,
+ class_id: this.param.clsid,
class_name: '',
event_id: eventid,
event_name: '',
@@ -2159,41 +2029,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('cancel')
- });
- else uni.showModal({
- title: this.translateSys('tip'),
- content: tip + ',' + this.translateSys('tip') + ':' + data
- .ret,
- showCancel: false,
- confirmText: this.translateSys('cancel')
- });
+ 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('cancel')
- });
+ .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;
@@ -2242,7 +2114,7 @@
rclsid: '',
robjid: '',
userlogin: '',
- clsid: $this.$data.param
+ clsid: $this.param
.clsid,
objid: "",
attr: param.req,
@@ -2271,14 +2143,14 @@
} else if (action.action_type == 'open_common_dlg') {
var $this = this;
if (val.common_dlg_id == 'check_list') {
- $this.$data.check_list = val.config;
+ $this.check_list = val.config;
if (val.config.appear_style ==
'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.$data.popupType = 'right';
+ $this.popupType = 'right';
else
- $this.$data.popupType = 'center'
+ $this.popupType = 'center'
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- $this.$refs.popup.open($this.$data.popupType);
+ $this.$refs.popup.open($this.popupType);
var popupParam = {
index: index,
iindex: iindex,
@@ -2286,7 +2158,7 @@
req: req,
data_attr: data_attr
}
- $this.$data.popupParam = popupParam;
+ $this.popupParam = popupParam;
}
} else if (action.action_type ==
'open_project_query_dlg') {
@@ -2321,12 +2193,12 @@
JSON.stringify(param_),
events: {
AddPer(data, param) {
- $this.$data.classAttrList[param
+ $this.classAttrList[param
.index]
.Attr[param
.iindex].Value = data[0]
.Name;
- $this.$data.classAttrList[param
+ $this.classAttrList[param
.index]
.Attr[param
.iindex].ValID = data[0]
@@ -2372,28 +2244,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('cancel')
- });
}
}
}).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('cancel')
- });
+ showError(ex, this.translateSys('tip') + "5.1")
+
});
},
@@ -2512,9 +2377,11 @@
right: 30rpx;
font-size: 60rpx;
}
+
.input-disabled {
background-color: #f3f3f3 !important;
}
+
input::-webkit-input-placeholder {
font-size: 12rpx;
}
@@ -2658,8 +2525,10 @@
margin-top: 50rpx;
padding: 20rpx;
line-height: 1.5;
+ // background: #fff;
+ // border: 1px solid #dcdee2;
+ // color: #000;
background: #fff;
- border: none;
color: #000;
font-size: 38rpx;
font-weight: bold;
@@ -2732,7 +2601,7 @@
.popup-footer {
float: right;
position: absolute;
- bottom: 0;
+ bottom: 10rpx;
right: 20rpx;
}
@@ -2756,9 +2625,11 @@
margin-top: 50rpx;
padding: 15rpx;
line-height: 1.5;
- background: #27A6E1;
- border: none;
- color: #fff;
+ // background: #27A6E1;
+ // border: none;
+ // color: #fff;
+ background: #fff;
+ color: #000;
font-size: 38rpx;
font-weight: bold;
/* float: right; */
@@ -2810,4 +2681,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