Skip to content

Commit 0230a4a

Browse files
committed
修复数据权限无法回显的问题
1 parent ecf9f26 commit 0230a4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/views/system/role/RoleDataPermissionForm.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ const open = async (row: RoleApi.RoleVO) => {
102102
formData.name = row.name
103103
formData.code = row.code
104104
formData.dataScope = row.dataScope
105-
row.dataScopeDeptIds?.forEach((deptId: number) => {
106-
treeRef.value.setChecked(deptId, true, false)
105+
106+
// 需要在 DOM 渲染完成后,再设置选中状态
107+
nextTick(() => {
108+
row.dataScopeDeptIds?.forEach((deptId: number) => {
109+
treeRef.value.setChecked(deptId, true, false)
110+
})
107111
})
108112
}
109113
defineExpose({ open }) // 提供 open 方法,用于打开弹窗

0 commit comments

Comments
 (0)