소스 검색

修改bug

zhangli 1 년 전
부모
커밋
ec15c60538

BIN
src/image/map/leftTitle.png


BIN
src/image/map/leftTitle11.png


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

@@ -25,11 +25,11 @@ export default {
     this.init()
   },
   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)]
     }
-    this.checkArr.push('000')
+    this.checkArr.push('999')
     //this.init()
   },
   methods:{
@@ -42,7 +42,7 @@ export default {
           const creatNode = (node,num,pId)=>{
             node.pId=pId
             if(num==1){
-              node.parent='000'
+              node.parent='999'
             }
             if(node.children && node.children.length > 0){
               let hArr = node.children.map(item=>{

+ 5 - 3
src/views/modules/knowledge/warehouse/contentData.vue

@@ -261,7 +261,7 @@ export default {
    },
    //修改分类
    changeClass(data){
-    if(data.categoryId=='000'){
+    if(data.categoryId=='999'){
       this.categoryId = ''
     }else{
       this.categoryId = data.categoryId
@@ -276,9 +276,11 @@ export default {
    },
    // 跳转添加
    addData(){
-    if(this.categoryValue.join(',')=='000'){
+    
+    if(this.categoryValue.join(',')=='999'){
       this.categoryValue=[]
     }
+    console.log(this.categoryValue)
     this.$router.push({
       name: "knowledgeAddUpdate",
       query: {
@@ -560,7 +562,7 @@ export default {
         operatorName: null,
         parent: "0",
         parents: null,
-        pkId: "000",
+        pkId: "999",
         sort: 2,
         updateBy: "1",
         updateTime: "2022-12-27 17:00:30",

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

@@ -280,7 +280,7 @@ export default {
       this.knowledgeForm.type = this.$route.query.type
       this.knowledgeForm.bastype = this.$route.query.type
     }
-    if(this.$route.query.categoryId&&this.$route.query.categoryId!='000') {
+    if(this.$route.query.categoryId&&this.$route.query.categoryId!='999') {
       this.knowledgeForm.categoryId = this.$route.query.categoryId.split(',')
     }
     let pkId = this.$route.query.pkId
@@ -413,6 +413,10 @@ export default {
     },
     //  提交数据
     handleSaveClick(type) {
+      if(this.knowledgeForm.categoryId.slice(-1)[0]=='999'){
+        this.$message.error('请选择分类');
+        return false
+      }
       if(type==0){
         this.knowledgeForm.isDraft = type
         this.saveData()