Luolei 6 lat temu
rodzic
commit
db0659aab8
1 zmienionych plików z 15 dodań i 34 usunięć
  1. 15 34
      src/components/icss/PubTagPartDetail.vue

+ 15 - 34
src/components/icss/PubTagPartDetail.vue

@@ -153,39 +153,30 @@ export default {
     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=[]
+          this.clearData()
         }
       }
     },
     sign(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=[]
+        this.clearData()
       }
     },
     type(newVal, preVal) {
       if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+        this.clearData()
+      }
+    },
+    searchVal(newVal, preVal){
+      if(newVal.trim() == ''){
+        this.searchTagList();
+      }else if(newVal.trim() != preVal.trim()){
+        this.searchTagList();
+      }
+    }
+  },
+  methods: {
+    clearData(){
         this.poolDetailList = [[],[],[],[],[],[]]
         this.poolDetailListTips = [[],[],[],[],[],[]]
         this.poolDetailListIds = [[],[],[],[],[],[]]
@@ -198,17 +189,7 @@ export default {
         this.currentLis=[]
         this.notIds=[]               
         this.multipleItem=[]
-      }
     },
-    searchVal(newVal, preVal){
-      if(newVal.trim() == ''){
-        this.searchTagList();
-      }else if(newVal.trim() != preVal.trim()){
-        this.searchTagList();
-      }
-    }
-  },
-  methods: {
     selectTagOne(e,id,n){
       e.stopPropagation()
       this.activePartSon = n