Jelajahi Sumber

症状推送添加标签标识

zhangxc 6 tahun lalu
induk
melakukan
457d83209b

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

@@ -59,6 +59,7 @@
         :type="dataPub.region1"
         :sexType="dataPub.region7"
         :options="editData.questionMapping"
+        :tipLis="dataPub.tipLis"
          @changeActionData="changeActionData"
       >
       </SymptomPush>

+ 62 - 12
src/components/icss/SymptomPush.vue

@@ -29,7 +29,7 @@
         <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
         <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
     </div>
-    <div class="symptomPushBottomPartRight ">
+    <div class="symptomPushBottomPartRight clearfix">
       <p class="symptomPushPoolTitle">操作界面:</p>
       <ul v-for="(item, index) in rightTagsList" 
             :key="index"    
@@ -49,6 +49,15 @@
                 {{it.name}}
             </li>
         </ul>
+        <div class="symptomPushTagListPartBox fl">
+            <ul v-for="(item, index) in rightTagsList" 
+                :key="index+'part'"    
+                class="symptomPushTagListPart fl"
+            >
+                <p v-if="item.controlType" class="symptomPushTagListPartItem">{{getControlType(item.controlType)}} </p> 
+                <p v-if="item.tagName" class="symptomPushTagListPartItem">{{item.tagName}} </p>  
+            </ul>
+        </div>
     </div>
   </div>
 </template>
@@ -63,6 +72,10 @@ export default {
             default: () => [],
             type: Array
         },
+        tipLis: {
+            default: () => [],
+            type: Array
+        },
         type: {
             default: '',
             type: String
@@ -79,9 +92,10 @@ export default {
     data() {
         return {
             leftTagsList: [],
-            selectLeftTagId: {},
+            selectLeftTagId: {},    //标签池中选中标签
             rightTagsList: [{}, {}],
-            currentSelectIndex: -1,
+            currentSelectIndex: -1,    //选中操作界面索引
+            currentTipLis:[],         //右侧选中的标签提示
             searchVal: '',
             styles:{
                 background:'#eae7e7'
@@ -89,23 +103,36 @@ export default {
         }
     },
     mounted() {
-        if(this.options.length) {
-            if(this.options.length === 2) {     //当两个模块都有值时
-                this.rightTagsList = this.options
-                this.$emit('changeActionData',this.rightTagsList, false);
-                
-            } else if(this.options.length === 1) {
-                this.options[0].controlType == 99 ? this.rightTagsList.splice(1, 1, this.options[0]) :this.rightTagsList.splice(0, 1, this.options[0])
+        this.currentTipLis = this.tipLis
+        this.$nextTick(()=>{ 
+            if(this.options.length) {
+                if(this.options.length === 2) {     //当两个模块都有值时
+                    this.rightTagsList = this.options
+                    this.$emit('changeActionData',this.rightTagsList, false);
+                    
+                } else if(this.options.length === 1) {
+                    this.options[0].controlType == 99 ? this.rightTagsList.splice(1, 1, this.options[0]) :this.rightTagsList.splice(0, 1, this.options[0])
+                }
+                this.searchTagList()
             }
-            this.searchTagList()
-        }
+
+        })
+        
     },
     watch: {
         pool(newVal, preVal) {
+            console.log('asasdasdas1111')
             if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
                 this.leftTagsList = newVal
             }
         },
+        tipLis(newVal, preVal) {
+            console.log(newVal,preVal)
+            if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+                console.log('asasdasdas')
+                this.currentTipLis = newVal
+            }
+        },
         searchVal(newVal, preVal){
             if(newVal.trim() == ''){
                 this.searchTagList()
@@ -262,6 +289,14 @@ export default {
         SelectList(index) {
             
             this.currentSelectIndex = this.currentSelectIndex === index ? -1 : index;
+        },
+        getControlType(controlType) {
+            for (let i = 0; i < this.currentTipLis.length; i++) {
+                if(this.currentTipLis[i].val == controlType) {
+                     return this.currentTipLis[i].name
+                }
+            }
+           
         }
     }
 }
@@ -362,6 +397,21 @@ export default {
             }
         }
     }
+    .symptomPushTagListPartBox {
+        width: 100%;
+    }
+    .symptomPushTagListPart {
+        width: 30%;
+        padding: 5px;
+    }
+    .symptomPushTagListPartItem {
+        display: inline-block;
+        text-align: center;
+        border: 1px solid #c0c4cc;
+        padding: 2px 3px;
+        border-radius: 5px;
+        margin: 0 3px 3px 0;
+    }
     .symptomPushTagItemPushBox {
         text-align: center
     }

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

@@ -105,7 +105,6 @@ export default {
       this.$nextTick(()=>{
         let tagList = this.options;
         if(tagList.length > 0){
-          console.log(99)
           this.rightTagsList2 = this.options
           let newArr = []
           for (let i = 0; i < this.rightTagsList2.length; i++) {