|
|
|
|
@ -102,8 +102,12 @@ const open = async (row: RoleApi.RoleVO) => {
|
|
|
|
|
formData.name = row.name
|
|
|
|
|
formData.code = row.code
|
|
|
|
|
formData.dataScope = row.dataScope
|
|
|
|
|
row.dataScopeDeptIds?.forEach((deptId: number) => {
|
|
|
|
|
treeRef.value.setChecked(deptId, true, false)
|
|
|
|
|
|
|
|
|
|
// 需要在 DOM 渲染完成后,再设置选中状态
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
row.dataScopeDeptIds?.forEach((deptId: number) => {
|
|
|
|
|
treeRef.value.setChecked(deptId, true, false)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|