소스 검색

多级分类回显问题解决

赵志鹏 1 년 전
부모
커밋
3819516605
2개의 변경된 파일23개의 추가작업 그리고 21개의 파일을 삭제
  1. 12 12
      src/views/modules/knowledge/warehouse/contentData.vue
  2. 11 9
      src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

+ 12 - 12
src/views/modules/knowledge/warehouse/contentData.vue

@@ -203,19 +203,19 @@ export default {
       }
       this.categoryName=this.$route.query.categoryName
     }
-
     if(this.$route.query.isBack) {
-      this.categoryValue = []
-      if(this.$route.query.categoryId!=undefined){
-        this.categoryId=this.$route.query.categoryId
-        this.categoryValue=[this.$route.query.parentp,this.$route.query.parent,this.$route.query.categoryId]
-      }else if(this.$route.query.parent!=undefined){
-        this.categoryId=this.$route.query.parent
-        this.categoryValue=[this.$route.query.parentp,this.$route.query.parent]
-      }else{
-        this.categoryId=this.$route.query.parentp
-        this.categoryValue.push(this.$route.query.parentp)
-      }
+      // this.categoryValue = []
+      // if(this.$route.query.categoryId!=undefined){
+      //   this.categoryId=this.$route.query.categoryId
+      //   this.categoryValue=[this.$route.query.parentp,this.$route.query.parent,this.$route.query.categoryId]
+      // }else if(this.$route.query.parent!=undefined){
+      //   this.categoryId=this.$route.query.parent
+      //   this.categoryValue=[this.$route.query.parentp,this.$route.query.parent]
+      // }else{
+      //   this.categoryId=this.$route.query.parentp
+      //   this.categoryValue.push(this.$route.query.parentp)
+      // }
+      this.categoryValue = this.$route.query.categoryId.split(',')
       // console.log(this.$route.query.categoryName)
       if(this.$route.query.categoryName) {
         this.categoryName=this.$route.query.categoryName

+ 11 - 9
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -571,22 +571,24 @@ export default {
       }
     },
     cancle() {
+      console.log(this.knowledgeForm.categoryId)
       if(this.classifyName) {
         let queryData = {
           categoryName: this.classifyName,
           isBack: 1,
           type: this.$route.query.type,
           tapAction: this.$route.query.tapAction,
+          categoryId: this.knowledgeForm.categoryId.join(',')
         }
-        if(this.knowledgeForm.categoryId[0]) {
-          queryData.parentp = this.knowledgeForm.categoryId[0]
-          if(this.knowledgeForm.categoryId[1]) {
-            queryData.parent = this.knowledgeForm.categoryId[1]
-            if(this.knowledgeForm.categoryId[2]) {
-              queryData.categoryId = this.knowledgeForm.categoryId[2]
-            } 
-          }
-        }
+        // if(this.knowledgeForm.categoryId[0]) {
+        //   queryData.parentp = this.knowledgeForm.categoryId[0]
+        //   if(this.knowledgeForm.categoryId[1]) {
+        //     queryData.parent = this.knowledgeForm.categoryId[1]
+        //     if(this.knowledgeForm.categoryId[2]) {
+        //       queryData.categoryId = this.knowledgeForm.categoryId[2]
+        //     } 
+        //   }
+        // }
         this.$router.replace({
           name: "contentData",
           query: queryData,