mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
feat(前端): 添加页面切换动画功能并优化工作流节点样式
refactor(后端): 统一查询参数处理使用QueueEnum枚举 style(前端): 优化菜单搜索组件样式 fix(后端): 移除不支持的数据库类型dm chore: 更新依赖和配置文件
This commit is contained in:
@@ -4,7 +4,7 @@ from fastapi import APIRouter, Body, Depends, Path
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||
from app.common.response import SuccessResponse
|
||||
from app.common.response import ResponseSchema, SuccessResponse
|
||||
from app.core.base_schema import BatchSetAvailable
|
||||
from app.core.dependencies import AuthPermission
|
||||
from app.core.logger import log
|
||||
@@ -20,7 +20,7 @@ DeptRouter = APIRouter(route_class=OperationLogRoute, prefix="/dept", tags=["部
|
||||
"/tree",
|
||||
summary="查询部门树",
|
||||
description="查询部门树",
|
||||
response_model=list[DeptOutSchema],
|
||||
response_model=ResponseSchema[list[DeptOutSchema]],
|
||||
)
|
||||
async def get_dept_tree_controller(
|
||||
search: Annotated[DeptQueryParam, Depends()],
|
||||
@@ -51,7 +51,7 @@ async def get_dept_tree_controller(
|
||||
"/detail/{id}",
|
||||
summary="查询部门详情",
|
||||
description="查询部门详情",
|
||||
response_model=DeptOutSchema,
|
||||
response_model=ResponseSchema[DeptOutSchema],
|
||||
)
|
||||
async def get_obj_detail_controller(
|
||||
id: Annotated[int, Path(description="部门ID")],
|
||||
@@ -79,7 +79,7 @@ async def get_obj_detail_controller(
|
||||
"/create",
|
||||
summary="创建部门",
|
||||
description="创建部门",
|
||||
response_model=DeptOutSchema,
|
||||
response_model=ResponseSchema[DeptOutSchema],
|
||||
)
|
||||
async def create_obj_controller(
|
||||
data: DeptCreateSchema,
|
||||
@@ -107,7 +107,7 @@ async def create_obj_controller(
|
||||
"/update/{id}",
|
||||
summary="修改部门",
|
||||
description="修改部门",
|
||||
response_model=DeptOutSchema,
|
||||
response_model=ResponseSchema[DeptOutSchema],
|
||||
)
|
||||
async def update_obj_controller(
|
||||
data: DeptUpdateSchema,
|
||||
@@ -137,6 +137,7 @@ async def update_obj_controller(
|
||||
"/delete",
|
||||
summary="删除部门",
|
||||
description="删除部门",
|
||||
response_model=ResponseSchema[None],
|
||||
)
|
||||
async def delete_obj_controller(
|
||||
ids: Annotated[list[int], Body(description="ID列表")],
|
||||
@@ -164,6 +165,7 @@ async def delete_obj_controller(
|
||||
"/available/setting",
|
||||
summary="批量修改部门状态",
|
||||
description="批量修改部门状态",
|
||||
response_model=ResponseSchema[None],
|
||||
)
|
||||
async def batch_set_available_obj_controller(
|
||||
data: BatchSetAvailable,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from fastapi import Query
|
||||
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
||||
|
||||
from app.common.enums import QueueEnum
|
||||
from app.core.base_schema import BaseSchema
|
||||
from app.core.validator import DateTimeStr
|
||||
|
||||
@@ -73,13 +74,13 @@ class DeptQueryParam:
|
||||
) -> None:
|
||||
|
||||
# 模糊查询字段
|
||||
self.name = ("like", name)
|
||||
self.name = (QueueEnum.like.value, name)
|
||||
|
||||
# 精确查询字段
|
||||
self.status = status
|
||||
self.status = (QueueEnum.eq.value, status)
|
||||
|
||||
# 时间范围查询
|
||||
if created_time and len(created_time) == 2:
|
||||
self.created_time = ("between", (created_time[0], created_time[1]))
|
||||
self.created_time = (QueueEnum.between.value, (created_time[0], created_time[1]))
|
||||
if updated_time and len(updated_time) == 2:
|
||||
self.updated_time = ("between", (updated_time[0], updated_time[1]))
|
||||
self.updated_time = (QueueEnum.between.value, (updated_time[0], updated_time[1]))
|
||||
|
||||
Reference in New Issue
Block a user