| | |
| | | classAttrList, |
| | | } from "@/api/index.js" |
| | | import buttonClickMixin from '@/mixins/button-click.js'; |
| | | |
| | | import { |
| | | showInfo, |
| | | showError |
| | | } from "@/js/Page.js" |
| | | |
| | | export default { |
| | | mixins: [buttonClickMixin], |
| | |
| | | this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //设置按钮文字 |
| | | console.log(param); |
| | | if (!param.Master_Cls.View_Style) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "该功能点未配置界面窗口,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("该功能点未配置界面窗口,请重新配置!") |
| | | |
| | | return; |
| | | } |
| | | if (!param.Master_Cls.View_Style.Name) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "该功能点未配置窗口样式,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("该功能点未配置窗口样式,请重新配置!") |
| | | |
| | | return; |
| | | } |
| | | this.param = param; |
| | |
| | | return result?.dict_item_list || [] |
| | | |
| | | } catch (ex) { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1.2", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('error') + " 1.2") |
| | | |
| | | return [] |
| | | } |
| | | |
| | |
| | | } |
| | | return result |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + " 1.1", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + " 1.1") |
| | | |
| | | return [] |
| | | }; |
| | | }, |
| | |
| | | |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + " 1.2", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + " 1.2") |
| | | |
| | | return {} |
| | | }; |
| | | }, |
| | |
| | | console.log(this.classAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "未找到可显示的的属性", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("未找到可显示的的属性!") |
| | | |
| | | } |
| | | }, |
| | | subClass_attr_init() { |
| | |
| | | console.log(this.subClassAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "未找到可显示的的属性", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("未找到可显示的的属性!") |
| | | |
| | | } |
| | | }, |
| | | scan_classAttr_extButton(e) { //选择按钮前 |
| | | var $this = this; |
| | | var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; |
| | | if (!Before_Select_Event) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "选择前事件为空!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("选择前事件为空!") |
| | | |
| | | return; |
| | | } |
| | | var mast_attr = []; |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择') { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar.DispName + "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + "未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | mast_attr.push(this.formatAttr(ar)) |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | var $this = this; |
| | | var After_Select_Event = $this.param.Scan_Code.After_Select_Event; |
| | | if (!After_Select_Event) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "选择后事件为空!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("选择后事件为空!") |
| | | |
| | | return; |
| | | } |
| | | var items = $this.check_list.items; |
| | |
| | | } |
| | | } |
| | | if (data.length == 0) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | var mast_attr = []; |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择') { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar.DispName + "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + "未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | mast_attr.push(this.formatAttr(ar)) |
| | |
| | | // console.log(success); |
| | | uni.hideLoading(); |
| | | $this.subPanelList.splice(index, 1); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "删除成功!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("删除成功!") |
| | | |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "9.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "9.1") |
| | | }); |
| | | } |
| | | }, |
| | |
| | | var button_callback = $this.classAttrList[index].Attr[iindex] |
| | | .button_callback; |
| | | if (!before_click_button) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "before_click_button-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("before_click_button-event_id为空!") |
| | | |
| | | return; |
| | | } |
| | | if (!button_callback) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "button_callback-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("button_callback-event_id为空!") |
| | | |
| | | return; |
| | | } |
| | | var data_attr = this.classAttrList[ |
| | |
| | | }, |
| | | classAttr_AddRef(e) { |
| | | console.log(e.target); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: "此功能还未实现!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo("此功能还未实现!") |
| | | |
| | | // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; |
| | | // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; |
| | | }, |
| | |
| | | .Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar |
| | | .DispName + |
| | | '不能为空!', |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | uni.hideLoading(); |
| | | let data = result.lua_result |
| | | if (data) { |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | | data |
| | | .err_info.join('<br/>') : ''; |
| | | if (data.ret == 801) uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + ',' + this.translateSys('tip') + ':' + data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | uni.showToast({ |
| | | title: this.translate('create_success'), |
| | | icon: "success", |
| | | duration: 3000 |
| | | }); |
| | | if (tip) { |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | } else |
| | | showInfo(this.translate('create_success')); |
| | | } |
| | | |
| | | } |
| | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip')) |
| | | }); |
| | | }, |
| | | ini_DataObjRunCustomEvent(info) { |
| | |
| | | runCustomEvent( |
| | | dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni |
| | | .showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = |
| | |
| | | } |
| | | } |
| | | } |
| | | if (action_type == |
| | | 'open_select_userdlg' |
| | | ) { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 2.2", |
| | | content: "open_select_userdlg这个action_type还未处理!", |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } catch (ex) { |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(tip, this.translateSys('tip')) |
| | | console.log(ex) |
| | | return |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 2.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "2.1") |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent(info, data_attr) { |
| | |
| | | runCustomEvent( |
| | | dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | if (tip) uni |
| | | .showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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 |
| | |
| | | } |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | if (data.result) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(tip, this.translateSys('tip')) |
| | | console.log(ex) |
| | | return |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 3.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "3.1") |
| | | }); |
| | | }, |
| | | OKDataObjRunCustomEvent() { |
| | |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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 || [] |
| | |
| | | this.add(); |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | if (data.result) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 4.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "4.1") |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent_Return(eventid, |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni |
| | | .showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | } |
| | | try { |
| | | var actions = data.action || [] |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(tip, this.translateSys('tip')) |
| | | console.log(ex) |
| | | return |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "5.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "5.1") |
| | | }); |
| | | }, |
| | | scan_ini_DataObjRunCustomEvent(info) { |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni |
| | | .showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(tip, this.translateSys('tip')) |
| | | console.log(ex) |
| | | return |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 6.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "6.1") |
| | | }); |
| | | }, |
| | | scan_DataObjRunCustomEvent(info, data_attr) { |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0&& data.ret != 1) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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) { |
| | | if (data.result) { |
| | |
| | | } |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | if (data.result) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(tip, this.translateSys('tip')) |
| | | console.log(ex) |
| | | return |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 7.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "7.1") |
| | | }); |
| | | }, |
| | | scan_OKDataObjRunCustomEvent(eventID) { |
| | |
| | | .Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar |
| | | .DispName + |
| | | '不能为空!', |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | .Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "", |
| | | content: ar |
| | | .DispName + |
| | | '不能为空!', |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | uni.hideLoading(); |
| | | if (data.ret != 0) { |
| | | var tip = data |
| | | .err_info ? |
| | | typeof data |
| | | .err_info == |
| | | 'string' ? data |
| | | .err_info : data |
| | | .err_info.join( |
| | | '<br/>') : ''; |
| | | if (data.ret == 801) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | else uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip + |
| | | ',提示:' + |
| | | data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | 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('<br/>') : |
| | | ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | |
| | | // var result = data.result; |
| | | if (eventID != $this.param.After_OK_Event.ID) |
| | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 8.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('tip') + "8.1") |
| | | }); |
| | | }, |
| | | |