mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-03 22:57:09 +08:00
fix(system/role): 修复角色权限禁用逻辑
This commit is contained in:
@@ -295,11 +295,13 @@ const save = async () => {
|
|||||||
const showCheckedAll = ref(true)
|
const showCheckedAll = ref(true)
|
||||||
// 加载角色详情
|
// 加载角色详情
|
||||||
const fetchRole = async (id: string) => {
|
const fetchRole = async (id: string) => {
|
||||||
|
try {
|
||||||
|
loading.value = true
|
||||||
disabled.value = !has.hasPermOr(['system:role:updatePermission'])
|
disabled.value = !has.hasPermOr(['system:role:updatePermission'])
|
||||||
// 查询角色详情
|
// 查询角色详情
|
||||||
const { data } = await getRole(id)
|
const { data } = await getRole(id)
|
||||||
if (!disabled.value) {
|
if (!disabled.value) {
|
||||||
disabled.value = data.isSystem
|
disabled.value = data.isSystem && data.code === 'admin'
|
||||||
}
|
}
|
||||||
isCascade.value = data.menuCheckStrictly
|
isCascade.value = data.menuCheckStrictly
|
||||||
// 更新选中键集合
|
// 更新选中键集合
|
||||||
@@ -312,6 +314,9 @@ const fetchRole = async (id: string) => {
|
|||||||
tableRef.value?.tableRef?.select(data.menuIds, true)
|
tableRef.value?.tableRef?.select(data.menuIds, true)
|
||||||
showCheckedAll.value = !disabled.value
|
showCheckedAll.value = !disabled.value
|
||||||
})
|
})
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新
|
// 刷新
|
||||||
|
|||||||
Reference in New Issue
Block a user