增加恢复默认菜单权限

This commit is contained in:
打豆豆
2023-12-05 13:49:20 +08:00
parent a83b9723ae
commit df9d07734f
3 changed files with 37 additions and 2 deletions

View File

@@ -134,6 +134,7 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button>
<el-button size="mini" type="text" icon="el-icon-s-help" v-if="scope.row.createBy === 'admin'" @click="restoreRole(scope.row.roleId)">恢复默认菜单权限</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
<span class="el-dropdown-link">
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
@@ -603,6 +604,31 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
// 恢复默认菜单权限
restoreRole(roleId) {
this.$confirm("确定恢复默认菜单权限吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
resetRole(roleId).then(result => {
if (result.code === 200) {
this.$notify({
title: '成功',
message: result.message,
type: 'success'
})
this.getList();
} else {
this.$notify({
title: '失败',
message: result.message,
type: 'error'
})
}
})
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {