cuiqian2004
2025-03-05 e8b665122cf256caae4993534c696d029883f0d5
pages/modal/3018.vue
@@ -22,17 +22,17 @@
                        <a @tap="classAttr_extButton(index,iindex)"><i
                              class="ace-icon fa fa-plus-circle"></i></a>
                     </div>
                     <input
                     <input
                        :type="attr.Type=='整数' || attr.Type=='浮点数' || attr.Type=='int' || attr.Type=='float'?'number':'text'"
                        :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'"
                        :class="attr.edit?'':'input-disabled'"  :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'"
                        :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
                        :disabled="attr.edit?false:true">
                     <!-- =='flase'?true:false -->
                     <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'"
                        :data-index="index" :data-iindex="iindex" style="height:60px;"
                        :class="attr.edit?'':'input-disabled'"  :data-index="index" :data-iindex="iindex" style="height:60px;"
                        :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea>
                     <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'"
                        :data-index="index" :data-iindex="iindex" style="height:90px;"
                        :class="attr.edit?'':'input-disabled'"  :data-index="index" :data-iindex="iindex" style="height:90px;"
                        :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea>
                     <!-- 扫码后事件返回 -->
                     <div class="input_vallist">
@@ -47,16 +47,16 @@
                     <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
                     <input
                        :type="attr.Type=='整数' || attr.Type=='浮点数' || attr.Type=='int' || attr.Type=='float' ?'number':'text'"
                        class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent"
                        class="attr_field" :class="attr.edit?'':'input-disabled'"  :value="attr.Value" @focus="ontap" @blur="onevent"
                        v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
                        :disabled="attr.edit?false:true">
                     <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent"
                     <textarea class="attr_field" :class="attr.edit?'':'input-disabled'"  :value="attr.Value" @focus="ontap" @blur="onevent"
                        v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex"
                        style="height:60px;"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
                        :disabled="attr.edit?false:true"></textarea>
                     <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent"
                     <textarea class="attr_field" :class="attr.edit?'':'input-disabled'"  :value="attr.Value" @focus="ontap" @blur="onevent"
                        v-else-if="attr.Height=='3'" :data-index="index" :data-iindex="iindex"
                        style="height:90px;"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}"
@@ -149,13 +149,13 @@
                        <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a>
                     </div>
                     <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
                        disabled="true">
                        disabled="true" :maxlength="-1">
                  </view>
                  <view v-if="classattr.control_style=='左右布局'">
                     <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
                     <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex"
                     <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"  :data-index="index" :data-iindex="iindex"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
                        disabled="true">
                        disabled="true" :maxlength="-1">
                     <div class="text-right2" v-if="attr.Type=='引用对象(单个)'|| attr.Type=='obj-ref'">
                        <a @tap="classAttr_AddRef" :data-classid="attr.RelCls[0].id"
                           :data-classname="attr.RelCls[0].name"><i class="ace-icon fa fa-plus-circle"></i></a>
@@ -179,13 +179,14 @@
                        <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i
                              class="ace-icon fa fa-plus-circle"></i></a>
                     </div>
                     <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true">
                     <input type="text" :class="attr.edit?'':'input-disabled'"  :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
                        :maxlength="-1">
                  </view>
                  <view v-if="classattr.control_style=='左右布局'">
                     <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
                     <input type="text" class="attr_field" :value="attr.Value"
                     <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"  :value="attr.Value"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
                        disabled="true">
                        disabled="true" :maxlength="-1">
                     <div class="text-right2">
                        <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i
                              class="ace-icon fa fa-plus-circle"></i></a>
@@ -202,13 +203,14 @@
                        <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i
                              class="ace-icon fa fa-plus-circle"></i></a>
                     </div>
                     <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true">
                     <input type="text"  :class="attr.edit?'':'input-disabled'"  :value="attr.Value" :style="{'width':attr.Width}" disabled="true"
                        :maxlength="-1">
                  </view>
                  <view v-if="classattr.control_style=='左右布局'">
                     <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
                     <input type="text" class="attr_field" :value="attr.Value"
                     <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"  :value="attr.Value"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}"
                        disabled="true">
                        disabled="true" :maxlength="-1">
                     <div class="text-right2">
                        <a class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i
                              class="ace-icon fa fa-plus-circle"></i></a>
@@ -221,14 +223,14 @@
                  <view v-if="classattr.control_style=='上下布局'">
                     <text class="tx_title">{{attr.DispName}}:<i class="i_tishi"
                           v-if="attr.notempty==true">*</i></text>
                     <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
                        :disabled="attr.edit?false:true">
                     <input type="text" :class="attr.edit?'':'input-disabled'"  :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"
                        :disabled="attr.edit?false:true" :maxlength="-1">
                  </view>
                  <view v-if="classattr.control_style=='左右布局'">
                     <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p>
                     <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex"
                     <input type="text" class="attr_field" :class="attr.edit?'':'input-disabled'"  :data-index="index" :data-iindex="iindex"
                        :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"
                        :disabled="attr.edit?false:true">
                        :disabled="attr.edit?false:true" :maxlength="-1">
                     <i class="i_tishi" v-if="attr.notempty==true">*</i>
                  </view>
               </view>
@@ -255,17 +257,18 @@
      </view>
      <view class="v-bottom"><button type="default" @tap="cancel"
            class="btn_cancel">{{translateSys('cancel')}}</button>
         <button type="default" @tap="sava" class="btn_add">{{title}}</button>
      <view class="v-bottom"><button type="default" @tap="ok" class="btn_add">{{title}}</button>
         <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button>
      </view>
      <!-- 普通弹窗 top bottom center left right -->
      <view>
         <uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange">
            <view class="popup-header">{{check_list.title}}</view>
            <view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }"
               :style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}">
               <view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}">
               :style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}">
               <view class="popup-cont"
                  :style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}">
                  <view class="view_popup_CheckList" v-for="(item,index) in check_list.items">
                     <checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check"
                        :data-index="index" :style="{'margin-left': '10rpx'}">
@@ -293,6 +296,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,
@@ -310,7 +328,9 @@
      },
      data() {
         return {
            title: this.translateSys('add2'),
            title: this.translateSys('ok'),
            editMode: false,
            objAttr: {},
            param: {},
            type: '',
            classAttrList: [],
@@ -354,13 +374,16 @@
         if (options.type) {
            this.$data.type = options.type;
         }
         this.editMode = options.editMode ? true : false;
         if (options.objAttr)
            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('cancel')
               confirmText: this.translateSys('close')
            });
            uni.navigateBack({
               delta: 1, //返回层数,2则上上页
@@ -372,7 +395,7 @@
               title: this.translateSys('tip'),
               content: this.translate('function_not_edit_dlg'),
               showCancel: false,
               confirmText: this.translateSys('cancel')
               confirmText: this.translateSys('close')
            });
            uni.navigateBack({
               delta: 1, //返回层数,2则上上页
@@ -407,375 +430,404 @@
            });
         },
         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('close')
               });
            }
         },
         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) {
               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: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            });
               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.param.clsid,
                  ui_style_type: 2,
                  ui_style_name: $this.param.Edit_dlg.Name
               };
               const result = await getUIStyleInfo(gridstyleInfo)
               var styledef = Base64.decode(result.style_def);
               result.style_def = JSON.parse(styledef);
               $this.$data.classGridStyle = result
               $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')
               });
            }
         },
         viewParam() { //将mobox3小写参数转换为mobox2大写参数
            var class_gridStyle = {
               ID: this.$data.classGridStyle.id,
               Name: this.$data.classGridStyle.name,
               Type: this.$data.classGridStyle.type,
               IsDefault: this.$data.classGridStyle.is_defaul,
               StyleDef: this.$data.classGridStyle.style_def,
            };
            this.$data.classGridStyle = class_gridStyle;
            var class_attrList = [];
            this.$data.classAttrList.forEach(data => {
               var attrs = [];
               if (data.attr_list) {
                  data.attr_list.forEach(attr => {
                     var dictitems = [];
                     if (attr.dictitem) {
                        attr.dictitem.forEach(dict => {
                           dictitems.push({
                              ID: dict.id,
                              Name: dict.name,
                              Note: dict.note,
                              Order: dict.order,
                              ImgUrl: null,
                              Code: dict.code,
                              HasSub: null,
                              ParentID: null,
                              ParentName: null,
                              Lvl: dict.lvl,
                              IsDefault: dict.is_default,
                              Value: dict.value,
                              CN_G_ID: dict.id,
                              CN_G_DICT_ID: null,
                              CN_S_NAME: dict.name,
                              CN_S_NOTE: dict.note,
                              CN_N_ORDER: dict.order,
                              CN_S_IMG_URL: null,
                              CN_S_CODE: dict.code,
                              CN_C_HAS_SUB: null,
                              CN_G_PARENT_ITEM_ID: null,
                              CN_G_PARENT_ITEM_NAME: null,
                              CN_N_LVL: dict.lvl,
                              CN_C_IS_DEFAULT: dict.is_default,
                              CN_S_VALUE: dict.value
                           });
                        });
                     }
                     attrs.push({
                        ID: attr.id,
                        Name: attr.name,
                        Type: attr.type,
                        Size: attr.size,
                        NotEmpty: attr.not_empty,
                        DefValue: attr.def_value,
                        Order: attr.order,
                        DictName: attr.dict_name,
                        DictID: attr.dict_id,
                        CodeDefName: attr.code_def_name,
                        CodeDefID: attr.code_def_id,
                        RelClsID: null,
                        RelCls: attr.ref_cls,
                        Width: attr.width,
                        Height: attr.height,
                        CtrlStyle: attr.ctrl_style,
                        HasAce: attr.has_ace,
                        CanShow: attr.can_show,
                        CanQuery: attr.can_query,
                        ReadOnly: attr.read_only,
                        IsKey: attr.is_key,
                        IsFixed: attr.is_fixed,
                        DispName: attr.disp_name,
                        LuaAttr: attr.lua_attr,
                        Desc: attr.desc,
                        ActionDef: attr.action_def ? Base64.decode(attr
                           .action_def) : '',
                        Multilingual: attr.multilingual,
                        RefCondition: attr.ref_condition,
                        GroupName: data.group,
                        Value: null,
                        dictitem: dictitems
                     });
                  });
               }
               class_attrList.push({
                  Name: data.group,
                  Order: data.order,
                  HasAce: data.has_ace,
                  BkColor: data.bk_color,
                  ImgFontStyle: data.img_font_style,
                  Attr: attrs
         async loadFormData(objAttr) {
            let attrs = []
            if (this.param.objid) {
               let info = await dataObjInfo({
                  class_id: this.param.clsid,
                  obj_id: this.param.objid,
               });
            });
            this.$data.classAttrList = class_attrList;
            // console.log(this.$data.classGridStyle);
            // console.log(this.$data.classAttrList);
            this.class_attr_init();
         },
         class_attr_init() {
            var attrlist = this.$data.classGridStyle.StyleDef.show_style
            var newattrlist = [];
            if (this.$data.classAttrList.length > 0) {
               for (var i = 0; i < attrlist.length; i++) {
                  var open = attrlist[i].open;
                  var name = attrlist[i].attrgroup_name;
                  var attrs = attrlist[i].attrs;
                  for (var s = 0; s < this.$data.classAttrList.length; s++) {
                     var clsattr = this.$data.classAttrList[s];
                     // if (name == clsattr.Name) {
                     var attr = [];
                     for (var j = 0; j < attrs.length; j++) {
                        for (var l = 0; l < clsattr.Attr.length; l++) {
                           var ca = clsattr.Attr[l];
                           if (attrs[j].attr == ca.Name) {
                              ca.action = attrs[j].action;
                              ca.edit = attrs[j].edit;
                              ca.notempty = attrs[j].notempty;
                              ca.ext_button = attrs[j].ext_button;
                              ca.button_img = attrs[j].button_img;
                              ca.button_tooltip = attrs[j].button_tooltip;
                              ca.before_click_button = attrs[j].before_click_button;
                              ca.button_callback = attrs[j].button_callback;
                              ca.hidden = attrs[j].hidden;
                              ca.select = attrs[j].select == undefined ? false : attrs[j].select;
                              ca.Value = "";
                              if (ca.dictitem.length > 0) {
                                 if (ca.select == true)
                                    ca.Value = []; //ca.dictitem[0].CN_S_NAME;
                                 else
                                    ca.Value = this.translateSys(
                                       "select"); //ca.dictitem[0].CN_S_NAME;
                                 var dictitemlist = [];
                                 for (var d = 0; d < ca.dictitem.length; d++) {
                                    ca.dictitem[d].label = ca.dictitem[d].CN_S_NAME;
                                    ca.dictitem[d].value = ca.dictitem[d].CN_S_NAME;
                                    ca.dictitem[d].attr = ca.Name;
                                    if (ca.dictitem[d].CN_C_IS_DEFAULT == '1')
                                       ca.Value = ca.dictitem[d].CN_S_NAME;
                                 }
                              }
                              if (utils.classUtils.attrTypeIsDateTime(ca.Type)) {
                                 var nowDate = new Date();
                                 var date = {
                                    year: nowDate.getFullYear(),
                                    month: nowDate.getMonth() + 1,
                                    day: nowDate.getDate()
                                 }
                                 ca.Value = date.year + '-' + (date.month >= 10 ? date.month :
                                    '0' +
                                    date
                                    .month) + '-' + (date.day >= 10 ? date.day : '0' + date
                                    .day);
                              }
                              if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) {
                                 ca.RelClsList = ca.RelCls;
                                 ca.Value = this.translateSys('please');
                              }
                              if (utils.classUtils.attrTypeIsRegion(ca.Type))
                                 ca.Value = this.translateSys("select");
                              if (utils.classUtils.attrTypeIsBool(ca.Type))
                                 ca.Value = false;
               attrs = [{
                  attr: "id",
                  value: info.id
               }, {
                  attr: "state",
                  value: info.state
               }]
               info.attr_list.forEach(({
                  name,
                  value
               }) => {
                  attrs.push({
                     attr: name,
                     value: value
                  })
               });
               this.setFormValues(attrs)
            } else if (objAttr) {
               Object.keys(objAttr).forEach((attr) => {
                  attrs.push({
                     attr: attr,
                     value: objAttr[attr]
                  })
               });
               this.setFormValues(attrs)
            }
                              attr.push(ca);
         },
         async viewParam() { //将mobox3小写参数转换为mobox2大写参数
            try {
               var class_gridStyle = {
                  ID: this.$data.classGridStyle.id,
                  Name: this.$data.classGridStyle.name,
                  Type: this.$data.classGridStyle.type,
                  IsDefault: this.$data.classGridStyle.is_defaul,
                  StyleDef: this.$data.classGridStyle.style_def,
               };
               this.$data.classGridStyle = class_gridStyle;
               var class_attrList = [];
               this.$data.classAttrList.forEach(data => {
                  var attrs = [];
                  if (data.attr_list) {
                     data.attr_list.forEach(attr => {
                        var dictitems = [];
                        if (attr.dictitem) {
                           attr.dictitem.forEach(dict => {
                              dictitems.push({
                                 ID: dict.id,
                                 Name: dict.name,
                                 Note: dict.note,
                                 Order: dict.order,
                                 ImgUrl: null,
                                 Code: dict.code,
                                 HasSub: null,
                                 ParentID: null,
                                 ParentName: null,
                                 Lvl: dict.lvl,
                                 IsDefault: dict.is_default,
                                 Value: dict.value,
                                 CN_G_ID: dict.id,
                                 CN_G_DICT_ID: null,
                                 CN_S_NAME: dict.name,
                                 CN_S_NOTE: dict.note,
                                 CN_N_ORDER: dict.order,
                                 CN_S_IMG_URL: null,
                                 CN_S_CODE: dict.code,
                                 CN_C_HAS_SUB: null,
                                 CN_G_PARENT_ITEM_ID: null,
                                 CN_G_PARENT_ITEM_NAME: null,
                                 CN_N_LVL: dict.lvl,
                                 CN_C_IS_DEFAULT: dict.is_default,
                                 CN_S_VALUE: dict.value
                              });
                           });
                        }
                        attrs.push({
                           ID: attr.id,
                           Name: attr.name,
                           Type: attr.type,
                           Size: attr.size,
                           NotEmpty: attr.not_empty,
                           DefValue: attr.def_value,
                           Order: attr.order,
                           DictName: attr.dict_name,
                           DictID: attr.dict_id,
                           CodeDefName: attr.code_def_name,
                           CodeDefID: attr.code_def_id,
                           RelClsID: null,
                           RelCls: attr.ref_cls,
                           Width: attr.width,
                           Height: attr.height,
                           CtrlStyle: attr.ctrl_style,
                           HasAce: attr.has_ace,
                           CanShow: attr.can_show,
                           CanQuery: attr.can_query,
                           ReadOnly: attr.read_only,
                           IsKey: attr.is_key,
                           IsFixed: attr.is_fixed,
                           DispName: attr.disp_name,
                           LuaAttr: attr.lua_attr,
                           Desc: attr.desc,
                           ActionDef: attr.action_def ? Base64.decode(attr
                              .action_def) : '',
                           Multilingual: attr.multilingual,
                           RefCondition: attr.ref_condition,
                           GroupName: data.group,
                           Value: null,
                           dictitem: dictitems
                        });
                     });
                  }
                  class_attrList.push({
                     Name: data.group,
                     Order: data.order,
                     HasAce: data.has_ace,
                     BkColor: data.bk_color,
                     ImgFontStyle: data.img_font_style,
                     Attr: attrs
                  });
               });
               this.$data.classAttrList = class_attrList;
               // console.log(this.$data.classGridStyle);
               // console.log(this.$data.classAttrList);
               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')
               });
            }
         },
         async class_attr_init() {
            try {
               var attrlist = this.$data.classGridStyle.StyleDef.show_style
               var newattrlist = [];
               if (this.$data.classAttrList.length > 0) {
                  for (var i = 0; i < attrlist.length; i++) {
                     var open = attrlist[i].open;
                     var name = attrlist[i].attrgroup_name;
                     var attrs = attrlist[i].attrs;
                     for (var s = 0; s < this.$data.classAttrList.length; s++) {
                        var clsattr = this.$data.classAttrList[s];
                        // if (name == clsattr.Name) {
                        var attr = [];
                        for (var j = 0; j < attrs.length; j++) {
                           for (var l = 0; l < clsattr.Attr.length; l++) {
                              var ca = clsattr.Attr[l];
                              if (attrs[j].attr == ca.Name) {
                                 ca.action = attrs[j].action;
                                 ca.edit = attrs[j].edit;
                                 ca.notempty = attrs[j].notempty;
                                 ca.ext_button = attrs[j].ext_button;
                                 ca.button_img = attrs[j].button_img;
                                 ca.button_tooltip = attrs[j].button_tooltip;
                                 ca.before_click_button = attrs[j].before_click_button;
                                 ca.button_callback = attrs[j].button_callback;
                                 ca.hidden = attrs[j].hidden;
                                 ca.select = attrs[j].select == undefined ? false : attrs[j].select;
                                 ca.Value = "";
                                 if (ca.dictitem.length > 0) {
                                    if (ca.select == true)
                                       ca.Value = []; //ca.dictitem[0].CN_S_NAME;
                                    else
                                       ca.Value = this.translateSys(
                                          "select"); //ca.dictitem[0].CN_S_NAME;
                                    var dictitemlist = [];
                                    for (var d = 0; d < ca.dictitem.length; d++) {
                                       ca.dictitem[d].label = ca.dictitem[d].CN_S_NAME;
                                       ca.dictitem[d].value = ca.dictitem[d].CN_S_NAME;
                                       ca.dictitem[d].attr = ca.Name;
                                       if (ca.dictitem[d].CN_C_IS_DEFAULT == '1')
                                          ca.Value = ca.dictitem[d].CN_S_NAME;
                                    }
                                 }
                                 if (utils.classUtils.attrTypeIsDateTime(ca.Type)) {
                                    var nowDate = new Date();
                                    var date = {
                                       year: nowDate.getFullYear(),
                                       month: nowDate.getMonth() + 1,
                                       day: nowDate.getDate()
                                    }
                                    ca.Value = date.year + '-' + (date.month >= 10 ? date.month :
                                       '0' +
                                       date
                                       .month) + '-' + (date.day >= 10 ? date.day : '0' + date
                                       .day);
                                 }
                                 if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) {
                                    ca.RelClsList = ca.RelCls;
                                    ca.Value = this.translateSys('please');
                                 }
                                 if (utils.classUtils.attrTypeIsRegion(ca.Type))
                                    ca.Value = this.translateSys("select");
                                 if (utils.classUtils.attrTypeIsBool(ca.Type))
                                    ca.Value = false;
                                 attr.push(ca);
                              }
                           }
                        }
                        newattrlist.push({
                           BkColor: clsattr.BkColor,
                           HasAce: clsattr.HasAce,
                           ImgFontStyle: clsattr.ImgFontStyle,
                           Name: clsattr.Name,
                           Order: clsattr.Order,
                           Open: open,
                           Attr: attr,
                           control_style: this.$data.classGridStyle.StyleDef.control_style,
                           title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith
                        })
                        // }
                     }
                  }
                  if (newattrlist.length > 0) {
                     this.$data.classAttrList = newattrlist;
                  }
                  var req = [];
                  if (this.$data.classGridStyle.StyleDef) {
                     if (this.$data.classGridStyle.StyleDef.show_style.length > 0) {
                        var attrlist = this.$data.classGridStyle.StyleDef.show_style
                        // $el.find('.attr_field').prop('readonly', true);
                        // $el.find('.attr_field').prop('disabled', true);
                        for (var i = 0; i < attrlist.length; i++) {
                           var attr = attrlist[i].attrs
                           for (var j = 0; j < attr.length; j++) {
                              var ar = attr[j];
                              req.push({
                                 attr: ar.attr,
                                 value: ar.value ? ar.value : ''
                              });
                           }
                        }
                     }
                     newattrlist.push({
                        BkColor: clsattr.BkColor,
                        HasAce: clsattr.HasAce,
                        ImgFontStyle: clsattr.ImgFontStyle,
                        Name: clsattr.Name,
                        Order: clsattr.Order,
                        Open: open,
                        Attr: attr,
                        control_style: this.$data.classGridStyle.StyleDef.control_style,
                        title_p_wdith: this.$data.classGridStyle.StyleDef.title_p_wdith
                     })
                     // }
                  }
               }
               if (newattrlist.length > 0) {
                  this.$data.classAttrList = newattrlist;
               }
               var req = [];
               if (this.$data.classGridStyle.StyleDef) {
                  if (this.$data.classGridStyle.StyleDef.show_style.length > 0) {
                     var attrlist = this.$data.classGridStyle.StyleDef.show_style
                     // $el.find('.attr_field').prop('readonly', true);
                     // $el.find('.attr_field').prop('disabled', true);
                     for (var i = 0; i < attrlist.length; i++) {
                        var attr = attrlist[i].attrs
                        for (var j = 0; j < attr.length; j++) {
                           var ar = attr[j];
                           req.push({
                              attr: ar.attr,
                              val: ar.value ? ar.value : ''
                           });
                  var eventlist = this.$data.classGridStyle.StyleDef.event;
                  // console.log(eventlist);
                  if (eventlist) {
                     if (eventlist.length > 0) {
                        for (var i = 0; i < eventlist.length; i++) {
                           if (eventlist[i].event_id == 'before_ok') {
                              this.$data.edit_ok_event = eventlist[i];
                           } else if (eventlist[i].event_id == 'initial') {
                              this.$data.edit_inital_event = eventlist[i];
                           } else if (eventlist[i].event_id == 'before_select_compose') {
                              this.$data.edit_select_compose_event = eventlist[i].scrip_id;
                              this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id;
                           }
                        }
                     }
                  }
               }
               var eventlist = this.$data.classGridStyle.StyleDef.event;
               // console.log(eventlist);
               if (eventlist) {
                  if (eventlist.length > 0) {
                     for (var i = 0; i < eventlist.length; i++) {
                        if (eventlist[i].event_id == 'before_ok') {
                           this.$data.edit_ok_event = eventlist[i];
                        } else if (eventlist[i].event_id == 'initial') {
                           this.$data.edit_inital_event = eventlist[i];
                        } else if (eventlist[i].event_id == 'before_select_compose') {
                           this.$data.edit_select_compose_event = eventlist[i].scrip_id;
                           this.$data.edit_compose_cls_id = eventlist[i].compose_cls_id;
                        }
                  await this.loadFormData(this.objAttr)
                  // console.log(req);
                  if (this.$data.edit_inital_event) {
                     var eventid = this.$data.edit_inital_event.scrip_id;
                     var info = {
                        eventid: eventid,
                        edtype: "0",
                        projectid: '',
                        rclsid: '',
                        robjid: '',
                        userlogin: '',
                        clsid: this.$data.param.clsid,
                        objid: "",
                        attr: req,
                     }
                     this.ini_DataObjRunCustomEvent(info);
                  }
               }
               // console.log(req);
               if (this.$data.edit_inital_event) {
                  var eventid = this.$data.edit_inital_event.scrip_id;
                  var info = {
                     eventid: eventid,
                     edtype: "0",
                     projectid: '',
                     rclsid: '',
                     robjid: '',
                     userlogin: '',
                     clsid: this.$data.param.clsid,
                     objid: "",
                     attr: req,
                  }
                  this.ini_DataObjRunCustomEvent(info);
               }
               console.log(this.$data.classGridStyle);
               console.log(this.$data.classAttrList);
                  console.log(this.$data.classGridStyle);
                  console.log(this.$data.classAttrList);
            } else {
               } else {
                  uni.showModal({
                     title: this.translateSys('tip'),
                     content: this.translate('no_find_attr_diaplay'),
                     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'),
                  content: this.translate('no_find_attr_diaplay'),
                  title: this.translateSys("error"),
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            }
         },
@@ -811,7 +863,7 @@
                  title: this.translateSys('tip'),
                  content: this.translate("icon_click_event_empty"),
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
               return;
            }
@@ -820,12 +872,82 @@
                  title: this.translateSys('tip'),
                  content: this.translate("icon_click_event_empty"),
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
               return;
            }
            this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index,
               iindex);
         },
         setFormValues(data) {
            if (JSON.stringify(data) == '{}') {
               return;
            }
            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];
                  let curIndex = data.findIndex((attr) => {
                     return attr.attr == ca.Name;
                  })
                  if (curIndex > -1) {
                     const attr = data[curIndex]
                     if (utils.classUtils
                        .attrTypeIsDict(ca
                           .Type)) {
                        var dictItemList = [];
                        for (var d in attr
                              .choice_list) {
                           var list_val = attr
                              .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 = attr.value;
                     }
                  }
               }
            }
            for (var i = 0; i < value.length; i++) {
               var length = 0;
               if (!this.$data.refdatastore.filter(function(
                     s) {
                     return data[i].attr == s.attr
                  }).length) {
                  length = 1;
                  this.$data.refdatastore.push(data[i]);
               }
               if (length == 0) {
                  for (var j = 0; j < this.$data.refdatastore
                     .length; j++) {
                     if (this.$data.refdatastore[j].attr ==
                        data[i]
                        .attr) {
                        this.$data.refdatastore[j].value =
                           data[i]
                           .value;
                     }
                  }
               }
            }
         },
         popupChange(e) {
            console.log('当前模式:' + e.type + ',状态:' + e.show);
@@ -869,7 +991,7 @@
                  title: this.translateSys('tip'),
                  content: "popupParam为空!",
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
               return;
            }
@@ -1191,7 +1313,7 @@
               title: this.translateSys('tip'),
               content: this.translateSys('unrealized'),
               showCancel: false,
               confirmText: this.translateSys('cancel')
               confirmText: this.translateSys('close')
            });
            // var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value];
            // this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
@@ -1241,18 +1363,7 @@
               }
            });
         },
         //确定
         sava() {
            if (this.$data.edit_ok_event)
               this.OKDataObjRunCustomEvent();
            else
               this.add();
         },
         add() {
            uni.showLoading({
               title: this.translateSys("loading"),
               mask: true
            });
         getPostDataObjAttr() {
            var req = [];
            var attrlist = this.$data.classAttrList;
            for (var i = 0; i < attrlist.length; i++) {
@@ -1262,138 +1373,228 @@
                  if (ar.Value == this.translateSys("select") || ar.Value == '——' + this
                     .translateSys(
                        "select") + '——') ar.Value = '';
                  if (utils.classUtils.attrTypeIsDict(ar.Type)) {
                     if (ar.select == true) { //判断下拉是否多选
                        var valStr = "";
                        for (var v in ar.Value) {
                           if (valStr)
                              valStr += ";";
                           valStr += ar.Value[v];
                        }
                        req.push({
                           name: ar.Name,
                           value: valStr
                        });
                     } else
                        req.push({
                           name: ar.Name,
                           value: ar.Value
                        });
                  } else {
                     const node = this.formatAttr(ar)
                  req.push(this.formatAttr(ar));
               }
            }
            if (this.$data.refdatastore.length > 0) {
               for (var i = 0; i < this.$data.refdatastore.length; i++) {
                  if (!req.filter(function(s) {
                        return this.$data.refdatastore[i].attr == s.name
                     }).length) {
                     length = 1;
                     req.push({
                        name: node.attr,
                        value: node.value
                        'attr': this.$data.refdatastore[i].attr,
                        'val': this.$data.refdatastore[i].value
                     });
                  }
                  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('cancel')
                     });
                     return;
                  }
               }
            }
            var enviroment = {
               'function': '3000', // 功能点编号
               cls_id: this.$data.param.clsid, // 功能点主数据类标识
               'button': 'top', // top/bottom
               button_name: this.translateSys('add2'),
               master: {
                  cls_id: this.$data.param.clsid,
               }
            };
            enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码
            var obj_attr = {};
            req.forEach(item => {
               obj_attr[item.name] = item.value;
               obj_attr[item.attr] = item.value;
            });
            // console.log(obj_attr);
            // var dataInfo={
            //     class_id: this.$data.param.clsid, data_obj_id: '', masterclsid: '',
            //     req: JSON.stringify(req), upfile: JSON.stringify([]), post_data: JSON.stringify({}),
            //     compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment),
            //    not_trigger_sys_event: ''
            // };
            var dataInfo = {
               class_id: this.$data.param.clsid,
               class_name: '',
               master_cls_id: '',
               master_obj_id: '',
               creator: '',
               creator_name: '',
               not_trigger_event: '',
               update_exist: '',
               post_process: '',
               ext_info: enviroment,
               obj_attr: obj_attr
            };
            console.log(dataInfo);
            // return
            this.$store.dispatch('createDataObj', dataInfo).then(success => {
               console.log(success);
            return obj_attr
         },
         //确定
         async ok() {
            try {
               uni.showLoading({
                  title: this.translateSys("loading"),
                  mask: true
               });
               this.okLoading = true
               var obj_attr = this.getPostDataObjAttr();
               let ret = await this.sava();
               this.okLoading = false
               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
                           });
                        }
               if (!ret) return;
               obj_attr.id = this.objId;
               const eventChannel = this.$scope.eventChannel;
               // const eventChannel = this.getOpenerEventChannel();
               eventChannel.emit(this.type, obj_attr);
                        // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}"
               uni.navigateBack()
            } catch (ex) {
               return false;
            }
         },
         //确定
         async sava() {
            try {
               if (this.param.objid) {
                  // let ret = await this.OKDataObjRunCustomEvent();
                  // if (!ret) return false;
                  if (this.$data.edit_ok_event) { // 点击确定按钮后
                     ret = await this.OKDataObjRunCustomEvent();
                     if (!ret) return false;
                  } else {
                     ret = await this.update();
                     if (!ret) return false;
                  }
               } else {
                  if (this.editMode) {
                     return true
                  } else {
                     // let ret = await this.OKDataObjRunCustomEvent();
                     // if (!ret) return false;
                     if (this.$data.edit_ok_event) { // 点击确定按钮后
                        ret = await this.OKDataObjRunCustomEvent();
                        if (!ret) return false;
                     } else {
                        ret = await this.add();
                        if (!ret) return false;
                     }
                  } else
                  }
               }
               return true;
            } catch (ex) {
               return false;
            }
         },
         // async sava() {
         //    try {
         //       if (this.$data.edit_ok_event)
         //          this.OKDataObjRunCustomEvent();
         //       else
         //          this.add();
         //    } catch (ex) {
         //       return false;
         //    }
         // },
         async add() {
            try {
               var req = [];
               var attrlist = this.$data.classAttrList;
               for (var i = 0; i < attrlist.length; i++) {
                  var attr = attrlist[i].Attr;
                  for (var j = 0; j < attr.length; j++) {
                     var ar = attr[j];
                     if (ar.Value == this.translateSys("select") || ar.Value == '——' + this
                        .translateSys(
                           "select") + '——') ar.Value = '';
                     if (utils.classUtils.attrTypeIsDict(ar.Type)) {
                        if (ar.select == true) { //判断下拉是否多选
                           var valStr = "";
                           for (var v in ar.Value) {
                              if (valStr)
                                 valStr += ";";
                              valStr += ar.Value[v];
                           }
                           req.push({
                              name: ar.Name,
                              value: valStr
                           });
                        } else
                           req.push({
                              name: ar.Name,
                              value: ar.Value
                           });
                     } else {
                        const node = this.formatAttr(ar)
                        req.push({
                           name: node.attr,
                           value: node.value
                        });
                     }
                     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')
                        });
                        return;
                     }
                  }
               }
               var enviroment = {
                  'function': '3000', // 功能点编号
                  cls_id: this.$data.param.clsid, // 功能点主数据类标识
                  'button': 'top', // top/bottom
                  button_name: this.translateSys('add2'),
                  master: {
                     cls_id: this.$data.param.clsid,
                  }
               };
               enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码
               var obj_attr = {};
               req.forEach(item => {
                  obj_attr[item.name] = item.value;
               });
               var dataInfo = {
                  class_id: this.$data.param.clsid,
                  class_name: '',
                  master_cls_id: '',
                  master_obj_id: '',
                  creator: '',
                  creator_name: '',
                  not_trigger_event: '',
                  update_exist: '',
                  post_process: '',
                  ext_info: enviroment,
                  obj_attr: obj_attr
               };
               console.log(dataInfo);
               // return
               DataObjCreate(dataInfo).then((res) => {
                  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
                     });
                  }
                  //刷新
                  uni.redirectTo({
                     url: '../modal/3018?param=' + JSON.stringify(this.$data
@@ -1401,24 +1602,33 @@
                        "&titlename=" + this.$data.title
                  });
                  // this.cancel();
               } else {
               }).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('error') + " ",
                     content: success.err_msg,
                     title: this.translateSys('tip'),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                     confirmText: this.translateSys('close')
                  });
               }
            }).catch(ex => {
               console.log(ex);
               uni.hideLoading();
               uni.showModal({
                  title: this.translateSys('tip'),
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
               });
            });
            } 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')
               });
            }
         },
         ini_DataObjRunCustomEvent(info) {
            var param = {
@@ -1442,7 +1652,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,144 +1682,82 @@
            };
            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('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')
                  });
                     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;
                                                }
                                             }
                                          }
                                       }
                                       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]
                                                   .value;
                                             }
                                          }
                                       }
                                    }
                                 }
                  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) {
                                 this.setFormValues(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('close')
                              });
                           }
                           // 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);
               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: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            });
         },
@@ -1655,7 +1803,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,249 +1827,177 @@
            };
            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('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')
                  });
                     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;
                                             }
                                          }
                                       }
                                    }
                                 }
                                 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 || [];
                           }
                  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.$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);
               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: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            });
         },
         OKDataObjRunCustomEvent() {
            var enviroment = {
               'function': '3000', // 功能点编号
               cls_id: this.$data.param.clsid, // 功能点主数据类标识
               'button': 'top', // top/bottom
               button_name: this.translateSys('add2'),
               master: {
                  cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id
         async OKDataObjRunCustomEvent() {
            try {
               var enviroment = {
                  'function': '3000', // 功能点编号
                  cls_id: this.$data.param.clsid, // 功能点主数据类标识
                  'button': 'top', // top/bottom
                  button_name: this.translateSys('add2'),
                  master: {
                     cls_id: this.$data.param.clsid, // button=bottom时 master的cls_id
               }
            };
            var eventid = this.$data.edit_ok_event.scrip_id;
            var req = [];
            var attrlist = this.$data.classAttrList;
            for (var i = 0; i < attrlist.length; i++) {
               var attr = attrlist[i].Attr;
               for (var j = 0; j < attr.length; j++) {
                  var ar = attr[j];
                  if (ar.Value == this.translateSys("select") || ar.Value == '——' + this
                     .translateSys(
                        "select") + '——') ar.Value = '';
                  req.push(this.formatAttr(ar));
               }
            }
            if (this.$data.refdatastore.length > 0) {
               for (var i = 0; i < this.$data.refdatastore.length; i++) {
                  if (!req.filter(function(s) {
                        return this.$data.refdatastore[i].attr == s.name
                     }).length) {
                     length = 1;
                     req.push({
                        'attr': this.$data.refdatastore[i].attr,
                        'val': this.$data.refdatastore[i].value
                     });
                  }
               };
               var eventid = this.$data.edit_ok_event.scrip_id;
               var req = [];
               var attrlist = this.$data.classAttrList;
               for (var i = 0; i < attrlist.length; i++) {
                  var attr = attrlist[i].Attr;
                  for (var j = 0; j < attr.length; j++) {
                     var ar = attr[j];
                     if (ar.Value == this.translateSys("select") || ar.Value == '——' + this
                        .translateSys(
                           "select") + '——') ar.Value = '';
                     req.push(this.formatAttr(ar));
                  }
               }
            }
            var info = {
               eventid: eventid,
               edtype: "0",
               projectid: '',
               rclsid: '',
               robjid: '',
               userlogin: '',
               clsid: this.$data.param.clsid,
               objid: "",
               attr: req,
            }
            //     var dataInfo = {
            //          edtype: info.edtype, eventid: info.eventid, projectid: info.projectid,rclsid: info.rclsid,
            // robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid,
            // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), global_attr: JSON.stringify(this.$data.global_attr)
            //      }
            enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码
            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;
            });
            if (!eventid.includes('{')) eventid = '{' + eventid + '}';
            var dataInfo = {
               ed_type: info.edtype,
               start_transaction: '',
               class_id: info.clsid,
               class_name: '',
               event_id: eventid,
               event_name: '',
               data_obj_id: info.objid,
               obj_attr: obj_attr,
               prj_id: info.projectid,
               ref_cls_id: info.rclsid,
               rel_obj_id: info.robjid,
               user_login: info.userlogin,
               data_json: '',
               compose_info: '',
               ext_info: enviroment,
               global_attr: global_attr,
               input_param: '',
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.result;
               if (this.$data.refdatastore.length > 0) {
                  for (var i = 0; i < this.$data.refdatastore.length; i++) {
                     if (!req.filter(function(s) {
                           return this.$data.refdatastore[i].attr == s.name
                        }).length) {
                        length = 1;
                        req.push({
                           'attr': this.$data.refdatastore[i].attr,
                           'val': this.$data.refdatastore[i].value
                        });
                     }
                  }
               }
               var info = {
                  eventid: eventid,
                  edtype: "0",
                  projectid: '',
                  rclsid: '',
                  robjid: '',
                  userlogin: '',
                  clsid: this.$data.param.clsid,
                  objid: this.$data.param.objid,
                  attr: req,
               }
               enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码
               var global_attr = Base64.encode(JSON.stringify(this.$data.global_attr)); //将字符串转换为base64编码
               var obj_attr = {};
               info.attr.forEach(item => {
                  obj_attr[item.attr] = item.value;
               });
               if (!eventid.includes('{')) eventid = '{' + eventid + '}';
               var dataInfo = {
                  ed_type: info.edtype,
                  start_transaction: '',
                  class_id: info.clsid,
                  class_name: '',
                  event_id: eventid,
                  event_name: '',
                  data_obj_id: info.objid,
                  obj_attr: obj_attr,
                  prj_id: info.projectid,
                  ref_cls_id: info.rclsid,
                  rel_obj_id: info.robjid,
                  user_login: info.userlogin,
                  data_json: '',
                  compose_info: '',
                  ext_info: enviroment,
                  global_attr: global_attr,
                  input_param: '',
               };
               console.log(dataInfo);
               // 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 :
@@ -1931,14 +2007,14 @@
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                        confirmText: this.translateSys('close')
                     });
                     else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this.translateSys('tip') + ':' + data
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                        confirmText: this.translateSys('close')
                     });
                     return false
                  } else {
@@ -1950,7 +2026,7 @@
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('cancel')
                        confirmText: this.translateSys('close')
                     });
                     var result = data.result;
@@ -1974,23 +2050,31 @@
                     this.add();
                  }
               } else {
               }).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",
                     content: success.err_msg,
                     title: this.translateSys('error') + " 4.1",
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                     confirmText: this.translateSys('close')
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               });
            } 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: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            });
            }
         },
         DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
            var enviroment = {
@@ -2050,7 +2134,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,248 +2158,242 @@
            };
            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('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')
                  });
                     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('close')
                     });
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys('error') + " 5",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys('cancel')
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys('tip') + "5.1",
                  content: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('cancel')
                  confirmText: this.translateSys('close')
               });
            });
         },
@@ -2352,7 +2430,6 @@
   }
</script>
<style>
   .popup-content {
      @include flex;
      align-items: center;
@@ -2362,6 +2439,7 @@
      /* height: 150px; */
      /* border: 1px solid red; */
   }
   .popup-height {
      @include height;
      /* width: 200px; */
@@ -2435,7 +2513,9 @@
         right: 30rpx;
         font-size: 60rpx;
      }
      .input-disabled {
         background-color: #f3f3f3 !important;
      }
      input::-webkit-input-placeholder {
         font-size: 12rpx;
      }
@@ -2570,7 +2650,7 @@
         color: #fff;
         font-size: 38rpx;
         font-weight: bold;
         float: right;
         float: left;
         display: inline-block;
      }
@@ -2579,12 +2659,14 @@
         margin-top: 50rpx;
         padding: 20rpx;
         line-height: 1.5;
         background: #27A6E1;
         border: none;
         color: #fff;
         // background: #fff;
      //   border: 1px solid #dcdee2;
         // color: #000;
         background: #fff;
         color: #000;
         font-size: 38rpx;
         font-weight: bold;
         float: left;
         float: right;
         display: inline-block;
      }
@@ -2631,14 +2713,14 @@
      .view-popup {
         position: relative;
      }
      .popup-cont {
         overflow-y: auto;
         /* border: 1px solid red; */
      }
      .popup-header {
         font-size: 42rpx;
@@ -2653,7 +2735,7 @@
      .popup-footer {
         float: right;
         position: absolute;
         bottom: 0;
         bottom: 10rpx;
         right: 20rpx;
      }
@@ -2677,9 +2759,11 @@
         margin-top: 50rpx;
         padding: 15rpx;
         line-height: 1.5;
         background: #27A6E1;
         border: none;
         color: #fff;
         // background: #27A6E1;
         // border: none;
         // color: #fff;
         background: #fff;
         color: #000;
         font-size: 38rpx;
         font-weight: bold;
         /* float: right; */