From 49dfdd3bf265db28d38167f34e9aabfdd3e8e5db Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 17 十月 2025 10:16:58 +0800
Subject: [PATCH] imagebutton
---
components/oi-form/list/input-number/index.vue | 2
pages/modal/3018_2.vue | 637 +++++-----
components/oi-form/list/textarea/index.vue | 2
pages/modal/3200_view.vue | 99 +
pages/modal/5601.vue | 745 +++++-------
pages/modal/3037_2.vue | 678 ++++++-----
pages/modal/3202.vue | 69
pages/modal/3202_view.vue | 183 +-
pages/login/set.vue | 2
components/oi-form/list/index.vue | 6
pages/modal/form/index.vue | 638 ++++------
pages/modal/3201.vue | 4
pages/modal/3018.vue | 7
components/oi-form/index.vue | 2
components/oi-form/list/input/index.vue | 2
pages/modal/3037.vue | 30
pages/modal/3200.vue | 141 +-
manifest.json | 4
components/oi-form/list/image-button/index.vue | 101 +
pages/login/index.vue | 2
20 files changed, 1,717 insertions(+), 1,637 deletions(-)
diff --git a/components/oi-form/index.vue b/components/oi-form/index.vue
index 61cd9f3..3a9ca90 100644
--- a/components/oi-form/index.vue
+++ b/components/oi-form/index.vue
@@ -82,7 +82,7 @@
this.form.model[attr] = item.value;
this.$emit("on-change", item)
},
-
+
onClick(item) {
this.$emit("on-click", item)
},
diff --git a/components/oi-form/list/image-button/index.vue b/components/oi-form/list/image-button/index.vue
new file mode 100644
index 0000000..b952cb4
--- /dev/null
+++ b/components/oi-form/list/image-button/index.vue
@@ -0,0 +1,101 @@
+<template>
+ <view class="oi-form-image-button">
+ <image v-if="data.setting.imgUrl" :src="data.setting.imgUrl" :width="data.setting.imgWidth"
+ :height="data.setting.imgHeight"> <button type="default" :style="{ color: data.setting.textColor }" :plain="
+ ['info', 'success', 'warning', 'error', 'primary'].includes(data.setting.type)? data.setting.ghost: false"
+ :class="data.setting.type + ' '+ data.setting.size" :disabled="data.disabled" @click="onClick">
+ <!-- :size="data.setting.size == 'small' ? 'mini':data.setting.size == 'large' ? 'plus':'default'" -->
+ <text v-if="data.setting.icon" class="img" :style="{color:data.setting.textColor}"></text>
+ {{ data.setting.text ||""}}
+ </button>
+ </image>
+ <button v-else type="default" :style="{ color: data.setting.textColor }" :plain="
+ ['info', 'success', 'warning', 'error', 'primary'].includes(data.setting.type)? data.setting.ghost: false"
+ :class="data.setting.type + ' '+ data.setting.size" :disabled="data.disabled" @click="onClick">
+ <!-- :size="data.setting.size == 'small' ? 'mini':data.setting.size == 'large' ? 'plus':'default'" -->
+ <text v-if="data.setting.icon" class="img" :style="{color:data.setting.textColor}"></text>
+ {{ data.setting.text ||""}}</button>
+ </view>
+</template>
+
+<script>
+ export default {
+ name: "OIFormImageButton",
+ props: {
+ data: {
+ type: Object,
+ required: true,
+ },
+ },
+ data() {
+ return {
+ largeMode: getApp().globalData?.largeMode || false,
+ }
+ },
+ methods: {
+
+ onClick(e) {
+ if (this.data.disabled)
+ return
+ this.$emit("on-click", e)
+ },
+
+
+ },
+ };
+</script>
+
+<style lang="less">
+ .oi-form-image-button {
+ // width: 100%;
+
+ uni-button {
+ padding: 14rpx;
+ line-height: 1.4;
+ font-size: 32rpx;
+ display: inline-block;
+ }
+
+ .large {
+ padding: 18rpx;
+ line-height: 1.6;
+ font-size: 36rpx;
+ }
+
+ .small {
+ padding: 10rpx;
+ line-height: 1.2;
+ font-size: 28rpx;
+ }
+
+ .primary {
+ color: #fff;
+ background: #27A6E1;
+ border: none;
+ }
+
+ .info {
+ color: #fff;
+ background-color: #2db7f5;
+ border: none;
+ }
+
+ .success {
+ color: #fff;
+ background-color: #19be6b;
+ border: none;
+ }
+
+ .error {
+ color: #fff;
+ background-color: #ed4014;
+ border: none;
+ }
+
+ .warning {
+ color: #fff;
+ background-color: #f90;
+ border: none;
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/components/oi-form/list/index.vue b/components/oi-form/list/index.vue
index 693b9f9..cc3f911 100644
--- a/components/oi-form/list/index.vue
+++ b/components/oi-form/list/index.vue
@@ -31,6 +31,8 @@
<OIFormDatePickerRange v-else-if="data.name == 'DatePickerRange'" :data="data" :model="model"
@on-change="onChange">
</OIFormDatePickerRange>
+ <OIFormImageButton v-else-if="data.name == 'ImageButton'" :data="data" @on-click="onClick">
+ </OIFormImageButton>
<OIFormText v-else-if="data.name == 'Text'" :data="data" :model="model">
</OIFormText>
<OIFormText v-else :data="data" :model="model">
@@ -51,6 +53,7 @@
import OIFormDatePicker from './date-picker/index.vue'
import OIFormDatePickerRange from './date-picker-range/index.vue'
import OIFormTimePicker from './time-picker/index.vue'
+ import OIFormImageButton from './image-button/index.vue'
export default {
name: "OIFormItem",
components: {
@@ -64,7 +67,8 @@
OIFormRadio,
OIFormDatePicker,
OIFormDatePickerRange,
- OIFormTimePicker
+ OIFormTimePicker,
+ OIFormImageButton
},
props: {
data: {
diff --git a/components/oi-form/list/input-number/index.vue b/components/oi-form/list/input-number/index.vue
index cafb6be..4871100 100644
--- a/components/oi-form/list/input-number/index.vue
+++ b/components/oi-form/list/input-number/index.vue
@@ -36,6 +36,8 @@
this.onChange(e)
},
onClick(e) {
+ if (this.data.disabled)
+ return
this.$emit("on-click", e)
},
onFocus(e) {
diff --git a/components/oi-form/list/input/index.vue b/components/oi-form/list/input/index.vue
index e98d727..35800af 100644
--- a/components/oi-form/list/input/index.vue
+++ b/components/oi-form/list/input/index.vue
@@ -87,6 +87,8 @@
this.$emit("on-click", e)
},
onClick(e) {
+ if (this.data.disabled)
+ return
this.$emit("on-click", e)
},
onFocus(e) {
diff --git a/components/oi-form/list/textarea/index.vue b/components/oi-form/list/textarea/index.vue
index b10ff9e..71a14da 100644
--- a/components/oi-form/list/textarea/index.vue
+++ b/components/oi-form/list/textarea/index.vue
@@ -31,6 +31,8 @@
this.onChange(e)
},
onClick(e) {
+ if (this.data.disabled)
+ return
this.$emit("on-click", e)
},
onFocus(e) {
diff --git a/manifest.json b/manifest.json
index 8a53602..5fec5f6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "MoboxPDA",
"appid" : "__UNI__56D451E",
"description" : "",
- "versionName" : "1.1.70",
- "versionCode" : 1170,
+ "versionName" : "1.1.71",
+ "versionCode" : 1171,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 1ee1a4f..4eae444 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -366,7 +366,7 @@
if (this.userServer.includes("://")) {
rootUrl = this.userServer
}
- showLoading("loading......")
+ showLoading("loading...")
const res = await login(rootUrl, this.userName, this.userPwd)
//璁剧疆鍏ㄥ眬鍙傛暟锛歶ser-鐢ㄦ埛淇℃伅
utils.session.setValue('server', rootUrl);
diff --git a/pages/login/set.vue b/pages/login/set.vue
index 762e82c..65a20a8 100644
--- a/pages/login/set.vue
+++ b/pages/login/set.vue
@@ -13,7 +13,7 @@
<uni-row>
<uni-col :span="16">
- <uni-forms-item :label="'OrgSAPI '+ translateSys('sys.port')" label-width="240rpx">
+ <uni-forms-item :label="'OrgSAPI '+ translateSys('sys.port')" label-width="250rpx">
<input type="number" class="input-port" v-model="form.orgSPort">
</uni-forms-item>
diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index f9273bc..7cea2aa 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -308,7 +308,9 @@
import {
showInfo,
showError,
- showModal
+ showModal,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
import utils from "@/js/utils.js"
@@ -437,6 +439,7 @@
},
async loadData() {
try {
+ showLoading("loading...")
const param = this.param
var edit_dlg = {
Model: param.EditDlgMode,
@@ -460,8 +463,10 @@
}
$this.classAttrList = result;
await $this.classGridStyleInfo();
+ hideLoading()
} catch (ex) {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys('error') + " 1")
}
diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue
index be926c9..0511d95 100644
--- a/pages/modal/3018_2.vue
+++ b/pages/modal/3018_2.vue
@@ -58,7 +58,9 @@
import utils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import dayjs from "dayjs";
import OIForm from '@/components/oi-form/index.vue'
@@ -225,37 +227,21 @@
});
},
async loadData(paramValue) {
+ try {
+ showLoading("loading...")
+ //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.UI_Style?.ID);
+ //浼犲叆鍙傛暟鍊�+ if (paramValue) {
- //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.UI_Style?.ID);
- //浼犲叆鍙傛暟鍊�- if (paramValue) {
-
- this.setFormValues(paramValue)
- // const attrs = paramValue.attrs || [];
- // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => {
- // if (ele.name != "Layout") {
- // attrs.forEach(async (ele2, index2) => {
- // if (ele.fieldId == ele2.name) {
- // ele.value = ele2.value;
- // }
- // });
- // } else {
- // ele.setting.colList.forEach(async (col) => {
- // if (col) {
- // attrs.forEach(async (ele2,
- // index2) => {
- // if (col.fieldId == ele2.name) {
- // col.value = ele2.value;
- // }
- // });
- // }
- // });
- // }
- // })
-
+ this.setFormValues(paramValue)
+ }
+ await this.loadInitialEvent();
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
}
- await this.loadInitialEvent();
},
async loadInitialEvent() {
@@ -271,7 +257,7 @@
value: obj_attr[a],
})),
};
-
+
var info = {
eventid: eventid,
edtype: "0",
@@ -286,7 +272,7 @@
}
this.DataObjRunCustomEvent(info);
}
-
+
} catch (ex) {
showError(ex, this.translateSys("error"))
@@ -671,7 +657,18 @@
},
onClick(item) {
// console.log("onClick",item);
- this.focusFieldId = item.fieldId
+ if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+ this.focusFieldId = item.fieldId
+ } else if (item.name == "ImageButton") {
+
+ var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+
+ if (!onClickEvent.id) {
+ showInfo(this.translate('icon_click_event_empty'))
+ return;
+ }
+ this.onChange(onClickEvent);
+ }
},
onEnterChange(item) {
let newVal = item.value
@@ -723,166 +720,25 @@
}
},
-
- classAttr_extButton(item) {
- var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠�- var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�-
- if (!onSuffixClickCallbackEvent.id) {
- showInfo(this.translate('icon_click_callback_empty'))
-
- return;
- }
- if (!onSuffixClickEvent.id) {
- showInfo(this.translate('icon_click_event_empty'))
-
- return;
- }
- this.popupType = 'right'
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- this.$refs.popup.open(this.popupType);
-
- this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent
- .id,
- item);
- },
- popupChange(e) {
- console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show);
- },
- checkChange(e) { //寮规check閫夋嫨
- // console.log(e.target.dataset);
- var index = e.target.dataset.index;
- var ischeck = e.target.dataset.ischeck;
- 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.check_list.items = data;
-
- },
- popup_cancel(e) { //寮规鍙栨秷
- this.$refs.popup.close();
- },
- popup_sava(e) { //寮规纭畾
- var $this = this;
- var items = $this.check_list.items;
- var data = [];
- var name = "";
- for (var i = 0; i < items.length; i++) {
- if (items[i].check == true) {
- if (name)
- name += ';';
- name += items[i].name;
- data.push({
- id: items[i].id,
- name: items[i].name
- });
- }
- }
- if (!$this.popupParam) {
- showInfo("popupParam涓虹┖锛�)
-
- return;
- }
- if (data.length == 0) {
- showInfo(this.translate("tip_no_select_data"))
-
- return;
- }
- var callback_eventid = $this.popupParam.button_callback.trim();
- var info = {
- eventid: callback_eventid,
- edtype: "0",
- projectid: '',
- rclsid: '',
- robjid: '',
- userlogin: '',
- clsid: $this.param.DataCls.id,
- objid: "",
- attr: $this.popupParam.req,
- dataJson: data
- }
- $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr);
- this.$refs.popup.close();
- },
-
- async DataObjRunCustomEvent(info, data_attr) {
- var $this = this;
- var enviroment = {
- 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�- 'button': 'top', // top/bottom
- button_name: this.translateSys('add2'),
- master: {
- cls_id: this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id
- //obj_id: '' // button=bottom鏃�master鐨刼bj_id
- }
- };
- if (data_attr) {
- enviroment.edit_dlg = {
- type: 'small', //灏忕獥鍙�- class_id: this.param.DataCls.id, //褰撳墠鏁版嵁绫籭d
- }
- if (data_attr) {
- enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�- name: data_attr.Name, //瀛楁灞炴�
- text: data_attr.DispName, //鏄剧ず鏂囨湰
- group_name: data_attr.GroupName, //灞炴�缁�- type: data_attr.Type, //瀛楁绫诲瀷
- readonly: data_attr.ReadOnly, //鏄惁鍙
- button_img: data_attr.button_img, //寮曠敤鎸夐挳鐨勫浘鏍�- button_tooltip: data_attr.button_tooltip //寮曠敤鎸夐挳鐨則ooltip
+ async onFormEventResult(data, callbackEventId, item) {
+ try {
+ const $this = this
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: $this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: $this.translateSys('add2'),
+ master: {
+ cls_id: $this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
}
- }
- }
-
- // var dataInfo = {
- // 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.global_attr), dataJson:JSON.stringify(info.dataJson)
- // }
- enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var input_param = Base64.encode(JSON.stringify(info.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 = {};
- info.attr.forEach(item => {
- obj_attr[item.attr] = item.value;
- });
- if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}';
- var dataInfo = {
- ed_type: info.edtype,
- start_transaction: true,
- class_id: info.clsid,
- class_name: '',
- event_id: info.eventid,
- event_name: '',
- data_obj_id: info.objid,
- obj_attr: obj_attr,
- prj_id: info.projectid,
- ref_cls_id: info.rclsid,
- rel_obj_id: info.robjid,
- user_login: info.userlogin,
- data_json: info.dataJson,
- compose_info: '',
- ext_info: enviroment,
- global_attr: global_attr,
- input_param: input_param,
- };
- console.log(dataInfo);
- // return;
- runCustomEvent(dataInfo).then(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
+ 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) {
@@ -890,7 +746,8 @@
if (pos > -1) tip = tip.substring(pos + 1);
}
}
- if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ 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
@@ -914,6 +771,7 @@
}
try {
var actionlist = data.action || []
+ var enviroment = JSON.stringify(enviroment);
for (var i = 0; i < actionlist.length; i++) {
var action = actionlist[i];
if (action.action_type == 'set_dlg_attr') {
@@ -942,141 +800,8 @@
focusFieldId: action.value
})
});
- } else {
- showInfo(this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed"))
-
}
- }
-
- } 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);
- showError(ex, this.translateSys("error") + " 3.1")
-
- });
- },
- dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
- const $this = this
- var enviroment = {
- 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: $this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�- 'button': 'top', // top/bottom
- button_name: $this.translateSys('add2'),
- master: {
- cls_id: $this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id
- //obj_id: '' // button=bottom鏃�master鐨刼bj_id
- }
- };
- var obj_attr = $this.head_styledef.form.model;
- console.log(obj_attr);
- var req = Object.keys(obj_attr).map((a) => ({
- attr: a,
- value: obj_attr[a] || "",
- }));
-
- var extinfo = enviroment;
- extinfo.edit_dlg = {
- type: 'small', //灏忕獥鍙�- class_id: $this.param.DataCls.id, //褰撳墠鏁版嵁绫籭d
- }
- extinfo = Base64.encode(JSON.stringify(extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var global_attr = Base64.encode(JSON.stringify($this
- .global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
- var obj_attr = {};
- req.forEach(item2 => {
- obj_attr[item2.attr] = item2.value;
- });
- let input_param = Base64.encode(
- JSON.stringify(
- Object.keys(obj_attr).map((a) => ({
- attr: a,
- value: obj_attr[a] || "",
- }))
- )
- );
-
- if (!eventid.includes('{')) eventid = '{' + eventid + '}';
- var dataInfo = {
- ed_type: "0",
- start_transaction: true,
- class_id: $this.param.DataCls.id,
- class_name: '',
- event_id: eventid,
- event_name: '',
- data_obj_id: '',
- obj_attr: obj_attr,
- prj_id: '',
- ref_cls_id: '',
- rel_obj_id: '',
- user_login: '',
- data_json: [],
- compose_info: '',
- ext_info: extinfo,
- global_attr: global_attr,
- input_param: input_param,
- };
- console.log(dataInfo);
- // return;
- runCustomEvent(dataInfo).then(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
- 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) {
- showInfo(data.result)
-
- }
- }
- try {
- var actions = data.action || []
- for (var i = 0; i < actions.length; i++) {
- var action = actions[i];
- console.log(action)
- var val = action.value;
- var enviroment = JSON.stringify(enviroment);
-
- if (action.action_type == 'open_panel') {
+ else if (action.action_type == 'open_panel') {
var d = dialog({
title: '<i class="ace-icon fa fa-info-circle"></i> ' +
$this.translateSys("tip"),
@@ -1243,17 +968,16 @@
}
});
} else {
- showInfo($this.translateSys(
+ showInfo(this.translateSys(
"quotation_mark_left") +
- action.action_type + $this
- .translateSys(
- "quotation_mark_right") + $this
+ action
+ .action_type + this.translateSys(
+ "quotation_mark_right") + this
.translate(
"tip_action_unprocessed"))
}
}
-
} catch (ex) {
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
@@ -1261,11 +985,250 @@
showError(tip, this.translateSys('tip'))
return
}
+
}
}
+ } catch (ex) {
+ showError(ex, this.translateSys("error") + "10.1")
+ }
+ },
+ classAttr_extButton(item) {
+ var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠�+ var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+
+ if (!onSuffixClickCallbackEvent.id) {
+ showInfo(this.translate('icon_click_callback_empty'))
+
+ return;
+ }
+ if (!onSuffixClickEvent.id) {
+ showInfo(this.translate('icon_click_event_empty'))
+
+ return;
+ }
+ this.popupType = 'right'
+ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+ this.$refs.popup.open(this.popupType);
+
+ this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent
+ .id,
+ item);
+ },
+ popupChange(e) {
+ console.log('褰撳墠妯″紡锛� + e.type + ',鐘舵�锛� + e.show);
+ },
+ checkChange(e) { //寮规check閫夋嫨
+ // console.log(e.target.dataset);
+ var index = e.target.dataset.index;
+ var ischeck = e.target.dataset.ischeck;
+ 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.check_list.items = data;
+
+ },
+ popup_cancel(e) { //寮规鍙栨秷
+ this.$refs.popup.close();
+ },
+ popup_sava(e) { //寮规纭畾
+ var $this = this;
+ var items = $this.check_list.items;
+ var data = [];
+ var name = "";
+ for (var i = 0; i < items.length; i++) {
+ if (items[i].check == true) {
+ if (name)
+ name += ';';
+ name += items[i].name;
+ data.push({
+ id: items[i].id,
+ name: items[i].name
+ });
+ }
+ }
+ if (!$this.popupParam) {
+ showInfo("popupParam涓虹┖锛�)
+
+ return;
+ }
+ if (data.length == 0) {
+ showInfo(this.translate("tip_no_select_data"))
+
+ return;
+ }
+ var callback_eventid = $this.popupParam.button_callback.trim();
+ var info = {
+ eventid: callback_eventid,
+ edtype: "0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
+ clsid: $this.param.DataCls.id,
+ objid: "",
+ attr: $this.popupParam.req,
+ dataJson: data
+ }
+ $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr);
+ this.$refs.popup.close();
+ },
+
+ async DataObjRunCustomEvent(info, data_attr) {
+ try {
+ var $this = this;
+ if (!info.eventid)
+ return
+ showLoading("loading...")
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: this.translateSys('add2'),
+ master: {
+ cls_id: this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ }
+ };
+ if (data_attr) {
+ enviroment.edit_dlg = {
+ type: 'small', //灏忕獥鍙�+ class_id: this.param.DataCls.id, //褰撳墠鏁版嵁绫籭d
+ }
+ if (data_attr) {
+ enviroment.edit_dlg.form_control = { //鎵�睘鐨勮〃鍗曟帶浠�+ name: data_attr.Name, //瀛楁灞炴�
+ text: data_attr.DispName, //鏄剧ず鏂囨湰
+ group_name: data_attr.GroupName, //灞炴�缁�+ type: data_attr.Type, //瀛楁绫诲瀷
+ readonly: data_attr.ReadOnly, //鏄惁鍙
+ button_img: data_attr.button_img, //寮曠敤鎸夐挳鐨勫浘鏍�+ button_tooltip: data_attr.button_tooltip //寮曠敤鎸夐挳鐨則ooltip
+ }
+ }
+ }
+ enviroment = Base64.encode(JSON.stringify(enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var input_param = Base64.encode(JSON.stringify(info.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 = {};
+ info.attr.forEach(item => {
+ obj_attr[item.attr] = item.value;
+ });
+ if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}';
+ var dataInfo = {
+ ed_type: info.edtype,
+ start_transaction: true,
+ class_id: info.clsid,
+ class_name: '',
+ event_id: info.eventid,
+ event_name: '',
+ data_obj_id: info.objid,
+ obj_attr: obj_attr,
+ prj_id: info.projectid,
+ ref_cls_id: info.rclsid,
+ rel_obj_id: info.robjid,
+ user_login: info.userlogin,
+ data_json: info.dataJson,
+ compose_info: '',
+ ext_info: enviroment,
+ global_attr: global_attr,
+ input_param: input_param,
+ };
+ console.log(dataInfo);
+ // return;
+ runCustomEvent(dataInfo).then(data => {
+ hideLoading()
+ $this.onFormEventResult(data, "")
+
+ }).catch(ex => {
+ // console.log(ex);
+ showError(ex, this.translateSys("error") + " 3.1")
+
+ });
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
+ }
+
+ },
+ dataObjRunCustomEvent_Return(eventid, button_callback, item) {
+ const $this = this
+ showLoading("loading...")
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: $this.param.DataCls.id, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: $this.translateSys('add2'),
+ master: {
+ cls_id: $this.param.DataCls.id, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ }
+ };
+ var obj_attr = $this.head_styledef.form.model;
+ console.log(obj_attr);
+ var req = Object.keys(obj_attr).map((a) => ({
+ attr: a,
+ value: obj_attr[a] || "",
+ }));
+
+ var extinfo = enviroment;
+ extinfo.edit_dlg = {
+ type: 'small', //灏忕獥鍙�+ class_id: $this.param.DataCls.id, //褰撳墠鏁版嵁绫籭d
+ }
+ extinfo = Base64.encode(JSON.stringify(extinfo)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var global_attr = Base64.encode(JSON.stringify($this
+ .global_attr)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜
+ var obj_attr = {};
+ req.forEach(item2 => {
+ obj_attr[item2.attr] = item2.value;
+ });
+ let input_param = Base64.encode(
+ JSON.stringify(
+ Object.keys(obj_attr).map((a) => ({
+ attr: a,
+ value: obj_attr[a] || "",
+ }))
+ )
+ );
+
+ if (!eventid.includes('{')) eventid = '{' + eventid + '}';
+ var dataInfo = {
+ ed_type: "0",
+ start_transaction: true,
+ class_id: $this.param.DataCls.id,
+ class_name: '',
+ event_id: eventid,
+ event_name: '',
+ data_obj_id: '',
+ obj_attr: obj_attr,
+ prj_id: '',
+ ref_cls_id: '',
+ rel_obj_id: '',
+ user_login: '',
+ data_json: [],
+ compose_info: '',
+ ext_info: extinfo,
+ global_attr: global_attr,
+ input_param: input_param,
+ };
+ console.log(dataInfo);
+ // return;
+ runCustomEvent(dataInfo).then(data => {
+ hideLoading()
+ $this.onFormEventResult(data, button_callback, item)
+
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + " 5.1")
});
@@ -1553,6 +1516,7 @@
afterOK() {
this.saving = true
const $this = this
+ showLoading("loading...")
var obj_attr = this.head_styledef.form.model;
// console.log(obj_attr);
var input_param = {
@@ -1584,8 +1548,9 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
-
+ hideLoading()
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
@@ -1661,7 +1626,6 @@
}
}
-
} catch (ex) {
let actionList = (data.action || []).map(a => a.action_type).join(';')
let tip = typeof ex == 'string' ? ex : ex.message
@@ -1673,9 +1637,9 @@
}
}
-
this.saving = false
}).catch(ex => {
+ hideLoading()
showError(ex, this.translateSys("tip") + " 7.1")
});
@@ -1721,6 +1685,7 @@
},
onTriggerEvent(btn, enviroment) {
const $this = this
+ showLoading("loading...")
var obj_attr = this.head_styledef.form.model;
// console.log(obj_attr);
var input_param = {
@@ -1751,7 +1716,7 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
-
+ hideLoading()
if (data.ret != 0 && data.ret != 1) {
let cls_name = data.event_info?.cls_name
let event_name = data.event_info?.event_name
@@ -1769,6 +1734,7 @@
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
@@ -1779,6 +1745,7 @@
showInfo(tip)
if (!this.param.After_Btn_Not_Refresh) {
//鍒锋柊
+
uni.redirectTo({
url: '../modal/3018_2?param=' + JSON.stringify(this
.$data
@@ -1831,8 +1798,7 @@
var value = action.value;
const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('remove_pre_page_subtable_row', value);
- }
- else if (action.action_type == "goback_to_pre_page") {
+ } else if (action.action_type == "goback_to_pre_page") {
//杩斿洖涓婁竴椤� uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -1849,6 +1815,7 @@
return
}
}
+
}
}
diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index a1e17b8..900baf4 100644
--- a/pages/modal/3037.vue
+++ b/pages/modal/3037.vue
@@ -672,7 +672,9 @@
import buttonClickMixin from '@/mixins/button-click.js';
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
export default {
@@ -752,15 +754,23 @@
async loadData() {
//涓绘暟鎹被鑾峰彇
- const param = this.param
- this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
- this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
- ?.View_Style?.Name)
- this.viewParam('Mast');
- this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
- this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
- ?.Name)
- this.viewParam('Sub');
+ try {
+ showLoading("loading...")
+ const param = this.param
+ this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls
+ ?.View_Style?.Name)
+ this.viewParam('Mast');
+ this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID)
+ this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style
+ ?.Name)
+ this.viewParam('Sub');
+ } catch (ex) {
+ // console.log(ex);
+ hideLoading()
+ showError(ex, this.translateSys('error') + " 1")
+
+ }
},
async DictItemGetList(attr) { //Mobox3寰楀埌瀛楀吀椤瑰垪琛� try {
diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index 884acb7..a0fee66 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -2,8 +2,9 @@
<view class="uni-page-modal-3017-2" :class="largeMode?'large-mode':''">
<!-- 琛ㄥご鏍峰紡 -->
<OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form"
- :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap"
- @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton">
+ :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap" :focusId="focusFieldId"
+ @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton"
+ @on-click="onClick">
</OIForm>
<!-- 浠庢暟鎹�-->
<view class="v-panel">
@@ -119,7 +120,9 @@
import utils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
appGetInfo,
@@ -157,8 +160,8 @@
subClassGridStyle: [],
popupType: "center",
check_list: {},
-
- focusMateria: false,
+ focusFieldId: "",
+ focusOldFieldId: "",
head_styledef: {
form: {
items: []
@@ -179,9 +182,6 @@
this.param = JSON.parse(options.param);
const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
this.loadData(paramValue)
-
- //椤甸潰鍒濆鍖栬幏鍙栫劍鐐�- // this.focusMateria=true;
},
initialEvent() {
let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial");
@@ -213,38 +213,22 @@
});
},
async loadData(paramValue) {
- console.log(this.param);
- //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
- //浼犲叆鍙傛暟鍊�- if (paramValue) {
- this.setFormValues(this.head_styledef, paramValue)
- // const attrs = paramValue.attrs || [];
- // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => {
- // if (ele.name != "Layout") {
- // attrs.forEach(async (ele2, index2) => {
- // if (ele.fieldId == ele2.name) {
- // ele.value = ele2.value;
- // }
- // });
- // } else {
- // ele.setting.colList.forEach(async (col) => {
- // if (col) {
- // attrs.forEach(async (ele2,
- // index2) => {
- // if (col.fieldId == ele2.name) {
- // col.value = ele2.value;
- // }
- // });
- // }
- // });
- // }
- // })
-
+ try {
+ showLoading("loading...")
+ console.log(this.param);
+ //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
+ //浼犲叆鍙傛暟鍊�+ if (paramValue) {
+ this.setFormValues(this.head_styledef, paramValue)
+ }
+ await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
+ await this.loadInitialEvent();
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
}
-
- await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
- await this.loadInitialEvent();
},
async loadInitialEvent() {
try {
@@ -297,29 +281,82 @@
if (!result.style_def.includes('"')) styledef = Base64.decode(result
.style_def);
}
- $this.head_styledef = result.style_def ? JSON.parse(styledef) : {};
+
+ const styledefHead = styledef ? JSON.parse(styledef) : {};
+
// console.log($this.head_styledef);
- if ($this.head_styledef.form?.items) {
- $this.head_styledef.form.items.forEach(async (ele, index) => {
- ele.show = true;
- if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
- await this.DictGetInfo(ele.bind.dict, index, 'mast');
- } else {
- if (ele?.name === "Select") {
- const selections = ele?.selections || []
- //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
- let itemName = ele.value || "";
- if (itemName) {
- $this.head_styledef.form
- .model[ele.fieldId] = itemName;
- }
- $this.head_styledef.form.items[index].selections = selections.map((
- a) => {
- return {
- value: a.value,
- text: a.label
+ if (styledefHead.form?.items) {
+ styledefHead.form.items.forEach(async (ele, index) => {
+ if (ele.name != "Layout") {
+ ele.show = true;
+ if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
+ await this.DictGetInfo(ele.bind.dict, index, 'mast');
+ } else {
+ if (ele?.name === "Select") {
+ const selections = ele?.selections || []
+ //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
+ let itemName = ele.value || "";
+ if (itemName) {
+ styledefHead.form
+ .model[ele.fieldId] = itemName;
}
- })
+ styledefHead.form.items[index].selections = selections.map((
+ a) => {
+ return {
+ value: a.value,
+ text: a.label
+ }
+ })
+ }
+
+ }
+ if ($this.focusFieldId == "") {
+ if (ele.name == 'Input' || ele.name ==
+ 'InputNumber') {
+ $this.setData({
+ focusFieldId: ele.fieldId
+ })
+ }
+ }
+ } else {
+ for (let j in ele.setting.colList) {
+ const col = ele.setting.colList[j]
+ if (col) {
+ col.show = true
+ if (col?.useDict) {
+ //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
+ await $this.DictGetInfo(col.bind
+ .dict,
+ styledefHead.form
+ .model, col);
+ } else {
+ if (col?.name === "Select") {
+ const selections = col?.selections || []
+ //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
+ let itemName = col.value || "";
+ if (itemName) {
+ styledefHead.form
+ .model[col.fieldId] = itemName;
+ }
+ col.selections = selections.map((a) => {
+ return {
+ value: a.value,
+ text: a.label
+ }
+ })
+ }
+ }
+ if ($this.focusFieldId == "") {
+ if (col.name == 'Input' || col
+ .name ==
+ 'InputNumber') {
+ $this.setData({
+ focusFieldId: col
+ .fieldId
+ })
+ }
+ }
+ }
}
}
@@ -344,6 +381,9 @@
$this.head_styledef.form.model["S_CLASSES"] = app.globalData.classes
}
}
+ $this.setData({
+ head_styledef: styledefHead
+ })
if ($this.head_styledef.event?.length > 0) {
$this.head_styledef.event.forEach(async (a) => { //鍒ゆ柇鏄惁鏄垵濮嬪寲浜嬩欢
if (a.event_id == "initial") {
@@ -582,51 +622,108 @@
getApp().onScan((result) => {
//console.log(result);
uni.hideKeyboard();
- var $this = this;
- console.log(item);
- item.value = result
- let newVal = item.value.trim()
- if (newVal) {
- item.oldvalue = newVal;
- var attr = item.fieldId;
- $this.head_styledef.form.model[attr] = newVal;
- $this.focusMateria = true; //鍒濆鍖栵紝绗簩涓緭鍏ユfocus灞炴�
- // setTimeout(function(){
- // $this.focusMateria=true; //绗簩涓緭鍏ユ鑾峰彇鐒︾偣
- setTimeout(function() {
- uni.hideKeyboard();
- }, 1000);
- // },500);
- //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�- var eventid = this.param.Scan_Code.Input_Change_Event.ID;
- if (eventid) {
- var obj_attr = this.head_styledef.form.model;
- // console.log(obj_attr);
- var req = Object.keys(obj_attr).map((a) => ({
- attr: a,
- value: obj_attr[a] || "",
- }));
- var info = {
- eventid: eventid,
- edtype: "7", //"0",
- projectid: '',
- rclsid: '',
- robjid: '',
- userlogin: '',
- clsid: 'MBOX', //this.param.Sub_Cls.ID,
- objid: "",
- attr: req,
- mast_attr: [],
- inputParamter: [{
- attr: 'mast_input_3037',
- value: newVal
- }]
+ this.onScanValue(item, result)
+ })
+ },
+ onScanValue(item, value) {
+ const $this = this;
+ //console.log("onScanValue", item);
+ item.value = value
+ let newVal = item.value
+ if (typeof item.value == "string") {
+ newVal = item.value.trim()
+ }
+ if (newVal) {
+ item.oldvalue = newVal;
+ var attr = item.fieldId;
+ $this.head_styledef.form.model[attr] = newVal;
+ setTimeout(function() {
+ uni.hideKeyboard();
+ }, 1000);
+ var eventid = this.param.Scan_Code.Input_Change_Event.ID;
+ if (eventid) {
+ var obj_attr = this.head_styledef.form.model;
+ // console.log(obj_attr);
+ var req = Object.keys(obj_attr).map((a) => ({
+ attr: a,
+ value: obj_attr[a] || "",
+ }));
+ var info = {
+ eventid: eventid,
+ edtype: "7", //"0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
+ clsid: 'MBOX', //this.param.Sub_Cls.ID,
+ objid: "",
+ attr: req,
+ mast_attr: [],
+ inputParamter: [{
+ attr: 'mast_input_3037',
+ value: newVal
+ }]
+ }
+
+ this.scan_DataObjRunCustomEvent(info, "");
+ }
+ var findd = false
+ for (let i in $this.head_styledef.form.items) {
+ const ele = $this.head_styledef.form.items[i]
+
+ if (ele.name != "Layout") {
+ if (ele.name == 'Input' || ele.name == 'InputNumber') {
+ if (attr == ele.fieldId) {
+ findd = true
+ } else {
+ if (findd) {
+ $this.setData({
+ focusFieldId: ele.fieldId
+ })
+ break
+ }
+
+ }
+
+ }
+ } else {
+ if (findd) {
+ let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+ return (col.name == 'Input' || col.name == 'InputNumber');
+ })
+ if (curIndex > -1) {
+ $this.setData({
+ focusFieldId: ele.setting.colList[curIndex]
+ .fieldId
+ })
+ break
+ }
+
+ } else {
+ let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+ return attr == col.fieldId;
+ })
+ if (curIndex > -1) {
+ findd = true
+ let curIndex2 = ele.setting.colList.findIndex((col, index2, arr) => {
+ return (col.name == 'Input' || col.name ==
+ 'InputNumber') &&
+ index2 >
+ curIndex;
+ })
+ if (curIndex2 > -1) {
+ $this.setData({
+ focusFieldId: ele.setting.colList[curIndex].fieldId
+ })
+ break
+ }
+ }
}
- this.scan_DataObjRunCustomEvent(info, "");
}
}
- })
+
+ }
},
onevent(item) {
// console.log(e.target);
@@ -678,6 +775,19 @@
}
},
+ onClick(item) {
+ if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+ this.focusFieldId = item.fieldId
+ } else if (item.name == "ImageButton") {
+ var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+
+ if (!onClickEvent.id) {
+ showInfo(this.translate('icon_click_event_empty'))
+ return;
+ }
+ this.onChange(onClickEvent);
+ }
+ },
classAttr_extButton(item) {
var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑诲洖璋� var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑讳簨浠�@@ -695,21 +805,13 @@
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
this.$refs.popup.open(this.popupType);
- this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent.id,
+ this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id,
item);
},
- dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
+ dataObjRunCustomEvent_Return(eventid, button_callback, item) {
const $this = this
- var enviroment = {
- 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: $this.head_styledef.form.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�- 'button': 'top', // top/bottom
- button_name: $this.translateSys('add2'),
- master: {
- cls_id: $this.head_styledef.form.clsId, // button=bottom鏃�master鐨刢ls_id
- //obj_id: '' // button=bottom鏃�master鐨刼bj_id
- }
- };
+ showLoading("loading...")
+
var obj_attr = $this.head_styledef.form.model;
console.log(obj_attr);
var req = Object.keys(obj_attr).map((a) => ({
@@ -772,6 +874,78 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
+ hideLoading()
+ $this.onFormEventResult(data, button_callback, item)
+
+ }).catch(ex => {
+ // console.log(ex);
+ hideLoading()
+ showError(ex, this.translateSys("error") + "5.1")
+ });
+ },
+
+ onEnterChange(item) {
+ console.log("onEnterChange", item);
+ let newVal = item.value
+ if (typeof item.value == "string") {
+ newVal = item.value.trim()
+ if (!newVal)
+ return
+ }
+ if (item.oldvalue != newVal) {
+ item.oldvalue = newVal;
+ var attr = item.fieldId;
+ this.head_styledef.form.model[attr] = newVal;
+ var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�+ if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠�+ this.onChange(onChangeEvent);
+ }
+ }
+
+ },
+ onDetail1EnterChange(item) {
+ //鐮佺洏涓牱寮忓洖杞︿簨浠�+ // console.log(item);
+ },
+ // 鍐呭鍙樺寲鍚庝簨浠�+ async onChange(event) {
+ var eventid = event?.id; //鍐呭鍙樺寲鍚庝簨浠�+ if (eventid) {
+ // self.event_no_sub = 1;
+ var obj_attr = this.head_styledef.form.model;
+ // console.log(obj_attr);
+ var req = Object.keys(obj_attr).map((a) => ({
+ attr: a,
+ value: obj_attr[a] || "",
+ }));
+ var info = {
+ eventid: eventid,
+ edtype: "0",
+ projectid: '',
+ rclsid: '',
+ robjid: '',
+ userlogin: '',
+ clsid: this.head_styledef.form.clsId,
+ objid: "",
+ attr: req,
+ }
+ this.DataObjRunCustomEvent(info);
+ }
+
+ },
+ async onFormEventResult(data, callbackEventId, item) {
+ try {
+ const $this = this
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: $this.head_styledef.form.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: $this.translateSys('add2'),
+ master: {
+ cls_id: $this.head_styledef.form.clsId, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ }
+ };
if (data.ret != 0 && data.ret != 1) {
let cls_name = data.event_info?.cls_name
let event_name = data.event_info?.event_name
@@ -799,20 +973,93 @@
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.head_styledef.form.items.length; c++) {
+ var attr = $this.head_styledef.form.items[c];
+ if (attr.name != 'Layout') {
+ if (attr.fieldId == result[i].attr) {
+ attr.value = '';
+ attr.oldvalue = '';
+ attr.value = result[i].value;
+ attr.oldvalue = result[i].value;
+ $this.head_styledef.form.model[attr.fieldId] = result[i].value;
+ }
+ } else if (attr.name == 'Layout') {
+ attr.setting.colList.forEach(col => {
+ if (col) {
+ if (col.fieldId == result[i].attr) {
+ col.value = '';
+ col.oldvalue = '';
+ col.value = result[i].value;
+ col.oldvalue = result[i].value;
+ $this.head_styledef.form.model[col.fieldId] =
+ 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') {
showInfo(data.result)
}
try {
- var actions = data.action || []
- for (var i = 0; i < actions.length; i++) {
- var action = actions[i];
- console.log(action)
- var val = action.value;
- var enviroment = JSON.stringify(enviroment);
-
- if (action.action_type == 'open_panel') {
+ var enviroment = JSON.stringify(enviroment);
+ var actionlist = data.action || []
+ 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($this.head_styledef, result)
+ } else if (action.action_type == 'set_dlg_attr_show') {
+ var data = action.value;
+ $this.setFormItemVisible(data)
+ // console.log($this.head_styledef);
+ } else if (action.action_type ==
+ "set_dlg_current_edit_attr"
+ ) {
+ if ($this
+ .focusOldFieldId ==
+ action.value) {
+ $this.setData({
+ focusFieldId: ""
+ })
+ } else {
+ $this.setData({
+ focusFieldId: $this
+ .focusOldFieldId
+ })
+ }
+ $this.$nextTick(() => {
+ $this.setData({
+ focusFieldId: action
+ .value
+ })
+ });
+ } else if (action.action_type == 'set_global_attr') {
+ $this.global_attr = action.value || [];
+ } else if (action.action_type == 'open_panel') {
var d = dialog({
title: '<i class="ace-icon fa fa-info-circle"></i> ' +
$this.translateSys("tip"),
@@ -965,15 +1212,8 @@
}
}
});
- } else {
- showInfo($this.translateSys(
- "quotation_mark_left") +
- action.action_type + $this.translateSys(
- "quotation_mark_right") + $this
- .translate(
- "tip_action_unprocessed"))
-
}
+
}
} catch (ex) {
@@ -984,65 +1224,13 @@
return
}
}
-
}
- }).catch(ex => {
- // console.log(ex);
- showError(ex, this.translateSys("error") + "5.1")
- });
- },
- onEnterChange(item) {
- console.log("onEnterChange", item);
- let newVal = item.value
- if (typeof item.value == "string") {
- newVal = item.value.trim()
- if (!newVal)
- return
+ } catch (ex) {
+ showError(ex, this.translateSys("error") + "10.1")
}
- if (item.oldvalue != newVal) {
- item.oldvalue = newVal;
- var attr = item.fieldId;
- this.head_styledef.form.model[attr] = newVal;
- var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�- if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠�- this.onChange(onChangeEvent);
- }
- }
-
},
- onDetail1EnterChange(item) {
- //鐮佺洏涓牱寮忓洖杞︿簨浠�- // console.log(item);
- },
- // 鍐呭鍙樺寲鍚庝簨浠�- async onChange(event) {
- var eventid = event?.id; //鍐呭鍙樺寲鍚庝簨浠�- if (eventid) {
- // self.event_no_sub = 1;
- var obj_attr = this.head_styledef.form.model;
- // console.log(obj_attr);
- var req = Object.keys(obj_attr).map((a) => ({
- attr: a,
- value: obj_attr[a] || "",
- }));
- var info = {
- eventid: eventid,
- edtype: "0",
- projectid: '',
- rclsid: '',
- robjid: '',
- userlogin: '',
- clsid: this.head_styledef.form.clsId,
- objid: "",
- attr: req,
- }
- this.DataObjRunCustomEvent(info);
- }
-
- },
-
scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� //console.log(e.target)
getApp().onScan((result) => {
@@ -1350,6 +1538,9 @@
DataObjRunCustomEvent(info, data_attr) {
var $this = this;
+ if (!info.eventid)
+ return
+ showLoading("loading...")
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -1412,113 +1603,12 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(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
- 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.head_styledef.form.items.length; c++) {
- var attr = $this.head_styledef.form.items[c];
- if (attr.name != 'Layout') {
- if (attr.fieldId == result[i].attr) {
- attr.value = '';
- attr.oldvalue = '';
- attr.value = result[i].value;
- attr.oldvalue = result[i].value;
- $this.head_styledef.form.model[attr.fieldId] = result[i].value;
- }
- } else if (attr.name == 'Layout') {
- attr.setting.colList.forEach(col => {
- if (col) {
- if (col.fieldId == result[i].attr) {
- col.value = '';
- col.oldvalue = '';
- col.value = result[i].value;
- col.oldvalue = result[i].value;
- $this.head_styledef.form.model[col.fieldId] =
- 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') {
- showInfo(data.result)
-
- }
- try {
- var actionlist = data.action || []
- 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($this.head_styledef, result)
- } else if (action.action_type == 'set_dlg_attr_show') {
- var data = action.value;
- $this.setFormItemVisible(data)
- // console.log($this.head_styledef);
- } else if (action.action_type == 'set_global_attr') {
- $this.global_attr = action.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'))
- return
- }
- }
- }
+ hideLoading()
+ $this.onFormEventResult(data, "")
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "3.1")
});
},
@@ -1628,6 +1718,7 @@
},
scan_DataObjRunCustomEvent(info, data_attr) {
var $this = this;
+ showLoading("loading...")
var obj_attr = {};
info.attr.forEach(item => {
obj_attr[item.attr] = item.value;
@@ -1689,7 +1780,7 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
-
+ hideLoading()
if (data.ret != 0 && data.ret != 1) {
let cls_name = data.event_info?.cls_name
let event_name = data.event_info?.event_name
@@ -1937,6 +2028,7 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "7.1")
});
},
@@ -1961,10 +2053,8 @@
},
scan_OKDataObjRunCustomEvent(eventID) {
this.saving = true
- uni.showLoading({
- title: this.translateSys("loading"),
- mask: true
- });
+ showLoading("loading...")
+
var $this = this;
//鑾峰彇琛ㄥご灞炴�
var obj_attr = this.head_styledef.form.model;
@@ -2036,7 +2126,7 @@
// return;
runCustomEvent(dataInfo).then(data => {
console.log(data);
- uni.hideLoading();
+ hideLoading()
if (data.ret != 0 && data.ret != 1) {
let cls_name = data.event_info?.cls_name
let event_name = data.event_info?.event_name
@@ -2095,7 +2185,7 @@
}).catch(ex => {
// console.log(ex);
this.saving = false
- uni.hideLoading();
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
});
},
diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue
index f083e36..d1b38a8 100644
--- a/pages/modal/3200.vue
+++ b/pages/modal/3200.vue
@@ -70,7 +70,9 @@
import classUtils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
appGetInfo,
@@ -155,75 +157,55 @@
},
async onLoad(options) {
// console.log(options);
- uni.setNavigationBarTitle({
- title: options.titlename
- }); //璁剧疆椤堕儴鏍囬
- this.title = options.titlename;
- this.param = JSON.parse(options.param);
+ try {
+ showLoading("loading...")
+ uni.setNavigationBarTitle({
+ title: options.titlename
+ }); //璁剧疆椤堕儴鏍囬
+ this.title = options.titlename;
+ this.param = JSON.parse(options.param);
- this.styledef = {};
- this.head_styledef = {
- form: {
- items: []
+ this.styledef = {};
+ this.head_styledef = {
+ form: {
+ items: []
+ }
+ };
+ this.detail1_styledef = {};
+ this.detail1StyleDefList = [];
+ this.ListHtml_Panel = "";
+ this.ListPageHtml_Show = {
+ name: "",
+ event: {
+ id: "",
+ name: ""
+ }
+ };
+ this.items = [];
+ this.active_id = '';
+ this.activeItem = {};
+ //this.activelist = [];
+ const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
+
+ if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML椤甸潰") {
+ // HTML椤甸潰
+ //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
+ await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id,
+ paramValue);
+ } else {
+ await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id);
+
+ await this.initial(paramValue);
+ await this.loadInitialEvent();
+
}
- };
- this.detail1_styledef = {};
- this.detail1StyleDefList = [];
- this.ListHtml_Panel = "";
- this.ListPageHtml_Show = {
- name: "",
- event: {
- id: "",
- name: ""
- }
- };
- this.items = [];
- this.active_id = '';
- this.activeItem = {};
- //this.activelist = [];
- const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
- if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML椤甸潰") {
- // HTML椤甸潰
- //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
- await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id,
- paramValue);
- } else {
- await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id);
-
- await this.initial(paramValue);
- await this.loadInitialEvent();
-
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
}
-
- // this.isFilter=true;
- // if(this.param.ShowFilter)
- // this.isFilter=false;
- // //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- // if(this.param.Query_Panel){
- // this.Head_UIStyleGetInfo(this.param.DataCls.id,this.param.Query_Panel.id);
- // }
- // if(this.param.ListPage.ListItem_UIDef?.ui_type=="HTML椤甸潰"){
- // // HTML椤甸潰
- // //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
- // await this.Html_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id);
- // }else{
- // await this.Detail1_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id);
- // }
- // this.orderby = this.param.Order?this.param.Order:'T_CREATE Desc';
- // if(this.param.Query_Event){
- // await this.onSearChange(this.param.DataCls.id,this.param.Query_Event.id);
- // } else{
- // this.wheres = this.param.Condition;
- // this.pageindex = 1;
- // this.page_size = 3;
- // this.query_id = "";
- // await this.loadDataGetList();
- // }
- // console.log(this.param);
- //椤甸潰鍒濆鍖栬幏鍙栫劍鐐�- // this.focusMateria=true;
},
computed: {
@@ -623,6 +605,7 @@
async onSearChange(clsid, eventid) {
try {
if (eventid) {
+ showLoading("loading...")
var $this = this;
var dataInfo = {
ed_type: 0,
@@ -630,9 +613,10 @@
class_id: clsid,
event_id: eventid,
};
+
var result = await runCustomEvent(dataInfo)
// console.log(result);
-
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -693,6 +677,7 @@
}
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + " 4.1")
}
@@ -700,10 +685,7 @@
//鏌ヨ鏁版嵁绫绘暟鎹俊鎭� async loadDataGetList() {
try {
- uni.showLoading({
- title: this.translateSys("loading"),
- mask: true
- });
+ showLoading("loading...")
//鏉′欢鏌ヨ
var condition = this.wheres;
if (this.where) {
@@ -725,7 +707,7 @@
};
dataObjQuery(dataInfo).then(result => {
console.log(result);
- uni.hideLoading();
+ hideLoading()
// var list=[];
$this.query_id = '';
@@ -852,9 +834,11 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "5.1")
});
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys("error") + "5.2")
}
},
@@ -1083,6 +1067,7 @@
//鎵ц浜嬩欢
async TriggerEvent(btn, style, enviroment) { //鎵ц瑙﹀彂浜嬩欢
try {
+ showLoading("loading...")
let obj_attr = {
S_ID: this.styledef.form.objId
};
@@ -1119,6 +1104,7 @@
obj_attr: obj_attr,
}
var result = await runCustomEvent(dataInfo)
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -1165,6 +1151,7 @@
}
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error'))
}
},
@@ -1261,16 +1248,20 @@
//鎵ц鍚庡鐞嗕簨浠� async AfterProcess_Event(clsId, afterProcess_Event, enviroment) {
try {
+
if (afterProcess_Event.ID) {
//鎵ц鍚庡鐞嗕簨浠�+ showLoading("loading...")
await this.runCustomEvent({
ed_type: 0,
start_transaction: true,
class_id: clsId,
event_id: afterProcess_Event.ID,
});
+ hideLoading()
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "7")
}
},
@@ -1362,6 +1353,7 @@
async onChange(event) {
try {
if (event.id) {
+ showLoading("loading...")
var obj_attr = this.head_styledef.form.model;
// console.log(obj_attr);
var input_param = Base64.encode(
@@ -1394,6 +1386,7 @@
};
runCustomEvent(dataInfo).then(result => {
// console.log(result);
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -1499,10 +1492,12 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
});
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "8.2")
}
@@ -1692,8 +1687,10 @@
async runCustomEvent(dataInfo) {
try {
var $this = this;
+ showLoading("loading...")
runCustomEvent(dataInfo).then(result => {
console.log(result);
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -1817,9 +1814,11 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "9.1")
});
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "9.2")
}
diff --git a/pages/modal/3200_view.vue b/pages/modal/3200_view.vue
index 169b378..ffb290d 100644
--- a/pages/modal/3200_view.vue
+++ b/pages/modal/3200_view.vue
@@ -40,7 +40,9 @@
import classUtils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
appGetInfo,
@@ -98,47 +100,56 @@
},
async onLoad(options) {
// console.log(options);
- uni.setNavigationBarTitle({
- title: options.titlename
- }); //璁剧疆椤堕儴鏍囬
- this.title = options.titlename;
- this.param = JSON.parse(options.param);
- console.log(this.param);
- this.styleDef = JSON.parse(options.style);
- // console.log(this.styleDef);
- if (this.param.ViewPage.View_UIDef.ui_type == "HTML椤甸潰") {
- // HTML椤甸潰
- //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
- this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ViewPage.View_UIDef.id, 'viewPage');
- } else {
- this.Detail2_UIstyleGetInfo(this.param.DataCls.id, this.param.ViewPage.View_UIDef.id);
- }
-
-
- //杩涘叆椤甸潰鍚庝簨浠�- var eventid = this.param.ViewPage.Enter_View_Event?.id;
- if (eventid) {
- try {
- var obj_attr = {
- 'S_ID': this.styleDef.form.objId
- };
- this.styleDef.form.attrs.forEach((attr) => {
- obj_attr[attr.name] = attr.value;
- });
- // console.log(obj_attr);
- var input_param = Base64.encode(JSON.stringify(obj_attr));
- this.runCustomEvent({
- ed_type: 0,
- start_transaction: true,
- class_id: this.param.DataCls.id,
- event_id: eventid,
- data_obj_id: this.styleDef.form.objId,
- obj_attr,
- input_param,
- });
- } catch (ex) {
- showError(ex, this.translateSys('error'))
+ try {
+ showLoading("loading...")
+ uni.setNavigationBarTitle({
+ title: options.titlename
+ }); //璁剧疆椤堕儴鏍囬
+ this.title = options.titlename;
+ this.param = JSON.parse(options.param);
+ console.log(this.param);
+ this.styleDef = JSON.parse(options.style);
+ // console.log(this.styleDef);
+ if (this.param.ViewPage.View_UIDef.ui_type == "HTML椤甸潰") {
+ // HTML椤甸潰
+ //鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
+ await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ViewPage.View_UIDef.id,
+ 'viewPage');
+ } else {
+ await this.Detail2_UIstyleGetInfo(this.param.DataCls.id, this.param.ViewPage.View_UIDef.id);
}
+
+
+ //杩涘叆椤甸潰鍚庝簨浠�+ var eventid = this.param.ViewPage.Enter_View_Event?.id;
+ if (eventid) {
+ try {
+ var obj_attr = {
+ 'S_ID': this.styleDef.form.objId
+ };
+ this.styleDef.form.attrs.forEach((attr) => {
+ obj_attr[attr.name] = attr.value;
+ });
+ // console.log(obj_attr);
+ var input_param = Base64.encode(JSON.stringify(obj_attr));
+ await this.runCustomEvent({
+ ed_type: 0,
+ start_transaction: true,
+ class_id: this.param.DataCls.id,
+ event_id: eventid,
+ data_obj_id: this.styleDef.form.objId,
+ obj_attr,
+ input_param,
+ });
+ } catch (ex) {
+ showError(ex, this.translateSys('error'))
+ }
+ }
+ hideLoading()
+ } catch (ex) {
+
+ hideLoading()
+ showError(ex, this.translateSys("error"));
}
},
methods: {
@@ -401,6 +412,7 @@
//鎵ц瑙﹀彂浜嬩欢
async triggerEvent(btn, style, enviroment) {
try {
+ showLoading("loading...")
btn.disabled = true
var obj_attr = {
'S_ID': this.styleDef.form.objId
@@ -411,6 +423,7 @@
// console.log(obj_attr);
// let input_param = Base64.encode(JSON.stringify(obj_attr));
// return;
+
await this.runCustomEvent({
ed_type: 0,
start_transaction: true,
@@ -420,7 +433,9 @@
obj_attr: obj_attr,
});
btn.disabled = false
+ hideLoading()
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "3")
}
},
@@ -455,7 +470,7 @@
if (time)
showError(tip, this.translateSys('tip'))
else
- showInfo(tip)
+ showInfo(tip)
if ([0, 2, 3, 4, -1].includes(result.result_type)) {
if (result.result_type == 2) {
diff --git a/pages/modal/3201.vue b/pages/modal/3201.vue
index 45e4615..8930f3e 100644
--- a/pages/modal/3201.vue
+++ b/pages/modal/3201.vue
@@ -37,7 +37,9 @@
import classUtils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
appGetInfo,
diff --git a/pages/modal/3202.vue b/pages/modal/3202.vue
index 7860655..6f3d68e 100644
--- a/pages/modal/3202.vue
+++ b/pages/modal/3202.vue
@@ -40,7 +40,9 @@
import classUtils from "@/js/utils.js"
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
appGetInfo,
@@ -116,29 +118,36 @@
},
async onLoad(options) {
- // console.log(options);
- uni.setNavigationBarTitle({
- title: options.titlename
- }); //璁剧疆椤堕儴鏍囬
- this.title = options.titlename;
- this.param = JSON.parse(options.param);
- const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
- this.styledef = {};
- this.head_styledef = {
- form: {
- items: []
- }
- };
- this.detail1_styledef = {};
- this.detail1StyleDefList = [];
- this.items = [];
- this.active_id = '';
- this.activeItem = {};
- this.click_item_view = false
- if (this.param?.ClickItem_Event?.id)
- this.click_item_view = true
- await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ListItem_Panel.id);
- this.initial(paramValue)
+ try {
+ showLoading("loading...")
+ // console.log(options);
+ uni.setNavigationBarTitle({
+ title: options.titlename
+ }); //璁剧疆椤堕儴鏍囬
+ this.title = options.titlename;
+ this.param = JSON.parse(options.param);
+ const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
+ this.styledef = {};
+ this.head_styledef = {
+ form: {
+ items: []
+ }
+ };
+ this.detail1_styledef = {};
+ this.detail1StyleDefList = [];
+ this.items = [];
+ this.active_id = '';
+ this.activeItem = {};
+ this.click_item_view = false
+ if (this.param?.ClickItem_Event?.id)
+ this.click_item_view = true
+ await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ListItem_Panel.id);
+ this.initial(paramValue)
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
+ }
},
methods: {
@@ -218,6 +227,7 @@
};
runCustomEvent(dataInfo).then(result => {
console.log(result);
+
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -588,6 +598,7 @@
if (!this.clickItemEvent.id) {
return;
}
+ showLoading("loading...")
const $this = this
var obj_attr = this.head_styledef.form.model;
@@ -628,6 +639,7 @@
data_json,
}).then(result => {
// console.log(result);
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -693,6 +705,7 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
});
},
@@ -746,7 +759,7 @@
//鎵ц瑙﹀彂浜嬩欢
async triggerEvent(btn, style, enviroment) {
const $this = this
-
+showLoading("loading...")
var obj_attr = this.head_styledef.form.model;
// console.log(obj_attr);
var input_param = Base64.encode(
@@ -784,6 +797,7 @@
input_param,
data_json,
}).then(result => {
+ hideLoading()
// console.log(result);
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
@@ -855,6 +869,7 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
});
},
@@ -1017,6 +1032,7 @@
async onChange(event) {
try {
if (event.id) {
+ showLoading("loading...")
var obj_attr = this.head_styledef.form.model;
console.log(obj_attr);
var input_param = Base64.encode(
@@ -1049,6 +1065,7 @@
};
runCustomEvent(dataInfo).then(result => {
console.log(result);
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -1143,10 +1160,12 @@
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
});
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "8.2")
}
diff --git a/pages/modal/3202_view.vue b/pages/modal/3202_view.vue
index a4501b9..1dc8d95 100644
--- a/pages/modal/3202_view.vue
+++ b/pages/modal/3202_view.vue
@@ -35,7 +35,9 @@
} from '@/js/Base64.js';
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import classUtils from "@/js/utils.js"
import {
@@ -113,58 +115,64 @@
},
},
onBackPress(e) {
- this.beforeNavigateBack()
+ this.beforeNavigateBack()
},
async onLoad(options) {
- console.log(options);
- uni.setNavigationBarTitle({
- title: options.titlename
- }); //璁剧疆椤堕儴鏍囬
- this.title = options.titlename;
- this.param = JSON.parse(options.param);
- this.head_styledef = {
- form: {
- items: []
- }
- };
- this.detail1_styledef = {};
- this.detail1StyleDefList = [];
- this.active_id = '';
- this.activeItem = {};
- await this.Head_UIStyleGetInfo(this.param.ClsID, this.param.MasterView_Panel.id);
- await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ViewItem_Panel.id);
- const dataObj = options.dataObj ? JSON.parse(options.dataObj) : {};
- if (dataObj) {
- let attrs = [];
- let master_view = dataObj?.master_view;
- Object.keys(master_view).forEach((a) => {
- attrs.push({
- attr: a,
- value: master_view[a]
+ try {
+ showLoading("loading...")
+ console.log(options);
+ uni.setNavigationBarTitle({
+ title: options.titlename
+ }); //璁剧疆椤堕儴鏍囬
+ this.title = options.titlename;
+ this.param = JSON.parse(options.param);
+ this.head_styledef = {
+ form: {
+ items: []
+ }
+ };
+ this.detail1_styledef = {};
+ this.detail1StyleDefList = [];
+ this.active_id = '';
+ this.activeItem = {};
+ await this.Head_UIStyleGetInfo(this.param.ClsID, this.param.MasterView_Panel.id);
+ await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ViewItem_Panel.id);
+ const dataObj = options.dataObj ? JSON.parse(options.dataObj) : {};
+ if (dataObj) {
+ let attrs = [];
+ let master_view = dataObj?.master_view;
+ Object.keys(master_view).forEach((a) => {
+ attrs.push({
+ attr: a,
+ value: master_view[a]
+ });
});
- });
- attrs.forEach((attr) => {
- this.head_styledef.form.items.forEach((ele2) => {
- if (ele2.name != "Layout") {
- if (ele2.fieldId == attr.attr) {
- ele2.value = attr.value;
- }
- } else if (ele2.name == "Layout") {
- ele2.setting.colList.forEach((col) => {
- if (col) {
- if (col.fieldId == attr.attr) {
- col.value = attr.value;
- }
+ attrs.forEach((attr) => {
+ this.head_styledef.form.items.forEach((ele2) => {
+ if (ele2.name != "Layout") {
+ if (ele2.fieldId == attr.attr) {
+ ele2.value = attr.value;
}
- });
- }
+ } else if (ele2.name == "Layout") {
+ ele2.setting.colList.forEach((col) => {
+ if (col) {
+ if (col.fieldId == attr.attr) {
+ col.value = attr.value;
+ }
+ }
+ });
+ }
+ });
});
- });
- this.viewAceionContent(dataObj.page.list);
+ this.viewAceionContent(dataObj.page.list);
+ }
+ if (this.enter_view_event.id)
+ this.enterAfterEvent(this.enter_view_event);
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
}
- if (this.enter_view_event.id)
- this.enterAfterEvent(this.enter_view_event);
-
},
methods: {
//
@@ -347,6 +355,7 @@
//椤甸潰杩涘叆鍚庝簨浠� async enterAfterEvent(event) {
try {
+ showLoading("loading...")
let data_json = [];
let jsonlist = [];
let detailStyleList = this.detail1StyleDefList;
@@ -372,7 +381,7 @@
} else input_param[item.fieldId] = item.value;
});
input_param = Base64.encode(JSON.stringify(input_param));
- this.runCustomEvent({
+ await this.runCustomEvent({
ed_type: 0,
start_transaction: true,
class_id: this.param.ClsID,
@@ -380,8 +389,10 @@
input_param,
data_json,
})
+ hideLoading()
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('tip'));
}
},
@@ -511,46 +522,55 @@
},
async onTriggerEvent(btn, enviroment) {
- let data_json = [];
- let jsonlist = [];
+ try {
+ showLoading("loading...")
- let detailStyleList = this.detail1StyleDefList;
- detailStyleList.forEach((style) => {
- let detail_attr = {};
- style.form.items.forEach((item) => {
+ let data_json = [];
+ let jsonlist = [];
+
+ let detailStyleList = this.detail1StyleDefList;
+ detailStyleList.forEach((style) => {
+ let detail_attr = {};
+ style.form.items.forEach((item) => {
+ if (item.name == "Layout") {
+ item.setting.colList.forEach((cols) => {
+ if (cols != null) detail_attr[cols.fieldId] = cols.value;
+ });
+ } else detail_attr[item.fieldId] = item.value;
+ });
+ jsonlist.push(detail_attr);
+ });
+ data_json = Base64.encode(JSON.stringify(jsonlist));
+
+ let input_param = {};
+ this.head_styledef.form.items.forEach((item) => {
if (item.name == "Layout") {
item.setting.colList.forEach((cols) => {
- if (cols != null) detail_attr[cols.fieldId] = cols.value;
+ if (cols != null) input_param[cols.fieldId] = cols.value;
});
- } else detail_attr[item.fieldId] = item.value;
+ } else input_param[item.fieldId] = item.value;
});
- jsonlist.push(detail_attr);
- });
- data_json = Base64.encode(JSON.stringify(jsonlist));
-
- let input_param = {};
- this.head_styledef.form.items.forEach((item) => {
- if (item.name == "Layout") {
- item.setting.colList.forEach((cols) => {
- if (cols != null) input_param[cols.fieldId] = cols.value;
- });
- } else input_param[item.fieldId] = item.value;
- });
- input_param = Base64.encode(JSON.stringify(input_param));
- await this.runCustomEvent({
- ed_type: 0,
- start_transaction: true,
- class_id: btn.Cls_ID,
- event_id: btn.Event.ID,
- input_param,
- data_json,
- });
+ input_param = Base64.encode(JSON.stringify(input_param));
+ await this.runCustomEvent({
+ ed_type: 0,
+ start_transaction: true,
+ class_id: btn.Cls_ID,
+ event_id: btn.Event.ID,
+ input_param,
+ data_json,
+ });
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
+ }
},
async navigateBackEvent() {
try {
var $this = this;
if (!this.exit_view_event.id)
return
+ showLoading("loading...")
let data_json = [];
let jsonlist = [];
let detailStyleList = this.detail1StyleDefList;
@@ -584,6 +604,7 @@
input_param,
data_json,
})
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
@@ -624,20 +645,20 @@
}
} catch (ex) {
+ hideLoading()
showError(ex, this.translateSys('error') + "9.2")
}
},
- cancel(e) { //鍙栨秷
-
+ cancel(e) { //鍙栨秷
+
this.beforeNavigateBack()
uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
});
},
- async beforeNavigateBack()
- {
+ async beforeNavigateBack() {
await this.navigateBackEvent()
const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('ExitViewPage');
diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index 4e0d95e..31dc2b6 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -118,7 +118,9 @@
} from '@/js/Base64.js';
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
dictGetInfo,
@@ -235,63 +237,70 @@
});
},
async loadData(paramValue) {
- //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�- await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
- //浼犲叆鍙傛暟鍊�- console.log(paramValue)
- if (paramValue) {
- this.setFormValues(paramValue)
- }
- //鍔犺浇鍒濆鐣岄潰
- if (this.param.Show_Welcom_Page) {
- this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+');
- this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width);
- this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height);
- };
- //鍔犺浇Tab椤电
- const pageList = this.param.Sub_Page || []
- for (let i in pageList) {
+ try {
+ showLoading("loading...")
+ //鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+ await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
+ //浼犲叆鍙傛暟鍊�+ console.log(paramValue)
+ if (paramValue) {
+ this.setFormValues(paramValue)
+ }
+ //鍔犺浇鍒濆鐣岄潰
+ if (this.param.Show_Welcom_Page) {
+ this.param.Welcome_Page.Img = this.param.Welcome_Page.Img.replace(/ /g, '+');
+ this.param.Welcome_Page.Width = parseInt(this.param.Welcome_Page.Width);
+ this.param.Welcome_Page.Height = parseInt(this.param.Welcome_Page.Height);
+ };
+ //鍔犺浇Tab椤电
+ const pageList = this.param.Sub_Page || []
+ for (let i in pageList) {
- const page = pageList[i]
- page.DefList = [];
- page.StyleDef = await this.Detail_UIstyleGetInfo(
- this.ClsID,
- page.UI_Style.ID
- );
- const buttons = this.pageButtonList(page)
- page.Button = buttons
- page.DropDownButton = []
- if (buttons.length > 3) {
- let cancelBtn = undefined
- const btns = []
- buttons.forEach((btn) => {
- if (btn.FunCode == "Cancel") {
- cancelBtn = btn
+ const page = pageList[i]
+ page.DefList = [];
+ page.StyleDef = await this.Detail_UIstyleGetInfo(
+ this.ClsID,
+ page.UI_Style.ID
+ );
+ const buttons = this.pageButtonList(page)
+ page.Button = buttons
+ page.DropDownButton = []
+ if (buttons.length > 3) {
+ let cancelBtn = undefined
+ const btns = []
+ buttons.forEach((btn) => {
+ if (btn.FunCode == "Cancel") {
+ cancelBtn = btn
+ } else {
+ btns.push(btn)
+ }
+ })
+ if (cancelBtn) {
+ if (btns.length > 2) {
+ page.DropDownButton = btns.splice(2)
+ page.Button = btns
+ }
+ page.Button.push(cancelBtn)
} else {
- btns.push(btn)
- }
- })
- if (cancelBtn) {
- if (btns.length > 2) {
- page.DropDownButton = btns.splice(2)
- page.Button = btns
- }
- page.Button.push(cancelBtn)
- } else {
- if (btns.length > 3) {
- page.DropDownButton = btns.splice(3)
- page.Button = btns
+ if (btns.length > 3) {
+ page.DropDownButton = btns.splice(3)
+ page.Button = btns
+ }
}
}
+ page.Row_Button = this.rowButtonList(page)
}
- page.Row_Button = this.rowButtonList(page)
- }
- this.setData({
- pageDetail: pageList
- })
- await this.loadInitialEvent();
- console.log(this.pageDetail);
+ this.setData({
+ pageDetail: pageList
+ })
+ await this.loadInitialEvent();
+ console.log(this.pageDetail);
+ hideLoading()
+ } catch (ex) {
+ hideLoading()
+ showError(ex, this.translateSys("error"));
+ }
},
async loadInitialEvent() {
try {
@@ -928,7 +937,16 @@
},
onClick(item) {
console.log("onClick", item)
- this.focusFieldId = item.fieldId
+ if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+ this.focusFieldId = item.fieldId
+ } else if (item.name == "ImageButton") {
+ var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+ if (!onClickEvent.id) {
+ showInfo(this.translate('icon_click_event_empty'))
+ return;
+ }
+ this.onChange(onClickEvent);
+ }
},
ontap(item) { //鎵爜鍔熻兘
// var $ele = e;
@@ -1066,9 +1084,7 @@
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
this.$refs.popup.open(this.popupType);
- this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '',
- onSuffixClickCallbackEvent.id,
- item);
+ this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id, item);
},
onDetailEnterChange(item, style, pageIndex) {
let newVal = item.value
@@ -1094,7 +1110,7 @@
async runDetailChangeEvent(event, style, pageIndex) {
try {
const detail_attr = {}
-
+ showLoading("loading...")
style.form.items.forEach(item2 => {
if (item2.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮� item2.setting.colList.forEach(col => {
@@ -1134,7 +1150,9 @@
};
const result = await runCustomEvent(dataInfo)
console.log(result)
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
+
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info
@@ -1195,6 +1213,7 @@
} catch (ex) {
console.log(ex)
+ hideLoading()
showError(ex, this.translateSys('error') + "6.1")
}
@@ -1270,6 +1289,7 @@
try {
if (event.id) {
//鑾峰彇琛ㄥご灞炴�
+ showLoading("loading...")
var head_attr = {};
this.head_styledef.form.items.forEach(item => {
if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -1328,246 +1348,13 @@
};
const result = await runCustomEvent(dataInfo)
console.log(result);
- if (result.ret != 0 && result.ret != 1) {
- let cls_name = result.event_info?.cls_name
- let event_name = result.event_info?.event_name
- tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
- .err_info
- .join('\n') : ''
- if (result.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 (result.ret == 801) showInfo(tip)
- else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
- this.saving = false
- return false
- } else {
- var tip = result.info ? typeof result.info == 'string' ? result.info :
- result.info.join('\n') : '';
- tip = tip || result.err_info
- let time = result.info_time || 0
- if (time)
- showError(tip, this.translateSys('tip'))
- else
- showInfo(tip)
- if ([0, 2, 3, 4, -1].includes(result.result_type)) {
- if (result.result_type == 2) {
-
- } else if (typeof result.result == 'string') {
- showInfo(result.result)
-
- }
- try {
- let actionList = result.action || []
- actionList.forEach(item => {
- if (item.action_type ==
- "insert_subtable_page_row"
- ) { //鐮佺洏涓�- $this.param.Show_Welcom_Page =
- false;
- var value = item.value;
- $this.viewAceionRow(value);
- } else if (item.action_type ==
- "set_subtable_page_content"
- ) { //宸茬爜鐩�- $this.param.Show_Welcom_Page =
- false;
- var value = item.value;
- const pageData = $this
- .pageDetail.find((
- page) => {
- return value
- .page_name ==
- page.Name;
- });
- if (value.clear_confirm !=
- false && value.clear ==
- true &&
- pageData && pageData
- .DefList.length > 0
- ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�- uni.showModal({
- title: this
- .translateSys(
- 'tip'),
- content: this
- .translate(
- "are_you_sure_clear_first"
- ) +
- this
- .translateSys(
- "quotation_mark_left"
- ) +
- value
- .page_name +
- this
- .translateSys(
- "quotation_mark_right"
- ) +
- this
- .translate(
- "are_you_sure_clear_last"
- ),
- cancelText: $this
- .translateSys(
- 'ok'),
- confirmText: $this
- .translateSys(
- 'cancel'
- ),
- success: function(
- res) {
- if (res
- .cancel
- ) {
- if (
- pageData)
- pageData
- .DefList = [];
- $this
- .viewAceionContent(
- value
- );
- } else if (
- res
- .confirm
- ) {
- if (
- pageData)
- pageData
- .DefList = [];
- $this
- .viewAceionContent(
- value
- );
- }
- }
- });
- } else {
- if (pageData)
- pageData.DefList = [];
- $this.viewAceionContent(
- value);
- }
- } else if (item.action_type ==
- "select_subtable_page") {
- var value = item.value;
- const pageIndex = $this
- .pageDetail.findIndex((
- page) => {
- return value
- .page_name ==
- page.Name;
- });
- if (pageIndex > -1) {
- $this.setData({
- current: pageIndex
- })
- }
- } else if (item.action_type ==
- "select_subtable_page_row") {
- // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}}
- var value = item.value;
- $this.viewActionSelectRow(
- value)
- } else if (item.action_type ==
- "remove_subtable_page_row"
- ) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�- var value = item.value;
- $this.viewActionRemoveRow(
- value)
- } else if (item.action_type ==
- "set_subtable_page_row") {
- $this.viewActionSetRow(item
- .value)
-
- } else if (item.action_type ==
- "set_subtable_page_ext_data") {
- var value = item.value;
- const pageData = $this
- .pageDetail.find((
- page) => {
- return value
- .page_name ==
- page.Name;
- });
- if (pageData)
- pageData.ExtData = value
- .ext_data
-
- } else if (item.action_type ==
- "clear_subpage_rows") {
- var value = item.value;
- const pageIndex = $this
- .pageDetail.findIndex((
- page) => {
- return value
- .page_name ==
- page.Name;
- });
- if (pageIndex > -1) {
- const pageData = $this
- .pageDetail[pageIndex]
- pageData.DefList = []
- pageData.ExtData = {}
-
- $this.$set(this.pageDetail,
- pageIndex, pageData
- )
- }
-
- } else if (item.action_type ==
- "set_dlg_current_edit_attr") {
-
- if ($this.focusOldFieldId ==
- item.value) {
- $this.setData({
- focusFieldId: ""
- })
- } else {
- $this.setData({
- focusFieldId: $this
- .focusOldFieldId
- })
- }
- $this.$nextTick(() => {
- $this.setData({
- focusFieldId: item
- .value
- })
- });
- } else if (item.action_type ==
- "set_dlg_attr") {
- // value = {"attr":"xxx", "value":"xxx"}
- var data = item.value;
- $this.setFormValues(data)
- } else if (item.action_type ==
- 'set_dlg_attr_show') {
- var data = item.value;
- $this.setFormItemVisible(data)
- }
- });
-
- } catch (ex) {
- let actionList = (result.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
- }
- }
-
- }
+ hideLoading()
+ await $this.onFormEventResult(result,"")
}
} catch (ex) {
console.log(ex);
+ hideLoading()
showError(ex, this.translateSys('error') + "4.2")
}
},
@@ -2607,6 +2394,9 @@
async DataObjRunCustomEvent(info, data_attr) {
var $this = this;
+ if( !info.eventid)
+ return
+ showLoading("loading...")
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -2673,102 +2463,17 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(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
- 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) {
- $this.setFormValues(data.result || [])
- } else if (typeof data.result ==
- 'string') {
- showInfo(data.result)
- }
- try {
- var actionlist = data.action || []
- 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(result)
- } else if (action
- .action_type ==
- 'set_dlg_attr_show') {
- var result = action.value;
- $this.setFormItemVisible(
- result)
-
- // console.log($this.head_styledef);
- } else if (action
- .action_type ==
- 'set_global_attr') {
- $this.global_attr = action
- .value || [];
- } else {
- showInfo(this
- .translateSys(
- "quotation_mark_left"
- ) +
- action
- .action_type +
- this
- .translateSys(
- "quotation_mark_right"
- ) +
- this
- .translate(
- "tip_action_unprocessed"
- ))
-
- }
- }
-
-
- } 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
- }
- }
- }
+ hideLoading()
+ $this.onFormEventResult(data,"")
}).catch(ex => {
// console.log(ex);
+ hideLoading()
showError(ex, this.translateSys("error") + "3.1")
});
},
- dataObjRunCustomEvent_Return(eventid, data_attr,
- button_callback, item) {
- console.log("dataObjRunCustomEvent_Return", eventid,
- data_attr, button_callback)
+ dataObjRunCustomEvent_Return(eventid, button_callback, item) {
+ showLoading("loading...")
const $this = this
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�@@ -2833,7 +2538,29 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
+ hideLoading()
+ $this.onFormEventResult(data, button_callback, item)
+ }).catch(ex => {
+ hideLoading()
+ showError(ex, this.translateSys("error") + "5.1")
+ });
+ },
+
+ async onFormEventResult(data, callbackEventId, item) {
+ try {
+ const $this = this
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: $this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: $this.translateSys('add2'),
+ master: {
+ cls_id: $this.ClsID, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ }
+ };
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
@@ -2867,16 +2594,202 @@
showInfo(data.result)
}
try {
+ var enviroment = JSON.stringify(enviroment);
var actions = data.action || []
- for (var i = 0; i < actions
- .length; i++) {
+ for (var i = 0; i < actions.length; i++) {
var action = actions[i];
console.log(action)
- var val = action.value;
- var enviroment = JSON
- .stringify(enviroment);
-
if (action.action_type ==
+ "insert_subtable_page_row"
+ ) { //鐮佺洏涓�+ $this.param.Show_Welcom_Page =
+ false;
+ var value = action.value;
+ $this.viewAceionRow(value);
+ } else if (action.action_type ==
+ "set_subtable_page_content"
+ ) { //宸茬爜鐩�+ $this.param.Show_Welcom_Page =
+ false;
+ var value = action.value;
+ const pageData = $this
+ .pageDetail.find((
+ page) => {
+ return value
+ .page_name ==
+ page.Name;
+ });
+ if (value.clear_confirm !=
+ false && value.clear ==
+ true &&
+ pageData && pageData
+ .DefList.length > 0
+ ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+ uni.showModal({
+ title: this
+ .translateSys(
+ 'tip'),
+ content: this
+ .translate(
+ "are_you_sure_clear_first"
+ ) +
+ this
+ .translateSys(
+ "quotation_mark_left"
+ ) +
+ value
+ .page_name +
+ this
+ .translateSys(
+ "quotation_mark_right"
+ ) +
+ this
+ .translate(
+ "are_you_sure_clear_last"
+ ),
+ cancelText: $this
+ .translateSys(
+ 'ok'),
+ confirmText: $this
+ .translateSys(
+ 'cancel'
+ ),
+ success: function(
+ res) {
+ if (res
+ .cancel
+ ) {
+ if (
+ pageData)
+ pageData
+ .DefList = [];
+ $this
+ .viewAceionContent(
+ value
+ );
+ } else if (
+ res
+ .confirm
+ ) {
+ if (
+ pageData)
+ pageData
+ .DefList = [];
+ $this
+ .viewAceionContent(
+ value
+ );
+ }
+ }
+ });
+ } else {
+ if (pageData)
+ pageData.DefList = [];
+ $this.viewAceionContent(
+ value);
+ }
+ } else if (action.action_type ==
+ "select_subtable_page") {
+ var value = action.value;
+ const pageIndex = $this
+ .pageDetail.findIndex((
+ page) => {
+ return value
+ .page_name ==
+ page.Name;
+ });
+ if (pageIndex > -1) {
+ $this.setData({
+ current: pageIndex
+ })
+ }
+ } else if (action.action_type ==
+ "select_subtable_page_row") {
+ // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}}
+ var value = action.value;
+ $this.viewActionSelectRow(
+ value)
+ } else if (action.action_type ==
+ "remove_subtable_page_row"
+ ) { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�+ var value = action.value;
+ $this.viewActionRemoveRow(
+ value)
+ } else if (action.action_type ==
+ "set_subtable_page_row") {
+ $this.viewActionSetRow(action
+ .value)
+
+ } else if (action.action_type ==
+ "set_subtable_page_ext_data") {
+ var value = action.value;
+ const pageData = $this
+ .pageDetail.find((
+ page) => {
+ return value
+ .page_name ==
+ page.Name;
+ });
+ if (pageData)
+ pageData.ExtData = value
+ .ext_data
+
+ } else if (action.action_type ==
+ "clear_subpage_rows") {
+ var value = action.value;
+ const pageIndex = $this
+ .pageDetail.findIndex((
+ page) => {
+ return value
+ .page_name ==
+ page.Name;
+ });
+ if (pageIndex > -1) {
+ const pageData = $this
+ .pageDetail[pageIndex]
+ pageData.DefList = []
+ pageData.ExtData = {}
+
+ $this.$set(this.pageDetail,
+ pageIndex, pageData
+ )
+ }
+
+ } else if (action.action_type ==
+ "set_dlg_current_edit_attr") {
+
+ if ($this.focusOldFieldId ==
+ action.value) {
+ $this.setData({
+ focusFieldId: ""
+ })
+ } else {
+ $this.setData({
+ focusFieldId: $this
+ .focusOldFieldId
+ })
+ }
+ $this.$nextTick(() => {
+ $this.setData({
+ focusFieldId: action
+ .value
+ })
+ });
+ } else if (action.action_type ==
+ "set_dlg_attr") {
+ // value = {"attr":"xxx", "value":"xxx"}
+ var data = action.value;
+ $this.setFormValues(data)
+ } else if (action.action_type ==
+ 'set_dlg_attr_show') {
+ var data = action.value;
+ $this.setFormItemVisible(data)
+ } else if (action
+ .action_type ==
+ 'set_global_attr') {
+ $this.global_attr = action
+ .value || [];
+ } else if (action.action_type ==
'open_panel') {
var d = dialog({
title: '<i class="ace-icon fa fa-info-circle"></i> ' +
@@ -2906,9 +2819,9 @@
// style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : ''
var param = {
item: item,
- button_callback: button_callback,
+ button_callback: callbackEventId,
req: req,
- data_attr: data_attr
+ data_attr: ""
}
uni.navigateTo({
url: '../selpsn/index?mulit=false¶m=' +
@@ -3008,9 +2921,9 @@
);
var popupParam = {
item: item,
- button_callback: button_callback,
+ button_callback: callbackEventId,
req: req,
- data_attr: data_attr
+ data_attr: ""
}
$this.setData({
popupParam: popupParam
@@ -3051,7 +2964,7 @@
priRel = '5';
var param_ = {
item: item,
- button_callback: button_callback,
+ button_callback: callbackEventId,
req: req
}
uni.navigateTo({
@@ -3155,12 +3068,10 @@
}
- }).catch(ex => {
- showError(ex, this.translateSys("error") + "5.1")
- });
+ } catch (ex) {
+ showError(ex, this.translateSys("error") + "10.1")
+ }
},
-
-
onPanelClick(value, id) {
// console.log(value);
this.active_id = id;
@@ -3769,9 +3680,9 @@
// });
},
//鎵ц纭畾鑴氭湰
- async runCustomEvent(pageParam, event, input_param, json,
- type) {
+ async runCustomEvent(pageParam, event, input_param, json, type) {
var $this = this;
+ showLoading("loading...")
var data_json = Base64.encode(
JSON.stringify(json)
);
@@ -3797,10 +3708,13 @@
console.log(dataInfo);
runCustomEvent(dataInfo).then(result => {
console.log(result);
+ hideLoading()
if (result.ret != 0 && result.ret != 1) {
+
let cls_name = result.event_info?.cls_name
let event_name = result.event_info?.event_name
- tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
+ tip = result.err_info ? typeof result.err_info == 'string' ? result
+ .err_info : result
.err_info
.join('\n') : ''
if (result.ret == 801) {
@@ -3809,7 +3723,8 @@
if (pos > -1) tip = tip.substring(pos + 1);
}
}
- if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+ if (cls_name && event_name) tip =
+ `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
if (result.ret == 801) showInfo(tip)
else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
this.saving = false
@@ -4150,15 +4065,22 @@
.setFormItemVisible(
data
)
- } else if (item.action_type == 'get_pre_page_subtable_next_row') {
+ } else if (item.action_type ==
+ 'get_pre_page_subtable_next_row') {
var data = item.value;
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.emit('get_pre_page_subtable_next_row', data);
- } else if (item.action_type == 'remove_pre_page_subtable_row') {
+ const eventChannel = this
+ .getOpenerEventChannel();
+ eventChannel.emit(
+ 'get_pre_page_subtable_next_row', data);
+ } else if (item.action_type ==
+ 'remove_pre_page_subtable_row') {
var data = item.value;
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.emit('remove_pre_page_subtable_row', data);
- } else if (item.action_type == "goback_to_pre_page") {
+ const eventChannel = this
+ .getOpenerEventChannel();
+ eventChannel.emit(
+ 'remove_pre_page_subtable_row', data);
+ } else if (item.action_type ==
+ "goback_to_pre_page") {
//杩斿洖涓婁竴椤� uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -4191,9 +4113,8 @@
}
}).catch(ex => {
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
-
-
});
},
diff --git a/pages/modal/form/index.vue b/pages/modal/form/index.vue
index baa3869..4fa48e1 100644
--- a/pages/modal/form/index.vue
+++ b/pages/modal/form/index.vue
@@ -506,7 +506,16 @@
}
},
onClick(item) {
- this.focusFieldId = item.fieldId
+ if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+ this.focusFieldId = item.fieldId
+ } else if (item.name == "ImageButton") {
+ var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+ if (!onClickEvent.id) {
+ showInfo(this.translate('icon_click_event_empty'))
+ return;
+ }
+ this.onChange(onClickEvent);
+ }
},
ontap(item) { //鎵爜鍔熻兘
// var $ele = e;
@@ -642,7 +651,7 @@
// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
this.$refs.popup.open(this.popupType);
- this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent.id,
+ this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id,
item);
},
@@ -697,85 +706,7 @@
};
runCustomEvent(dataInfo).then(result => {
console.log(result);
- if (result.ret != 0 && result.ret != 1) {
- let cls_name = result.event_info?.cls_name
- let event_name = result.event_info?.event_name
- tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info :
- result.err_info
- .join('\n') : ''
-
- if (cls_name && event_name) tip =
- `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
- if (result.ret == 801) showInfo(tip)
- else showError(`${tip}锛屾彁绀猴細${result.ret}`, this.translateSys('tip'))
- this.saving = false
- return false
- } else {
- var tip = result.info ? typeof result.info == 'string' ? result.info :
- result.info.join('\n') : '';
- tip = tip || result.err_info
- let time = result.info_time || 0
- if (time)
- showError(tip, this.translateSys('tip'))
- else
- showInfo(tip)
- if ([0, 2, 3, 4, -1].includes(result.result_type)) {
- if (result.result_type == 2) {
-
- } else if (typeof result.result == 'string') {
- showInfo(result.result)
-
- }
- try {
- var actionList = result.action || []
- actionList.forEach(item => {
-
- if (item.action_type ==
- "set_dlg_current_edit_attr"
- ) {
-
- if ($this
- .focusOldFieldId ==
- item.value) {
- $this.setData({
- focusFieldId: ""
- })
- } else {
- $this.setData({
- focusFieldId: $this
- .focusOldFieldId
- })
- }
- $this.$nextTick(() => {
- $this.setData({
- focusFieldId: item
- .value
- })
- });
- } else if (item.action_type ==
- "set_dlg_attr") {
- // value = {"attr":"xxx", "value":"xxx"}
- var data = item.value;
- $this.setFormValues(data)
- } else if (action.action_type ==
- 'set_dlg_attr_show') {
- var data = action.value;
-
- $this.setFormItemVisible(data)
- }
- });
-
- } catch (ex) {
- let actionList = (result.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
- }
- }
-
- }
+ $this.onFormEventResult(result, "")
}).catch(ex => {
// console.log(ex);
@@ -786,7 +717,268 @@
showError(ex, this.translateSys('tip') + "4.2")
}
},
+ async onFormEventResult(data, button_callback, item) {
+ try {
+ const $this = this
+ var enviroment = {
+ 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: $this.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom
+ button_name: $this.translateSys('add2'),
+ master: {
+ cls_id: $this.clsId, // button=bottom鏃�master鐨刢ls_id
+ //obj_id: '' // button=bottom鏃�master鐨刼bj_id
+ }
+ };
+ 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 (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
+ let time = data.info_time || 0
+ if (time)
+ showError(tip, this.translateSys('tip'))
+ else
+ showInfo(tip)
+ showInfo(tip)
+ if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+ if (data.result_type == 2) {
+
+ } else if (typeof data.result == 'string') {
+ showInfo(data.result)
+
+ }
+ try {
+ var enviroment = JSON.stringify(enviroment);
+ var actions = data.action || []
+ for (var i = 0; i < actions.length; i++) {
+ var action = actions[i];
+ console.log(action)
+ var val = action.value;
+ if (action.action_type ==
+ "set_dlg_current_edit_attr"
+ ) {
+
+ if ($this
+ .focusOldFieldId ==
+ action.value) {
+ $this.setData({
+ focusFieldId: ""
+ })
+ } else {
+ $this.setData({
+ focusFieldId: $this
+ .focusOldFieldId
+ })
+ }
+ $this.$nextTick(() => {
+ $this.setData({
+ focusFieldId: action
+ .value
+ })
+ });
+ } else if (action.action_type ==
+ "set_dlg_attr") {
+ // value = {"attr":"xxx", "value":"xxx"}
+ var data = action.value;
+ $this.setFormValues(data)
+ } else if (action.action_type ==
+ 'set_dlg_attr_show') {
+ var data = action.value;
+
+ $this.setFormItemVisible(data)
+ } else if (action.action_type == 'set_global_attr') {
+ $this.global_attr = action.value || [];
+ } else 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 param = {
+ item: item,
+ button_callback: button_callback,
+ req: req,
+ 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.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') {
+
+ if (val.common_dlg_id == 'check_list') {
+ $this.setData({
+ check_list: val.config
+ })
+ if (val.config.appear_style ==
+ 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({
+ popupType: "right"
+ })
+ else
+ $this.setData({
+ popupType: "center"
+ })
+ // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+ $this.$refs.popup.open($this.popupType);
+ var popupParam = {
+ item: item,
+ button_callback: button_callback,
+ req: req,
+ data_attr: ""
+ }
+ $this.setData({
+ 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 param_ = {
+ item: item,
+ button_callback: button_callback,
+ req: req
+ }
+ uni.navigateTo({
+ url: '../selPrj/index?relation=' + priRel +
+ '¶m=' +
+ JSON.stringify(param_),
+ events: {
+ AddPer(data, param) {
+ var attr = param.item.fieldId;
+ $this.head_styledef.form.model[
+ attr] =
+ data[0].ID +
+ ';' + data[0].Name;
+
+ // $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.clsId,
+ objid: "",
+ attr: param.req,
+ dataJson: [],
+ }
+
+ $this.DataObjRunCustomEvent(
+ info);
+ }
+ }
+ }
+ });
+ } else {
+ showInfo($this.translateSys(
+ "quotation_mark_left") +
+ action.action_type + $this
+ .translateSys(
+ "quotation_mark_right") + $this
+ .translate(
+ "tip_action_unprocessed"))
+
+ }
+ }
+
+ } 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) {
+ showError(ex, this.translateSys("error") + "10.1")
+ }
+ },
setFormValues(attrs) {
console.log(attrs)
const head_styledef = this.head_styledef
@@ -944,6 +1136,8 @@
async DataObjRunCustomEvent(info, data_attr) {
var $this = this;
+ if (!info.eventid)
+ return
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -1003,79 +1197,15 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(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 (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
- 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) {
- $this.setFormValues(data.result || [])
- } else if (typeof data.result == 'string') {
- showInfo(data.result)
-
- }
- try {
- var actionlist = data.action || []
- 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(result)
- } else if (action.action_type == 'set_dlg_attr_show') {
- var result = action.value;
-
- $this.setFormItemVisible(result)
- } else if (action.action_type == 'set_global_attr') {
- $this.global_attr = action.value || [];
- } else {
- uni.showModal({
- title: this.translateSys("tip"),
- content: this.translateSys(
- "quotation_mark_left") +
- action
- .action_type + this.translateSys(
- "quotation_mark_right") + this
- .translate(
- "tip_action_unprocessed")
- });
- }
- }
-
- } 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
- }
- }
-
-
- }
+ $this.onFormEventResult(data, "")
}).catch(ex => {
// console.log(ex);
showError(ex, this.translateSys('error') + "3.1")
});
},
- dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
- console.log("dataObjRunCustomEvent_Return", eventid, data_attr, button_callback)
+ dataObjRunCustomEvent_Return(eventid, button_callback, item) {
+ console.log("dataObjRunCustomEvent_Return", eventid, button_callback)
const $this = this
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙�@@ -1132,217 +1262,7 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(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 (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
- let time = data.info_time || 0
- if (time)
- showError(tip, this.translateSys('tip'))
- else
- showInfo(tip)
- showInfo(tip)
- if ([0, 2, 3, 4, -1].includes(data.result_type)) {
- if (data.result_type == 2) {
-
- } else if (typeof data.result == 'string') {
- showInfo(data.result)
-
- }
- try {
- var actions = data.action || []
- for (var i = 0; i < actions.length; i++) {
- var action = actions[i];
- console.log(action)
- 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 param = {
- item: item,
- 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.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') {
-
- if (val.common_dlg_id == 'check_list') {
- $this.setData({
- check_list: val.config
- })
- if (val.config.appear_style ==
- 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({
- popupType: "right"
- })
- else
- $this.setData({
- popupType: "center"
- })
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
- $this.$refs.popup.open($this.popupType);
- var popupParam = {
- item: item,
- button_callback: button_callback,
- req: req,
- data_attr: data_attr
- }
- $this.setData({
- 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 param_ = {
- item: item,
- button_callback: button_callback,
- req: req
- }
- uni.navigateTo({
- url: '../selPrj/index?relation=' + priRel +
- '¶m=' +
- JSON.stringify(param_),
- events: {
- AddPer(data, param) {
- var attr = param.item.fieldId;
- $this.head_styledef.form.model[
- attr] =
- data[0].ID +
- ';' + data[0].Name;
-
- // $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.clsId,
- objid: "",
- attr: param.req,
- dataJson: [],
- }
-
- $this.DataObjRunCustomEvent(
- info);
- }
- }
- }
- });
- } else {
- showInfo($this.translateSys(
- "quotation_mark_left") +
- action.action_type + $this
- .translateSys(
- "quotation_mark_right") + $this
- .translate(
- "tip_action_unprocessed"))
-
- }
- }
-
- } 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
- }
- }
- }
+ $this.onFormEventResult(data, button_callback, item)
}).catch(ex => {
showError(ex, this.translateSys('tip') + "5.1")
--
Gitblit v1.9.1