cuiqian2004
5 天以前 07925905f1a596e20e980de6d42db217abb753b0
pages/modal/3018.vue
@@ -305,6 +305,13 @@
   import {
      Base64
   } from '@/js/Base64.js';
   import {
      showInfo,
      showError,
      showModal,
      showLoading,
      hideLoading
   } from "@/js/Page.js"
   import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
   import utils from "@/js/utils.js"
   import {
@@ -375,13 +382,16 @@
      mounted() {
         console.log("3018 mounted");
      },
      onReady() {
         uni.setNavigationBarTitle({
            title: this.title
         }); //设置顶部标题
      },
      onLoad(options) {
         console.log("3018", options);
         uni.setNavigationBarTitle({
            title: options.titlename
         }); //设置顶部标题
         var param = JSON.parse(options.param);
         this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //设置按钮文字
         this.title =  options.titlename; //设置按钮文字param.Add_BtnName ? param.Add_BtnName :
         if (options.type) {
            this.type = options.type;
         }
@@ -390,24 +400,14 @@
            this.objAttr = JSON.parse(options.objAttr);
         console.log(param);
         if (!param.EditDlgMode) {
            uni.showModal({
               title: this.translateSys('tip'),
               content: this.translate('function_not_edit_dlg'),
               showCancel: false,
               confirmText: this.translateSys('close')
            });
            showError(this.translate('function_not_edit_dlg'), this.translateSys("tip"))
            uni.navigateBack({
               delta: 1, //返回层数,2则上上页
            });
            return;
         }
         if (!param.Edit_dlg.Name) {
            uni.showModal({
               title: this.translateSys('tip'),
               content: this.translate('function_not_edit_dlg'),
               showCancel: false,
               confirmText: this.translateSys('close')
            });
            showError(this.translate('function_not_edit_dlg'), this.translateSys("tip"))
            uni.navigateBack({
               delta: 1, //返回层数,2则上上页
            });
@@ -442,6 +442,7 @@
         },
         async loadData() {
            try {
                  showLoading("loading...")
               const param = this.param
               var edit_dlg = {
                  Model: param.EditDlgMode,
@@ -465,18 +466,12 @@
               }
               $this.classAttrList = result;
               await $this.classGridStyleInfo();
               hideLoading()
            } 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",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               hideLoading()
               showError(ex, this.translateSys('error') + " 1")
            }
         },
         async DictItemGetList(attr) { //Mobox3得到字典项列表
@@ -491,16 +486,8 @@
               return res?.dict_item_list || []
            } catch (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")
               return []
            }
         },
@@ -521,17 +508,8 @@
               $this.viewParam();
            } 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.4",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 1.4")
            }
         },
         async loadFormData(objAttr) {
@@ -665,16 +643,8 @@
               await this.class_attr_init();
            } catch (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"),
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error'))
            }
         },
         async class_attr_init() {
@@ -819,24 +789,13 @@
                  console.log(this.classAttrList);
               } else {
                  uni.showModal({
                     title: this.translateSys('tip'),
                     content: this.translate('no_find_attr_diaplay'),
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  showInfo(this.translate('no_find_attr_diaplay'))
               }
            } catch (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"),
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error'))
            }
         },
@@ -867,29 +826,20 @@
               .before_click_button;
            var button_callback = $this.classAttrList[index].Attr[iindex].button_callback;
            if (!before_click_button) {
               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;
            }
            if (!button_callback) {
               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.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index,
               iindex);
         },
         setFormValues(data) {
            if (JSON.stringify(data) == '{}') {
               return;
            if (!Array.isArray(data)) {
               return
            }
            for (var a = 0; a < this.classAttrList.length; a++) {
               for (var l = 0; l < this.classAttrList[a].Attr.length; l++) {
@@ -959,12 +909,8 @@
               }
            }
            if (!$this.popupParam) {
               uni.showModal({
                  title: this.translateSys('tip'),
                  content: "popupParam为空!",
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showInfo("popupParam为空!")
               return;
            }
            $this.classAttrList[$this.popupParam.index].Attr[$this.popupParam.iindex]
@@ -1002,7 +948,7 @@
            //console.log(e.target)
            getApp().onScan((result) => {
               console.log(result);
               this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value =result;
               this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result;
               uni.hideKeyboard();
               this.onevent($ele, result);
            })
@@ -1270,14 +1216,8 @@
         },
         classAttr_AddRef(e) {
            console.log(e.target);
            uni.showModal({
               title: this.translateSys('tip'),
               content: this.translateSys('unrealized'),
               showCancel: false,
               confirmText: this.translateSys('close')
            });
            // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value];
            // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
            showInfo(this.translateSys('unrealized'))
         },
         classAttr_AddPrj(index, iindex) {
            var param = {
@@ -1388,16 +1328,8 @@
               uni.navigateBack()
            } catch (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') + " 6.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 6.1")
               return false;
            }
         },
@@ -1434,31 +1366,13 @@
               }
               return true;
            } catch (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') + " 5.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 5.1")
               return false;
            }
         },
         // async sava() {
         //    try {
         //       if (this.edit_ok_event)
         //          this.OKDataObjRunCustomEvent();
         //       else
         //          this.add();
         //    } catch (ex) {
         //       return false;
         //    }
         // },
         async add() {
            try {
               var req = [];
@@ -1499,16 +1413,9 @@
                     if (ar.notempty == true && !ar.Value) {
                        // if(ar.NotEmpty=='1'){
                        uni.hideLoading();
                        // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: this.translateSys('quotation_mark_left') + ar.DispName +
                              this
                              .translateSys('quotation_mark_right') + this.translate(
                                 "cannot_empty"),
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        showInfo(this.translateSys('quotation_mark_left') + ar.DispName +
                           this.translateSys('quotation_mark_right') + this.translate("cannot_empty"))
                        return;
                     }
                  }
@@ -1547,46 +1454,39 @@
                  console.log(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) 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/>') : '';
                     if (tip) uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     uni.showToast({
                        title: this.translate('create_success'),
                        icon: "success",
                        duration: 3000
                     });
                  if (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'))
                           else
                              showInfo(tip)
                        } else
                           showInfo(this.translate('create_success'))
                     }
                  }
                  //刷新
                  uni.redirectTo({
                     url: '../modal/3018?param=' + JSON.stringify(this.$data
@@ -1598,28 +1498,13 @@
               }).catch(ex => {
                  console.log(ex);
                  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'))
               });
            } catch (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') + " 4.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 4.1")
            }
         },
         ini_DataObjRunCustomEvent(info) {
@@ -1675,40 +1560,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 == 801) uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
               if (data.ret != 0 && data.ret != 1) {
                  let cls_name = data.event_info?.cls_name
                  let event_name = data.event_info?.event_name
                  let 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'))
                  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')
                  });
                     .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.action) {
                     var actionlist = data.action;
                     if (actionlist) {
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           showInfo(data.result)
                        }
                     }
                     try {
                        var actionlist = data.action || []
                        for (var j = 0; j < actionlist.length; j++) {
                           var action = actionlist[j];
                           var action_type = action.action_type;
@@ -1719,38 +1606,33 @@
                              }
                           }
                           if (action_type == 'open_select_userdlg') {
                              uni.showModal({
                                 title: this.translateSys('error') + " 2.2",
                                 content: this.translateSys(
                                       "quotation_mark_left") +
                                    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_type + this.translateSys(
                                    "quotation_mark_right") + this
                                 .translate(
                                    "tip_action_unprocessed"))
                           }
                           // else if (action_type == 'tip_dlg') {
                           // }
                        }
                     } 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') + " 2.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 2.1")
            });
         },
         DataObjRunCustomEvent(info, data_attr) {
@@ -1821,94 +1703,98 @@
            // return;
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  if (data.ret == 801) uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
               if (data.ret != 0 && data.ret != 1) {
                  let cls_name = data.event_info?.cls_name
                  let event_name = data.event_info?.event_name
                  let 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'))
                  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')
                  });
                     .join('\n') : '';
                  tip = tip || data.err_info
                  let time = data.info_time || 0
                  if (time)
                     showError(tip, this.translateSys('tip'))
                  else
                     showInfo(tip)
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                        var result = data.result || []
                        for (var i = 0; i < result.length; i++) {
                           for (var c = 0; c < $this.classAttrList.length; c++) {
                              var attr = $this.classAttrList[c].Attr;
                              for (var j = 0; j < attr.length; j++) {
                                 if (attr[j].Name == result[i].attr) {
                                    attr[j].Value = result[i].value;
                                 }
                              }
                           }
                           console.log($this.refdatastore)
                           var length = 0;
                           if (!$this.refdatastore.filter(function(s) {
                                 return result[i].attr == s.attr
                              }).length) {
                              length = 1;
                              $this.refdatastore.push(result[i]);
                           }
                           if (length == 0) {
                              for (var j = 0; j < $this.refdatastore.length; j++) {
                                 if ($this.refdatastore[j].attr == result[i]
                                    .attr) {
                                    $this.refdatastore[j].value = result[i]
                                       .value;
                                 }
                              }
                           }
                        }
                  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(action.value)
                        } else if (data.action[i].action_type == 'set_global_attr') {
                           $this.global_attr = data.action[i].value || [];
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           showInfo(data.result)
                        }
                     }
                  }
                     try {
                        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(action.value)
                              } else if (data.action[i].action_type == 'set_global_attr') {
                                 $this.global_attr = data.action[i].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'))
                  if (data.result_type == 2 && data.result) {
                     var result = data.result;
                     for (var i = 0; i < result.length; i++) {
                        for (var c = 0; c < $this.classAttrList.length; c++) {
                           var attr = $this.classAttrList[c].Attr;
                           for (var j = 0; j < attr.length; j++) {
                              if (attr[j].Name == result[i].attr) {
                                 attr[j].Value = result[i].value;
                              }
                           }
                        }
                        console.log($this.refdatastore)
                        var length = 0;
                        if (!$this.refdatastore.filter(function(s) {
                              return result[i].attr == s.attr
                           }).length) {
                           length = 1;
                           $this.refdatastore.push(result[i]);
                        }
                        if (length == 0) {
                           for (var j = 0; j < $this.refdatastore.length; j++) {
                              if ($this.refdatastore[j].attr == result[i]
                                 .attr) {
                                 $this.refdatastore[j].value = result[i]
                                    .value;
                              }
                           }
                        }
                        return
                     }
                  }
               }
            }).catch(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: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 3.1")
            });
         },
         async OKDataObjRunCustomEvent() {
@@ -1990,85 +1876,73 @@
               // return;
               runCustomEvent(dataInfo).then(data => {
                  console.log(data);
                  if (data.ret != 0) {
                     var tip = data.err_info ? typeof data.err_info == 'string' ? data
                        .err_info :
                        data
                        .err_info.join('<br/>') : '';
                     if (data.ret == 801) uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  if (data.ret != 0 && data.ret != 1) {
                     let cls_name = data.event_info?.cls_name
                     let event_name = data.event_info?.event_name
                     let 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'))
                     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')
                     });
                     if (data.result) {
                        var result = data.result;
                        console.log(this.refdatastore)
                        for (var i = 0; i < result.length; i++) {
                           // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
                           var length = 0;
                           if (!this.refdatastore.filter(function(s) {
                                 return result[i].attr == s.attr
                              }).length) {
                              length = 1;
                              this.refdatastore.push(result[i]);
                           }
                           if (length == 0) {
                              for (var j = 0; j < this.refdatastore.length; j++) {
                                 if (this.refdatastore[j].attr == result[i].attr) {
                                    this.refdatastore[j].value = result[i].value;
                        .join('\n') : '';
                     tip = tip || data.err_info
                     let time = data.info_time || 0
                     if (time)
                        showError(tip, this.translateSys('tip'))
                     else
                        showInfo(tip)
                     if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                        if (data.result_type == 2) {
                           var result = data.result || [];
                           console.log(this.refdatastore)
                           for (var i = 0; i < result.length; i++) {
                              // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value);
                              var length = 0;
                              if (!this.refdatastore.filter(function(s) {
                                    return result[i].attr == s.attr
                                 }).length) {
                                 length = 1;
                                 this.refdatastore.push(result[i]);
                              }
                              if (length == 0) {
                                 for (var j = 0; j < this.refdatastore.length; j++) {
                                    if (this.refdatastore[j].attr == result[i].attr) {
                                       this.refdatastore[j].value = result[i].value;
                                    }
                                 }
                              }
                           }
                        } else if (typeof data.result == 'string') {
                           if (data.result) {
                              showInfo(data.result)
                           }
                        }
                     }
                     this.add();
                        this.add();
                     }
                  }
               }).catch(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') + " 4.1",
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  showError(ex, this.translateSys('error') + " 4.1")
               });
            } catch (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') + " 4.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + " 4.1")
            }
         },
         DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
@@ -2155,41 +2029,43 @@
            // return;
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
               if (data.ret != 0) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
                     .err_info.join('<br/>') : '';
                  if (data.ret == 801) uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
               if (data.ret != 0 && data.ret != 1) {
                  let cls_name = data.event_info?.cls_name
                  let event_name = data.event_info?.event_name
                  let 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'))
                  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')
                  });
                     .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;
                     console.log(actions);
                     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];
                           var val = action.value;
@@ -2368,28 +2244,21 @@
                              d.show();
                           }
                        }
                     } 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.translate("execute_script_return_empty"),
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  }
               }
            }).catch(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: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('tip') + "5.1")
            });
         },