| | |
| | | this.form.model[attr] = item.value; |
| | | this.$emit("on-change", item) |
| | | }, |
| | | |
| | | |
| | | onClick(item) { |
| | | this.$emit("on-click", item) |
| | | }, |
| New file |
| | |
| | | <template> |
| | | <view class="oi-form-image-button"> |
| | | <image v-if="data.setting.imgUrl" :src="data.setting.imgUrl" :width="data.setting.imgWidth" |
| | | :height="data.setting.imgHeight"> <button type="default" :style="{ color: data.setting.textColor }" :plain=" |
| | | ['info', 'success', 'warning', 'error', 'primary'].includes(data.setting.type)? data.setting.ghost: false" |
| | | :class="data.setting.type + ' '+ data.setting.size" :disabled="data.disabled" @click="onClick"> |
| | | <!-- :size="data.setting.size == 'small' ? 'mini':data.setting.size == 'large' ? 'plus':'default'" --> |
| | | <text v-if="data.setting.icon" class="img" :style="{color:data.setting.textColor}"></text> |
| | | {{ data.setting.text ||""}} |
| | | </button> |
| | | </image> |
| | | <button v-else type="default" :style="{ color: data.setting.textColor }" :plain=" |
| | | ['info', 'success', 'warning', 'error', 'primary'].includes(data.setting.type)? data.setting.ghost: false" |
| | | :class="data.setting.type + ' '+ data.setting.size" :disabled="data.disabled" @click="onClick"> |
| | | <!-- :size="data.setting.size == 'small' ? 'mini':data.setting.size == 'large' ? 'plus':'default'" --> |
| | | <text v-if="data.setting.icon" class="img" :style="{color:data.setting.textColor}"></text> |
| | | {{ data.setting.text ||""}}</button> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "OIFormImageButton", |
| | | props: { |
| | | data: { |
| | | type: Object, |
| | | required: true, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | largeMode: getApp().globalData?.largeMode || false, |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | onClick(e) { |
| | | if (this.data.disabled) |
| | | return |
| | | this.$emit("on-click", e) |
| | | }, |
| | | |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .oi-form-image-button { |
| | | // width: 100%; |
| | | |
| | | uni-button { |
| | | padding: 14rpx; |
| | | line-height: 1.4; |
| | | font-size: 32rpx; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .large { |
| | | padding: 18rpx; |
| | | line-height: 1.6; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .small { |
| | | padding: 10rpx; |
| | | line-height: 1.2; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .primary { |
| | | color: #fff; |
| | | background: #27A6E1; |
| | | border: none; |
| | | } |
| | | |
| | | .info { |
| | | color: #fff; |
| | | background-color: #2db7f5; |
| | | border: none; |
| | | } |
| | | |
| | | .success { |
| | | color: #fff; |
| | | background-color: #19be6b; |
| | | border: none; |
| | | } |
| | | |
| | | .error { |
| | | color: #fff; |
| | | background-color: #ed4014; |
| | | border: none; |
| | | } |
| | | |
| | | .warning { |
| | | color: #fff; |
| | | background-color: #f90; |
| | | border: none; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <OIFormDatePickerRange v-else-if="data.name == 'DatePickerRange'" :data="data" :model="model" |
| | | @on-change="onChange"> |
| | | </OIFormDatePickerRange> |
| | | <OIFormImageButton v-else-if="data.name == 'ImageButton'" :data="data" @on-click="onClick"> |
| | | </OIFormImageButton> |
| | | <OIFormText v-else-if="data.name == 'Text'" :data="data" :model="model"> |
| | | </OIFormText> |
| | | <OIFormText v-else :data="data" :model="model"> |
| | |
| | | import OIFormDatePicker from './date-picker/index.vue' |
| | | import OIFormDatePickerRange from './date-picker-range/index.vue' |
| | | import OIFormTimePicker from './time-picker/index.vue' |
| | | import OIFormImageButton from './image-button/index.vue' |
| | | export default { |
| | | name: "OIFormItem", |
| | | components: { |
| | |
| | | OIFormRadio, |
| | | OIFormDatePicker, |
| | | OIFormDatePickerRange, |
| | | OIFormTimePicker |
| | | OIFormTimePicker, |
| | | OIFormImageButton |
| | | }, |
| | | props: { |
| | | data: { |
| | |
| | | this.onChange(e) |
| | | }, |
| | | onClick(e) { |
| | | if (this.data.disabled) |
| | | return |
| | | this.$emit("on-click", e) |
| | | }, |
| | | onFocus(e) { |
| | |
| | | this.$emit("on-click", e) |
| | | }, |
| | | onClick(e) { |
| | | if (this.data.disabled) |
| | | return |
| | | this.$emit("on-click", e) |
| | | }, |
| | | onFocus(e) { |
| | |
| | | this.onChange(e) |
| | | }, |
| | | onClick(e) { |
| | | if (this.data.disabled) |
| | | return |
| | | this.$emit("on-click", e) |
| | | }, |
| | | onFocus(e) { |
| | |
| | | "name" : "MoboxPDA", |
| | | "appid" : "__UNI__56D451E", |
| | | "description" : "", |
| | | "versionName" : "1.1.70", |
| | | "versionCode" : 1170, |
| | | "versionName" : "1.1.71", |
| | | "versionCode" : 1171, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | if (this.userServer.includes("://")) { |
| | | rootUrl = this.userServer |
| | | } |
| | | showLoading("loading......") |
| | | showLoading("loading...") |
| | | const res = await login(rootUrl, this.userName, this.userPwd) |
| | | //设置全局参数:user-用户信息 |
| | | utils.session.setValue('server', rootUrl); |
| | |
| | | |
| | | <uni-row> |
| | | <uni-col :span="16"> |
| | | <uni-forms-item :label="'OrgSAPI '+ translateSys('sys.port')" label-width="240rpx"> |
| | | <uni-forms-item :label="'OrgSAPI '+ translateSys('sys.port')" label-width="250rpx"> |
| | | <input type="number" class="input-port" v-model="form.orgSPort"> |
| | | |
| | | </uni-forms-item> |
| | |
| | | import { |
| | | showInfo, |
| | | showError, |
| | | showModal |
| | | showModal, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' |
| | | import utils from "@/js/utils.js" |
| | |
| | | }, |
| | | async loadData() { |
| | | try { |
| | | showLoading("loading...") |
| | | const param = this.param |
| | | var edit_dlg = { |
| | | Model: param.EditDlgMode, |
| | |
| | | } |
| | | $this.classAttrList = result; |
| | | await $this.classGridStyleInfo(); |
| | | hideLoading() |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + " 1") |
| | | |
| | | } |
| | |
| | | import utils from "@/js/utils.js" |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import dayjs from "dayjs"; |
| | | import OIForm from '@/components/oi-form/index.vue' |
| | |
| | | }); |
| | | }, |
| | | async loadData(paramValue) { |
| | | try { |
| | | showLoading("loading...") |
| | | //获取数据类的自定义表单参数 |
| | | await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.UI_Style?.ID); |
| | | //传入参数值 |
| | | if (paramValue) { |
| | | |
| | | //获取数据类的自定义表单参数 |
| | | await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.UI_Style?.ID); |
| | | //传入参数值 |
| | | if (paramValue) { |
| | | |
| | | this.setFormValues(paramValue) |
| | | // const attrs = paramValue.attrs || []; |
| | | // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { |
| | | // if (ele.name != "Layout") { |
| | | // attrs.forEach(async (ele2, index2) => { |
| | | // if (ele.fieldId == ele2.name) { |
| | | // ele.value = ele2.value; |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // ele.setting.colList.forEach(async (col) => { |
| | | // if (col) { |
| | | // attrs.forEach(async (ele2, |
| | | // index2) => { |
| | | // if (col.fieldId == ele2.name) { |
| | | // col.value = ele2.value; |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }) |
| | | |
| | | this.setFormValues(paramValue) |
| | | } |
| | | await this.loadInitialEvent(); |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | await this.loadInitialEvent(); |
| | | |
| | | }, |
| | | async loadInitialEvent() { |
| | |
| | | value: obj_attr[a], |
| | | })), |
| | | }; |
| | | |
| | | |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | |
| | | |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys("error")) |
| | | |
| | |
| | | }, |
| | | 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); |
| | | } |
| | | }, |
| | | onEnterChange(item) { |
| | | let newVal = item.value |
| | |
| | | } |
| | | |
| | | }, |
| | | |
| | | classAttr_extButton(item) { |
| | | var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击事件 |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击回调 |
| | | |
| | | if (!onSuffixClickCallbackEvent.id) { |
| | | showInfo(this.translate('icon_click_callback_empty')) |
| | | |
| | | return; |
| | | } |
| | | if (!onSuffixClickEvent.id) { |
| | | showInfo(this.translate('icon_click_event_empty')) |
| | | |
| | | return; |
| | | } |
| | | this.popupType = 'right' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open(this.popupType); |
| | | |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent |
| | | .id, |
| | | item); |
| | | }, |
| | | popupChange(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | checkChange(e) { //弹框check选择 |
| | | // console.log(e.target.dataset); |
| | | var index = e.target.dataset.index; |
| | | var ischeck = e.target.dataset.ischeck; |
| | | var data = this.check_list.items; |
| | | // this.check_list.items=[]; |
| | | if (this.check_list.multiple_choice == "0") { //判断时单选还是多选 |
| | | for (var i in data) { |
| | | data[i].check = false; |
| | | } |
| | | } |
| | | data[index].check = ischeck ? false : true; |
| | | this.check_list.items = data; |
| | | |
| | | }, |
| | | popup_cancel(e) { //弹框取消 |
| | | this.$refs.popup.close(); |
| | | }, |
| | | popup_sava(e) { //弹框确定 |
| | | var $this = this; |
| | | var items = $this.check_list.items; |
| | | var data = []; |
| | | var name = ""; |
| | | for (var i = 0; i < items.length; i++) { |
| | | if (items[i].check == true) { |
| | | if (name) |
| | | name += ';'; |
| | | name += items[i].name; |
| | | data.push({ |
| | | id: items[i].id, |
| | | name: items[i].name |
| | | }); |
| | | } |
| | | } |
| | | if (!$this.popupParam) { |
| | | showInfo("popupParam为空!") |
| | | |
| | | return; |
| | | } |
| | | if (data.length == 0) { |
| | | showInfo(this.translate("tip_no_select_data")) |
| | | |
| | | return; |
| | | } |
| | | var callback_eventid = $this.popupParam.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.param.DataCls.id, |
| | | objid: "", |
| | | attr: $this.popupParam.req, |
| | | dataJson: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); |
| | | this.$refs.popup.close(); |
| | | }, |
| | | |
| | | async DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: this.translateSys('add2'), |
| | | master: { |
| | | cls_id: this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | if (data_attr) { |
| | | enviroment.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: this.param.DataCls.id, //当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | enviroment.edit_dlg.form_control = { //所属的表单控件 |
| | | name: data_attr.Name, //字段属性 |
| | | text: data_attr.DispName, //显示文本 |
| | | group_name: data_attr.GroupName, //属性组 |
| | | type: data_attr.Type, //字段类型 |
| | | readonly: data_attr.ReadOnly, //是否只读 |
| | | button_img: data_attr.button_img, //引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip //引用按钮的tooltip |
| | | async onFormEventResult(data, callbackEventId, item) { |
| | | try { |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: $this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: $this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | } |
| | | } |
| | | |
| | | // var dataInfo = { |
| | | // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), |
| | | // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, |
| | | // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: "", |
| | | // global_attr: JSON.stringify(this.global_attr), dataJson:JSON.stringify(info.dataJson) |
| | | // } |
| | | enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码 |
| | | var input_param = Base64.encode(JSON.stringify(info.attr)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify(this |
| | | .global_attr)); //将字符串转换为base64编码 |
| | | if (info.dataJson) |
| | | info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | info.attr.forEach(item => { |
| | | obj_attr[item.attr] = item.value; |
| | | }); |
| | | if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: info.edtype, |
| | | start_transaction: true, |
| | | class_id: info.clsid, |
| | | class_name: '', |
| | | event_id: info.eventid, |
| | | event_name: '', |
| | | data_obj_id: info.objid, |
| | | obj_attr: obj_attr, |
| | | prj_id: info.projectid, |
| | | ref_cls_id: info.rclsid, |
| | | rel_obj_id: info.robjid, |
| | | user_login: info.userlogin, |
| | | data_json: info.dataJson, |
| | | compose_info: '', |
| | | ext_info: enviroment, |
| | | global_attr: global_attr, |
| | | input_param: input_param, |
| | | }; |
| | | 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 |
| | | 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) { |
| | |
| | | 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 (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | | var enviroment = JSON.stringify(enviroment); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | |
| | | focusFieldId: 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 |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | showError(ex, this.translateSys("error") + " 3.1") |
| | | |
| | | }); |
| | | }, |
| | | dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) { |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: $this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: $this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | var obj_attr = $this.head_styledef.form.model; |
| | | console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: $this.param.DataCls.id, //当前数据类id |
| | | } |
| | | extinfo = Base64.encode(JSON.stringify(extinfo)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify($this |
| | | .global_attr)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | req.forEach(item2 => { |
| | | obj_attr[item2.attr] = item2.value; |
| | | }); |
| | | let input_param = Base64.encode( |
| | | JSON.stringify( |
| | | Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })) |
| | | ) |
| | | ); |
| | | |
| | | if (!eventid.includes('{')) eventid = '{' + eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: "0", |
| | | start_transaction: true, |
| | | class_id: $this.param.DataCls.id, |
| | | class_name: '', |
| | | event_id: eventid, |
| | | event_name: '', |
| | | data_obj_id: '', |
| | | obj_attr: obj_attr, |
| | | prj_id: '', |
| | | ref_cls_id: '', |
| | | rel_obj_id: '', |
| | | user_login: '', |
| | | data_json: [], |
| | | compose_info: '', |
| | | ext_info: extinfo, |
| | | global_attr: global_attr, |
| | | input_param: input_param, |
| | | }; |
| | | 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) { |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | if (data.result) { |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | } |
| | | try { |
| | | var actions = data.action || [] |
| | | 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 == 'open_panel') { |
| | | else if (action.action_type == 'open_panel') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | | $this.translateSys("tip"), |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | showInfo($this.translateSys( |
| | | showInfo(this.translateSys( |
| | | "quotation_mark_left") + |
| | | action.action_type + $this |
| | | .translateSys( |
| | | "quotation_mark_right") + $this |
| | | 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 |
| | |
| | | showError(tip, this.translateSys('tip')) |
| | | return |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys("error") + "10.1") |
| | | } |
| | | }, |
| | | classAttr_extButton(item) { |
| | | var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击事件 |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击回调 |
| | | |
| | | if (!onSuffixClickCallbackEvent.id) { |
| | | showInfo(this.translate('icon_click_callback_empty')) |
| | | |
| | | return; |
| | | } |
| | | if (!onSuffixClickEvent.id) { |
| | | showInfo(this.translate('icon_click_event_empty')) |
| | | |
| | | return; |
| | | } |
| | | this.popupType = 'right' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open(this.popupType); |
| | | |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent |
| | | .id, |
| | | item); |
| | | }, |
| | | popupChange(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | checkChange(e) { //弹框check选择 |
| | | // console.log(e.target.dataset); |
| | | var index = e.target.dataset.index; |
| | | var ischeck = e.target.dataset.ischeck; |
| | | var data = this.check_list.items; |
| | | // this.check_list.items=[]; |
| | | if (this.check_list.multiple_choice == "0") { //判断时单选还是多选 |
| | | for (var i in data) { |
| | | data[i].check = false; |
| | | } |
| | | } |
| | | data[index].check = ischeck ? false : true; |
| | | this.check_list.items = data; |
| | | |
| | | }, |
| | | popup_cancel(e) { //弹框取消 |
| | | this.$refs.popup.close(); |
| | | }, |
| | | popup_sava(e) { //弹框确定 |
| | | var $this = this; |
| | | var items = $this.check_list.items; |
| | | var data = []; |
| | | var name = ""; |
| | | for (var i = 0; i < items.length; i++) { |
| | | if (items[i].check == true) { |
| | | if (name) |
| | | name += ';'; |
| | | name += items[i].name; |
| | | data.push({ |
| | | id: items[i].id, |
| | | name: items[i].name |
| | | }); |
| | | } |
| | | } |
| | | if (!$this.popupParam) { |
| | | showInfo("popupParam为空!") |
| | | |
| | | return; |
| | | } |
| | | if (data.length == 0) { |
| | | showInfo(this.translate("tip_no_select_data")) |
| | | |
| | | return; |
| | | } |
| | | var callback_eventid = $this.popupParam.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.param.DataCls.id, |
| | | objid: "", |
| | | attr: $this.popupParam.req, |
| | | dataJson: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); |
| | | this.$refs.popup.close(); |
| | | }, |
| | | |
| | | async DataObjRunCustomEvent(info, data_attr) { |
| | | try { |
| | | var $this = this; |
| | | if (!info.eventid) |
| | | return |
| | | showLoading("loading...") |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: this.translateSys('add2'), |
| | | master: { |
| | | cls_id: this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | if (data_attr) { |
| | | enviroment.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: this.param.DataCls.id, //当前数据类id |
| | | } |
| | | if (data_attr) { |
| | | enviroment.edit_dlg.form_control = { //所属的表单控件 |
| | | name: data_attr.Name, //字段属性 |
| | | text: data_attr.DispName, //显示文本 |
| | | group_name: data_attr.GroupName, //属性组 |
| | | type: data_attr.Type, //字段类型 |
| | | readonly: data_attr.ReadOnly, //是否只读 |
| | | button_img: data_attr.button_img, //引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip //引用按钮的tooltip |
| | | } |
| | | } |
| | | } |
| | | enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码 |
| | | var input_param = Base64.encode(JSON.stringify(info.attr)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify(this |
| | | .global_attr)); //将字符串转换为base64编码 |
| | | if (info.dataJson) |
| | | info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | info.attr.forEach(item => { |
| | | obj_attr[item.attr] = item.value; |
| | | }); |
| | | if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: info.edtype, |
| | | start_transaction: true, |
| | | class_id: info.clsid, |
| | | class_name: '', |
| | | event_id: info.eventid, |
| | | event_name: '', |
| | | data_obj_id: info.objid, |
| | | obj_attr: obj_attr, |
| | | prj_id: info.projectid, |
| | | ref_cls_id: info.rclsid, |
| | | rel_obj_id: info.robjid, |
| | | user_login: info.userlogin, |
| | | data_json: info.dataJson, |
| | | compose_info: '', |
| | | ext_info: enviroment, |
| | | global_attr: global_attr, |
| | | input_param: input_param, |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | hideLoading() |
| | | $this.onFormEventResult(data, "") |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | showError(ex, this.translateSys("error") + " 3.1") |
| | | |
| | | }); |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | |
| | | }, |
| | | dataObjRunCustomEvent_Return(eventid, button_callback, item) { |
| | | const $this = this |
| | | showLoading("loading...") |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: $this.param.DataCls.id, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: $this.param.DataCls.id, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | var obj_attr = $this.head_styledef.form.model; |
| | | console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | |
| | | var extinfo = enviroment; |
| | | extinfo.edit_dlg = { |
| | | type: 'small', //小窗口 |
| | | class_id: $this.param.DataCls.id, //当前数据类id |
| | | } |
| | | extinfo = Base64.encode(JSON.stringify(extinfo)); //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify($this |
| | | .global_attr)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | req.forEach(item2 => { |
| | | obj_attr[item2.attr] = item2.value; |
| | | }); |
| | | let input_param = Base64.encode( |
| | | JSON.stringify( |
| | | Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })) |
| | | ) |
| | | ); |
| | | |
| | | if (!eventid.includes('{')) eventid = '{' + eventid + '}'; |
| | | var dataInfo = { |
| | | ed_type: "0", |
| | | start_transaction: true, |
| | | class_id: $this.param.DataCls.id, |
| | | class_name: '', |
| | | event_id: eventid, |
| | | event_name: '', |
| | | data_obj_id: '', |
| | | obj_attr: obj_attr, |
| | | prj_id: '', |
| | | ref_cls_id: '', |
| | | rel_obj_id: '', |
| | | user_login: '', |
| | | data_json: [], |
| | | compose_info: '', |
| | | ext_info: extinfo, |
| | | global_attr: global_attr, |
| | | input_param: input_param, |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | hideLoading() |
| | | $this.onFormEventResult(data, button_callback, item) |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + " 5.1") |
| | | |
| | | }); |
| | |
| | | afterOK() { |
| | | this.saving = true |
| | | const $this = this |
| | | showLoading("loading...") |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var input_param = { |
| | |
| | | console.log(dataInfo); |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | |
| | | hideLoading() |
| | | 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 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | this.saving = false |
| | | }).catch(ex => { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("tip") + " 7.1") |
| | | |
| | | }); |
| | |
| | | }, |
| | | onTriggerEvent(btn, enviroment) { |
| | | const $this = this |
| | | showLoading("loading...") |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var input_param = { |
| | |
| | | console.log(dataInfo); |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | |
| | | hideLoading() |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | |
| | | 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 |
| | |
| | | showInfo(tip) |
| | | if (!this.param.After_Btn_Not_Refresh) { |
| | | //刷新 |
| | | |
| | | uni.redirectTo({ |
| | | url: '../modal/3018_2?param=' + JSON.stringify(this |
| | | .$data |
| | |
| | | var value = action.value; |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('remove_pre_page_subtable_row', value); |
| | | } |
| | | else if (action.action_type == "goback_to_pre_page") { |
| | | } else if (action.action_type == "goback_to_pre_page") { |
| | | //返回上一页 |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import buttonClickMixin from '@/mixins/button-click.js'; |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | |
| | | export default { |
| | |
| | | |
| | | async loadData() { |
| | | //主数据类获取 |
| | | const param = this.param |
| | | this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) |
| | | this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls |
| | | ?.View_Style?.Name) |
| | | this.viewParam('Mast'); |
| | | this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) |
| | | this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style |
| | | ?.Name) |
| | | this.viewParam('Sub'); |
| | | try { |
| | | showLoading("loading...") |
| | | const param = this.param |
| | | this.classAttrList = await this.classAttrGetList(param.Master_Cls?.ID) |
| | | this.classGridStyle = await this.classGridStyleInfo(param.Master_Cls.ID, param.Master_Cls |
| | | ?.View_Style?.Name) |
| | | this.viewParam('Mast'); |
| | | this.classAttrList = await this.classAttrGetList(param.Sub_Cls?.ID) |
| | | this.classGridStyle = await this.classGridStyleInfo(param.Sub_Cls?.ID, param.Sub_Cls?.View_Style |
| | | ?.Name) |
| | | this.viewParam('Sub'); |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + " 1") |
| | | |
| | | } |
| | | }, |
| | | async DictItemGetList(attr) { //Mobox3得到字典项列表 |
| | | try { |
| | |
| | | <view class="uni-page-modal-3017-2" :class="largeMode?'large-mode':''"> |
| | | <!-- 表头样式 --> |
| | | <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" |
| | | :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap" |
| | | @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton"> |
| | | :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap" :focusId="focusFieldId" |
| | | @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton" |
| | | @on-click="onClick"> |
| | | </OIForm> |
| | | <!-- 从数据 --> |
| | | <view class="v-panel"> |
| | |
| | | import utils from "@/js/utils.js" |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import { |
| | | appGetInfo, |
| | |
| | | subClassGridStyle: [], |
| | | popupType: "center", |
| | | check_list: {}, |
| | | |
| | | focusMateria: false, |
| | | focusFieldId: "", |
| | | focusOldFieldId: "", |
| | | head_styledef: { |
| | | form: { |
| | | items: [] |
| | |
| | | this.param = JSON.parse(options.param); |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | this.loadData(paramValue) |
| | | |
| | | //页面初始化获取焦点 |
| | | // this.focusMateria=true; |
| | | }, |
| | | initialEvent() { |
| | | let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial"); |
| | |
| | | }); |
| | | }, |
| | | async loadData(paramValue) { |
| | | console.log(this.param); |
| | | //获取数据类的自定义表单参数 |
| | | await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID); |
| | | //传入参数值 |
| | | if (paramValue) { |
| | | this.setFormValues(this.head_styledef, paramValue) |
| | | // const attrs = paramValue.attrs || []; |
| | | // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { |
| | | // if (ele.name != "Layout") { |
| | | // attrs.forEach(async (ele2, index2) => { |
| | | // if (ele.fieldId == ele2.name) { |
| | | // ele.value = ele2.value; |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // ele.setting.colList.forEach(async (col) => { |
| | | // if (col) { |
| | | // attrs.forEach(async (ele2, |
| | | // index2) => { |
| | | // if (col.fieldId == ele2.name) { |
| | | // col.value = ele2.value; |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }) |
| | | |
| | | try { |
| | | showLoading("loading...") |
| | | console.log(this.param); |
| | | //获取数据类的自定义表单参数 |
| | | await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID); |
| | | //传入参数值 |
| | | if (paramValue) { |
| | | this.setFormValues(this.head_styledef, paramValue) |
| | | } |
| | | await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID); |
| | | await this.loadInitialEvent(); |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | |
| | | await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID); |
| | | await this.loadInitialEvent(); |
| | | }, |
| | | async loadInitialEvent() { |
| | | try { |
| | |
| | | if (!result.style_def.includes('"')) styledef = Base64.decode(result |
| | | .style_def); |
| | | } |
| | | $this.head_styledef = result.style_def ? JSON.parse(styledef) : {}; |
| | | |
| | | const styledefHead = styledef ? JSON.parse(styledef) : {}; |
| | | |
| | | // console.log($this.head_styledef); |
| | | if ($this.head_styledef.form?.items) { |
| | | $this.head_styledef.form.items.forEach(async (ele, index) => { |
| | | ele.show = true; |
| | | if (ele.useDict == true) { //判断useDict是否使用字典 |
| | | await this.DictGetInfo(ele.bind.dict, index, 'mast'); |
| | | } else { |
| | | if (ele?.name === "Select") { |
| | | const selections = ele?.selections || [] |
| | | //有默认值,显示默认值 |
| | | let itemName = ele.value || ""; |
| | | if (itemName) { |
| | | $this.head_styledef.form |
| | | .model[ele.fieldId] = itemName; |
| | | } |
| | | $this.head_styledef.form.items[index].selections = selections.map(( |
| | | a) => { |
| | | return { |
| | | value: a.value, |
| | | text: a.label |
| | | if (styledefHead.form?.items) { |
| | | styledefHead.form.items.forEach(async (ele, index) => { |
| | | if (ele.name != "Layout") { |
| | | ele.show = true; |
| | | if (ele.useDict == true) { //判断useDict是否使用字典 |
| | | await this.DictGetInfo(ele.bind.dict, index, 'mast'); |
| | | } else { |
| | | if (ele?.name === "Select") { |
| | | const selections = ele?.selections || [] |
| | | //有默认值,显示默认值 |
| | | let itemName = ele.value || ""; |
| | | if (itemName) { |
| | | styledefHead.form |
| | | .model[ele.fieldId] = itemName; |
| | | } |
| | | }) |
| | | styledefHead.form.items[index].selections = selections.map(( |
| | | a) => { |
| | | return { |
| | | value: a.value, |
| | | text: a.label |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | if ($this.focusFieldId == "") { |
| | | if (ele.name == 'Input' || ele.name == |
| | | 'InputNumber') { |
| | | $this.setData({ |
| | | focusFieldId: ele.fieldId |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | for (let j in ele.setting.colList) { |
| | | const col = ele.setting.colList[j] |
| | | if (col) { |
| | | col.show = true |
| | | if (col?.useDict) { |
| | | //判断useDict是否使用字典 |
| | | await $this.DictGetInfo(col.bind |
| | | .dict, |
| | | styledefHead.form |
| | | .model, col); |
| | | } else { |
| | | if (col?.name === "Select") { |
| | | const selections = col?.selections || [] |
| | | //有默认值,显示默认值 |
| | | let itemName = col.value || ""; |
| | | if (itemName) { |
| | | styledefHead.form |
| | | .model[col.fieldId] = itemName; |
| | | } |
| | | col.selections = selections.map((a) => { |
| | | return { |
| | | value: a.value, |
| | | text: a.label |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | if ($this.focusFieldId == "") { |
| | | if (col.name == 'Input' || col |
| | | .name == |
| | | 'InputNumber') { |
| | | $this.setData({ |
| | | focusFieldId: col |
| | | .fieldId |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | $this.head_styledef.form.model["S_CLASSES"] = app.globalData.classes |
| | | } |
| | | } |
| | | $this.setData({ |
| | | head_styledef: styledefHead |
| | | }) |
| | | if ($this.head_styledef.event?.length > 0) { |
| | | $this.head_styledef.event.forEach(async (a) => { //判断是否是初始化事件 |
| | | if (a.event_id == "initial") { |
| | |
| | | getApp().onScan((result) => { |
| | | //console.log(result); |
| | | uni.hideKeyboard(); |
| | | var $this = this; |
| | | console.log(item); |
| | | item.value = result |
| | | let newVal = item.value.trim() |
| | | if (newVal) { |
| | | item.oldvalue = newVal; |
| | | var attr = item.fieldId; |
| | | $this.head_styledef.form.model[attr] = newVal; |
| | | $this.focusMateria = true; //初始化,第二个输入框focus属性 |
| | | // setTimeout(function(){ |
| | | // $this.focusMateria=true; //第二个输入框获取焦点 |
| | | setTimeout(function() { |
| | | uni.hideKeyboard(); |
| | | }, 1000); |
| | | // },500); |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.param.Scan_Code.Input_Change_Event.ID; |
| | | if (eventid) { |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "7", //"0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: 'MBOX', //this.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: [], |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: newVal |
| | | }] |
| | | this.onScanValue(item, result) |
| | | }) |
| | | }, |
| | | onScanValue(item, value) { |
| | | const $this = this; |
| | | //console.log("onScanValue", item); |
| | | item.value = value |
| | | let newVal = item.value |
| | | if (typeof item.value == "string") { |
| | | newVal = item.value.trim() |
| | | } |
| | | if (newVal) { |
| | | item.oldvalue = newVal; |
| | | var attr = item.fieldId; |
| | | $this.head_styledef.form.model[attr] = newVal; |
| | | setTimeout(function() { |
| | | uni.hideKeyboard(); |
| | | }, 1000); |
| | | var eventid = this.param.Scan_Code.Input_Change_Event.ID; |
| | | if (eventid) { |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "7", //"0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: 'MBOX', //this.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: [], |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: newVal |
| | | }] |
| | | } |
| | | |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | } |
| | | var findd = false |
| | | for (let i in $this.head_styledef.form.items) { |
| | | const ele = $this.head_styledef.form.items[i] |
| | | |
| | | if (ele.name != "Layout") { |
| | | if (ele.name == 'Input' || ele.name == 'InputNumber') { |
| | | if (attr == ele.fieldId) { |
| | | findd = true |
| | | } else { |
| | | if (findd) { |
| | | $this.setData({ |
| | | focusFieldId: ele.fieldId |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | if (findd) { |
| | | let curIndex = ele.setting.colList.findIndex((col, index2, arr) => { |
| | | return (col.name == 'Input' || col.name == 'InputNumber'); |
| | | }) |
| | | if (curIndex > -1) { |
| | | $this.setData({ |
| | | focusFieldId: ele.setting.colList[curIndex] |
| | | .fieldId |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } else { |
| | | let curIndex = ele.setting.colList.findIndex((col, index2, arr) => { |
| | | return attr == col.fieldId; |
| | | }) |
| | | if (curIndex > -1) { |
| | | findd = true |
| | | let curIndex2 = ele.setting.colList.findIndex((col, index2, arr) => { |
| | | return (col.name == 'Input' || col.name == |
| | | 'InputNumber') && |
| | | index2 > |
| | | curIndex; |
| | | }) |
| | | if (curIndex2 > -1) { |
| | | $this.setData({ |
| | | focusFieldId: ele.setting.colList[curIndex].fieldId |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | onevent(item) { |
| | | // console.log(e.target); |
| | |
| | | } |
| | | |
| | | }, |
| | | onClick(item) { |
| | | 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); |
| | | } |
| | | }, |
| | | classAttr_extButton(item) { |
| | | var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击回调 |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击事件 |
| | |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open(this.popupType); |
| | | |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent.id, |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id, |
| | | item); |
| | | }, |
| | | dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) { |
| | | dataObjRunCustomEvent_Return(eventid, button_callback, item) { |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: $this.head_styledef.form.clsId, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: $this.head_styledef.form.clsId, // button=bottom时 master的cls_id |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | showLoading("loading...") |
| | | |
| | | var obj_attr = $this.head_styledef.form.model; |
| | | console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | |
| | | console.log(dataInfo); |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | hideLoading() |
| | | $this.onFormEventResult(data, button_callback, item) |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "5.1") |
| | | }); |
| | | }, |
| | | |
| | | onEnterChange(item) { |
| | | console.log("onEnterChange", item); |
| | | let newVal = item.value |
| | | if (typeof item.value == "string") { |
| | | newVal = item.value.trim() |
| | | if (!newVal) |
| | | return |
| | | } |
| | | if (item.oldvalue != newVal) { |
| | | item.oldvalue = newVal; |
| | | var attr = item.fieldId; |
| | | this.head_styledef.form.model[attr] = newVal; |
| | | var onChangeEvent = item.bind.onChangeEvent; //内容变化后事件 |
| | | if (onChangeEvent?.id) { //内容变化后事件 |
| | | this.onChange(onChangeEvent); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onDetail1EnterChange(item) { |
| | | //码盘中样式回车事件 |
| | | // console.log(item); |
| | | }, |
| | | // 内容变化后事件 |
| | | async onChange(event) { |
| | | var eventid = event?.id; //内容变化后事件 |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.head_styledef.form.clsId, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | |
| | | }, |
| | | async onFormEventResult(data, callbackEventId, item) { |
| | | try { |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: $this.head_styledef.form.clsId, // 功能点主数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: $this.translateSys('add2'), |
| | | master: { |
| | | cls_id: $this.head_styledef.form.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 |
| | |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | var result = data.result || [] |
| | | |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.head_styledef.form.items.length; c++) { |
| | | var attr = $this.head_styledef.form.items[c]; |
| | | if (attr.name != 'Layout') { |
| | | if (attr.fieldId == result[i].attr) { |
| | | attr.value = ''; |
| | | attr.oldvalue = ''; |
| | | attr.value = result[i].value; |
| | | attr.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[attr.fieldId] = result[i].value; |
| | | } |
| | | } else if (attr.name == 'Layout') { |
| | | attr.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == result[i].attr) { |
| | | col.value = ''; |
| | | col.oldvalue = ''; |
| | | col.value = result[i].value; |
| | | col.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[col.fieldId] = |
| | | result[i].value; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.refdatastore.filter(function(s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.refdatastore.length; j++) { |
| | | if ($this.refdatastore[j].attr == result[i].attr) { |
| | | $this.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actions = data.action || [] |
| | | 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 == 'open_panel') { |
| | | var enviroment = JSON.stringify(enviroment); |
| | | 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($this.head_styledef, result) |
| | | } else if (action.action_type == 'set_dlg_attr_show') { |
| | | var data = action.value; |
| | | $this.setFormItemVisible(data) |
| | | // console.log($this.head_styledef); |
| | | } 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_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> ' + |
| | | $this.translateSys("tip"), |
| | |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | showInfo($this.translateSys( |
| | | "quotation_mark_left") + |
| | | action.action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed")) |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (ex) { |
| | |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | showError(ex, this.translateSys("error") + "5.1") |
| | | }); |
| | | }, |
| | | |
| | | onEnterChange(item) { |
| | | console.log("onEnterChange", item); |
| | | let newVal = item.value |
| | | if (typeof item.value == "string") { |
| | | newVal = item.value.trim() |
| | | if (!newVal) |
| | | return |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys("error") + "10.1") |
| | | } |
| | | if (item.oldvalue != newVal) { |
| | | item.oldvalue = newVal; |
| | | var attr = item.fieldId; |
| | | this.head_styledef.form.model[attr] = newVal; |
| | | var onChangeEvent = item.bind.onChangeEvent; //内容变化后事件 |
| | | if (onChangeEvent?.id) { //内容变化后事件 |
| | | this.onChange(onChangeEvent); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onDetail1EnterChange(item) { |
| | | //码盘中样式回车事件 |
| | | // console.log(item); |
| | | }, |
| | | // 内容变化后事件 |
| | | async onChange(event) { |
| | | var eventid = event?.id; //内容变化后事件 |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var req = Object.keys(obj_attr).map((a) => ({ |
| | | attr: a, |
| | | value: obj_attr[a] || "", |
| | | })); |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.head_styledef.form.clsId, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | |
| | | }, |
| | | |
| | | scan_ontap(e) { //扫码区扫码功能 |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | |
| | | |
| | | DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | if (!info.eventid) |
| | | return |
| | | showLoading("loading...") |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: this.param.Master_Cls.ID, // 功能点主数据类标识 |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(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) { |
| | | var result = data.result || [] |
| | | |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.head_styledef.form.items.length; c++) { |
| | | var attr = $this.head_styledef.form.items[c]; |
| | | if (attr.name != 'Layout') { |
| | | if (attr.fieldId == result[i].attr) { |
| | | attr.value = ''; |
| | | attr.oldvalue = ''; |
| | | attr.value = result[i].value; |
| | | attr.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[attr.fieldId] = result[i].value; |
| | | } |
| | | } else if (attr.name == 'Layout') { |
| | | attr.setting.colList.forEach(col => { |
| | | if (col) { |
| | | if (col.fieldId == result[i].attr) { |
| | | col.value = ''; |
| | | col.oldvalue = ''; |
| | | col.value = result[i].value; |
| | | col.oldvalue = result[i].value; |
| | | $this.head_styledef.form.model[col.fieldId] = |
| | | result[i].value; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.refdatastore.filter(function(s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.refdatastore.length; j++) { |
| | | if ($this.refdatastore[j].attr == result[i].attr) { |
| | | $this.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } 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($this.head_styledef, result) |
| | | } else if (action.action_type == 'set_dlg_attr_show') { |
| | | var data = action.value; |
| | | $this.setFormItemVisible(data) |
| | | // console.log($this.head_styledef); |
| | | } else if (action.action_type == 'set_global_attr') { |
| | | $this.global_attr = action.value || []; |
| | | } |
| | | |
| | | } |
| | | |
| | | } 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") |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | scan_DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | showLoading("loading...") |
| | | var obj_attr = {}; |
| | | info.attr.forEach(item => { |
| | | obj_attr[item.attr] = item.value; |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | |
| | | hideLoading() |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "7.1") |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | scan_OKDataObjRunCustomEvent(eventID) { |
| | | this.saving = true |
| | | uni.showLoading({ |
| | | title: this.translateSys("loading"), |
| | | mask: true |
| | | }); |
| | | showLoading("loading...") |
| | | |
| | | var $this = this; |
| | | //获取表头属性 |
| | | var obj_attr = this.head_styledef.form.model; |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | uni.hideLoading(); |
| | | hideLoading() |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | this.saving = false |
| | | uni.hideLoading(); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | }, |
| | |
| | | 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); |
| | | try { |
| | | showLoading("loading...") |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | this.title = options.titlename; |
| | | this.param = JSON.parse(options.param); |
| | | |
| | | |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.ListHtml_Panel = ""; |
| | | this.ListPageHtml_Show = { |
| | | name: "", |
| | | event: { |
| | | id: "", |
| | | name: "" |
| | | } |
| | | }; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | //this.activelist = []; |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | |
| | | if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML页面") { |
| | | // HTML页面 |
| | | //获取数据类的HTML页面 |
| | | await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id, |
| | | paramValue); |
| | | } else { |
| | | await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id); |
| | | |
| | | await this.initial(paramValue); |
| | | await this.loadInitialEvent(); |
| | | |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.ListHtml_Panel = ""; |
| | | this.ListPageHtml_Show = { |
| | | name: "", |
| | | event: { |
| | | id: "", |
| | | name: "" |
| | | } |
| | | }; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | //this.activelist = []; |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | |
| | | if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML页面") { |
| | | // HTML页面 |
| | | //获取数据类的HTML页面 |
| | | await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id, |
| | | paramValue); |
| | | } else { |
| | | await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id); |
| | | |
| | | await this.initial(paramValue); |
| | | await this.loadInitialEvent(); |
| | | |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | |
| | | // this.isFilter=true; |
| | | // if(this.param.ShowFilter) |
| | | // this.isFilter=false; |
| | | // //获取数据类的自定义表单参数 |
| | | // if(this.param.Query_Panel){ |
| | | // this.Head_UIStyleGetInfo(this.param.DataCls.id,this.param.Query_Panel.id); |
| | | // } |
| | | // if(this.param.ListPage.ListItem_UIDef?.ui_type=="HTML页面"){ |
| | | // // HTML页面 |
| | | // //获取数据类的HTML页面 |
| | | // await this.Html_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id); |
| | | // }else{ |
| | | // await this.Detail1_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id); |
| | | // } |
| | | // this.orderby = this.param.Order?this.param.Order:'T_CREATE Desc'; |
| | | // if(this.param.Query_Event){ |
| | | // await this.onSearChange(this.param.DataCls.id,this.param.Query_Event.id); |
| | | // } else{ |
| | | // this.wheres = this.param.Condition; |
| | | // this.pageindex = 1; |
| | | // this.page_size = 3; |
| | | // this.query_id = ""; |
| | | // await this.loadDataGetList(); |
| | | // } |
| | | // console.log(this.param); |
| | | //页面初始化获取焦点 |
| | | // this.focusMateria=true; |
| | | }, |
| | | computed: { |
| | | |
| | |
| | | async onSearChange(clsid, eventid) { |
| | | try { |
| | | if (eventid) { |
| | | showLoading("loading...") |
| | | var $this = this; |
| | | var dataInfo = { |
| | | ed_type: 0, |
| | |
| | | class_id: clsid, |
| | | event_id: eventid, |
| | | }; |
| | | |
| | | var 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 |
| | |
| | | } |
| | | } |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + " 4.1") |
| | | |
| | | } |
| | |
| | | //查询数据类数据信息 |
| | | async loadDataGetList() { |
| | | try { |
| | | uni.showLoading({ |
| | | title: this.translateSys("loading"), |
| | | mask: true |
| | | }); |
| | | showLoading("loading...") |
| | | //条件查询 |
| | | var condition = this.wheres; |
| | | if (this.where) { |
| | |
| | | }; |
| | | dataObjQuery(dataInfo).then(result => { |
| | | console.log(result); |
| | | uni.hideLoading(); |
| | | hideLoading() |
| | | |
| | | // var list=[]; |
| | | $this.query_id = ''; |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "5.1") |
| | | }); |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "5.2") |
| | | } |
| | | }, |
| | |
| | | //执行事件 |
| | | async TriggerEvent(btn, style, enviroment) { //执行触发事件 |
| | | try { |
| | | showLoading("loading...") |
| | | let obj_attr = { |
| | | S_ID: this.styledef.form.objId |
| | | }; |
| | |
| | | obj_attr: obj_attr, |
| | | } |
| | | var result = await runCustomEvent(dataInfo) |
| | | hideLoading() |
| | | if (result.ret != 0 && result.ret != 1) { |
| | | let cls_name = result.event_info?.cls_name |
| | | let event_name = result.event_info?.event_name |
| | |
| | | } |
| | | } |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error')) |
| | | } |
| | | }, |
| | |
| | | //执行后处理事件 |
| | | async AfterProcess_Event(clsId, afterProcess_Event, enviroment) { |
| | | try { |
| | | |
| | | if (afterProcess_Event.ID) { |
| | | //执行后处理事件 |
| | | showLoading("loading...") |
| | | await this.runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | | class_id: clsId, |
| | | event_id: afterProcess_Event.ID, |
| | | }); |
| | | hideLoading() |
| | | } |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "7") |
| | | } |
| | | }, |
| | |
| | | async onChange(event) { |
| | | try { |
| | | if (event.id) { |
| | | showLoading("loading...") |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var input_param = Base64.encode( |
| | |
| | | }; |
| | | 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 |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | } |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "8.2") |
| | | |
| | | } |
| | |
| | | async runCustomEvent(dataInfo) { |
| | | try { |
| | | var $this = this; |
| | | showLoading("loading...") |
| | | 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 |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "9.1") |
| | | }); |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "9.2") |
| | | |
| | | } |
| | |
| | | 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) { |
| | |
| | | import classUtils from "@/js/utils.js" |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import { |
| | | appGetInfo, |
| | |
| | | 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); |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | this.click_item_view = false |
| | | if (this.param?.ClickItem_Event?.id) |
| | | this.click_item_view = true |
| | | await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ListItem_Panel.id); |
| | | this.initial(paramValue) |
| | | try { |
| | | showLoading("loading...") |
| | | // console.log(options); |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | this.title = options.titlename; |
| | | this.param = JSON.parse(options.param); |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | this.click_item_view = false |
| | | if (this.param?.ClickItem_Event?.id) |
| | | this.click_item_view = true |
| | | await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ListItem_Panel.id); |
| | | this.initial(paramValue) |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | |
| | | }, |
| | | methods: { |
| | |
| | | }; |
| | | runCustomEvent(dataInfo).then(result => { |
| | | 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 |
| | |
| | | if (!this.clickItemEvent.id) { |
| | | return; |
| | | } |
| | | showLoading("loading...") |
| | | const $this = this |
| | | |
| | | var obj_attr = this.head_styledef.form.model; |
| | |
| | | data_json, |
| | | }).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 |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | }, |
| | |
| | | //执行触发事件 |
| | | async triggerEvent(btn, style, enviroment) { |
| | | const $this = this |
| | | |
| | | showLoading("loading...") |
| | | var obj_attr = this.head_styledef.form.model; |
| | | // console.log(obj_attr); |
| | | var input_param = Base64.encode( |
| | |
| | | input_param, |
| | | data_json, |
| | | }).then(result => { |
| | | hideLoading() |
| | | // console.log(result); |
| | | if (result.ret != 0 && result.ret != 1) { |
| | | let cls_name = result.event_info?.cls_name |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | }, |
| | |
| | | async onChange(event) { |
| | | try { |
| | | if (event.id) { |
| | | showLoading("loading...") |
| | | var obj_attr = this.head_styledef.form.model; |
| | | console.log(obj_attr); |
| | | var input_param = Base64.encode( |
| | |
| | | }; |
| | | 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 |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | } |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "8.2") |
| | | |
| | | } |
| | |
| | | } from '@/js/Base64.js'; |
| | | import { |
| | | showInfo, |
| | | showError |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | | import classUtils from "@/js/utils.js" |
| | | import { |
| | |
| | | }, |
| | | }, |
| | | onBackPress(e) { |
| | | this.beforeNavigateBack() |
| | | this.beforeNavigateBack() |
| | | }, |
| | | async onLoad(options) { |
| | | console.log(options); |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | this.title = options.titlename; |
| | | this.param = JSON.parse(options.param); |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | await this.Head_UIStyleGetInfo(this.param.ClsID, this.param.MasterView_Panel.id); |
| | | await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ViewItem_Panel.id); |
| | | const dataObj = options.dataObj ? JSON.parse(options.dataObj) : {}; |
| | | if (dataObj) { |
| | | let attrs = []; |
| | | let master_view = dataObj?.master_view; |
| | | Object.keys(master_view).forEach((a) => { |
| | | attrs.push({ |
| | | attr: a, |
| | | value: master_view[a] |
| | | try { |
| | | showLoading("loading...") |
| | | console.log(options); |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | this.title = options.titlename; |
| | | this.param = JSON.parse(options.param); |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.active_id = ''; |
| | | this.activeItem = {}; |
| | | await this.Head_UIStyleGetInfo(this.param.ClsID, this.param.MasterView_Panel.id); |
| | | await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ViewItem_Panel.id); |
| | | const dataObj = options.dataObj ? JSON.parse(options.dataObj) : {}; |
| | | if (dataObj) { |
| | | let attrs = []; |
| | | let master_view = dataObj?.master_view; |
| | | Object.keys(master_view).forEach((a) => { |
| | | attrs.push({ |
| | | attr: a, |
| | | value: master_view[a] |
| | | }); |
| | | }); |
| | | }); |
| | | attrs.forEach((attr) => { |
| | | this.head_styledef.form.items.forEach((ele2) => { |
| | | if (ele2.name != "Layout") { |
| | | if (ele2.fieldId == attr.attr) { |
| | | ele2.value = attr.value; |
| | | } |
| | | } else if (ele2.name == "Layout") { |
| | | ele2.setting.colList.forEach((col) => { |
| | | if (col) { |
| | | if (col.fieldId == attr.attr) { |
| | | col.value = attr.value; |
| | | } |
| | | attrs.forEach((attr) => { |
| | | this.head_styledef.form.items.forEach((ele2) => { |
| | | if (ele2.name != "Layout") { |
| | | if (ele2.fieldId == attr.attr) { |
| | | ele2.value = attr.value; |
| | | } |
| | | }); |
| | | } |
| | | } else if (ele2.name == "Layout") { |
| | | ele2.setting.colList.forEach((col) => { |
| | | if (col) { |
| | | if (col.fieldId == attr.attr) { |
| | | col.value = attr.value; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | this.viewAceionContent(dataObj.page.list); |
| | | this.viewAceionContent(dataObj.page.list); |
| | | } |
| | | if (this.enter_view_event.id) |
| | | this.enterAfterEvent(this.enter_view_event); |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | if (this.enter_view_event.id) |
| | | this.enterAfterEvent(this.enter_view_event); |
| | | |
| | | }, |
| | | methods: { |
| | | // |
| | |
| | | //页面进入后事件 |
| | | async enterAfterEvent(event) { |
| | | try { |
| | | showLoading("loading...") |
| | | let data_json = []; |
| | | let jsonlist = []; |
| | | let detailStyleList = this.detail1StyleDefList; |
| | |
| | | } else input_param[item.fieldId] = item.value; |
| | | }); |
| | | input_param = Base64.encode(JSON.stringify(input_param)); |
| | | this.runCustomEvent({ |
| | | await this.runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | | class_id: this.param.ClsID, |
| | |
| | | input_param, |
| | | data_json, |
| | | }) |
| | | hideLoading() |
| | | |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('tip')); |
| | | } |
| | | }, |
| | |
| | | |
| | | }, |
| | | async onTriggerEvent(btn, enviroment) { |
| | | let data_json = []; |
| | | let jsonlist = []; |
| | | try { |
| | | showLoading("loading...") |
| | | |
| | | let detailStyleList = this.detail1StyleDefList; |
| | | detailStyleList.forEach((style) => { |
| | | let detail_attr = {}; |
| | | style.form.items.forEach((item) => { |
| | | let data_json = []; |
| | | let jsonlist = []; |
| | | |
| | | let detailStyleList = this.detail1StyleDefList; |
| | | detailStyleList.forEach((style) => { |
| | | let detail_attr = {}; |
| | | style.form.items.forEach((item) => { |
| | | if (item.name == "Layout") { |
| | | item.setting.colList.forEach((cols) => { |
| | | if (cols != null) detail_attr[cols.fieldId] = cols.value; |
| | | }); |
| | | } else detail_attr[item.fieldId] = item.value; |
| | | }); |
| | | jsonlist.push(detail_attr); |
| | | }); |
| | | data_json = Base64.encode(JSON.stringify(jsonlist)); |
| | | |
| | | let input_param = {}; |
| | | this.head_styledef.form.items.forEach((item) => { |
| | | if (item.name == "Layout") { |
| | | item.setting.colList.forEach((cols) => { |
| | | if (cols != null) detail_attr[cols.fieldId] = cols.value; |
| | | if (cols != null) input_param[cols.fieldId] = cols.value; |
| | | }); |
| | | } else detail_attr[item.fieldId] = item.value; |
| | | } else input_param[item.fieldId] = item.value; |
| | | }); |
| | | jsonlist.push(detail_attr); |
| | | }); |
| | | data_json = Base64.encode(JSON.stringify(jsonlist)); |
| | | |
| | | let input_param = {}; |
| | | this.head_styledef.form.items.forEach((item) => { |
| | | if (item.name == "Layout") { |
| | | item.setting.colList.forEach((cols) => { |
| | | if (cols != null) input_param[cols.fieldId] = cols.value; |
| | | }); |
| | | } else input_param[item.fieldId] = item.value; |
| | | }); |
| | | input_param = Base64.encode(JSON.stringify(input_param)); |
| | | await this.runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | | class_id: btn.Cls_ID, |
| | | event_id: btn.Event.ID, |
| | | input_param, |
| | | data_json, |
| | | }); |
| | | input_param = Base64.encode(JSON.stringify(input_param)); |
| | | await this.runCustomEvent({ |
| | | ed_type: 0, |
| | | start_transaction: true, |
| | | class_id: btn.Cls_ID, |
| | | event_id: btn.Event.ID, |
| | | input_param, |
| | | data_json, |
| | | }); |
| | | hideLoading() |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys("error")); |
| | | } |
| | | }, |
| | | async navigateBackEvent() { |
| | | try { |
| | | var $this = this; |
| | | if (!this.exit_view_event.id) |
| | | return |
| | | showLoading("loading...") |
| | | let data_json = []; |
| | | let jsonlist = []; |
| | | let detailStyleList = this.detail1StyleDefList; |
| | |
| | | input_param, |
| | | data_json, |
| | | }) |
| | | hideLoading() |
| | | if (result.ret != 0 && result.ret != 1) { |
| | | let cls_name = result.event_info?.cls_name |
| | | let event_name = result.event_info?.event_name |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | hideLoading() |
| | | showError(ex, this.translateSys('error') + "9.2") |
| | | |
| | | } |
| | | |
| | | }, |
| | | cancel(e) { //取消 |
| | | |
| | | cancel(e) { //取消 |
| | | |
| | | this.beforeNavigateBack() |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | | }); |
| | | }, |
| | | async beforeNavigateBack() |
| | | { |
| | | async beforeNavigateBack() { |
| | | await this.navigateBackEvent() |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('ExitViewPage'); |
| | |
| | | } 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") |
| | | |
| | | |
| | | }); |
| | | }, |
| | | |
| | |
| | | } |
| | | }, |
| | | 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, |
| | | this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id, |
| | | item); |
| | | }, |
| | | |
| | |
| | | }; |
| | | runCustomEvent(dataInfo).then(result => { |
| | | 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 (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 { |
| | | var actionList = result.action || [] |
| | | actionList.forEach(item => { |
| | | |
| | | 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 (action.action_type == |
| | | 'set_dlg_attr_show') { |
| | | var data = action.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 |
| | | } |
| | | } |
| | | |
| | | } |
| | | $this.onFormEventResult(result, "") |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | |
| | | showError(ex, this.translateSys('tip') + "4.2") |
| | | } |
| | | }, |
| | | async onFormEventResult(data, button_callback, 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 |
| | | .join('\n') : '' |
| | | |
| | | 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) |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var enviroment = JSON.stringify(enviroment); |
| | | var actions = data.action || [] |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | console.log(action) |
| | | var val = action.value; |
| | | 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> ' + |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var param = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: "" |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selpsn/index?mulit=false¶m=' + |
| | | JSON |
| | | .stringify( |
| | | param), |
| | | events: { |
| | | AddPer(data, param) { |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param |
| | | .button_callback |
| | | .trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.clsId, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data, |
| | | dataJson: [], |
| | | } |
| | | $this.DataObjRunCustomEvent(info, |
| | | param |
| | | .data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } else if (action.action_type == 'open_data_query_dlg') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_common_dlg') { |
| | | |
| | | if (val.common_dlg_id == 'check_list') { |
| | | $this.setData({ |
| | | check_list: val.config |
| | | }) |
| | | if (val.config.appear_style == |
| | | 'sideslip') //判断是否是侧滑 |
| | | $this.setData({ |
| | | popupType: "right" |
| | | }) |
| | | else |
| | | $this.setData({ |
| | | popupType: "center" |
| | | }) |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.popupType); |
| | | var popupParam = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: "" |
| | | } |
| | | $this.setData({ |
| | | popupParam: popupParam |
| | | }) |
| | | } |
| | | } else if (action.action_type == |
| | | 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action |
| | | .value |
| | | .select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | var param_ = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selPrj/index?relation=' + priRel + |
| | | '¶m=' + |
| | | JSON.stringify(param_), |
| | | events: { |
| | | AddPer(data, param) { |
| | | var attr = param.item.fieldId; |
| | | $this.head_styledef.form.model[ |
| | | attr] = |
| | | data[0].ID + |
| | | ';' + data[0].Name; |
| | | |
| | | // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; |
| | | var callback_eventid = param |
| | | .button_callback |
| | | .trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.clsId, |
| | | objid: "", |
| | | attr: param.req, |
| | | dataJson: [], |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent( |
| | | info); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } 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 |
| | | } |
| | | } |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys("error") + "10.1") |
| | | } |
| | | }, |
| | | setFormValues(attrs) { |
| | | console.log(attrs) |
| | | const head_styledef = this.head_styledef |
| | |
| | | |
| | | async DataObjRunCustomEvent(info, data_attr) { |
| | | var $this = this; |
| | | if (!info.eventid) |
| | | return |
| | | 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 (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) |
| | | } else if (action.action_type == 'set_global_attr') { |
| | | $this.global_attr = action.value || []; |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: 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 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | $this.onFormEventResult(data, "") |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | 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) { |
| | | console.log("dataObjRunCustomEvent_Return", eventid, button_callback) |
| | | const $this = this |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | |
| | | 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 (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) |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actions = data.action || [] |
| | | 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 == 'open_panel') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var param = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: data_attr |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selpsn/index?mulit=false¶m=' + |
| | | JSON |
| | | .stringify( |
| | | param), |
| | | events: { |
| | | AddPer(data, param) { |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param |
| | | .button_callback |
| | | .trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.clsId, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data, |
| | | dataJson: [], |
| | | } |
| | | $this.DataObjRunCustomEvent(info, |
| | | param |
| | | .data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } else if (action.action_type == 'open_data_query_dlg') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + |
| | | $this.translateSys("tip"), |
| | | content: $this.translateSys( |
| | | "quotation_mark_left") + |
| | | action |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed") |
| | | }); |
| | | d.show(); |
| | | } else if (action.action_type == 'open_common_dlg') { |
| | | |
| | | if (val.common_dlg_id == 'check_list') { |
| | | $this.setData({ |
| | | check_list: val.config |
| | | }) |
| | | if (val.config.appear_style == |
| | | 'sideslip') //判断是否是侧滑 |
| | | $this.setData({ |
| | | popupType: "right" |
| | | }) |
| | | else |
| | | $this.setData({ |
| | | popupType: "center" |
| | | }) |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.popupType); |
| | | var popupParam = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req, |
| | | data_attr: data_attr |
| | | } |
| | | $this.setData({ |
| | | popupParam: popupParam |
| | | }) |
| | | } |
| | | } else if (action.action_type == |
| | | 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action |
| | | .value |
| | | .select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | var param_ = { |
| | | item: item, |
| | | button_callback: button_callback, |
| | | req: req |
| | | } |
| | | uni.navigateTo({ |
| | | url: '../selPrj/index?relation=' + priRel + |
| | | '¶m=' + |
| | | JSON.stringify(param_), |
| | | events: { |
| | | AddPer(data, param) { |
| | | var attr = param.item.fieldId; |
| | | $this.head_styledef.form.model[ |
| | | attr] = |
| | | data[0].ID + |
| | | ';' + data[0].Name; |
| | | |
| | | // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; |
| | | var callback_eventid = param |
| | | .button_callback |
| | | .trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.clsId, |
| | | objid: "", |
| | | attr: param.req, |
| | | dataJson: [], |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent( |
| | | info); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } 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 |
| | | } |
| | | } |
| | | } |
| | | $this.onFormEventResult(data, button_callback, item) |
| | | |
| | | }).catch(ex => { |
| | | showError(ex, this.translateSys('tip') + "5.1") |