jt
2024-06-07 575b738219e66bb4f1a72c902155c1a354198978
pages/modal/3018_2.vue
@@ -4,9 +4,11 @@
   /* line-height: 30rpx; */
   padding: 5rpx 0;
}
.v-headStyle:first-child{
   margin-top: 15rpx;
}
.v-headStyle .txt_title{
  font-size: 34rpx;
  text-align: right;
@@ -15,6 +17,7 @@
  
   /* border: 0.1rpx solid red; */
}
.v-headStyle input{
   vertical-align: middle;
   display: inline-block;
@@ -33,9 +36,11 @@
   transition-duration: 0.1s;
   margin-top: 4rpx;
}
.v-headStyle input::-webkit-input-placeholder {
   font-size: 12rpx;
}
.v-headStyle .form-item-span{
   /* vertical-align:top; */
    color: #2d8cf0;
@@ -45,6 +50,7 @@
   
   /* border: 0.1rpx solid red; */
}
.input-wrapper{
   border: 1px solid #d5d5d5;
    display: inline-block;
@@ -52,11 +58,13 @@
   line-height: 22rpx;
   vertical-align: middle;
}
.check_rememberPwd,
.input-switch{
   vertical-align: middle;
   margin-left:10rpx
}
[nvue] uni-view {
    position: relative;
    border: 0 solid #000;
@@ -66,6 +74,7 @@
.uni-input {
   /* border: none; */
}
.uni-icon{
   /* border: 1px solid red; */
   width: 8%;
@@ -91,6 +100,7 @@
.input-disabled{
   background-color: #f3f3f3 !important;
}
button.btn_add {
   width:49.5%;
   margin-top: 50rpx;
@@ -104,6 +114,7 @@
   float: right;
   display: inline-block;
}
button.btn_cancel {
   width:49.5%;
   margin-top: 50rpx;
@@ -117,9 +128,11 @@
   float: left;
   display: inline-block;
}
.view-popup{
   position:relative;
}
.popup-content {
   @include flex;
   align-items: center;
@@ -129,28 +142,34 @@
   /* height: 150px; */
   /* border: 1px solid red; */
}
.popup-cont {
   overflow-y: auto;
   /* border: 1px solid red; */
}
.popup-height {
   @include height;
   /* width: 200px; */
}
.popup-header{
   font-size: 42rpx;
   font-weight: bold;
   margin:20rpx 20rpx 0px 20rpx;
}
.view_popup_CheckList{
   margin-bottom: 20rpx;
}
.popup-footer{
   float: right;
   position:absolute;
   bottom:0;
   right:20rpx;
}
button.btn_popup_add {
   width:180rpx;
   margin-top: 50rpx;
@@ -165,6 +184,7 @@
   /* float: left; */
   display: inline-block;
}
button.btn_popup_cancel {
   width:180rpx;
   margin-top: 50rpx;
@@ -178,6 +198,7 @@
   /* float: right; */
   display: inline-block;
}
#dv_select{
   display: inline-block;
   width: 66%;
@@ -193,11 +214,13 @@
   /* vertical-align: 10px; */
   vertical-align: middle;
}
#dv_select .uni-select{
   border: 1px solid #ccc;
   border-radius: 0 !important;
   color: #2d8cf0;   
}
#dv_select .uni-select__input-text{
   color: #2d8cf0;   
}
@@ -210,53 +233,64 @@
   text-align: center;
    font-weight: bold;
}
.v-panel{
   min-height:788rpx;
}
.v-panellist{
   border:4rpx solid #aaa;
   border-radius: 10rpx;
   margin: 10rpx 20rpx 0rpx 20rpx;
}
.v-paneldel{
   text-align: right;
}
.panel_del{
   font-size: 44rpx;
   text-decoration: initial;
   margin-top: 10rpx;
   margin-right: 20rpx;
}
.class_attr_body .form-group {
   margin: 20rpx 30rpx;
    /* margin-left: -12px;
    margin-right: -12px; */
}
.subclass_attr_body .form-group {
   margin: 20rpx 10rpx;
    /* margin-left: -12px;
    margin-right: -12px; */
}
.form-group > label[class*="col-"] {
    margin-bottom: 8rpx;
   font-size: 32rpx;
}
.form-group label {
    vertical-align: middle;
    line-height: 60rpx;
}
.tx_title2{
   font-size: 32rpx;
   text-align: right;
   display: inline-block;
   vertical-align: -2px;
}
.attr_field{
   display: inline-block;
   vertical-align: middle;
   margin-left: 8px;
   /* width: 71%; */
}
.text-right2 {
   margin: 0;
   vertical-align: -4px;
@@ -265,9 +299,11 @@
   font-size: 44rpx;
   display: inline-block;
}
input::-webkit-input-placeholder {
   font-size: 12rpx;
}
.v-panel input{
   border: 1px solid #d5d5d5;
   width: 98%;
@@ -282,6 +318,7 @@
   transition-duration: 0.1s;
   margin-top: 4rpx;
}
.date_iput{
   /* border: 1px solid #d5d5d5; */
   /* width: 98%; */
@@ -295,11 +332,13 @@
   box-shadow: none !important;
   transition-duration: 0.1s;
}
.dv_input{
    display: inline-block;
    width: 65%;    
   /* line-height: 22rpx; */
}
.view-floor{
   padding: 0 20rpx;
}
@@ -309,24 +348,30 @@
      margin-bottom: 0px;
      display: block;
   }
   ::v-deep .uni-row {
      margin-bottom: 0px;
   }
   .view-tabpage ::v-deep .uni-row  {
      margin-bottom: 5px;
   }
   .demo-uni-col {
      height: 36px;
      border-radius: 5px;
   }
   .demo-uni-row .uni-input{
      width: calc(100% - 120px);
   }
   .text {
       font-size: 12px;
       color: #666;
       margin-top: 5px;
   }
   // .uni-px-5 {
   //    margin: 0;
   //    display: inline-block;
@@ -356,14 +401,9 @@
           :style="'width: calc(100% - '+item.labelWidth+'px);'">{{item.value}}</span>
         <!-- 下拉框-单选 item.useDict?item.dict:item.selections-->
         <uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled"
            :style="'width: calc(100% - '+item.labelWidth-10+'px);'"
            :class="item.disabled?'input-disabled':''"
            v-model="item.value"
            :localdata="item.dict"
            @change="onchange(item)"
            :disabled="item.disabled"
            :clear="false"
         ></uni-data-select>
               :style="'width: calc(100% - '+item.labelWidth-10+'px);'" :class="item.disabled?'input-disabled':''"
               v-model="item.value" :localdata="item.dict" @change="onchange(item)" :disabled="item.disabled"
               :clear="false"></uni-data-select>
         <!-- 下拉框-多选 -->
         <!-- <select-cy v-else-if="attr.select==true"  :value="item.value" 
           :name="item.fieldId" 
@@ -375,42 +415,26 @@
         ></select-cy> -->
         <!-- 文本框/数字框 -->
         <view class="input-wrapper" v-if="(item.name=='Input' || item.name=='InputNumber') && !item.disabled">
            <text v-if="item.setting.prefix"
               class="uni-icon"
               :class="[item.setting.prefix]"
               <text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]"
               @change="classAttr_extButton(item)">&#xe568;</text>
            <input class="uni-input" :class="item.disabled?'input-disabled':''"
               :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'"
               v-model="item.value"
               :disabled="item.disabled"
               :placeholder="item.placeholder"
                  :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'" v-model="item.value"
                  :disabled="item.disabled" :placeholder="item.placeholder"
               :style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}" 
               :focus="focusMateria"
               @focus="ontap(item)"
               @blur="onevent(item)"
            />
            <text v-if="item.setting.suffix"
               class="uni-icon"
               :class="[item.setting.suffix]"
                  :focus="focusMateria" @focus="ontap(item)" @blur="onevent(item)" />
               <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]"
               @click="classAttr_extButton(item)">&#xe568;</text>
          </view>
         <!-- 多行文本 -->
         <view class="input-wrapper" v-if="item.name=='Textarea' && !item.disabled">
            <textarea class="uni-input" :class="item.disabled?'input-disabled':''" :value="item.value" 
              :placeholder="item.placeholder"
              @blur="onModelValue(item)"
              :data-index="index"
              style="height:60px;"
              :style="{'width':'96%'}"
              :disabled="item.disabled"
            ></textarea>
                  :placeholder="item.placeholder" @blur="onModelValue(item)" :data-index="index"
                  style="height:60px;" :style="{'width':'96%'}" :disabled="item.disabled"></textarea>
            
          </view>
         <!-- 复选框 -->
         <checkbox-group class="check_rememberPwd" v-if="item.name=='Checkbox'"
            :class="item.disabled?'input-disabled':''"
            @change="onModelValue(item)"
            :disabled="item.disabled"
               :class="item.disabled?'input-disabled':''" @change="onModelValue(item)" :disabled="item.disabled"
            :data-ischeck="item.value">
            <label>
               <checkbox :value="item.value" :checked="item.value"/>
@@ -419,16 +443,12 @@
         </checkbox-group>
         <!-- Switch开关 -->
         <switch class="input-switch" v-if="item.name=='Switch'" :class="item.disabled?'input-disabled':''"
           :disabled="item.disabled"
           v-model="item.value"
           @change="onModelValue(item)" />
               :disabled="item.disabled" v-model="item.value" @change="onModelValue(item)" />
         <!-- 日期时间 -->
         <view class="input-wrapper" v-if="(item.name=='TimePicker' || item.name=='DatePicker') && !item.disabled">
            <view class="input-wrapper"
               v-if="(item.name=='TimePicker' || item.name=='DatePicker') && !item.disabled">
            <picker mode="date" class="date_iput" :class="item.disabled?'input-disabled':''" 
              :disabled="item.disabled"
              :value="item.value"
              @change="onModelValue(item)"
            >
                  :disabled="item.disabled" :value="item.value" @change="onModelValue(item)">
               <view class="picker">{{item.value}}</view>
            </picker>
         </view>
@@ -440,53 +460,32 @@
               <view v-if="cols!=null" >
                  <text class="txt_title" :style="{'width':cols.labelWidth+'px'}">{{cols.label}}:</text>
                  <span class="form-item-span" v-if="cols.disabled">{{cols.value}}</span>
                  <view class="input-wrapper" v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled">
                     <text v-if="cols.setting.prefix"
                        class="uni-icon"
                        :class="[cols.setting.prefix]"
                  <view class="input-wrapper"
                     v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled">
                     <text v-if="cols.setting.prefix" class="uni-icon" :class="[cols.setting.prefix]"
                        @change="onchange(cols)">&#xe568;</text>
                     <input class="uni-input" :class="cols.disabled?'input-disabled':''" 
                        :type="cols.name=='Input'?'text':cols.name=='InputNumber'?'number':'text'" 
                        v-model="cols.value"
                        :disabled="cols.disabled"
                        :placeholder="cols.placeholder"
                        v-model="cols.value" :disabled="cols.disabled" :placeholder="cols.placeholder"
                        :style="{'width':cols.setting.prefix && cols.setting.suffix?'78%':cols.setting.prefix || cols.setting.suffix?'87%':'96%'}" 
                        :focus="focusMateria"
                        @focus="ontap(cols)"
                        @blur="onevent(cols)"
                     />
                     <text v-if="cols.setting.suffix"
                        class="uni-icon"
                        :class="[cols.setting.suffix]"
                        :focus="focusMateria" @focus="ontap(cols)" @blur="onevent(cols)" />
                     <text v-if="cols.setting.suffix" class="uni-icon" :class="[cols.setting.suffix]"
                        @click="onchange(cols)">&#xe568;</text>
                  </view>
                  <!-- 下拉框-单选 cols.useDict?cols.dict:cols.selections-->
                  <uni-data-select id="dv_select" v-if="cols.name=='Select' && !cols.disabled"
                     :class="cols.disabled?'input-disabled':''"
                     v-model="cols.value"
                     :localdata="cols.dict"
                     @change="onchange(cols)"
                     :disabled="cols.disabled"
                     :clear="false"
                  ></uni-data-select>
                     :class="cols.disabled?'input-disabled':''" v-model="cols.value" :localdata="cols.dict"
                     @change="onchange(cols)" :disabled="cols.disabled" :clear="false"></uni-data-select>
                  <!-- 多行文本 -->
                  <view class="input-wrapper" v-if="cols.name=='Textarea' && !cols.disabled">
                     <textarea class="uni-input" :value="cols.value"
                       :class="cols.disabled?'input-disabled':''"
                       :placeholder="cols.placeholder"
                       @blur="onModelValue(cols)"
                       style="height:60px;"
                       :style="{'width':'96%'}"
                       :disabled="cols.disabled"
                     ></textarea>
                     <textarea class="uni-input" :value="cols.value" :class="cols.disabled?'input-disabled':''"
                        :placeholder="cols.placeholder" @blur="onModelValue(cols)" style="height:60px;"
                        :style="{'width':'96%'}" :disabled="cols.disabled"></textarea>
                  </view>
                  <!-- 复选框 -->
                  <checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'"
                     :class="cols.disabled?'input-disabled':''"
                     :disabled="item.disabled"
                     @change="onModelValue(cols)"
                     :data-ischeck="cols.value"
                     :style="{'margin-left':'10rpx'}">
                     :class="cols.disabled?'input-disabled':''" :disabled="item.disabled"
                     @change="onModelValue(cols)" :data-ischeck="cols.value" :style="{'margin-left':'10rpx'}">
                     <label>
                        <checkbox :value="cols.value" :checked="cols.value"/>
                        <text>{{cols.label}}</text>
@@ -494,17 +493,13 @@
                  </checkbox-group>
                  <!-- Switch开关 -->
                  <switch v-if="cols.name=='Switch'" :class="cols.disabled?'input-disabled':''"
                     :disabled="item.disabled"
                     v-model="cols.value"
                     @change="onModelValue(cols)"
                     :disabled="item.disabled" v-model="cols.value" @change="onModelValue(cols)"
                     :style="{'margin-left':'10rpx'}"/>
                  <!-- 日期时间 -->
                  <view class="input-wrapper" v-if="(cols.name=='TimePicker' || cols.name=='DatePicker') && !cols.disabled">
                  <view class="input-wrapper"
                     v-if="(cols.name=='TimePicker' || cols.name=='DatePicker') && !cols.disabled">
                     <picker mode="date" class="date_iput" :class="cols.disabled?'input-disabled':''" 
                       :disabled="item.disabled"
                       :value="cols.value"
                       @change="onModelValue(cols)"
                     >
                        :disabled="item.disabled" :value="cols.value" @change="onModelValue(cols)">
                        <view class="picker">{{cols.value}}</view>
                     </picker>
                  </view>
@@ -528,7 +523,8 @@
            :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'}">
                  <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'}">
                     <checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check"
                        :data-index="index" :style="{'margin-left': '10rpx'}">
                        <label>
                           <checkbox :value="item.check" :checked="item.check"/>
                           <text>{{item.name}}</text>
@@ -575,11 +571,14 @@
         items:[]
      }
     },
            after_ok: {},
    };
  },
  onLoad(options) {
   // console.log(options);
   uni.setNavigationBarTitle({ title: options.titlename}); //设置顶部标题
         uni.setNavigationBarTitle({
            title: options.titlename
         }); //设置顶部标题
   this.$data.param = JSON.parse(options.param);
   this.$data.title = this.$data.param.Add_BtnName?this.$data.param.Add_BtnName:options.titlename; //设置按钮文字
   
@@ -605,7 +604,8 @@
                 //mobox2的style_def是json字符串
                 styledef = ret.result.style_def.replace(/\\/g,"");
                 //mobox3的style_def是base64字符串
                 if(!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result.style_def);
                     if (!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result
                        .style_def);
            }
            $this.$data.head_styledef = ret.result.style_def? JSON.parse(styledef): {};
            // console.log($this.$data.head_styledef);
@@ -618,17 +618,32 @@
            if($this.head_styledef.event?.length>0){
              $this.head_styledef.event.forEach(async (a)=>{  //判断是否是初始化事件
                if(a.event_id == "initial"){
                  await this.loadInitEvent(a.scrip_id);
                           await $this.loadInitEvent(a.scrip_id);
                        } else if (a.event_id == 'after_ok') {
                           $this.after_ok = {
                              id: a.scrip_id,
                              name: a.scrip_name
                           };
                }
              });
            }
            
         }else{
            uni.showModal({title:"错误1",content:ret.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误1",
                     content: ret.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         // console.log(ex);
         uni.showModal({title:"错误1.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "错误1.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
        
    },
@@ -669,11 +684,21 @@
            }
            
         }else{
            uni.showModal({title:"错误1.2",content:success.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误1.2",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         // console.log(ex);
         uni.showModal({title:"错误1.3",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "错误1.3",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
   },
   async loadInitEvent(eventid){
@@ -692,13 +717,30 @@
         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:'提示',content:tip,showCancel:false,confirmText:"取消"});
                else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"});
                     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: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     else uni.showModal({
                        title: '提示',
                        content: tip + ',提示:' + data.ret,
                        showCancel: false,
                        confirmText: "取消"
                     });
               return false
            }else{
               var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : '';
               if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
            
               var actionlist = data.action;
               if (actionlist) {
@@ -709,14 +751,20 @@
                        var result = action.value;
                        for (var i = 0; i < result.length; i++) {
                           if (result[i].choice_list) {
                              for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
                                    for (var c = 0; c < $this.head_styledef.form.items
                                       .length; c++) {
                                 var attr = $this.head_styledef.form.items[c];
                                 if(attr.name!='Layout'){
                                   if(attr.fieldId==result[i].attr){
                                      var dictItemList=[];
                                      for(var d in result[i].choice_list){
                                         var val =result[i].choice_list[d];
                                         dictItemList.push({"CN_S_NAME":val,"CN_S_VALUE":val,"text":val,"value":val});
                                                dictItemList.push({
                                                   "CN_S_NAME": val,
                                                   "CN_S_VALUE": val,
                                                   "text": val,
                                                   "value": val
                                                });
                                      }
                                      attr.dict = dictItemList;
                                   }
@@ -725,9 +773,16 @@
                                     if(col){
                                       if(col.fieldId==result[i].attr){
                                          var dictItemList=[];
                                          for(var d in result[i].choice_list){
                                             var val =result[i].choice_list[d];
                                             dictItemList.push({"CN_S_NAME":val,"CN_S_VALUE":val,"text":val,"value":val});
                                                   for (var d in result[i]
                                                      .choice_list) {
                                                      var val = result[i]
                                                         .choice_list[d];
                                                      dictItemList.push({
                                                         "CN_S_NAME": val,
                                                         "CN_S_VALUE": val,
                                                         "text": val,
                                                         "value": val
                                                      });
                                          }
                                          col.dict = dictItemList;
                                       }
@@ -737,12 +792,15 @@
                                 
                              }
                           }
                           for (var c = 0; c < $this.$data.head_styledef.form.items.length; c++) {
                                 for (var c = 0; c < $this.$data.head_styledef.form.items
                                    .length; c++) {
                              var attr = $this.$data.head_styledef.form.items[c];
                              // console.log(attr[j].Name+'=='+result[i].attr);
                              //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据
                              if($this.head_styledef.form.model[result[i].attr]==undefined){
                                   $this.head_styledef.form.model[result[i].attr]=result[i].value;
                                    if ($this.head_styledef.form.model[result[i].attr] ==
                                       undefined) {
                                       $this.head_styledef.form.model[result[i].attr] = result[i]
                                          .value;
                              }
                              //判断是否是栅格表单
                              if(attr.name!='Layout'){
@@ -751,7 +809,8 @@
                                   attr.oldvalue = '';
                                   attr.value = result[i].value;
                                   attr.oldvalue = result[i].value;
                                   $this.head_styledef.form.model[attr.fieldId] =result[i].value;
                                          $this.head_styledef.form.model[attr.fieldId] = result[
                                             i].value;
                                }
                              } else if(attr.name=='Layout'){
                                attr.setting.colList.forEach(col=>{
@@ -761,7 +820,8 @@
                                       col.oldvalue = '';
                                       col.value = result[i].value;
                                       col.oldvalue = result[i].value;
                                       $this.head_styledef.form.model[col.fieldId] =result[i].value;
                                                $this.head_styledef.form.model[col
                                                   .fieldId] = result[i].value;
                                    }
                                  }
                                });
@@ -785,57 +845,102 @@
                     } else if (data.action[i].action_type == 'set_dlg_attr_show') {
                        var result = action.value;
                        result.forEach(async (attr,key) => {
                          $this.$data.head_styledef.form.items.forEach(async (ele,index) => {
                                 $this.$data.head_styledef.form.items.forEach(async (
                                    ele, index) => {
                            //判断是否是栅格表单
                           if(ele.name!='Layout'){
                              if(ele.fieldId==attr.attr){
                                 ele.show=attr.show;
                              }
                           } else if(ele.name=='Layout'){
                              ele.setting.colList.forEach(col=>{
                                       ele.setting.colList.forEach(
                                       col => {
                                 if(col){
                                    if(col.fieldId==attr.attr){
                                       col.show=attr.show;
                                             if (col.fieldId ==
                                                attr.attr) {
                                                col.show = attr
                                                   .show;
                                    }
                                 }
                              });
                           }
                          });
                        });
                        var head_styledef = JSON.parse(JSON.stringify($this.$data.head_styledef));
                              var head_styledef = JSON.parse(JSON.stringify($this.$data
                                 .head_styledef));
                        $this.$data.head_styledef =[];
                        $this.$data.head_styledef = head_styledef;
                        // console.log($this.$data.head_styledef);
                     } else {
                        uni.showModal({title:"提示",content:"执行初始化事件失败:"+item.action_type + '此action尚未处理!',showCancel:false,confirmText:"取消"});
                              uni.showModal({
                                 title: "提示",
                                 content: "执行初始化事件失败:" + item.action_type + '此action尚未处理!',
                                 showCancel: false,
                                 confirmText: "取消"
                              });
                     } 
                  }
               }
            }
         }else{
            uni.showModal({title:"错误3",content:"执行初始化事件失败:"+success.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误3",
                     content: "执行初始化事件失败:" + success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         // console.log(ex);
         uni.showModal({title:"错误3.1",content:"执行初始化事件失败:"+ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "错误3.1",
                  content: "执行初始化事件失败:" + ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
   },
   
      
   ontap(item){ //扫码功能
      // uni.scanCode({
      //   //成功回调
      //   success: function (res) {
      //    //条码类型
      //    console.log(res.scanType);
      //    //条码的值
      //    console.log(res.result);
      //   },//失败回调
      //   fail: function (res) {},
      //   //完成回调
      //   complete: function (res) {},
            // 打开蓝牙适配器
            // uni.openBluetoothAdapter({
            //   success: function() {
            //    // 开始搜索蓝牙设备
            //    uni.startBluetoothDevicesDiscovery({
            //      success: function() {
            //       // 监听找到新设备的事件
            //       uni.onBluetoothDeviceFound(function(devices) {
            //         // 这里可以过滤出RFID芯片,连接并读取数据
            //         console.log(devices[0].deviceId);
      // })
            //      }
            //    })
            //   }
            // });
            // 监听NFC功能是否可用
            // uni.getNFCAdapterState({
            //   success: function(res) {
            //    console.log(res);
            //     if (res.errCode === 0) {
            //       // NFC功能可用,开始监听
            //       uni.onNFCStart((res) => {
            //         if (res.errCode === 0) {
            //           // 开始NFC标签检测
            //           uni.makeNFCReaderStart({
            //             success: function() {
            //               // 监听NFC标签
            //               uni.onNFCTagDiscovered(function(res) {
            //                                 console.log(res);
            //                 // 这里可以处理NFC标签数据
            //               })
            //             }
            //           })
            //         }
            //       })
            //     }
            //   }
            // })
      getApp().onScan((result)=>{
         //console.log(result.decodedata);
         uni.hideKeyboard();
@@ -958,11 +1063,21 @@
      var onSuffixClickEvent = item.bind.onSuffixClickEvent;   //后图标点击回调
      
      if(!onSuffixClickCallbackEvent.id){
         uni.showModal({title:"提示",content:"后图标点击事件为空!",showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "提示",
                  content: "后图标点击事件为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
         return;
      }
      if(!onSuffixClickEvent.id){
         uni.showModal({title:"提示",content:"后图标点击回调为空!",showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "提示",
                  content: "后图标点击回调为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
         return;
      }
      this.$data.popupType = 'right'
@@ -1002,11 +1117,19 @@
            if(name)
               name+=';';
            name+=items[i].name;
            data.push({id:items[i].id,name:items[i].name});
                  data.push({
                     id: items[i].id,
                     name: items[i].name
                  });
         }
      }
      if(!$this.$data.popupParam){
         uni.showModal({title:"提示",content:"popupParam为空!",showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "提示",
                  content: "popupParam为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
         return;
      }
      
@@ -1108,13 +1231,30 @@
         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:'提示',content:tip,showCancel:false,confirmText:"取消"});
                else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"});
                     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: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     else uni.showModal({
                        title: '提示',
                        content: tip + ',提示:' + data.ret,
                        showCancel: false,
                        confirmText: "取消"
                     });
               return false
            }else{
               var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : '';
               if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
            
               var actionlist = data.action;
               if (actionlist) {
@@ -1132,7 +1272,12 @@
                                      var dictItemList=[];
                                      for(var d in result[i].choice_list){
                                         var val =result[i].choice_list[d];
                                         dictItemList.push({"CN_S_NAME":val,"CN_S_VALUE":val,"text":val,"value":val});
                                                dictItemList.push({
                                                   "CN_S_NAME": val,
                                                   "CN_S_VALUE": val,
                                                   "text": val,
                                                   "value": val
                                                });
                                      }
                                      attr.dict = dictItemList;
                                   }
@@ -1143,7 +1288,12 @@
                                          var dictItemList=[];
                                          for(var d in result[i].choice_list){
                                             var val =result[i].choice_list[d];
                                             dictItemList.push({"CN_S_NAME":val,"CN_S_VALUE":val,"text":val,"value":val});
                                                      dictItemList.push({
                                                         "CN_S_NAME": val,
                                                         "CN_S_VALUE": val,
                                                         "text": val,
                                                         "value": val
                                                      });
                                          }
                                          col.dict = dictItemList;
                                       }
@@ -1158,7 +1308,8 @@
                              // console.log(attr[j].Name+'=='+result[i].attr);
                              //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据
                              if($this.head_styledef.form.model[result[i].attr]==undefined){
                                   $this.head_styledef.form.model[result[i].attr]=result[i].value;
                                       $this.head_styledef.form.model[result[i].attr] = result[i]
                                          .value;
                              }
                              //判断是否是栅格表单
                              if(attr.name!='Layout'){
@@ -1167,7 +1318,8 @@
                                   attr.oldvalue = '';
                                   attr.value = result[i].value;
                                   attr.oldvalue = result[i].value;
                                   $this.head_styledef.form.model[attr.fieldId] =result[i].value;
                                          $this.head_styledef.form.model[attr.fieldId] = result[i]
                                             .value;
                                }
                              } else if(attr.name=='Layout'){
                                attr.setting.colList.forEach(col=>{
@@ -1177,7 +1329,8 @@
                                       col.oldvalue = '';
                                       col.value = result[i].value;
                                       col.oldvalue = result[i].value;
                                       $this.head_styledef.form.model[col.fieldId] =result[i].value;
                                                $this.head_styledef.form.model[col
                                                   .fieldId] = result[i].value;
                                    }
                                  }
                                });
@@ -1201,7 +1354,8 @@
                     } else if (action.action_type == 'set_dlg_attr_show') {
                        var result = action.value;
                        result.forEach(async (attr,key) => {
                          $this.$data.head_styledef.form.items.forEach(async (ele,index) => {
                                 $this.$data.head_styledef.form.items.forEach(async (ele,
                                    index) => {
                            //判断是否是栅格表单
                           if(ele.name!='Layout'){
                              if(ele.fieldId==attr.attr){
@@ -1210,8 +1364,10 @@
                           } else if(ele.name=='Layout'){
                              ele.setting.colList.forEach(col=>{
                                 if(col){
                                    if(col.fieldId==attr.attr){
                                       col.show=attr.show;
                                             if (col.fieldId == attr
                                                .attr) {
                                                col.show = attr
                                                   .show;
                                    }
                                 }
                              });
@@ -1225,7 +1381,12 @@
                     } else if (action.action_type == 'set_global_attr') {
                        $this.$data.global_attr = action.value || [];
                     } else {
                        uni.showModal({title:"提示",content:action.action_type + '此action尚未处理!',showCancel:false,confirmText:"取消"});
                              uni.showModal({
                                 title: "提示",
                                 content: action.action_type + '此action尚未处理!',
                                 showCancel: false,
                                 confirmText: "取消"
                              });
                     } 
                  }
               }
@@ -1260,7 +1421,8 @@
                                 col.oldvalue = '';
                                 col.value = result[i].value;
                                 col.oldvalue = result[i].value;
                                 $this.head_styledef.form.model[col.fieldId] =result[i].value;
                                          $this.head_styledef.form.model[col.fieldId] =
                                             result[i].value;
                              }
                            }
                          });
@@ -1285,11 +1447,21 @@
               }
            }
         }else{
            uni.showModal({title:"错误3",content:success.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误3",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         // console.log(ex);
         uni.showModal({title:"错误3.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "错误3.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
   },
   DataObjRunCustomEvent_Return(eventid,data_attr,button_callback,item){
@@ -1315,7 +1487,10 @@
                  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 });
                     req.push({
                        'attr': this.$data.refdatastore[i].attr,
                        'val': this.$data.refdatastore[i].value
                     });
              }
          }
      }
@@ -1362,13 +1537,30 @@
         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:'提示',content:tip,showCancel:false,confirmText:"取消"});
                else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"});
                     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: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     else uni.showModal({
                        title: '提示',
                        content: tip + ',提示:' + data.ret,
                        showCancel: false,
                        confirmText: "取消"
                     });
               return false
            }else{
               var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : '';
               if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
            
               if (data != "") {
               var actions = data.action;
@@ -1381,12 +1573,12 @@
                     
                     if (action.action_type == 'open_panel') {
                        var d = dialog({
                           title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示',
                                    title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                       '提示',
                           content: action.action_type + '此action尚未处理!'
                        });
                        d.show();
                     }
                     else if (action.action_type == 'open_select_userdlg') {
                              } else if (action.action_type == 'open_select_userdlg') {
                        var style = val.style;
                        // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : ''
                        var $this = this;
@@ -1397,12 +1589,14 @@
                           data_attr:data_attr
                        }
                        uni.navigateTo({
                           url:'../selpsn/index?mulit=false&param='+JSON.stringify(param),
                                    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 callback_eventid = param.button_callback
                                       .trim();
                                 var info = {
                                    eventid: callback_eventid,
                                    edtype: "0",
@@ -1420,15 +1614,14 @@
                              }
                           }
                        });   
                     }
                     else if (action.action_type == 'open_data_query_dlg') {
                              } else if (action.action_type == 'open_data_query_dlg') {
                        var d = dialog({
                           title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示',
                                    title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                       '提示',
                           content: action.action_type + '此action尚未处理!'
                        });
                        d.show();
                     }
                     else if (action.action_type == 'open_common_dlg') {
                              } else if (action.action_type == 'open_common_dlg') {
                        var $this = this;
                        if(val.common_dlg_id == 'check_list'){
                           $this.$data.check_list= val.config;
@@ -1446,8 +1639,7 @@
                           }
                           $this.$data.popupParam= popupParam;
                        }
                     }
                     else if (action.action_type == 'open_project_query_dlg') {
                              } else if (action.action_type == 'open_project_query_dlg') {
                        //console.log(action.value.select_range);
                        //console.log(action.value.mulit_select);
                        var priRel = '-1';
@@ -1457,7 +1649,8 @@
                           priRel = '1';
                        else if (action.value.select_range == '我创建的')
                           priRel = '2';
                        else if (action.value.select_range == '我参与的' || action.value.select_range == '我参加的')
                                 else if (action.value.select_range == '我参与的' || action.value
                                    .select_range == '我参加的')
                           priRel = '3';
                        else if (action.value.select_range == '我关注的')
                           priRel = '4';
@@ -1471,15 +1664,18 @@
                           req:req
                        }
                        uni.navigateTo({
                           url:'../selPrj/index?relation='+priRel+'&param='+JSON.stringify(param_),
                                    url: '../selPrj/index?relation=' + priRel + '&param=' +
                                       JSON.stringify(param_),
                           events:{
                              AddPer(data,param){ 
                                 var attr = param.item.fieldId;
                                 $this.head_styledef.form.model[attr] = data[0].ID+';'+data[0].Name;
                                          $this.head_styledef.form.model[attr] = data[0].ID +
                                             ';' + data[0].Name;
                                 
                                 // $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();
                                          var callback_eventid = param.button_callback
                                       .trim();
                                 if (callback_eventid) {
                                    var info = {
                                       eventid: callback_eventid,
@@ -1499,31 +1695,52 @@
                              }
                           }
                        });
                     }
                     else {
                        uni.showModal({title:"提示",content:action.action_type + '此action尚未处理!',showCancel:false,confirmText:"取消"});
                              } else {
                                 uni.showModal({
                                    title: "提示",
                                    content: action.action_type + '此action尚未处理!',
                                    showCancel: false,
                                    confirmText: "取消"
                                 });
                     } 
                  }
               }
               }else{
                  uni.showModal({title:"提示5.2",content: '调用 before_click_button 脚本返回空,event_id' + eventid,showCancel:false,confirmText:"取消"});
                        uni.showModal({
                           title: "提示5.2",
                           content: '调用 before_click_button 脚本返回空,event_id' + eventid,
                           showCancel: false,
                           confirmText: "取消"
                        });
               }
            }
         }else{
            uni.showModal({title:"错误5",content:success.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误5",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         // console.log(ex);
         uni.showModal({title:"提示5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "提示5.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
   },
   
   //确定
   sava(){
      // if (this.$data.edit_ok_event)
      //    this.OKDataObjRunCustomEvent();
      // else
            if (this.after_ok?.id) { // 点击确定按钮后
               this.afterOK();
            } else {
         this.add();
            }
   },
   add(){
      uni.showLoading({
@@ -1581,35 +1798,146 @@
               console.log(action);
               if(action.ret=='0'){
                  if (action.ret != 0) {
                     uni.showModal({title:"提示",content:'执行脚本失败,' + action.result,showCancel:false,confirmText:"取消"});
                           uni.showModal({
                              title: "提示",
                              content: '执行脚本失败,' + action.result,
                              showCancel: false,
                              confirmText: "取消"
                           });
                     return;
                  }
                  if (action.info) {
                     uni.showModal({title:"提示",content:'执行脚本失败,' + action.info,showCancel:false,confirmText:"取消"});
                           uni.showModal({
                              title: "提示",
                              content: '执行脚本失败,' + action.info,
                              showCancel: false,
                              confirmText: "取消"
                           });
                     return;
                  }
                  if(action.result_type=='0'){
                     uni.showToast({title:action.result,icon:"success",duration:3000});
                           uni.showToast({
                              title: action.result,
                              icon: "success",
                              duration: 3000
                           });
                  } 
                  
                  // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}"
               }
            } else
               uni.showToast({title:"创建成功!",icon:"success",duration:3000});
                     uni.showToast({
                        title: "创建成功!",
                        icon: "success",
                        duration: 3000
                     });
            //刷新
            uni.redirectTo({
               url:'../modal/3018_2?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title
                     url: '../modal/3018_2?param=' + JSON.stringify(this.$data.param) +
                        "&titlename=" + this.$data.title
            });
            // this.class_attr_init();
         }else{
            uni.showModal({title:"错误",content:success.err_msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: "错误",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
         }
      }).catch(ex=>{
         console.log(ex);
         uni.hideLoading();
         uni.showModal({title:"提示",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: "提示",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
      });
   },
         afterOK() {
            var obj_attr = this.head_styledef.form.model;
            // console.log(obj_attr);
            var input_param = {
               id: "",
               attrs: Object.keys(obj_attr).map((a) => ({
                  attr: a,
                  value: obj_attr[a],
               })),
            };
            if (!this.after_ok.id.includes('{')) this.after_ok.id = '{' + this.after_ok.id + '}';
            var dataInfo = {
               ed_type: "0",
               start_transaction: true,
               class_id: this.$data.param.DataCls.id,
               class_name: '',
               event_id: this.after_ok.id,
               event_name: '',
               data_obj_id: '',
               obj_attr: obj_attr,
               prj_id: '',
               ref_cls_id: '',
               rel_obj_id: '',
               user_login: '',
               data_json: '',
               compose_info: '',
               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 (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: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     else uni.showModal({
                        title: '提示',
                        content: tip + ',提示:' + data.ret,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     return false
                  } else {
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: '提示',
                        content: tip,
                        showCancel: false,
                        confirmText: "取消"
                     });
                     var result = data.result;
                  }
               } else {
                  uni.showModal({
                     title: "错误7",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: "取消"
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "提示7.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
            });
         },
   cancel(e){ //取消
      uni.navigateBack({
         delta:1 //返回层数,2则上上页