角色权限修改

dev
yujialong 3 years ago
parent 7d23ffd562
commit ccb9b1882b
  1. 9
      src/layouts/header/index.vue
  2. 8
      src/layouts/navbar/index.vue
  3. 6
      src/pages/role/list/index.vue

@ -7,7 +7,7 @@
<div style="height: 64px;"></div>
<navbar ref="nav"></navbar>
<div class="action" v-if="token">
<img v-if="showSetting && isCustomer" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar>
@ -119,8 +119,11 @@ export default {
userName && this.setInfo({
userName
})
} else {
// 3/data/list
if (this.routes.length && !this.routes.find(e => e.name !== '/data/list')) this.showSetting = false
}
// ,
// ,
setTimeout(() => {
this.token && !this.isCustomer && this.getUserInfo()
}, 1000)
@ -177,7 +180,7 @@ export default {
})
window.open(route.href)
} else {
// ,,
// ,,
util.warningMsg('该角色未开放模块,请联系管理员')
}
},

@ -90,8 +90,12 @@ export default {
this.menus = this.defaultMenus
}
} else {
// ,
this.menus = [...this.defaultMenus, ...this.dataMenu]
// ,
if (this.routes.find(e => e.name === '/data/list')) {
this.menus = this.dataMenu
} else {
this.menus = this.dataMenu[0]
}
}
},
jump(item) {

@ -148,7 +148,7 @@ export default {
getPer(){
if(!this.permissions.length){
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => {
this.permissions = res.children[0].children
this.permissions = res.children
}).catch(res => {})
}
},
@ -166,7 +166,7 @@ export default {
permissions.map(e => {
if(result.includes(e.id) && e.children.length){
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1)
e.children.every(n => result.includes(n.id)) || result.splice(result.indexOf(e.id),1)
}
e.children.length && this.handleRolePer(data,e.children)
})
@ -175,11 +175,13 @@ export default {
},
async getDetail(row){
this.getPer()
setTimeout(() => {
this.$get(`${this.api.getRole}?id=${row.id}`).then(res => {
this.form = res.role
this.checkedIds = this.handleRolePer(res.permissionList,this.permissions)
this.$refs.per.setCheckedNodes(this.checkedIds)
}).catch(res => {})
}, 100)
},
showRole(row){
this.isDetail = true

Loading…
Cancel
Save