| | |
| | | import classUtils from "@/js/utils.js" |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import { |
| | | appGetInfo, |
| | |
| | | }, |
| | | 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: { |
| | |
| | | //执行触发事件 |
| | | async triggerEvent(btn, style, enviroment) { |
| | | try { |
| | | showLoading("loading...") |
| | | btn.disabled = true |
| | | var obj_attr = { |
| | | 'S_ID': this.styleDef.form.objId |
| | |
| | | // console.log(obj_attr); |
| | | // let input_param = Base64.encode(JSON.stringify(obj_attr)); |
| | | // return; |
| | | |
| | | await this.runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | |
| | | obj_attr: obj_attr, |
| | | }); |
| | | btn.disabled = false |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "3") |
| | | } |
| | | }, |
| | |
| | | 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) { |