瀏覽代碼

bug修改

wangfei 6 年之前
父節點
當前提交
4e509dd132
共有 2 個檔案被更改,包括 16 行新增11 行删除
  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 查看文件

@@ -67,12 +67,13 @@ export default {
67 67
       key: '',
68 68
       selid: '',
69 69
       dialogTableVisible: false,
70
+      roleMenus: [],
70 71
     }
71 72
   },
72 73
   computed: {
73 74
     ...mapRoleState({
74 75
       roles: x => x.roleList,
75
-      roleMenus: x => x.roleMenus,
76
+      // roleMenus: x => x.roleMenus,
76 77
     }),
77 78
     ...mapState({
78 79
       menus: x => x.app.menus
@@ -136,9 +137,10 @@ export default {
136 137
     },
137 138
     handlePermission (index, row) {
138 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 145
     handleNodeClick (node) {
144 146
       console.log(node)

+ 10
- 7
src/store/system/role.js 查看文件

@@ -79,13 +79,16 @@ export default {
79 79
       commit('updateInfo', {})
80 80
     },
81 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 94
     SaveRoleMenus ({ commit }, payload) {