mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
feat: 重构代码生成模块并优化相关功能
- 重构代码生成模板,统一路由前缀和业务路径规范 - 优化数据库表分页查询性能,支持方言特定实现 - 新增同步数据库差异预览功能 - 调整字段配置界面,支持拖拽排序和批量设置 - 清理旧版示例代码和冗余配置 - 修复权限和路由嵌套路径处理问题 - 优化前端样式和交互细节
This commit is contained in:
@@ -66,7 +66,12 @@ class RoleCRUD(CRUDBase[RoleModel, RoleCreateSchema, RoleUpdateSchema]):
|
||||
- None
|
||||
"""
|
||||
roles = await self.list(search={"id": ("in", role_ids)})
|
||||
menus = await MenuCRUD(self.auth).get_list_crud(search={"id": ("in", menu_ids)})
|
||||
# 前端未勾选时 menu_ids 可能为空:此时应清空关联,而不是触发全量查询
|
||||
menus = (
|
||||
[]
|
||||
if not menu_ids
|
||||
else await MenuCRUD(self.auth).get_list_crud(search={"id": ("in", menu_ids)})
|
||||
)
|
||||
|
||||
for obj in roles:
|
||||
relationship = obj.menus
|
||||
@@ -99,7 +104,12 @@ class RoleCRUD(CRUDBase[RoleModel, RoleCreateSchema, RoleUpdateSchema]):
|
||||
- None
|
||||
"""
|
||||
roles = await self.list(search={"id": ("in", role_ids)})
|
||||
depts = await DeptCRUD(self.auth).get_list_crud(search={"id": ("in", dept_ids)})
|
||||
# 前端未勾选时 dept_ids 可能为空:此时应清空关联,而不是触发全量查询
|
||||
depts = (
|
||||
[]
|
||||
if not dept_ids
|
||||
else await DeptCRUD(self.auth).get_list_crud(search={"id": ("in", dept_ids)})
|
||||
)
|
||||
|
||||
for obj in roles:
|
||||
relationship = obj.depts
|
||||
|
||||
Reference in New Issue
Block a user