Luolei 6 år sedan
förälder
incheckning
cf66c47fa6
3 ändrade filer med 42 tillägg och 33 borttagningar
  1. 7 9
      src/components/icss/PubTagGroup.vue
  2. 32 24
      src/components/icss/PubTagPartDetail.vue
  3. 3 0
      src/less/common.less

+ 7 - 9
src/components/icss/PubTagGroup.vue

@@ -312,10 +312,6 @@ export default {
       systom:null,      //标签系统名称存在与否
     }
   },
-  beforeDestroy:function(){
-    console.log(995)
-    this.searchVal = ''
-  },
   computed: {
     newSex() {
       return this.form.region7;
@@ -371,14 +367,16 @@ export default {
     },
     searchTagList() {
       let region1 = this.form.region1, region2 = this.form.region2;
-      let param1 = !!region2 ? api.getGroupParams(region2): {};
-      let param2 = {
+      let paramFst = !!region2 ? api.getGroupParams(region2): {};
+      let paramSec = {
         "type": region1,
         "sexType": this.form.region7,
+        "tagName":'',
+        "notIds": [],
       }
-      let param = Object.assign(param1,param2)
-
-      api.searchTagList(param).then((res) => {
+      console.log(paramFst,paramSec,7787)
+      let params = Object.assign({},paramFst,paramSec)
+      api.searchTagList(params).then((res) => {
         if (res.data.code === '0') {
           this.form.tagPool = res.data.data
         }

+ 32 - 24
src/components/icss/PubTagPartDetail.vue

@@ -37,7 +37,7 @@
           v-if="choose == 'single'"
         >
           <template v-for="item in poolDetailList[0]">
-            <span class="hzx ellipsis" v-for="part in item.questionDetailList" :title="'[ '+item.name+' ]'" :key="part.id">{{part.name}}</span>
+            <!-- <span class="hzx ellipsis" v-for="part in item.questionDetailList" :title="'[ '+item.name+' ]'" :key="part.id">{{part.name}}</span> -->
           </template>
         </div>
         <div
@@ -46,14 +46,14 @@
           @click="selectPart(0)"
           v-else
         >
-          <span class="hzx ellipsis" v-for="item in poolDetailList[0][0].questionDetailList" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span>
+          <!-- <span class="hzx ellipsis" v-for="item in poolDetailList[0][0].questionDetailList" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span> -->
         </div>
         <div class="onlyBottom pubList">
           <ul class="clearfix">
             <li v-for="n in 5"
               :key="n + 'part'"
               class="onlyBottomPart "
-              :class="selectArr[n]?'activeBgc':null"
+              :class="selectArr[n]?'activeBgc':(n==1 && sign == 6?'activeBgcF5':'')"
               :style="{borderRight:n==5?'0':''}"
               @click="selectPart(n)"
             >
@@ -89,7 +89,7 @@
                   <span v-if="item.type == section.val" :title="section.name" :key="section.val">{{section.name}}</span>         
                 </template>
               </p>        
-              <p class="partDetail tipsWrap" :title="item.join" :key="item.join+'--'" v-if="!!item.join">标签之间链接{{item.join}}</p> 
+              <p class="partDetail tipsWrap" :title="item.join" :key="item.join+'--'" v-if="!!item.join">标签之间链接{{item.join}}</p>
               <p class="partDetail tipsWrap" :title="item.name" :key="item.type+'--'" v-if="!!item.name">{{item.name}}</p> 
             </template>
           </li>
@@ -134,11 +134,6 @@ export default {
         type: Array
     }
   },
-
-  beforeDestroy:function(){
-    console.log(99)
-    this.searchVal = ''
-  },
   data() {
     return {
       poolDetailList: [[{questionDetailList:[]}],[{questionDetailList:[]}],[],[],[],[]],     //默认6个部分
@@ -255,11 +250,6 @@ export default {
         this.clearData()
       }
     },
-    type(newVal, preVal) {
-      if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
-        // this.clearData()
-      }
-    },
     searchVal(newVal, preVal){
       if(newVal.trim() == ''){
         this.searchTagList();
@@ -270,7 +260,7 @@ export default {
   },
   methods: {
     clearData(){
-        this.poolDetailList = [[],[],[],[],[],[]]
+        this.poolDetailList = [[{questionDetailList:[]}],[{questionDetailList:[]}],[],[],[],[]]
         this.poolDetailListTips = [[],[],[],[],[],[]]
         this.poolDetailListIds = [[],[],[],[],[],[]]
         this.poolDetailListAll=[]
@@ -546,7 +536,16 @@ export default {
                     }
                   }
                 }else{
-                  this.poolDetailList[idx] = (this.poolDetailList[idx]).concat(tmpArr);
+                  if(tmpArr[0].tagType == 1){
+                    this.$message({
+                        showClose: true,
+                        message: '添加的数据有误',
+                        type: 'warning'
+                    });
+                    return
+                  }else{
+                    this.poolDetailList[idx] = (this.poolDetailList[idx]).concat(tmpArr);
+                  }
                 }
                 this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
                 this.searchTagList();
@@ -554,14 +553,23 @@ export default {
               }else{
                 ++num;
                 if(num == 6){
-                  for(let i = 2;i < this.poolDetailList.length;i++){
-                    let ids = [];
-                    if(this.poolDetailList[i].length == 0){      //判断part里面是不是有数据,没有直接添加
-                      this.poolDetailList[i] = tmpArr;
-                      this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);
-                      this.searchTagList();
-                      this.getPoolDetailListTips();
-                      return;
+                  if(tmpArr[0].tagType == 1){
+                    this.$message({
+                        showClose: true,
+                        message: '添加的数据有误',
+                        type: 'warning'
+                    });
+                    return
+                  }else{
+                    for(let i = 2;i < this.poolDetailList.length;i++){
+                      let ids = [];
+                      if(this.poolDetailList[i].length == 0){      //判断part里面是不是有数据,没有直接添加
+                        this.poolDetailList[i] = tmpArr;
+                        this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);
+                        this.searchTagList();
+                        this.getPoolDetailListTips();
+                        return;
+                      }
                     }
                   }
                 }

+ 3 - 0
src/less/common.less

@@ -169,4 +169,7 @@
 /* 选中状态边框颜色改变 */
 .activeBgc {
   background-color: #eae7e7;
+}
+.activeBgcF5 {
+  background-color: #f5f5f5;
 }