| | |
| | | }, |
| | | }, |
| | | onBackPress(e) { |
| | | this.navigateBackEvent() |
| | | this.beforeNavigateBack() |
| | | }, |
| | | async onLoad(options) { |
| | | console.log(options); |
| | |
| | | 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 |
| | |
| | | data_json, |
| | | }); |
| | | }, |
| | | navigateBackEvent() { |
| | | async navigateBackEvent() { |
| | | try { |
| | | var $this = this; |
| | | if (!this.exit_view_event.id) |
| | | return |
| | | let data_json = []; |
| | |
| | | } else input_param[item.fieldId] = item.value; |
| | | }); |
| | | input_param = Base64.encode(JSON.stringify(input_param)); |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | |
| | | eventChannel.emit('ExitViewEvent', { |
| | | const result = await runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | | class_id: this.param.ClsID, |
| | | event_id: this.exit_view_event.id, |
| | | input_param, |
| | | data_json, |
| | | }); |
| | | }) |
| | | 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) |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys('error') + "9.2") |
| | | |
| | | } |
| | | |
| | | }, |
| | | cancel(e) { //取消 |
| | | this.navigateBackEvent() |
| | | |
| | | this.beforeNavigateBack() |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | | }); |
| | | }, |
| | | async beforeNavigateBack() |
| | | { |
| | | await this.navigateBackEvent() |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('ExitViewPage'); |
| | | }, |
| | | /** |
| | | * 只支持["column1='A' or column2='B'", "column3='C' and column4='D'", "column5='E'"]这种格式 |
| | | * { |