cuiqian2004
4 天以前 07925905f1a596e20e980de6d42db217abb753b0
pages/modal/3018_2.vue
@@ -56,6 +56,12 @@
      Base64
   } from '@/js/Base64.js';
   import utils from "@/js/utils.js"
   import {
      showInfo,
      showError,
      showLoading,
      hideLoading
   } from "@/js/Page.js"
   import dayjs from "dayjs";
   import OIForm from '@/components/oi-form/index.vue'
   import {
@@ -110,7 +116,7 @@
            uni.scanCode({
               scanType: ["qrCode", 'barCode'],
               success: function(res) {
                  console.log(res)
                  if ($this.focusFieldId) {
                     const items = $this.head_styledef.form.items || []
                     for (let i in items) {
@@ -171,21 +177,31 @@
            this.loadData()
         }
      },
      onReady() {
         uni.setNavigationBarTitle({
            title: this.title
         }); //设置顶部标题
      },
      onLoad(options) {
         // console.log(options);
         uni.setNavigationBarTitle({
            title: options.titlename
         }); //设置顶部标题
         this.param = JSON.parse(options.param);
         this.title = this.param.Add_BtnName ? this.param.Add_BtnName : options
            .titlename; //设置按钮文字
         this.title = options.titlename; //设置按钮文字 this.param.Add_BtnName ? this.param.Add_BtnName :
         this.btnName = this.param.Add_BtnName || ""
         this.loadData(options.paramValue)
         const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
         this.loadData(paramValue)
      },
      computed: {
         dropdownBtns() {
            const btns = this.head_styledef.button || [];
            return btns
         },
         initialEvent() {
            let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial");
            return {
               id: event?.scrip_id || "",
               name: event?.scrip_name || "",
            };
         },
      },
@@ -213,35 +229,57 @@
            });
         },
         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) {
               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"));
            }
         },
         async loadInitialEvent() {
            try {
               var eventid = this.initialEvent?.id; //内容变化后事件
               if (eventid) {
                  // self.event_no_sub = 1;
                  let obj_attr = this.head_styledef.form.model;
                  let req = {
                     id: "",
                     attrs: Object.keys(obj_attr).map((a) => ({
                        attr: a,
                        value: obj_attr[a],
                     })),
                  };
                  var info = {
                     eventid: eventid,
                     edtype: "0",
                     projectid: '',
                     rclsid: '',
                     robjid: '',
                     userlogin: '',
                     clsid: this.param.DataCls.id,
                     objid: "",
                     attr: req,
                     dataJson: []
                  }
                  this.DataObjRunCustomEvent(info);
               }
            } catch (ex) {
               showError(ex, this.translateSys("error"))
            }
         },
         async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式
            var $this = this;
@@ -373,17 +411,7 @@
               }
            } catch (ex) {
               // console.log(ex);
               console.log(JSON.stringify(ex), ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error") + "1.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys("error") + " 1.1")
            }
         },
         async DictGetInfo(dict, formModel, formItem) { //Mobox3得到得到字典信息字典项列表
@@ -412,18 +440,7 @@
               }
               formItem.dict = list;
            } catch (ex) {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error") + "1.3",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys("error") + " 1.3")
            }
@@ -441,51 +458,38 @@
               };
               console.log(dataInfo);
               var data = await runCustomEvent(dataInfo)
               if (data.ret != 0&& data.ret != 1) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info : data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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);
                     }
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  }
                  if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                  if (data.ret == 801) showInfo(tip)
                  else showError(`${tip},提示:${data.ret}`, this.translateSys('tip'))
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data.info.join('<br/>') : '';
                     data.info.join('\n') : '';
                  tip = tip || data.err_info
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  let time = data.info_time || 0
                  if (time)
                     showError(tip, this.translateSys('tip'))
                  else
                     showInfo(tip)
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                           showInfo(data.result)
                        }
                     }
                     try {
@@ -519,22 +523,18 @@
                                 })
                              });
                           } else {
                              uni.showModal({
                                 title: this.translateSys("tip"),
                                 content: this.translate(
                                       'execute_init_event_failed') +
                                    this.translateSys("full_stop") +
                                    this.translate('reason') + this
                                    .translateSys(
                                       "colon") +
                                    this.translateSys("quotation_mark_left") +
                                    action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this
                                    .translate('tip_action_unprocessed'),
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                              showInfo($this.translate(
                                    'execute_init_event_failed') +
                                 $this.translateSys("full_stop") +
                                 $this.translate('reason') + $this
                                 .translateSys(
                                    "colon") +
                                 $this.translateSys("quotation_mark_left") +
                                 action
                                 .action_type + $this.translateSys(
                                    "quotation_mark_right") + $this
                                 .translate('tip_action_unprocessed'))
                           }
                        }
@@ -542,31 +542,14 @@
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        showError(tip, this.translateSys('tip'))
                        return
                     }
                  }
               }
            } catch (ex) {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error") + "3",
                  content: this.translate('execute_init_event_failed') +
                     this.translateSys("full_stop") +
                     this.translate('reason') + this.translateSys("colon") + tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys("error") + " 3")
            }
         },
@@ -582,7 +565,7 @@
         },
         onScanValue(item, value) {
            const $this = this;
            //console.log("onScanValue", item);
            console.log("onScanValue", value);
            item.value = value
            let newVal = item.value
            if (typeof item.value == "string") {
@@ -676,7 +659,18 @@
         },
         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
@@ -728,231 +722,58 @@
            }
         },
         classAttr_extButton(item) {
            var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //后图标点击事件
            var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击回调
            if (!onSuffixClickCallbackEvent.id) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate('icon_click_callback_empty'),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               return;
            }
            if (!onSuffixClickEvent.id) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate('icon_click_event_empty'),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               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) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: "popupParam为空!",
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               return;
            }
            if (data.length == 0) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate("tip_no_select_data"),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               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,req) {
            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
                  }
               }
            }
               };
               if (data.ret != 0 && data.ret != 1) {
            // 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) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  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);
                     }
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' +
                        data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  }
                  if (cls_name && event_name) tip =
                     `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                  if (data.ret == 801) showInfo(tip)
                  else showError(`${tip},提示:${data.ret}`, this.translateSys('tip'))
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data
                     .info
                     .join(
                        '<br/>') : '';
                     data.info.join('\n') : '';
                  tip = tip || data.err_info
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  let time = data.info_time || 0
                  if (time)
                     showError(tip, this.translateSys('tip'))
                  else
                     showInfo(tip)
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                        $this.setFormValues(data.result || [])
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                           showInfo(data.result)
                        }
                     }
                     try {
                        var actionlist = data.action || []
                        var enviroment = JSON.stringify(enviroment);
                        for (var i = 0; i < actionlist.length; i++) {
                           var action = actionlist[i];
                           if (action.action_type == 'set_dlg_attr') {
@@ -981,176 +802,7 @@
                                    focusFieldId: 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"),
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                           }
                        }
                     } catch (ex) {
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        return
                     }
                  }
               }
            }).catch(ex => {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error") + "3.1",
                  content: exStr,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
            });
         },
         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) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  if (data.ret == 801) {
                     if ($this.param.Only_Script_Error) {
                        let pos = tip.indexOf(":");
                        if (pos > -1) tip = tip.substring(pos + 1);
                     }
                     uni.showModal({
                        title: $this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: $this.translateSys('close')
                     });
                  } else uni.showModal({
                     title: $this.translateSys("tip"),
                     content: tip + ',' + $this.translateSys('tip') + ':' +
                        data
                        .ret,
                     showCancel: false,
                     confirmText: $this.translateSys('close')
                  });
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data
                     .info
                     .join(
                        '<br/>') : '';
                  tip = tip || data.err_info
                  if (tip) uni.showModal({
                     title: $this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: $this.translateSys('close')
                  });
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                     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"),
@@ -1317,60 +969,285 @@
                                 }
                              });
                           } 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"),
                                 showCancel: false,
                                 confirmText: $this.translateSys(
                                    'close')
                              });
                              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}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        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 = info.attr ? 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,req)
            }).catch(ex => {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: $this.translateSys('tip') + "5.1",
                  content: exStr,
                  showCancel: false,
                  confirmText: $this.translateSys('close')
               });
               hideLoading()
               showError(ex, this.translateSys("error") + " 5.1")
            });
         },
         //确定
         sava() {
            if (this.after_ok?.id) { // 点击确定按钮后
               this.afterOK();
            } else {
               this.add();
            }
            this.handleButtonClick((done) => {
               if (this.after_ok?.id) { // 点击确定按钮后
                  this.afterOK();
               } else {
                  this.add();
               }
               setTimeout(() => {
                  done(); // 重置状态
               }, 1000);
            });
         },
         add() {
@@ -1418,56 +1295,34 @@
               uni.hideLoading();
               let data = res.lua_result
               if (data) {
                  if (data.ret != 0&& ret.ret != 1) {
                     var tip = data.err_info ? typeof data.err_info == 'string' ? data
                        .err_info :
                        data
                        .err_info.join('<br/>') : '';
                  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 (tip) {
                           uni.showModal({
                              title: this.translateSys("tip"),
                              content: tip,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' +
                           data.ret || "",
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     }
                     if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                     if (data.ret == 801) showInfo(tip)
                     else showError(`${tip},提示:${data.ret}`, this.translateSys('tip'))
                     this.saving = false
                     return false
                  } else {
                     var tip = data.info ? typeof data.info == 'string' ? data.info :
                        data
                        .info
                        .join(
                           '<br/>') : '';
                        data.info.join('\n') : '';
                     tip = tip || data.err_info
                     if (tip) uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     else {
                        uni.showToast({
                           title: this.translate('create_success'),
                           icon: "success",
                           duration: 3000
                        });
                     if (tip) {
                        let time = data.info_time || 0
                        if (time)
                           showError(tip, this.translateSys('tip'))
                        elseshowInfo(tip)
                     } else {
                        showInfo(this.translate('create_success'));
                     }
                     if (!this.param.After_Btn_Not_Refresh) {
                        //刷新
                        uni.redirectTo({
@@ -1482,12 +1337,8 @@
                              $this.setFormValues(data.result || [])
                           } else if (typeof data.result == 'string') {
                              if (data.result) {
                                 uni.showModal({
                                    title: this.translateSys('tip'),
                                    content: data.result,
                                    showCancel: false,
                                    confirmText: this.translateSys('close')
                                 });
                                 showInfo(data.result)
                              }
                           }
                           try {
@@ -1527,13 +1378,7 @@
                              let actionList = (data.action || []).map(a => a.action_type).join(';')
                              let tip = typeof ex == 'string' ? ex : ex.message
                              tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                              uni.showModal({
                                 title: this.translateSys('tip'),
                                 content: tip,
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                              console.log(ex)
                              showError(tip, this.translateSys('tip'))
                              return
                           }
                        }
@@ -1547,21 +1392,17 @@
               this.saving = false
               uni.hideLoading();
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys("tip"))
            });
         },
         setFormValues(data) {
            const $this = this
            const head_styledef = this.head_styledef
            if (!Array.isArray(data)) {
               return
            }
            for (var i = 0; i < data.length; i++) {
               const attr = data[i]
               if (attr.choice_list) {
@@ -1682,6 +1523,7 @@
         afterOK() {
            this.saving = true
            const $this = this
            showLoading("loading...")
            var obj_attr = this.head_styledef.form.model;
            // console.log(obj_attr);
            var input_param = {
@@ -1713,46 +1555,33 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               hideLoading()
               if (data.ret != 0 && data.ret != 1) {
               if (data.ret != 0&& data.ret != 1) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  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);
                     }
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' +
                        data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  }
                  if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                  if (data.ret == 801) showInfo(tip)
                  else showError(`${tip},提示:${data.ret}`, this.translateSys('tip'))
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data
                     .info
                     .join(
                        '<br/>') : '';
                     data.info.join('\n') : '';
                  tip = tip || data.err_info
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  let time = data.info_time || 0
                  if (time)
                     showError(tip, this.translateSys('tip'))
                  else
                     showInfo(tip)
                  if (!this.param.After_Btn_Not_Refresh) {
                     //刷新
                     uni.redirectTo({
@@ -1766,14 +1595,10 @@
                        if (data.result_type == 2) {
                        } else if (typeof data.result == 'string') {
                           if (data.result) {
                              uni.showModal({
                                 title: this.translateSys('tip'),
                                 content: data.result,
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                           }
                           showInfo(data.result)
                        }
                        try {
                           var actionlist = data.action || []
@@ -1808,39 +1633,22 @@
                              }
                           }
                        } catch (ex) {
                           let actionList = (data.action || []).map(a => a.action_type).join(';')
                           let tip = typeof ex == 'string' ? ex : ex.message
                           tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: tip,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                           console.log(ex)
                           showError(tip, this.translateSys('tip'))
                           return
                        }
                     }
                  }
               }
               this.saving = false
            }).catch(ex => {
               // console.log(ex);
               this.saving = false
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys('tip') + "7.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               hideLoading()
               showError(ex, this.translateSys("tip") + " 7.1")
            });
         },
         //点击按钮列表
@@ -1861,6 +1669,14 @@
            })
         },
         onButtonClicked(btn) {
            this.handleButtonClick((done) => {
               this.buttonClicked(btn);
               setTimeout(() => {
                  done(); // 重置状态
               }, 1000);
            });
         },
         buttonClicked(btn) {
            let enviroment = {
               button: "top",
               button_name: btn.ShowName,
@@ -1873,12 +1689,8 @@
               if (btn.Edit_dlg.Model == "small") {
                  this.showAddSmallDialog(btn, enviroment);
               } else {
                  uni.showModal({
                     title: this.translateSys("tip"),
                     content: this.translateSys("unrealized"),
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  showInfo(this.translateSys("unrealized"))
               }
            } else if (btn.FunCode == "TriggerEvent") {
               this.onTriggerEvent(btn, enviroment);
@@ -1888,6 +1700,7 @@
         },
         onTriggerEvent(btn, enviroment) {
            const $this = this
            showLoading("loading...")
            var obj_attr = this.head_styledef.form.model;
            // console.log(obj_attr);
            var input_param = {
@@ -1917,47 +1730,37 @@
            };
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo&& data.ret != 1).then(data => {
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
            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
                     .join('\n') : ''
                  if (data.ret == 801) {
                     if (this.param.Only_Script_Error) {
                        let pos = tip.indexOf(":");
                        if (pos > -1) tip = tip.substring(pos + 1);
                     }
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' +
                        data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  }
                  if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                  if (data.ret == 801) showInfo(tip)
                  else showError(`${tip},提示:${data.ret}`, this.translateSys('tip'))
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data
                     .info
                     .join(
                        '<br/>') : '';
                     data.info.join('\n') : '';
                  tip = tip || data.err_info
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  let time = data.info_time || 0
                  if (time)
                     showError(tip, this.translateSys('tip'))
                  else
                     showInfo(tip)
                  if (!this.param.After_Btn_Not_Refresh) {
                     //刷新
                     uni.redirectTo({
                        url: '../modal/3018_2?param=' + JSON.stringify(this
                              .$data
@@ -1969,14 +1772,8 @@
                        if (data.result_type == 2) {
                        } else if (typeof data.result == 'string') {
                           if (data.result) {
                              uni.showModal({
                                 title: this.translateSys('tip'),
                                 content: data.result,
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                           }
                           showInfo(data.result)
                        }
                        try {
                           var actionlist = data.action || []
@@ -2008,8 +1805,20 @@
                                          .value
                                    })
                                 });
                              } else if (action.action_type == 'get_pre_page_subtable_next_row') {
                                 var value = action.value;
                                 const eventChannel = this.getOpenerEventChannel();
                                 eventChannel.emit('get_pre_page_subtable_next_row', value);
                              } else if (action.action_type == 'remove_pre_page_subtable_row') {
                                 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") {
                                 //返回上一页
                                 uni.navigateBack({
                                    delta: 1, //返回层数,2则上上页
                                 });
                              }
                           }
@@ -2017,31 +1826,17 @@
                           let actionList = (data.action || []).map(a => a.action_type).join(';')
                           let tip = typeof ex == 'string' ? ex : ex.message
                           tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: tip,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                           console.log(ex)
                           showError(tip, this.translateSys('tip'))
                           return
                        }
                     }
                  }
               }
            }).catch(ex => {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys('tip') + "7.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys("close")
               });
               showError(ex, this.translateSys("tip") + " 7.1")
            });
         },