Browse Source

bug修改

wangfei 6 years ago
parent
commit
4e509dd132
2 changed files with 16 additions and 11 deletions
  1. 6
    4
      src/pages/system/systemSet/roleManager/index.vue
  2. 10
    7
      src/store/system/role.js

+ 6
- 4
src/pages/system/systemSet/roleManager/index.vue View File

67
       key: '',
67
       key: '',
68
       selid: '',
68
       selid: '',
69
       dialogTableVisible: false,
69
       dialogTableVisible: false,
70
+      roleMenus: [],
70
     }
71
     }
71
   },
72
   },
72
   computed: {
73
   computed: {
73
     ...mapRoleState({
74
     ...mapRoleState({
74
       roles: x => x.roleList,
75
       roles: x => x.roleList,
75
-      roleMenus: x => x.roleMenus,
76
+      // roleMenus: x => x.roleMenus,
76
     }),
77
     }),
77
     ...mapState({
78
     ...mapState({
78
       menus: x => x.app.menus
79
       menus: x => x.app.menus
136
     },
137
     },
137
     handlePermission (index, row) {
138
     handlePermission (index, row) {
138
       this.selid = row.RoleId
139
       this.selid = row.RoleId
139
-      this.GetRoleMenu({id: this.selid})
140
-      console.log(this.roleMenus)
141
-      this.dialogTableVisible = true
140
+      this.GetRoleMenu({id: this.selid}).then((res) => {
141
+        this.roleMenus = res || []
142
+        this.dialogTableVisible = true
143
+      })
142
     },
144
     },
143
     handleNodeClick (node) {
145
     handleNodeClick (node) {
144
       console.log(node)
146
       console.log(node)

+ 10
- 7
src/store/system/role.js View File

79
       commit('updateInfo', {})
79
       commit('updateInfo', {})
80
     },
80
     },
81
     GetRoleMenu ({ commit }, payload) {
81
     GetRoleMenu ({ commit }, payload) {
82
-      ajax(api.role.getmenus.url, {
83
-        method: api.role.getmenus.method,
84
-        urlData: {
85
-          id: payload.id,
86
-        },
87
-      }).then(res => {
88
-        commit('updateRoleMenus', res)
82
+      return new Promise((resolve, reject) => {
83
+        ajax(api.role.getmenus.url, {
84
+          method: api.role.getmenus.method,
85
+          urlData: {
86
+            id: payload.id,
87
+          },
88
+        }).then(res => {
89
+          commit('updateRoleMenus', res)
90
+          resolve(res)
91
+        }).catch(reject)
89
       })
92
       })
90
     },
93
     },
91
     SaveRoleMenus ({ commit }, payload) {
94
     SaveRoleMenus ({ commit }, payload) {