jt
2023-05-11 9bcb6b47a130099d65dc0b55d2c2addd8b9191ca
pages/modal/classAttr.vue
@@ -270,7 +270,7 @@
                     <i class="i_tishi" v-if="attr.notempty==true">*</i>
                  </view>
               </view>
               <view class="form-group" v-if="attr.Type=='字典' || attr.Type=='字典-字符串'" :style="{'display':attr.hidden == true?'none':''}">
               <view class="form-group" v-if="attr.Type=='字典' || attr.Type=='字典-字符串' || attr.Type=='字典-整数'" :style="{'display':attr.hidden == true?'none':''}">
                  <view v-if="classattr.control_style=='上下布局'">
                     <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text>
                     <picker class="section_iput" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" v-if="attr.select==false" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true">
@@ -283,7 +283,7 @@
                     <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" v-if="attr.select==false" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}">
                        <label class="">{{ attr.Value }}</label>
                     </picker>
                     <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"></select-cy>
                     <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" :data-index="index" :data-iindex="iindex" :style="{'display':'inline-block','margin-left':'8px','width':attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"></select-cy>
                     <i class="i_tishi" v-if="attr.notempty==true">*</i>
                  </view>
               </view>
@@ -399,7 +399,7 @@
            edit_compose_cls_id:"",
            global_attr:[],
            refdatastore: [],      //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id}
            inputValList:[{Name:"test"},{Name:"test2"},{Name:"test3"},{Name:"test4"},{Name:"test5"},{Name:"test6"},{Name:"test7"}],
            inputValList:[{Name:"test"},{Name:"test2"},{Name:"test3"},{Name:"test4"},{Name:"test5"},{Name:"test6"},{Name:"test7"}]
         }
      },
      onLoad(options) {
@@ -503,13 +503,13 @@
            this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.target.value;
         },
         onchange(e) {
            console.log(e.target);
            // console.log(e.target);
            var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e.target.value];
            var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']];
            console.log(data_attr);
            if (value.Name != data_attr.Value) {
               this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value.Name;
               console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
               // console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value);
               var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
               if (eventid) {
                    // self.event_no_sub = 1;
@@ -553,10 +553,8 @@
               var index ,iindex,dindex=0;
               for(var i in this.$data.classAttrList){
                  for(var j in this.$data.classAttrList[i].Attr){
                     for(var d in this.$data.classAttrList[i].Attr[j].dictitem){
                        if(delvalue[0].Name == this.$data.classAttrList[i].Attr[j].dictitem[d].Name){
                           this.$data.classAttrList[i].Attr[j].Value="";
                        }
                     if(delvalue[0].attr == this.$data.classAttrList[i].Attr[j].Name){
                        this.$data.classAttrList[i].Attr[j].Value="";
                     }
                  }
               }
@@ -566,10 +564,8 @@
               var index ,iindex,dindex=0;
               for(var i in this.$data.classAttrList){
                  for(var j in this.$data.classAttrList[i].Attr){
                     for(var d in this.$data.classAttrList[i].Attr[j].dictitem){
                        if(item[v].Name == this.$data.classAttrList[i].Attr[j].dictitem[d].Name){
                           index=i;iindex=j;dindex=d;
                        }
                     if(item[v].attr == this.$data.classAttrList[i].Attr[j].Name){
                        index=i;iindex=j;dindex=d;
                     }
                  }
               }
@@ -579,7 +575,7 @@
               console.log(data_attr);
               if (itemvalue.Name != data_attr.Value) {
                  this.$data.classAttrList[index].Attr[iindex].Value=value;
                  console.log(this.$data.classAttrList[index].Attr[iindex].Value);
                  // console.log(this.$data.classAttrList[index].Attr[iindex].Value);
                  var eventid = this.$data.classAttrList[index].Attr[iindex].action;
                  if (eventid) {
                       // self.event_no_sub = 1;
@@ -595,7 +591,7 @@
                                req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' });
                             else if(ar.Type=='布尔值')
                              req.push({ attr: ar.Name, val: ar.Value?'1':'0'});
                             else if(ar.Type=='字典' || ar.Type=='字典-字符串')
                             else if(ar.Type=='字典' || ar.Type=='字典-字符串' || ar.Type=='字典-整数')
                              req.push({ attr: ar.Name, val: itemvalue.Name});
                             else
                                req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''});
@@ -814,7 +810,8 @@
         },
         add(){
            uni.showLoading({
               title:"加载中..."
               title:"加载中...",
               mask:true
            });
            var req=[];
            var attrlist = this.$data.classAttrList;
@@ -829,7 +826,7 @@
                       req.push({ name: ar.Name, value: ar.ValID ?ar.ValID :'' });
                    else if(ar.Type=='布尔值')
                     req.push({ name: ar.Name, value: ar.Value?'1':'0'});
                    else if(ar.Type=='字典' || ar.Type=='字典-字符串'){
                    else if(ar.Type=='字典' || ar.Type=='字典-字符串' || ar.Type=='字典-整数'){
                     if(ar.select==true){ //判断下拉是否多选
                        var valStr ="";
                        for(var v in ar.Value){
@@ -943,6 +940,7 @@
                                    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;
                                    }
@@ -1089,7 +1087,7 @@
                                    for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) {
                                       var ca = this.$data.classAttrList[a].Attr[l];
                                       if (val[i].attr  == ca.Name) {
                                          if(ca.Type=='字典' || ca.Type=='字典-字符串'){
                                          if(ca.Type=='字典' || ca.Type=='字典-字符串' || ca.Type=='字典-整数'){
                                             var dictItemList=[];
                                             for(var d in val[i].choice_list){
                                                var list_val =val[i].choice_list[d];
@@ -1192,7 +1190,7 @@
                                    var attr = $this.$data.classAttrList[c].Attr;
                                    for (var j = 0; j < attr.length; j++) {
                                       if(attr[j].Name==result[i].attr){
                                          if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串'){
                                          if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串' || attr[j].Type=='字典-整数'){
                                             var dictItemList=[];
                                             for(var d in result[i].choice_list){
                                                var val =result[i].choice_list[d];