zhangli 1 år sedan
förälder
incheckning
5fade60840

+ 1 - 1
src/views/modules/knowledge/components/classMenu.vue

@@ -26,7 +26,7 @@ export default {
     
   },
   mounted(){
-    this.checkArr=this.categoryValue
+    this.checkArr=JSON.parse(JSON.stringify(this.categoryValue))
     if(this.categoryValue.length!=0){
       this.checkId=this.categoryValue[(this.categoryValue.length-1)]
     }

+ 1 - 0
src/views/modules/knowledge/warehouse/contentData.vue

@@ -276,6 +276,7 @@ export default {
    },
    // 跳转添加
    addData(){
+    console.log(this.categoryValue)
     if(this.categoryValue.join(',')=='000'){
       this.categoryValue=[]
     }

+ 5 - 1
src/views/modules/knowledge/warehouse/knowledgeAddUpdate.vue

@@ -247,7 +247,7 @@ export default {
       this.knowledgeForm.type = this.$route.query.type
       this.knowledgeForm.bastype = this.$route.query.type
     }
-    if(this.$route.query.categoryId) {
+    if(this.$route.query.categoryId&&this.$route.query.categoryId!='000') {
       this.knowledgeForm.categoryId = this.$route.query.categoryId.split(',')
     }
     let pkId = this.$route.query.pkId
@@ -329,6 +329,10 @@ export default {
     //  提交数据
     handleSaveClick() {
       let that = this
+      if(this.knowledgeForm.categoryId.slice(-1)[0]=='000'){
+        this.$message.error('请选择分类');
+        return false
+      }
       this.$refs.knowledgeRef.validate(valid => {
         if (valid) {
            // 新增