diff --git a/src/views/system/role/RoleDataPermissionForm.vue b/src/views/system/role/RoleDataPermissionForm.vue index 51867a77..c00e3972 100644 --- a/src/views/system/role/RoleDataPermissionForm.vue +++ b/src/views/system/role/RoleDataPermissionForm.vue @@ -102,10 +102,12 @@ const open = async (row: RoleApi.RoleVO) => { formData.name = row.name formData.code = row.code formData.dataScope = row.dataScope + await nextTick() + row.dataScopeDeptIds?.forEach((deptId: number): void => { await nextTick() // 需要在 DOM 渲染完成后,再设置选中状态 - row.dataScopeDeptIds?.forEach((deptId: number) => { + row.dataScopeDeptIds?.forEach((deptId: number): void => { treeRef.value.setChecked(deptId, true, false) }) }