Browse Source

去掉弹窗

Luolei 6 years ago
parent
commit
0589cb8c85

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

@@ -18,6 +18,7 @@
         :type="dataPub.region1"
         :sign="dataPub.region2"
         :order="dataPub.order"
+        :sexType="dataPub.region7"
         :tipLis="dataPub.tipLis"
         :choose="dataPub.region2 == 6?'multiple':'single'"
         v-show="dataPub.region2 == 2 || dataPub.region2 == 6"
@@ -172,7 +173,7 @@ export default {
         type: 'warning'
       }).then(() => {
         resolve();
-      }).catch(() => { });
+      }).catch(() => {});
     },
     warning(msg, type) {
       this.$message({

+ 71 - 34
src/components/icss/PubTagGroup.vue

@@ -11,10 +11,11 @@
         label="选择归属:"
         prop="region1"
       >
+        <span class="changeTips">改变归属后,标签明细将会恢复到默认状态</span>
         <el-select
           v-model="form.region1"
           placeholder="请选择归属"
-          @change="sendData"
+          @change="(e)=>readyChangeSelect(e,1)"
         >
           <el-option
             v-for="item in Adscriptions"
@@ -28,10 +29,11 @@
         label="选择填写单类型:"
         prop="region2"
       >
+        <span class="changeTips">改变类型后,标签明细将会恢复到默认状态</span>
         <el-select
           v-model="form.region2"
           placeholder="请选择填写单类型"
-          @change="changeType"
+          @change="(e)=>readyChangeSelect(e,2)"
         >
           <el-option
             v-for="item in labelTypes"
@@ -96,9 +98,10 @@
         label="性别:"
         prop="region7"
       >
+        <span class="changeTips">改变性别后,标签明细将会恢复到默认状态</span>
         <el-select
           v-model="form.region7"
-          @change="readyChangeSex"
+          @change="(e)=>readyChangeSelect(e,3)"
         >
           <el-option
             label="通用"
@@ -213,6 +216,8 @@ export default {
         ],
       },
       tmpSex: '通用',
+      tmpOwn: '',
+      tmpType: '',
       Adscriptions: [],
       labelTypes: [],
       labelTypesList: [],
@@ -242,11 +247,13 @@ export default {
       this.tmpSex = prevVal;
     },
     newType(nextVal, prevVal) {
+      this.tmpOwn = prevVal;
       if (nextVal != prevVal) {
         this.searchTagList()
       }
     },
     newSign(nextVal, prevVal) {
+      this.tmpType = prevVal;
       if (nextVal != prevVal && JSON.stringify(this.form.tagPool) != '[]' ) {
         this.searchTagList()
       }
@@ -264,11 +271,12 @@ export default {
       })
     },
     searchTagList() {
-      let region1 = this.form.region1,region2 = this.form.region2;
+      let region1 = this.form.region1, region2 = this.form.region2;
       let param = {
         "type": region1,
-        // "tagType": region2 == 2?[1]:[],
+        "tagType": region2 == 2?[1]:(region2 == 6?[1,2,3,4,10]:[]),
         "controlType":region2 == 2?[1,2]:[],
+        "sexType": this.form.region7,
       }
       api.searchTagList(param).then((res) => {
         if (res.data.code === '0') {
@@ -299,36 +307,51 @@ export default {
       this.$emit('changeVal', this.form, false)
       this.$emit('changeType', type, false)
     },
-    changeSex(sex) {   //改变性别清空数据
-      this.form = {
-        region1: '',
-        region2: '',
-        region3: '',
-        region4: '',
-        region5: '',
-        region6: '1',
-        region7: sex,
-        region8: '0',
-        region9: '200',
-        region10: '0',
-        region11: '1',
-        tagPool:[]
-      }
+    changeSex(data) {   //改变性别清空数据
       this.$emit('changeVal', this.form, false)
-      this.$emit('changeSex', sex, false)
+      this.$emit('changeSex', data, false)
+      this.searchTagList()
     },
-    readyChangeSex(data) {
-      let sex = data;
-      this.$confirm('改变性别后,所填信息将会回复到默认状态?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'cancelColor',
-        type: 'warning'
-      }).then(() => {
-        this.changeSex(sex);
-      }).catch(() => {
-        this.form.region7 = this.tmpSex;
-      });
+    readyChangeSelect(tmpData,type) {
+      console.log(tmpData)
+      this.changeSex(tmpData);
+      // if(type == 3){
+      //   this.form.region7 = this.tmpSex;
+      //   this.$alert('改变性别后,标签明细将会恢复到默认状态?', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonClass: 'cancelColor',
+      //     type: 'warning'
+      //   }).then(() => {
+      //     this.form.region7 = tmpData
+      //     this.changeSex(tmpData);
+      //   }).catch(() => {
+      //     // this.form.region7 = this.tmpSex;
+      //   });
+      // }else if(type == 2){
+      //   this.form.region2 = this.tmpType
+      //   this.$alert('改变类型后,标签明细将会恢复到默认状态?', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonClass: 'cancelColor',
+      //     type: 'warning'
+      //   }).then(() => {
+      //     this.form.region2 = tmpData;
+      //     this.changeSex(tmpData);
+      //   }).catch(() => {
+      //     // this.form.region2 = this.tmpType;
+      //   });
+      // }else if(type == 1){
+      //   this.form.region1 = this.tmpOwn;
+      //   this.$alert('改变归属后,标签明细将会恢复到默认状态?', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonClass: 'cancelColor',
+      //     type: 'warning'
+      //   }).then(() => {
+      //     this.form.region1 = tmpData;
+      //     this.changeSex(tmpData);
+      //   }).catch(() => {
+      //     // this.form.region1 = this.tmpOwn;
+      //   });
+      // }
     },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
@@ -339,7 +362,14 @@ export default {
           return false;
         }
       });
-    }
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      })
+    },
   }
 }
 </script>
@@ -393,6 +423,13 @@ export default {
   .cancelColor {
     color: #22ccc8 !important;
   }
+  .changeTips {
+    position: absolute;
+    left: 220px;
+    min-width: 300px;
+    color: #ea7777;
+    font-size: 12px;
+  }
 }
 </style>
 

+ 27 - 4
src/components/icss/PubTagPartDetail.vue

@@ -77,10 +77,10 @@
       </div>
       <div class="partWaring">
         <ul>
-          <li class="ellipsis" v-for="i in 5" :key="i">
-            <p v-for="item in poolDetailListTips[i]" class="partDetail tipsWrap" v-show="poolDetailListTips[i].length > 0" :key="item">
+          <li v-for="i in 5" :key="i">
+            <p v-for="item in poolDetailListTips[i]" class="partDetail tipsWrap ellipsis" v-show="poolDetailListTips[i].length > 0" :key="item">
               <template v-for="section in currentTipLis">
-                <span class="tips" v-if="item == section.val" :title="section.name">{{section.name}}</span>         
+                <span class="tips" v-if="item == section.val" :title="section.name" :key="section.val">{{section.name}}</span>         
               </template>
             </p>
           </li>
@@ -108,6 +108,10 @@ export default {
       default: '',
       type: String
     },
+    sexType: {
+      default: '',
+      type: String
+    },
     sign: {
       default: '',
       type: String
@@ -146,6 +150,24 @@ export default {
         this.currentTipLis = newVal
       }
     },
+    sexType(newVal, preVal) {
+      if (newVal != preVal) {
+        if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+          this.poolDetailList = [[],[],[],[],[],[]]
+          this.poolDetailListTips = [[],[],[],[],[],[]]
+          this.poolDetailListIds = [[],[],[],[],[],[]]
+          this.poolDetailListAll=[]
+          this.activePart='-1'
+          this.activePartSon='-1'
+          this.selectArr = [false, false, false, false, false, false]
+          this.searchVal= ''
+          this.currentPool= []        
+          this.currentLis=[]           
+          this.notIds=[]               
+          this.multipleItem=[]
+        }
+      }
+    },
     sign(newVal, preVal) {
       if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
         this.poolDetailList = [[],[],[],[],[],[]]
@@ -285,8 +307,9 @@ export default {
         "tagName": this.searchVal || '',
         "type": this.type,
         "notIds": this.notIds,
-        "tagType": this.sign == 2?[1]:[],
+        "tagType": this.sign == 2?[1]:(this.sign == 6?[1,2,3,4,10]:[]),
         "controlType":this.sign == 2?[1,2]:[],
+        "sexType": this.sexType,
       }
       api.searchTagList(param).then((res) => {
         if (res.data.code === '0') {

+ 4 - 0
src/less/base.less

@@ -46,6 +46,10 @@ a {
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
+
+	display:-webkit-box;
+	-webkit-line-clamp:1;3
+	-webkit-box-orient:vertical;
 }