fix: (system): 修复VbenTree加载顺序问题

- 调整了数据权限分配和菜单分配表单中的加载顺序
- 确保在设置表单值之前完成树形结构数据的加载
This commit is contained in:
2025-07-21 14:27:34 +08:00
parent b031b6ac0f
commit 7031dbebe6
7 changed files with 16 additions and 17 deletions

View File

@@ -74,11 +74,11 @@ const [Modal, modalApi] = useVbenModal({
}
modalApi.lock();
try {
await formApi.setValues(await getRole(data.id as number));
// 加载部门列表
await loadDeptTree();
toggleExpandAll();
// 设置表单值, 一定要在加载树之后
await formApi.setValues(await getRole(data.id as number));
} finally {
modalApi.unlock();
}

View File

@@ -69,13 +69,13 @@ const [Modal, modalApi] = useVbenModal({
}
modalApi.lock();
try {
await formApi.setValues(data);
// 加载角色菜单
const menuIds = await getRoleMenuList(data.id as number);
await formApi.setFieldValue('menuIds', menuIds);
// 加载菜单列表
await loadMenuTree();
await formApi.setValues(data);
} finally {
modalApi.unlock();
}