mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-04-26 00:00:04 +08:00
43 lines
797 B
Vue
43 lines
797 B
Vue
<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>
|