Bläddra i källkod

Merge branch 'bug-fix#3417'

cxmo 1 år sedan
förälder
incheckning
144039f97d
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12 0
      src/views/system_manage/operateAuthManage.vue

+ 12 - 0
src/views/system_manage/operateAuthManage.vue

@@ -298,9 +298,21 @@ export default {
       operateAuthInterface.getClassificationBySource({Source: this.default_tab}).then(res => {
         if(res.Ret == 200){
           this.classificationList = res.Data.List || []
+          //如果是三级分类,去掉最后一级分类的child
+          if([3,4,5].includes(this.default_tab)){
+            this.filterNodes(this.classificationList)
+          }
         }
       })
     },
+    filterNodes(arr) {
+        arr.length && arr.forEach(item => {
+            item.Child && item.Child.length && this.filterNodes(item.Child)
+            if(item.Child && !item.Child.length) {
+                delete item.Child
+            }
+        })
+    },
     
     changeTab({key}) {
       this.default_tab = key;