| | |
| | | } from '@/js/Base64.js'; |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import { |
| | | dictGetInfo, |
| | |
| | | }); |
| | | }, |
| | | 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 { |
| | |
| | | }, |
| | | 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; |
| | |
| | | // 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 |
| | |
| | | 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 => { |
| | |
| | | }; |
| | | 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 |
| | |
| | | |
| | | } catch (ex) { |
| | | console.log(ex) |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "6.1") |
| | | } |
| | | |
| | |
| | | try { |
| | | if (event.id) { |
| | | //获取表头属性 |
| | | showLoading("loading...") |
| | | var head_attr = {}; |
| | | this.head_styledef.form.items.forEach(item => { |
| | | if (item.name == "Layout") { //判断是否是栅栏格式 |
| | |
| | | }; |
| | | 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 |
| | | ) { //判断是否清空页签内容,正在码盘是否有数据 |
| | | 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" |
| | | ) { //清除面板中指定id的数据 |
| | | 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}时出现异常,请检查脚本返回的数据格式是否正确。${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") |
| | | } |
| | | }, |
| | |
| | | |
| | | async DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | if( !info.eventid) |
| | | return |
| | | showLoading("loading...") |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.ClsID, // 功能点主数据类标识 |
| | |
| | | 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}时出现异常,请检查脚本返回的数据格式是否正确。${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', // 功能点编号 |
| | |
| | | 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的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_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 |
| | |
| | | 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 |
| | | ) { //判断是否清空页签内容,正在码盘是否有数据 |
| | | 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" |
| | | ) { //清除面板中指定id的数据 |
| | | 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> ' + |
| | |
| | | // 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=' + |
| | |
| | | ); |
| | | var popupParam = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | button_callback: callbackEventId, |
| | | req: req, |
| | | data_attr: data_attr |
| | | data_attr: "" |
| | | } |
| | | $this.setData({ |
| | | popupParam: popupParam |
| | |
| | | priRel = '5'; |
| | | var param_ = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | button_callback: callbackEventId, |
| | | req: req |
| | | } |
| | | uni.navigateTo({ |
| | |
| | | |
| | | } |
| | | |
| | | }).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; |
| | |
| | | // }); |
| | | }, |
| | | //执行确定脚本 |
| | | 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) |
| | | ); |
| | |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | .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, //返回层数,2则上上页 |
| | |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | |
| | | |
| | | }); |
| | | }, |
| | | |