mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-12 16:57:10 +08:00
fix(system/role): 修复角色权限禁用逻辑
This commit is contained in:
@@ -295,23 +295,28 @@ const save = async () => {
|
||||
const showCheckedAll = ref(true)
|
||||
// 加载角色详情
|
||||
const fetchRole = async (id: string) => {
|
||||
disabled.value = !has.hasPermOr(['system:role:updatePermission'])
|
||||
// 查询角色详情
|
||||
const { data } = await getRole(id)
|
||||
if (!disabled.value) {
|
||||
disabled.value = data.isSystem
|
||||
try {
|
||||
loading.value = true
|
||||
disabled.value = !has.hasPermOr(['system:role:updatePermission'])
|
||||
// 查询角色详情
|
||||
const { data } = await getRole(id)
|
||||
if (!disabled.value) {
|
||||
disabled.value = data.isSystem && data.code === 'admin'
|
||||
}
|
||||
isCascade.value = data.menuCheckStrictly
|
||||
// 更新选中键集合
|
||||
selectedKeys.value = new Set(data.menuIds)
|
||||
// 更新表格数据的选中状态
|
||||
updateTableDataCheckedStatus(tableData.value, data.menuIds)
|
||||
// 手动设置表格行的选中状态,确保组件响应
|
||||
await nextTick(() => {
|
||||
tableRef.value?.tableRef?.selectAll(false)
|
||||
tableRef.value?.tableRef?.select(data.menuIds, true)
|
||||
showCheckedAll.value = !disabled.value
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
isCascade.value = data.menuCheckStrictly
|
||||
// 更新选中键集合
|
||||
selectedKeys.value = new Set(data.menuIds)
|
||||
// 更新表格数据的选中状态
|
||||
updateTableDataCheckedStatus(tableData.value, data.menuIds)
|
||||
// 手动设置表格行的选中状态,确保组件响应
|
||||
await nextTick(() => {
|
||||
tableRef.value?.tableRef?.selectAll(false)
|
||||
tableRef.value?.tableRef?.select(data.menuIds, true)
|
||||
showCheckedAll.value = !disabled.value
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新
|
||||
|
Reference in New Issue
Block a user