Преглед изворни кода

修改菜单和部门管理

ljh пре 2 година
родитељ
комит
dd0897980f

+ 4 - 1
chuanyi-admin/src/views/system/dept/index.vue

@@ -290,9 +290,12 @@ export default {
         type: 'warning'
       }).then(() => {
         try {
+          const isParent = this.depts.find(v => {
+            return v.children.length
+          })
           this.depts.forEach(o => {
             // 选中父级
-            if (o.children.length) {
+            if (o.children.length || isParent.children.length) {
               this.$message({
                 type: 'warning',
                 message: '删除失败,请先删除下级部门'

+ 1 - 1
chuanyi-admin/src/views/system/menu/index.vue

@@ -214,7 +214,7 @@ export default {
       }).then(res => {
         if (res.code === 200) {
           const data = res.data
-          this.options = this.$utils.toArrayTree(data.menuList)
+          this.options = data.menuList
         }
       })
     },