Ver código fonte

标签组修改

Luolei 6 anos atrás
pai
commit
14e739f9bc

+ 4 - 1
src/components/icss/InspactTagGroup.vue

@@ -82,8 +82,12 @@ export default {
         }
     },
     mounted() {
+      this.$nextTick(()=>{
+        this.rightTagsList = this.options
         this.rightTagsList2 = this.options
+        this.$emit('changeActionData',this.options, false);
         this.searchTagList()
+      })
     },
     watch: {
         pool(newVal, preVal) {
@@ -191,7 +195,6 @@ export default {
                 if(this.rightTagsList[i].id) {
                     notIds.push(this.rightTagsList[i].id)
                 }
-                
             }
             let param = {
                 "tagName": this.searchVal,

+ 0 - 1
src/components/icss/NoiseTemplate.vue

@@ -162,7 +162,6 @@ export default {
         });
         return;
       }
-
       let detailLis = utils.dataRecombination(this.sendIds, this.dataPub.region2)
       let param = {
         "questionWrapper": {

+ 1 - 1
src/components/icss/PubTagGroup.vue

@@ -298,7 +298,7 @@ export default {
     newType(nextVal, prevVal) {
       this.tmpOwn = prevVal;
       if (nextVal != prevVal) {
-        this.searchTagList()
+        // this.searchTagList()
       }
     },
     newSign(nextVal, prevVal) {

+ 44 - 11
src/components/icss/PubTagPartDetail.vue

@@ -146,12 +146,39 @@ export default {
       notIds:[],               //去重IDs
       multipleItem:[],         //右侧选中的单条标签
       currentTipLis:[],         //右侧选中的标签提示
+      tmpNum:0,
     }
   },
   mounted(){
-    console.log(this.options)
-    this.poolDetailList = []
-    this.searchTagList()
+    this.$nextTick(()=>{
+      let tagList = this.options;
+      if(tagList.length > 0){
+        let tmpArr = [[],[],[],[],[],[]];
+        this.tmpNum = 1
+        if(tagList[0].formPosition == 1){
+          tagList.map((val,idx)=>{
+            if(this.sign == 2) {     //杂音修改
+                tmpArr[idx].push(val)
+            }else{       //既往史修改
+              tmpArr[idx] = val.questionMapping
+            }
+          })
+        }else{
+          tagList.map((val,idx)=>{
+            if(this.sign == 2) {     //杂音修改
+                tmpArr[idx+1].push(val)
+            }else{       //既往史修改
+              tmpArr[idx+1] = val.questionMapping
+            }
+          })
+        }
+        
+        this.poolDetailList = tmpArr
+        this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
+        this.searchTagList()
+        this.getPoolDetailListTips();
+      }
+    })
   },
   watch: {
     pool(newVal, preVal) {
@@ -163,17 +190,19 @@ export default {
       }
     },
     sexType(newVal, preVal) {
-      if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
-        this.clearData()
+      if (newVal != preVal) {
+        if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
+          this.clearData()
+        }
       }
     },
     sign(newVal, preVal) {
-      if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
-        // this.clearData()
+      if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
+        this.clearData()
       }
     },
     type(newVal, preVal) {
-      if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+      if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
         // this.clearData()
       }
     },
@@ -202,11 +231,14 @@ export default {
     },
     selectTagOne(e,id,n){
       e.stopPropagation()
+      if(this.activePartSon != n){
+        this.multipleItem = []
+      }
       this.activePartSon = n
       this.activePart = -1
       this.selectArr = [false, false, false, false, false, false]
       this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
-      if(utils.filterArr(this.multipleItem,id,2)){
+      if(utils.filterArr(this.multipleItem,id,2)){     //选中的有没有单列的小项,有去掉
         let tmpArr = utils.filterArr(this.multipleItem,id,1);
         this.multipleItem = tmpArr;
       }else{
@@ -308,6 +340,7 @@ export default {
         "tagType": this.sign == 2?[1]:(this.sign == 6?[1,2,3,4,10]:[]),
         "controlType":this.sign == 2?[1,2]:[],
         "sexType": this.sexType,
+        "notTagType":[8],        //去掉文字标签查重
       }
       api.searchTagList(param).then((res) => {
         if (res.data.code === '0') {
@@ -394,7 +427,7 @@ export default {
             tmpArr.push(res.data.data[idStr]);
             this.selectArr.map((flg,idx)=>{         //判断右侧有没有选中
               if(flg){    //有选中
-                if(idx == 0 && res.data.data[idStr].questionDetailList && res.data.data[idStr].questionDetailList.length > 1){
+                if(idx == 0 && res.data.data[idStr].questionDetailList && res.data.data[idStr].questionDetailList.length != 1){
                   this.$message({
                     showClose: true,
                     message: '添加的数据有误',
@@ -424,7 +457,7 @@ export default {
               }
               this.currentLis = [];       //左侧选中数据清空
             })
-            console.log('单选的数据',this.poolDetailList)
+            // console.log('单选的数据',this.poolDetailList)
           }else{           //判断是多选
             let num = 0,tmpArr = [];
             this.currentLis.map((id)=>{