From 07925905f1a596e20e980de6d42db217abb753b0 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:06:11 +0800
Subject: [PATCH] plugin
---
pages/modal/5601.vue | 1068 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 644 insertions(+), 424 deletions(-)
diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index 2fe2da4..23d4884 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -58,7 +58,8 @@
'btn-one':pageData.Button.length == 1,
'btn-left':(btnIndex < pageData.Button.length - 1),
'btn-right': btnIndex > 0 && btnIndex == pageData.Button.length - 1 ,
- 'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}" @click="onBtnClick(btn, pageData)">
+ 'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),
+ 'width-30':(pageData.DropDownButton.length> 0)}" @click="onBtnClick(btn, pageData)">
<text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="img"></text>
{{btn.ShowName ||""}}
</button>
@@ -108,7 +109,7 @@
</view>
</uni-popup>
</view>
-
+
</view>
</template>
@@ -118,7 +119,9 @@
} from '@/js/Base64.js';
import {
showInfo,
- showError
+ showError,
+ showLoading,
+ hideLoading
} from "@/js/Page.js"
import {
dictGetInfo,
@@ -188,10 +191,12 @@
};
},
},
- onLoad(options) {
+ onReady() {
uni.setNavigationBarTitle({
- title: options.titlename
+ title: this.title
}); //璁剧疆椤堕儴鏍囬
+ },
+ onLoad(options) {
this.title = options.titlename;
this.param = JSON.parse(options.param);
//鑾峰彇涓绘暟鎹被ID
@@ -235,71 +240,376 @@
});
},
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 {
- if (this.initialEvent.id) {
- this.onChange(this.initialEvent)
+ const event = this.initialEvent
+ if (event.id) {
+ //鑾峰彇琛ㄥご灞炴�
+ var head_attr = {};
+ this.head_styledef.form.items.forEach(item => {
+ if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+ item.setting.colList.forEach(col => {
+ if (col != null) head_attr[col
+ .fieldId] = col.value;
+ });
+ } else
+ head_attr[item.fieldId] = item.value;
+ });
+ var obj_attr = this.head_styledef.form.model;
+ // console.log(obj_attr);
+
+ var input_param = Base64.encode(
+ JSON.stringify({
+ id: "",
+ attrs: Object.keys(head_attr).map((a) => ({
+ attr: a,
+ value: head_attr[a] || "",
+ }))
+ })
+ );
+ var $this = this;
+ const jsonList = []
+ this.pageDetail.forEach((page) => {
+
+ jsonList.push({
+ page_name: page.Name,
+ item_list: $this.getDetailAttrList(
+ page),
+ ext_data: page.ExtData || {}
+ })
+
+ })
+ const data_json = Base64.encode(
+ JSON.stringify(jsonList)
+ );
+ console.log(jsonList)
+ var dataInfo = {
+ ed_type: 0,
+ start_transaction: true,
+ class_id: this.head_styledef.form.clsId,
+ class_name: '',
+ event_id: event.id,
+ event_name: '',
+ data_obj_id: '',
+ obj_attr: obj_attr,
+ prj_id: '',
+ ref_cls_id: '',
+ rel_obj_id: '',
+ user_login: '',
+ data_json: data_json,
+ compose_info: '',
+ ext_info: '',
+ global_attr: '',
+ input_param: input_param,
+ };
+ 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
+ }
+ }
+
+ }
+
}
} catch (ex) {
- showError(ex, this.translateSys('error'))
+ console.log(ex);
+ showError(ex, this.translateSys('error') + "4.2")
}
},
@@ -630,7 +940,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;
@@ -768,9 +1087,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
@@ -796,7 +1113,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 => {
@@ -836,7 +1153,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
@@ -860,7 +1179,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) {
@@ -897,6 +1216,7 @@
} catch (ex) {
console.log(ex)
+ hideLoading()
showError(ex, this.translateSys('error') + "6.1")
}
@@ -972,6 +1292,7 @@
try {
if (event.id) {
//鑾峰彇琛ㄥご灞炴�
+ showLoading("loading...")
var head_attr = {};
this.head_styledef.form.items.forEach(item => {
if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -1030,246 +1351,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")
}
},
@@ -1412,8 +1500,7 @@
const detailStyleDefList = pageData.DefList || []
value.row.forEach((row) => {
if (row.id) {
- for (let index = 0; index < detailStyleDefList
- .length; index++) {
+ for (let index = 0; index < detailStyleDefList.length; index++) {
const ele = detailStyleDefList[index]
if (ele.form.objId == row.id) {
detailStyleDefList.splice(index, 1);
@@ -2310,6 +2397,9 @@
async DataObjRunCustomEvent(info, data_attr) {
var $this = this;
+ if( !info.eventid)
+ return
+ showLoading("loading...")
var enviroment = {
'function': '3000', // 鍔熻兘鐐圭紪鍙� cls_id: this.ClsID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -2376,102 +2466,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', // 鍔熻兘鐐圭紪鍙�@@ -2536,7 +2541,29 @@
console.log(dataInfo);
// return;
runCustomEvent(dataInfo).then(data => {
+ hideLoading()
+ $this.onFormEventResult(data, button_callback, item,req)
+ }).catch(ex => {
+ hideLoading()
+ showError(ex, this.translateSys("error") + "5.1")
+ });
+ },
+
+ async onFormEventResult(data, callbackEventId, item,req) {
+ 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
@@ -2570,16 +2597,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> ' +
@@ -2609,9 +2822,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=' +
@@ -2711,9 +2924,9 @@
);
var popupParam = {
item: item,
- button_callback: button_callback,
+ button_callback: callbackEventId,
req: req,
- data_attr: data_attr
+ data_attr: ""
}
$this.setData({
popupParam: popupParam
@@ -2754,7 +2967,7 @@
priRel = '5';
var param_ = {
item: item,
- button_callback: button_callback,
+ button_callback: callbackEventId,
req: req
}
uni.navigateTo({
@@ -2858,12 +3071,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;
@@ -3472,9 +3683,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)
);
@@ -3500,10 +3711,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) {
@@ -3512,7 +3726,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
@@ -3525,7 +3740,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) {
@@ -3853,16 +4068,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, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -3895,9 +4116,8 @@
}
}).catch(ex => {
+ hideLoading()
showError(ex, this.translateSys("error") + "8.1")
-
-
});
},
--
Gitblit v1.9.1