cuiqian2004
2024-09-27 2c523baaae59f4033f56b78128ffb62cf5a7eb38
pages/modal/3018.vue
@@ -293,6 +293,21 @@
   import Base64 from '../../components/js-base64/base64.js'
   import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
   import utils from "@/js/utils.js"
   import {
      appGetInfo,
      dictGetInfo,
      dictItemGetInfo
   } from "@/api/mobox.js"
   import {
      getUIStyleInfo,
      runCustomEvent,
      dataObjCreate
   } from "@/api/data.js"
   import {
      classAttrList,
   } from "@/api/index.js"
   export default {
      modules: {
         Base64,
@@ -407,82 +422,56 @@
            });
         },
         async loadData() {
            const param = this.param
            var edit_dlg = {
               Model: param.EditDlgMode,
               Name: param.Edit_dlg.Name
            }
            var dataInfo = {
               class_id: this.param.clsid,
               class_name: '',
               group_name: ''
            };
            var $this = this;
            $this.$store.state.thisareaFuncID = param.clsid;
            // console.log($this.$store.getters.getclassAttrList);
            //获取
            if ($this.$store.getters.getclassAttrList) {
               $this.$data.classAttrList = $this.$store.getters.getclassAttrList;
               $this.classGridStyleInfo();
            } else {
               $this.$store.dispatch('classAttrGetList', dataInfo)
                  .then((success) => {
                     if (success.err_code == 0) {
                        $this.$data.classAttrList = success.result;
                        success.result.forEach(async (group, index) => {
                           group.attr_list.forEach(async (attr, key) => {
                              if (utils.classUtils.attrTypeIsDict(attr.type)) {
                                 await $this.DictItemGetList(attr, key,
                                    index);
                              }
                           });
                        });
                        setTimeout(function() {
                           $this.classGridStyleInfo();
                        }, 500);
                     } else {
                        uni.showModal({
                           title: this.translateSys('error') + " 1",
                           content: success.err_msg,
                           showCancel: false,
                           confirmText: this.translateSys('cancel')
                        });
                     }
                  }).catch(ex => {
                     // console.log(ex);
                     uni.showModal({
                        title: this.translateSys('error') + " 1.1",
                        content: ex.errMsg,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                  });
            }
            console.log(this.$data.param);
         },
         async DictItemGetList(attr, key, index) { //Mobox3得到字典项列表
            this.data = [];
            var $this = this;
            var dataInfo = {
               dict_id: attr.dict_id,
               dict_name: attr.dict_name
            };
            // console.log(dataInfo);
            this.$store.dispatch('DictItemGetList', dataInfo).then(async (success) => {
               // console.log(success);
               if (success.err_code == 0) {
                  $this.$data.classAttrList[index].attr_list[key].dictitem = success.result;
                  this.$store.commit("classAttrList", $this.$data.classAttrList);
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 1.2",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
            try {
               const param = this.param
               var edit_dlg = {
                  Model: param.EditDlgMode,
                  Name: param.Edit_dlg.Name
               }
            }).catch(ex => {
               var dataInfo = {
                  class_id: this.param.clsid,
                  class_name: '',
                  group_name: ''
               };
               var $this = this;
               const result = await classAttrList(dataInfo) || []
               for (let index in result) {
                  const group = result[index]
                  for (let key in group.attr_list) {
                     const attr = group.attr_list[key]
                     if (utils.classUtils.attrTypeIsDict(attr.type)) {
                        attr.dictitem = await $this.DictItemGetList(attr);
                     }
                  }
               }
               $this.$data.classAttrList = result;
               await $this.classGridStyleInfo();
            } 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("cancel")
               });
            }
         },
         async DictItemGetList(attr) { //Mobox3得到字典项列表
            try {
               this.data = [];
               var $this = this;
               var dataInfo = {
                  dict_id: attr.dict_id,
                  dict_name: attr.dict_name
               };
               const res = await dictItemGetInfo(dataInfo)
               return res?.dict_item_list || []
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys('error') + " 1.3",
@@ -490,48 +479,32 @@
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
               });
            });
               return []
            }
         },
         async classGridStyleInfo() {
            var $this = this;
            var gridstyleInfo = {
               class_id: $this.$data.param.clsid,
               ui_style_type: 2,
               ui_style_name: $this.$data.param.Edit_dlg.Name
            };
            $this.$store.state.thisEditName = $this.$data.param.Edit_dlg.Name
            // console.log($this.$store.getters.getclassGridStyleInfo);
            //获取
            if ($this.$store.getters.getclassGridStyleInfo) {
               $this.$data.classGridStyle = $this.$store.getters.getclassGridStyleInfo;
               $this.viewParam();
            } else {
               // console.log(gridstyleInfo);
               $this.$store.dispatch('UIStyleGetInfo', gridstyleInfo).then(async (success) => {
                  // console.log(success);
                  if (success.err_code == 0) {
                     var styledef = Base64.decode(success.result.style_def);
                     success.result.style_def = JSON.parse(styledef);
                     $this.$data.classGridStyle = success.result;
                     // console.log($this.$data.classGridStyle);
                     $this.viewParam();
                  } else {
                     uni.showModal({
                        title: this.translateSys('error') + " 1.4",
                        content: success.err_msg,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                  }
               }).catch(ex => {
                  console.log(ex);
                  uni.showModal({
                     title: this.translateSys('error') + " 1.5",
                     content: ex.errMsg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
            try {
               var $this = this;
               var gridstyleInfo = {
                  class_id: $this.$data.param.clsid,
                  ui_style_type: 2,
                  ui_style_name: $this.$data.param.Edit_dlg.Name
               };
               const result = await getUIStyleInfo(dataInfo)
               var styledef = Base64.decode(result.style_def);
               result.style_def = JSON.parse(styledef);
               $this.$data.classGridStyle = result
               $this.viewParam();
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys('error') + " 1.4",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
               });
            }
         },
@@ -728,7 +701,7 @@
                           var ar = attr[j];
                           req.push({
                              attr: ar.attr,
                              val: ar.value ? ar.value : ''
                              value: ar.value ? ar.value : ''
                           });
                        }
                     }
@@ -1342,73 +1315,63 @@
            };
            console.log(dataInfo);
            // return
            this.$store.dispatch('createDataObj', dataInfo).then(success => {
               console.log(success);
            DataObjCreate(dataInfo).then((result) => {
               console.log(result);
               uni.hideLoading();
               if (success.err_code == 0) {
                  var result = success.result;
                  // if(result.result_type == 0){}
                  if (success.result.action) {
                     var action = JSON.parse(success.result.action);
                     console.log(action);
                     if (action.ret == '0') {
                        if (action.ret != 0) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: this.translate('execute_script_failed') +
                                 this
                                 .translateSys('comma') + this.translate(
                                    'result') +
                                 this
                                 .translateSys('colon') + action.result,
                              showCancel: false,
                              confirmText: this.translateSys('cancel')
                           });
                           return;
                        }
                        if (action.info) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: this.translate('execute_script_failed') +
                                 this
                                 .translateSys('comma') +
                                 this.translateSys('colon') + action.info,
                              showCancel: false,
                              confirmText: this.translateSys('cancel')
                           });
                           return;
                        }
                        if (action.result_type == '0') {
                           uni.showToast({
                              title: action.result,
                              icon: "success",
                              duration: 3000
                           });
                        }
                        // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}"
               if (result.action) {
                  var action = JSON.parse(result.action);
                  console.log(action);
                  if (action.ret == '0') {
                     if (action.ret != 0) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: this.translate('execute_script_failed') +
                              this
                              .translateSys('comma') + this.translate(
                                 'result') +
                              this
                              .translateSys('colon') + action.result,
                           showCancel: false,
                           confirmText: this.translateSys('cancel')
                        });
                        return;
                     }
                  } else
                     uni.showToast({
                        title: this.translate('create_success'),
                        icon: "success",
                        duration: 3000
                     });
                  //刷新
                  uni.redirectTo({
                     url: '../modal/3018?param=' + JSON.stringify(this.$data
                           .param) +
                        "&titlename=" + this.$data.title
                     if (action.info) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: this.translate('execute_script_failed') +
                              this
                              .translateSys('comma') +
                              this.translateSys('colon') + action.info,
                           showCancel: false,
                           confirmText: this.translateSys('cancel')
                        });
                        return;
                     }
                     if (action.result_type == '0') {
                        uni.showToast({
                           title: action.result,
                           icon: "success",
                           duration: 3000
                        });
                     }
                     // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}"
                  }
               } else
                  uni.showToast({
                     title: this.translate('create_success'),
                     icon: "success",
                     duration: 3000
                  });
                  // this.cancel();
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " ",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
               }
               //刷新
               uni.redirectTo({
                  url: '../modal/3018?param=' + JSON.stringify(this.$data
                        .param) +
                     "&titlename=" + this.$data.title
               });
               // this.cancel();
            }).catch(ex => {
               console.log(ex);
               uni.hideLoading();
@@ -1442,7 +1405,7 @@
            param.enviroment = Base64.encode(JSON.stringify(param.enviroment)); //将字符串转换为base64编码
            var obj_attr = {};
            info.attr.forEach(item => {
               obj_attr[item.attr] = item.val;
               obj_attr[item.attr] = item.value;
            });
            // console.log(obj_attr);
            // var dataInfo = {
@@ -1472,137 +1435,127 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.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('cancel')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                     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('cancel')
                     });
            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('cancel')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
                  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('cancel')
                  });
                     if (data.action) {
                        var actionlist = data.action;
                        if (actionlist) {
                           for (var j = 0; j < actionlist.length; j++) {
                              var action = actionlist[j];
                              var action_type = action.action_type;
                              var value = action.value;
                              if (action_type == 'set_dlg_attr') {
                                 if (value) {
                                    console.log(value);
                                    for (var i = 0; i < value.length; i++) {
                                       for (var a = 0; a < this.$data.classAttrList
                                          .length; a++) {
                                          for (var l = 0; l < this.$data
                                             .classAttrList[a]
                                             .Attr
                                             .length; l++) {
                                             var ca = this.$data.classAttrList[a]
                                                .Attr[l];
                                             if (value[i].attr == ca.Name) {
                                                if (utils.classUtils
                                                   .attrTypeIsDict(ca
                                                      .Type)) {
                                                   var dictItemList = [];
                                                   for (var d in value[i]
                                                         .choice_list) {
                                                      var list_val = value[i]
                                                         .choice_list[d];
                                                      dictItemList.push({
                                                         "CN_S_NAME": list_val,
                                                         "Name": list_val,
                                                         "label": list_val,
                                                         "value": list_val
                                                      });
                  if (data.action) {
                     var actionlist = data.action;
                     if (actionlist) {
                        for (var j = 0; j < actionlist.length; j++) {
                           var action = actionlist[j];
                           var action_type = action.action_type;
                           var value = action.value;
                           if (action_type == 'set_dlg_attr') {
                              if (value) {
                                 console.log(value);
                                 for (var i = 0; i < value.length; i++) {
                                    for (var a = 0; a < this.$data.classAttrList
                                       .length; a++) {
                                       for (var l = 0; l < this.$data
                                          .classAttrList[a]
                                          .Attr
                                          .length; l++) {
                                          var ca = this.$data.classAttrList[a]
                                             .Attr[l];
                                          if (value[i].attr == ca.Name) {
                                             if (utils.classUtils
                                                .attrTypeIsDict(ca
                                                   .Type)) {
                                                var dictItemList = [];
                                                for (var d in value[i]
                                                      .choice_list) {
                                                   var list_val = value[i]
                                                      .choice_list[d];
                                                   dictItemList.push({
                                                      "CN_S_NAME": list_val,
                                                      "Name": list_val,
                                                      "label": list_val,
                                                      "value": list_val
                                                   });
                                                   }
                                                   ca.dictitem = dictItemList;
                                                   // attr[j].dictitem = val[i].choice_list;
                                                } else {
                                                   ca.Value = value[i].value;
                                                }
                                                ca.dictitem = dictItemList;
                                                // attr[j].dictitem = val[i].choice_list;
                                             } else {
                                                ca.Value = value[i].value;
                                             }
                                          }
                                       }
                                    }
                                       var length = 0;
                                       if (!this.$data.refdatastore.filter(function(
                                             s) {
                                             return value[i].attr == s.attr
                                          }).length) {
                                          length = 1;
                                          this.$data.refdatastore.push(value[i]);
                                       }
                                       if (length == 0) {
                                          for (var j = 0; j < this.$data.refdatastore
                                             .length; j++) {
                                             if (this.$data.refdatastore[j].attr ==
                                    var length = 0;
                                    if (!this.$data.refdatastore.filter(function(
                                          s) {
                                          return value[i].attr == s.attr
                                       }).length) {
                                       length = 1;
                                       this.$data.refdatastore.push(value[i]);
                                    }
                                    if (length == 0) {
                                       for (var j = 0; j < this.$data.refdatastore
                                          .length; j++) {
                                          if (this.$data.refdatastore[j].attr ==
                                             value[i]
                                             .attr) {
                                             this.$data.refdatastore[j].value =
                                                value[i]
                                                .attr) {
                                                this.$data.refdatastore[j].value =
                                                   value[i]
                                                   .value;
                                             }
                                                .value;
                                          }
                                       }
                                    }
                                 }
                              }
                              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('cancel')
                                 });
                              }
                              // else if (action_type == 'tip_dlg') {
                              // }
                           }
                           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('cancel')
                              });
                           }
                           // else if (action_type == 'tip_dlg') {
                           // }
                        }
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 2",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -1655,7 +1608,7 @@
               info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //将字符串转换为base64编码
            var obj_attr = {};
            info.attr.forEach(item => {
               obj_attr[item.attr] = item.val;
               obj_attr[item.attr] = item.value;
            });
            if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}';
            var dataInfo = {
@@ -1679,153 +1632,144 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.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('cancel')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                     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('cancel')
                     });
            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('cancel')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
                  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('cancel')
                  });
                     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;
                              for (var i = 0; i < result.length; i++) {
                                 if (result[i].choice_list) {
                                    for (var c = 0; c < $this.$data.classAttrList
                                       .length; c++) {
                                       var attr = $this.$data.classAttrList[c].Attr;
                                       for (var j = 0; j < attr.length; j++) {
                                          if (attr[j].Name == result[i].attr) {
                                             if (utils.classUtils.attrTypeIsDict(
                                                   attr[j]
                                                   .Type)) {
                                                var dictItemList = [];
                                                for (var d in result[i]
                                                      .choice_list) {
                                                   var val = result[i]
                                                      .choice_list[d];
                                                   dictItemList.push({
                                                      "CN_S_NAME": val,
                                                      "Name": val,
                                                      "label": val,
                                                      "value": val
                                                   });
                                                }
                                                attr[j].dictitem = dictItemList;
                                                // attr[j].dictitem = result[i].choice_list;
                                             }
                                          }
                                       }
                                    }
                                 }
                  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;
                           for (var i = 0; i < result.length; i++) {
                              if (result[i].choice_list) {
                                 for (var c = 0; c < $this.$data.classAttrList
                                    .length; c++) {
                                    var attr = $this.$data.classAttrList[c].Attr;
                                    for (var j = 0; j < attr.length; j++) {
                                       console.log(attr[j].Name + '==' + result[i]
                                          .attr);
                                       if (attr[j].Name == result[i].attr) {
                                          attr[j].Value = result[i].value;
                                       }
                                    }
                                 }
                                 var length = 0;
                                 if (!$this.$data.refdatastore.filter(function(s) {
                                       return result[i].attr == s.attr
                                    }).length) {
                                    length = 1;
                                    $this.$data.refdatastore.push(result[i]);
                                 }
                                 if (length == 0) {
                                    for (var j = 0; j < $this.$data.refdatastore
                                       .length; j++) {
                                       if ($this.$data.refdatastore[j].attr == result[
                                             i]
                                          .attr) {
                                          $this.$data.refdatastore[j].value = result[
                                                i]
                                             .value;
                                          if (utils.classUtils.attrTypeIsDict(
                                                attr[j]
                                                .Type)) {
                                             var dictItemList = [];
                                             for (var d in result[i]
                                                   .choice_list) {
                                                var val = result[i]
                                                   .choice_list[d];
                                                dictItemList.push({
                                                   "CN_S_NAME": val,
                                                   "Name": val,
                                                   "label": val,
                                                   "value": val
                                                });
                                             }
                                             attr[j].dictitem = dictItemList;
                                             // attr[j].dictitem = result[i].choice_list;
                                          }
                                       }
                                    }
                                 }
                              }
                           } else if (data.action[i].action_type == 'set_global_attr') {
                              $this.$data.global_attr = data.action[i].value || [];
                              for (var c = 0; c < $this.$data.classAttrList
                                 .length; c++) {
                                 var attr = $this.$data.classAttrList[c].Attr;
                                 for (var j = 0; j < attr.length; j++) {
                                    console.log(attr[j].Name + '==' + result[i]
                                       .attr);
                                    if (attr[j].Name == result[i].attr) {
                                       attr[j].Value = result[i].value;
                                    }
                                 }
                              }
                              var length = 0;
                              if (!$this.$data.refdatastore.filter(function(s) {
                                    return result[i].attr == s.attr
                                 }).length) {
                                 length = 1;
                                 $this.$data.refdatastore.push(result[i]);
                              }
                              if (length == 0) {
                                 for (var j = 0; j < $this.$data.refdatastore
                                    .length; j++) {
                                    if ($this.$data.refdatastore[j].attr == result[
                                          i]
                                       .attr) {
                                       $this.$data.refdatastore[j].value = result[
                                             i]
                                          .value;
                                    }
                                 }
                              }
                           }
                        } else if (data.action[i].action_type == 'set_global_attr') {
                           $this.$data.global_attr = data.action[i].value || [];
                        }
                     }
                  }
                     if (data.result) {
                        var result = data.result;
                        for (var i = 0; i < result.length; i++) {
                           for (var c = 0; c < $this.$data.classAttrList.length; c++) {
                              var attr = $this.$data.classAttrList[c].Attr;
                              for (var j = 0; j < attr.length; j++) {
                                 if (attr[j].Name == result[i].attr) {
                                    attr[j].Value = result[i].value;
                                 }
                  if (data.result) {
                     var result = data.result;
                     for (var i = 0; i < result.length; i++) {
                        for (var c = 0; c < $this.$data.classAttrList.length; c++) {
                           var attr = $this.$data.classAttrList[c].Attr;
                           for (var j = 0; j < attr.length; j++) {
                              if (attr[j].Name == result[i].attr) {
                                 attr[j].Value = result[i].value;
                              }
                           }
                        }
                           var length = 0;
                           if (!$this.$data.refdatastore.filter(function(s) {
                                 return result[i].attr == s.attr
                              }).length) {
                              length = 1;
                              $this.$data.refdatastore.push(result[i]);
                           }
                           if (length == 0) {
                              for (var j = 0; j < $this.$data.refdatastore.length; j++) {
                                 if ($this.$data.refdatastore[j].attr == result[i]
                                    .attr) {
                                    $this.$data.refdatastore[j].value = result[i]
                                       .value;
                                 }
                        var length = 0;
                        if (!$this.$data.refdatastore.filter(function(s) {
                              return result[i].attr == s.attr
                           }).length) {
                           length = 1;
                           $this.$data.refdatastore.push(result[i]);
                        }
                        if (length == 0) {
                           for (var j = 0; j < $this.$data.refdatastore.length; j++) {
                              if ($this.$data.refdatastore[j].attr == result[i]
                                 .attr) {
                                 $this.$data.refdatastore[j].value = result[i]
                                    .value;
                              }
                           }
                        }
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 3",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -1894,7 +1838,7 @@
            var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //将字符串转换为base64编码
            var obj_attr = {};
            info.attr.forEach(item => {
               obj_attr[item.attr] = item.val;
               obj_attr[item.attr] = item.value;
            });
            if (!eventid.includes('{')) eventid = '{' + eventid + '}';
            var dataInfo = {
@@ -1918,70 +1862,61 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.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('cancel')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                     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('cancel')
                     });
                     var result = data.result;
                     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.$data.refdatastore.filter(function(s) {
                              return result[i].attr == s.attr
                           }).length) {
                           length = 1;
                           this.$data.refdatastore.push(result[i]);
                        }
                        if (length == 0) {
                           for (var j = 0; j < this.$data.refdatastore.length; j++) {
                              if (this.$data.refdatastore[j].attr == result[i].attr) {
                                 this.$data.refdatastore[j].value = result[i].value;
                              }
                           }
                        }
                     }
                     this.add();
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 4",
                     content: success.err_msg,
            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('cancel')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
                  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('cancel')
                  });
                  var result = data.result;
                  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.$data.refdatastore.filter(function(s) {
                           return result[i].attr == s.attr
                        }).length) {
                        length = 1;
                        this.$data.refdatastore.push(result[i]);
                     }
                     if (length == 0) {
                        for (var j = 0; j < this.$data.refdatastore.length; j++) {
                           if (this.$data.refdatastore[j].attr == result[i].attr) {
                              this.$data.refdatastore[j].value = result[i].value;
                           }
                        }
                     }
                  }
                  this.add();
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -2050,7 +1985,7 @@
            var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //将字符串转换为base64编码
            var obj_attr = {};
            req.forEach(item => {
               obj_attr[item.attr] = item.val;
               obj_attr[item.attr] = item.value;
            });
            if (!eventid.includes('{')) eventid = '{' + eventid + '}';
            var dataInfo = {
@@ -2074,241 +2009,232 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.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('cancel')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                     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('cancel')
                     });
            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('cancel')
                  });
                  else uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip + ',' + this.translateSys('tip') + ':' + data
                        .ret,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
                  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('cancel')
                  });
                     if (data != "") {
                        var actions = data.action;
                        console.log(actions);
                        if (actions) {
                           for (var i = 0; i < actions.length; i++) {
                              var action = actions[i];
                              var val = action.value;
                              var enviroment = JSON.stringify(enviroment);
                  if (data != "") {
                     var actions = data.action;
                     console.log(actions);
                     if (actions) {
                        for (var i = 0; i < actions.length; i++) {
                           var action = actions[i];
                           var val = action.value;
                           var enviroment = JSON.stringify(enviroment);
                              if (action.action_type == 'open_panel') {
                                 var d = dialog({
                                    title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                       this.translateSys('tip'),
                                    content: this.translateSys(
                                          "quotation_mark_left") +
                                       action
                                       .action_type + this.translateSys(
                                          "quotation_mark_right") + this
                                       .translate(
                                          "tip_action_unprocessed")
                                 });
                                 d.show();
                              } else if (action.action_type == 'open_select_userdlg') {
                                 var style = val.style;
                                 // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : ''
                                 var $this = this;
                                 var param = {
                           if (action.action_type == 'open_panel') {
                              var d = dialog({
                                 title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                    this.translateSys('tip'),
                                 content: this.translateSys(
                                       "quotation_mark_left") +
                                    action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this
                                    .translate(
                                       "tip_action_unprocessed")
                              });
                              d.show();
                           } else if (action.action_type == 'open_select_userdlg') {
                              var style = val.style;
                              // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : ''
                              var $this = this;
                              var param = {
                                 index: index,
                                 iindex: iindex,
                                 button_callback: button_callback,
                                 req: req,
                                 data_attr: data_attr
                              }
                              uni.navigateTo({
                                 url: '../selpsn/index?mulit=false&param=' +
                                    JSON
                                    .stringify(
                                       param),
                                 events: {
                                    AddPer(data, param) {
                                       // console.log(param);
                                       console.log(data);
                                       var callback_eventid = param
                                          .button_callback
                                          .trim();
                                       var info = {
                                          eventid: callback_eventid,
                                          edtype: "0",
                                          projectid: '',
                                          rclsid: '',
                                          robjid: '',
                                          userlogin: '',
                                          clsid: $this.$data.param
                                             .clsid,
                                          objid: "",
                                          attr: param.req,
                                          inputparameter: data,
                                          dataJson: [],
                                       }
                                       $this.DataObjRunCustomEvent(info,
                                          param
                                          .data_attr);
                                    }
                                 }
                              });
                           } else if (action.action_type == 'open_data_query_dlg') {
                              var d = dialog({
                                 title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                    this.translateSys('tip'),
                                 content: this.translateSys(
                                       "quotation_mark_left") +
                                    action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this
                                    .translate(
                                       "tip_action_unprocessed")
                              });
                              d.show();
                           } else if (action.action_type == 'open_common_dlg') {
                              var $this = this;
                              if (val.common_dlg_id == 'check_list') {
                                 $this.$data.check_list = val.config;
                                 if (val.config.appear_style ==
                                    'sideslip') //判断是否是侧滑
                                    $this.$data.popupType = 'right';
                                 else
                                    $this.$data.popupType = 'center'
                                 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                                 $this.$refs.popup.open($this.$data.popupType);
                                 var popupParam = {
                                    index: index,
                                    iindex: iindex,
                                    button_callback: button_callback,
                                    req: req,
                                    data_attr: data_attr
                                 }
                                 uni.navigateTo({
                                    url: '../selpsn/index?mulit=false&param=' +
                                       JSON
                                       .stringify(
                                          param),
                                    events: {
                                       AddPer(data, param) {
                                          // console.log(param);
                                          console.log(data);
                                          var callback_eventid = param
                                             .button_callback
                                             .trim();
                                 $this.$data.popupParam = popupParam;
                              }
                           } else if (action.action_type ==
                              'open_project_query_dlg') {
                              //console.log(action.value.select_range);
                              //console.log(action.value.mulit_select);
                              var priRel = '-1';
                              if (action.value.select_range == '全部相关')
                                 priRel = '0';
                              else if (action.value.select_range == '我负责的项目')
                                 priRel = '1';
                              else if (action.value.select_range == '我创建的')
                                 priRel = '2';
                              else if (action.value.select_range == '我参与的' || action
                                 .value
                                 .select_range == '我参加的')
                                 priRel = '3';
                              else if (action.value.select_range == '我关注的')
                                 priRel = '4';
                              else if (action.value.select_range == '我下属的项目')
                                 priRel = '5';
                              var $this = this;
                              var param_ = {
                                 index: index,
                                 iindex: iindex,
                                 button_callback: button_callback,
                                 req: req
                              }
                              uni.navigateTo({
                                 url: '../selPrj/index?relation=' + priRel +
                                    '&param=' +
                                    JSON.stringify(param_),
                                 events: {
                                    AddPer(data, param) {
                                       $this.$data.classAttrList[param
                                             .index]
                                          .Attr[param
                                             .iindex].Value = data[0]
                                          .Name;
                                       $this.$data.classAttrList[param
                                             .index]
                                          .Attr[param
                                             .iindex].ValID = data[0]
                                          .ID + ';' +
                                          data[0]
                                          .Name;
                                       var callback_eventid = param
                                          .button_callback
                                          .trim();
                                       if (callback_eventid) {
                                          var info = {
                                             eventid: callback_eventid,
                                             edtype: "0",
                                             projectid: '',
                                             rclsid: '',
                                             robjid: '',
                                             userlogin: '',
                                             clsid: $this.$data.param
                                                .clsid,
                                             edtype: "2",
                                             projectid: data[0].ID,
                                             rclsid: "",
                                             robjid: "",
                                             userlogin: "",
                                             clsid: $this.$data
                                                .param.clsid,
                                             objid: "",
                                             attr: param.req,
                                             inputparameter: data,
                                             dataJson: [],
                                          }
                                          $this.DataObjRunCustomEvent(info,
                                             param
                                             .data_attr);
                                          $this.DataObjRunCustomEvent(
                                             info);
                                       }
                                    }
                                 });
                              } else if (action.action_type == 'open_data_query_dlg') {
                                 var d = dialog({
                                    title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                       this.translateSys('tip'),
                                    content: this.translateSys(
                                          "quotation_mark_left") +
                                       action
                                       .action_type + this.translateSys(
                                          "quotation_mark_right") + this
                                       .translate(
                                          "tip_action_unprocessed")
                                 });
                                 d.show();
                              } else if (action.action_type == 'open_common_dlg') {
                                 var $this = this;
                                 if (val.common_dlg_id == 'check_list') {
                                    $this.$data.check_list = val.config;
                                    if (val.config.appear_style ==
                                       'sideslip') //判断是否是侧滑
                                       $this.$data.popupType = 'right';
                                    else
                                       $this.$data.popupType = 'center'
                                    // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                                    $this.$refs.popup.open($this.$data.popupType);
                                    var popupParam = {
                                       index: index,
                                       iindex: iindex,
                                       button_callback: button_callback,
                                       req: req,
                                       data_attr: data_attr
                                    }
                                    $this.$data.popupParam = popupParam;
                                 }
                              } else if (action.action_type ==
                                 'open_project_query_dlg') {
                                 //console.log(action.value.select_range);
                                 //console.log(action.value.mulit_select);
                                 var priRel = '-1';
                                 if (action.value.select_range == '全部相关')
                                    priRel = '0';
                                 else if (action.value.select_range == '我负责的项目')
                                    priRel = '1';
                                 else if (action.value.select_range == '我创建的')
                                    priRel = '2';
                                 else if (action.value.select_range == '我参与的' || action
                                    .value
                                    .select_range == '我参加的')
                                    priRel = '3';
                                 else if (action.value.select_range == '我关注的')
                                    priRel = '4';
                                 else if (action.value.select_range == '我下属的项目')
                                    priRel = '5';
                                 var $this = this;
                                 var param_ = {
                                    index: index,
                                    iindex: iindex,
                                    button_callback: button_callback,
                                    req: req
                                 }
                                 uni.navigateTo({
                                    url: '../selPrj/index?relation=' + priRel +
                                       '&param=' +
                                       JSON.stringify(param_),
                                    events: {
                                       AddPer(data, param) {
                                          $this.$data.classAttrList[param
                                                .index]
                                             .Attr[param
                                                .iindex].Value = data[0]
                                             .Name;
                                          $this.$data.classAttrList[param
                                                .index]
                                             .Attr[param
                                                .iindex].ValID = data[0]
                                             .ID + ';' +
                                             data[0]
                                             .Name;
                                          var callback_eventid = param
                                             .button_callback
                                             .trim();
                                          if (callback_eventid) {
                                             var info = {
                                                eventid: callback_eventid,
                                                edtype: "2",
                                                projectid: data[0].ID,
                                                rclsid: "",
                                                robjid: "",
                                                userlogin: "",
                                                clsid: $this.$data
                                                   .param.clsid,
                                                objid: "",
                                                attr: param.req,
                                                dataJson: [],
                                             }
                                             $this.DataObjRunCustomEvent(
                                                info);
                                          }
                                       }
                                    }
                                 });
                              } else {
                                 var d = dialog({
                                    title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                       this.translateSys('tip'),
                                    content: this.translateSys(
                                          "quotation_mark_left") +
                                       action
                                       .action_type + this.translateSys(
                                          "quotation_mark_right") + this
                                       .translate(
                                          "tip_action_unprocessed")
                                 });
                                 d.show();
                              }
                              });
                           } else {
                              var d = dialog({
                                 title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                    this.translateSys('tip'),
                                 content: this.translateSys(
                                       "quotation_mark_left") +
                                    action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this
                                    .translate(
                                       "tip_action_unprocessed")
                              });
                              d.show();
                           }
                        }
                     } else {
                        uni.showModal({
                           title: this.translateSys('tip') + "5.2",
                           content: this.translate("execute_script_return_empty"),
                           showCancel: false,
                           confirmText: this.translateSys('cancel')
                        });
                     }
                  } else {
                     uni.showModal({
                        title: this.translateSys('tip') + "5.2",
                        content: this.translate("execute_script_return_empty"),
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                     });
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 5",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -2352,7 +2278,6 @@
   }
</script>
<style>
   .popup-content {
      @include flex;
      align-items: center;
@@ -2362,6 +2287,7 @@
      /* height: 150px; */
      /* border: 1px solid red; */
   }
   .popup-height {
      @include height;
      /* width: 200px; */
@@ -2631,14 +2557,14 @@
      .view-popup {
         position: relative;
      }
      .popup-cont {
         overflow-y: auto;
         /* border: 1px solid red; */
      }
      .popup-header {
         font-size: 42rpx;