cuiqian2004
2025-08-29 7662665a4f88da0f8afa804bd4a34dfbefc1fb56
pages/modal/3018_2.vue
@@ -2,7 +2,8 @@
   <view class="uni-page-modal-3018-2" :class="largeMode?'large-mode':''">
      <view class="view-content">
         <!-- 表头样式 -->
         <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " :focusId="focusFieldId"
         <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form"
            :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " :focusId="focusFieldId"
            @on-click="onClick" @on-focus="ontap" @on-change="onEnterChange" @on-click-prefix="classAttr_extButton"
            @on-click-suffix="classAttr_extButton"></OIForm>
@@ -55,6 +56,10 @@
      Base64
   } from '@/js/Base64.js';
   import utils from "@/js/utils.js"
   import {
      showInfo,
      showError
   } from "@/js/Page.js"
   import dayjs from "dayjs";
   import OIForm from '@/components/oi-form/index.vue'
   import {
@@ -107,7 +112,7 @@
         if (e.index == 0) {
            const $this = this
            uni.scanCode({
               scanType: ["qrCode"],
               scanType: ["qrCode", 'barCode'],
               success: function(res) {
                  if ($this.focusFieldId) {
@@ -179,12 +184,20 @@
         this.title = this.param.Add_BtnName ? this.param.Add_BtnName : options
            .titlename; //设置按钮文字
         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 || "",
            };
         },
      },
@@ -217,30 +230,44 @@
            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)
               // 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;
               //                   }
               //                });
               //             }
               //          });
               //       }
               //    })
            }
            await this.loadInitialEvent();
         },
         async loadInitialEvent() {
            try {
               if (this.initialEvent.id) {
                  this.onChange(this.initialEvent)
               }
            } catch (ex) {
               showError(ex, this.translateSys("error"))
            }
         },
         async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式
            var $this = this;
@@ -372,17 +399,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得到得到字典信息字典项列表
@@ -411,18 +428,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")
            }
@@ -440,74 +446,72 @@
               };
               console.log(dataInfo);
               var data = await runCustomEvent(dataInfo)
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info : data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                     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)) {
                  var actionlist = data.action;
                  if (actionlist) {
                     console.log(actionlist);
                     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.hideFormItems(result)
                           // console.log($this.head_styledef);
                        } else if (action.action_type ==
                           "set_dlg_current_edit_attr"
                        ) {
                           if ($this.focusOldFieldId == action.value) {
                              $this.setData({
                                 focusFieldId: ""
                              })
                     if (data.result_type == 2) {
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           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.hideFormItems(result)
                              // 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 {
                              $this.setData({
                                 focusFieldId: $this
                                    .focusOldFieldId
                              })
                           }
                           $this.$nextTick(() => {
                              $this.setData({
                                 focusFieldId: action
                                    .value
                              })
                           });
                        } else {
                           uni.showModal({
                              title: this.translateSys("tip"),
                              content: this.translate(
                              showInfo(this.translate(
                                    'execute_init_event_failed') +
                                 this.translateSys("full_stop") +
                                 this.translate('reason') + this
@@ -517,28 +521,23 @@
                                 action
                                 .action_type + this.translateSys(
                                    "quotation_mark_right") + this
                                 .translate('tip_action_unprocessed'),
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                                 .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);
               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")
            }
         },
@@ -706,21 +705,13 @@
            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')
               });
               showInfo(this.translate('icon_click_callback_empty'))
               return;
            }
            if (!onSuffixClickEvent.id) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate('icon_click_event_empty'),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showInfo(this.translate('icon_click_event_empty'))
               return;
            }
            this.popupType = 'right'
@@ -769,21 +760,13 @@
               }
            }
            if (!$this.popupParam) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: "popupParam为空!",
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showInfo("popupParam为空!")
               return;
            }
            if (data.length == 0) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate("tip_no_select_data"),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showInfo(this.translate("tip_no_select_data"))
               return;
            }
            var callback_eventid = $this.popupParam.button_callback.trim();
@@ -872,113 +855,96 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  var actionlist = data.action;
                  if (actionlist) {
                     console.log(actionlist);
                     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.hideFormItems(result)
                           // console.log($this.head_styledef);
                        } else if (action.action_type == 'set_global_attr') {
                           $this.global_attr = action.value || [];
                        } else if (action.action_type ==
                           "set_dlg_current_edit_attr"
                        ) {
                           if ($this.focusOldFieldId == action.value) {
                              $this.setData({
                                 focusFieldId: ""
                              })
                     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') {
                        if (data.result) {
                           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.hideFormItems(result)
                              // console.log($this.head_styledef);
                           } else if (action.action_type == 'set_global_attr') {
                              $this.global_attr = action.value || [];
                           } 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 {
                              $this.setData({
                                 focusFieldId: $this.focusOldFieldId
                              })
                           }
                           $this.$nextTick(() => {
                              $this.setData({
                                 focusFieldId: action.value
                              })
                           });
                        } else {
                           uni.showModal({
                              title: this.translateSys("tip"),
                              content: this.translateSys(
                              showInfo(this.translateSys(
                                    "quotation_mark_left") +
                                 action
                                 .action_type + this.translateSys(
                                    "quotation_mark_right") + this
                                 .translate(
                                    "tip_action_unprocessed"),
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                  }
                  // var head_styledef = JSON.parse(JSON.stringify($this.head_styledef));
                  // $this.head_styledef=[];
                  // $this.head_styledef = head_styledef;
                  console.log($this.head_styledef);
                                    "tip_action_unprocessed"))
                  if (data.result) {
                     $this.setFormValues(data.result)
                           }
                        }
                     } 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);
               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')
               });
               showError(ex, this.translateSys("error") + " 3.1")
            });
         },
         dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
@@ -1044,47 +1010,42 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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) {
                     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/>') : '';
                  if (tip) uni.showModal({
                     title: $this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: $this.translateSys('close')
                  });
                     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) {
                  if (data != "") {
                     var actions = data.action;
                     if (actions) {
                     } 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)
@@ -1258,49 +1219,31 @@
                                 }
                              });
                           } 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}`
                        showError(tip, this.translateSys('tip'))
                        return
                     }
                  } else {
                     uni.showModal({
                        title: $this.translateSys('tip') + "5.2",
                        content: $this.translateSys(
                              "quotation_mark_left") +
                           "before_click_button" + $this.translateSys(
                              "quotation_mark_right") + $this
                           .translateSys(
                              "comma") + 'event_id' + eventid,
                        showCancel: false,
                        confirmText: $this.translateSys('close')
                     });
                  }
               }
            }).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')
               });
               showError(ex, this.translateSys("error") + " 5.1")
            });
         },
@@ -1357,122 +1300,115 @@
            dataObjCreate(dataInfo).then(res => {
               uni.hideLoading();
               let data = res.lua_result
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  if (data.ret == 801) {
                     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')
                  });
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info :
                     data
                     .info
                     .join(
                        '<br/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  else {
                     uni.showToast({
                        title: this.translate('create_success'),
                        icon: "success",
                        duration: 3000
                     });
                  }
                  if (!this.param.After_Btn_Not_Refresh) {
                     //刷新
                     uni.redirectTo({
                        url: '../modal/3018_2?param=' + JSON.stringify(this
                              .$data
                              .param) +
                           "&titlename=" + this.title
                     });
                  } else {
                     var actionlist = data.action;
                     if (actionlist) {
                        console.log(actionlist);
                        for (var i = 0; i < actionlist.length; i++) {
                           var action = actionlist[i];
                           if (action.action_type == 'set_dlg_attr') {
                              $this.setFormValues(action.value)
                           } else if (action.action_type == 'set_dlg_attr_show') {
                              var result = action.value;
                              $this.hideFormItems(result)
                           } 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
                                 })
                              });
                           }
               if (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
                     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({
                           url: '../modal/3018_2?param=' + JSON.stringify(this
                                 .$data
                                 .param) +
                              "&titlename=" + this.title
                        });
                     } else {
                        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) {
                                 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') {
                                    $this.setFormValues(action.value)
                                 } else if (action.action_type == 'set_dlg_attr_show') {
                                    var result = action.value;
                                    $this.hideFormItems(result)
                                 } 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
                                       })
                                    });
                                 }
                              }
                           } 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.class_attr_init();
               }
               // this.class_attr_init();
               this.saving = false
            }).catch(ex => {
               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) {
@@ -1584,12 +1520,12 @@
                  if (index == -1) head_styledef.hiddenIds.push(attr.attr);
               }
            });
            this.setData({
               head_styledef: head_styledef
            })
         },
         afterOK() {
            this.saving = true
            const $this = this
@@ -1625,44 +1561,31 @@
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                     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 (!this.param.After_Btn_Not_Refresh) {
                     //刷新
                     uni.redirectTo({
@@ -1672,58 +1595,65 @@
                           "&titlename=" + this.title
                     });
                  } else {
                     var actionlist = data.action;
                     if (actionlist) {
                        console.log(actionlist);
                        for (var i = 0; i < actionlist.length; i++) {
                           var action = actionlist[i];
                           if (action.action_type == 'set_dlg_attr') {
                              $this.setFormValues(action.value)
                           } else if (action.action_type == 'set_dlg_attr_show') {
                              var result = action.value;
                              $this.hideFormItems(result)
                           } 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
                                 })
                              });
                           }
                     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 actionlist = data.action || []
                           for (var i = 0; i < actionlist.length; i++) {
                              var action = actionlist[i];
                              if (action.action_type == 'set_dlg_attr') {
                                 $this.setFormValues(action.value)
                              } else if (action.action_type == 'set_dlg_attr_show') {
                                 var result = action.value;
                                 $this.hideFormItems(result)
                              } 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
                                    })
                                 });
                              }
                           }
                        } 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.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')
               });
               showError(ex, this.translateSys("tip") + " 7.1")
            });
         },
         //点击按钮列表
@@ -1756,12 +1686,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);
@@ -1801,43 +1727,32 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
               if (data.ret != 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/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                     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 (!this.param.After_Btn_Not_Refresh) {
                     //刷新
                     uni.redirectTo({
@@ -1847,56 +1762,75 @@
                           "&titlename=" + this.title
                     });
                  } else {
                     var actionlist = data.action;
                     if (actionlist) {
                        console.log(actionlist);
                        for (var i = 0; i < actionlist.length; i++) {
                           var action = actionlist[i];
                           if (action.action_type == 'set_dlg_attr') {
                              $this.setFormValues(action.value)
                           } else if (action.action_type == 'set_dlg_attr_show') {
                              var result = action.value;
                              $this.hideFormItems(result)
                           } else if (action.action_type ==
                              "set_dlg_current_edit_attr"
                           ) {
                              if ($this
                                 .focusOldFieldId ==
                                 action.value) {
                                 $this.setData({
                                    focusFieldId: ""
                                 })
                              } else {
                                 $this.setData({
                                    focusFieldId: $this
                                       .focusOldFieldId
                                 })
                     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 actionlist = data.action || []
                           for (var i = 0; i < actionlist.length; i++) {
                              var action = actionlist[i];
                              if (action.action_type == 'set_dlg_attr') {
                                 $this.setFormValues(action.value)
                              } else if (action.action_type == 'set_dlg_attr_show') {
                                 var result = action.value;
                                 $this.hideFormItems(result)
                              } 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 == '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);
                              }
                              $this.$nextTick(() => {
                                 $this.setData({
                                    focusFieldId: action
                                       .value
                                 })
                              });
                              else if (action.action_type == "goback_to_pre_page") {
                                 //返回上一页
                                 uni.navigateBack({
                                    delta: 1, //返回层数,2则上上页
                                 });
                              }
                           }
                        } 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);
               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")
            });
         },