chris před 2 roky
rodič
revize
01fa789040
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      src/views/modules/sys/role-add-or-update.vue

+ 4 - 2
src/views/modules/sys/role-add-or-update.vue

@@ -89,6 +89,7 @@
     methods: {
       init (id) {
         this.dataForm.id = id || 0
+        console.log('tree')
         this.$http({
           url: this.$http.adornUrl('/user-service/menu/tree'),
           method: 'get',
@@ -98,6 +99,7 @@
             this.menuList = data.data
           }
         }).then(() => {
+          console.log('queryTree')
           this.$http({
             url: this.$http.adornUrl('/user-service/org/queryTree'),
             method: 'get',
@@ -128,7 +130,7 @@
                 if (data.data.menuIdList) {
                   data.data.menuIdList.forEach(i => {
                     const node = this.$refs.menuListTree.getNode(i)
-                    if (node.isLeaf) {
+                    if (node && node.isLeaf) {
                       this.$refs.menuListTree.setChecked(node, true)
                     }
                   })
@@ -136,7 +138,7 @@
                 if (data.data.orgIdList) {
                   data.data.orgIdList.forEach(i => {
                     const node = this.$refs.orgListData.getNode(i)
-                    if (node.isLeaf) {
+                    if (node && node.isLeaf) {
                       this.$refs.orgListData.setChecked(node, true, false)
                     }
                   })