mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-04-26 00:00:04 +08:00
角色管理 分配权限 数据权限 封装pd-tree
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<pd-tree ref="tree" :el="{ 'show-checkbox': true }" url="menu/tree" :select-values.sync="menus" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'RoleAssignPermissions',
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menus: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$get('menu/by/role',{ roleId: this.id }).then(res => {
|
||||
this.menus = res.data.map((row) => row.id).join(',')
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
this.$post('role/save', {
|
||||
id: this.id,
|
||||
menus: this.menus
|
||||
}).then((response) => {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '分配成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
this.$emit('close')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user