mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-08 10:39:59 +00:00
Merge pull request #223 from 1014TaoTao/v2.0.0
refactor: 统一权限标识前缀为module_格式
This commit is contained in:
@@ -21,7 +21,7 @@ AIRouter = APIRouter(route_class=OperationLogRoute, prefix="/ai", tags=["MCP智
|
|||||||
@AIRouter.post("/chat", summary="智能对话", description="与MCP智能助手进行对话")
|
@AIRouter.post("/chat", summary="智能对话", description="与MCP智能助手进行对话")
|
||||||
async def chat_controller(
|
async def chat_controller(
|
||||||
query: ChatQuerySchema,
|
query: ChatQuerySchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:chat"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:chat"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
智能对话接口
|
智能对话接口
|
||||||
@@ -51,7 +51,7 @@ async def chat_controller(
|
|||||||
@AIRouter.get("/detail/{id}", summary="获取 MCP 服务器详情", description="获取 MCP 服务器详情")
|
@AIRouter.get("/detail/{id}", summary="获取 MCP 服务器详情", description="获取 MCP 服务器详情")
|
||||||
async def detail_controller(
|
async def detail_controller(
|
||||||
id: int = Path(..., description="MCP ID"),
|
id: int = Path(..., description="MCP ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取 MCP 服务器详情接口
|
获取 MCP 服务器详情接口
|
||||||
@@ -71,7 +71,7 @@ async def detail_controller(
|
|||||||
async def list_controller(
|
async def list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: McpQueryParam = Depends(),
|
search: McpQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询 MCP 服务器列表接口
|
查询 MCP 服务器列表接口
|
||||||
@@ -93,7 +93,7 @@ async def list_controller(
|
|||||||
@AIRouter.post("/create", summary="创建 MCP 服务器", description="创建 MCP 服务器")
|
@AIRouter.post("/create", summary="创建 MCP 服务器", description="创建 MCP 服务器")
|
||||||
async def create_controller(
|
async def create_controller(
|
||||||
data: McpCreateSchema,
|
data: McpCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建 MCP 服务器接口
|
创建 MCP 服务器接口
|
||||||
@@ -114,7 +114,7 @@ async def create_controller(
|
|||||||
async def update_controller(
|
async def update_controller(
|
||||||
data: McpUpdateSchema,
|
data: McpUpdateSchema,
|
||||||
id: int = Path(..., description="MCP ID"),
|
id: int = Path(..., description="MCP ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改 MCP 服务器接口
|
修改 MCP 服务器接口
|
||||||
@@ -135,7 +135,7 @@ async def update_controller(
|
|||||||
@AIRouter.delete("/delete", summary="删除 MCP 服务器", description="删除 MCP 服务器")
|
@AIRouter.delete("/delete", summary="删除 MCP 服务器", description="删除 MCP 服务器")
|
||||||
async def delete_controller(
|
async def delete_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:ai:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:ai:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除 MCP 服务器接口
|
删除 MCP 服务器接口
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ JobRouter = APIRouter(route_class=OperationLogRoute, prefix="/job", tags=["定
|
|||||||
@JobRouter.get("/detail/{id}", summary="获取定时任务详情", description="获取定时任务详情")
|
@JobRouter.get("/detail/{id}", summary="获取定时任务详情", description="获取定时任务详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="定时任务ID"),
|
id: int = Path(..., description="定时任务ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取定时任务详情
|
获取定时任务详情
|
||||||
@@ -45,7 +45,7 @@ async def get_obj_detail_controller(
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: JobQueryParam = Depends(),
|
search: JobQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询定时任务
|
查询定时任务
|
||||||
@@ -66,7 +66,7 @@ async def get_obj_list_controller(
|
|||||||
@JobRouter.post("/create", summary="创建定时任务", description="创建定时任务")
|
@JobRouter.post("/create", summary="创建定时任务", description="创建定时任务")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: JobCreateSchema,
|
data: JobCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建定时任务
|
创建定时任务
|
||||||
@@ -86,7 +86,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: JobUpdateSchema,
|
data: JobUpdateSchema,
|
||||||
id: int = Path(..., description="定时任务ID"),
|
id: int = Path(..., description="定时任务ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改定时任务
|
修改定时任务
|
||||||
@@ -106,7 +106,7 @@ async def update_obj_controller(
|
|||||||
@JobRouter.delete("/delete", summary="删除定时任务", description="删除定时任务")
|
@JobRouter.delete("/delete", summary="删除定时任务", description="删除定时任务")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除定时任务
|
删除定时任务
|
||||||
@@ -125,7 +125,7 @@ async def delete_obj_controller(
|
|||||||
@JobRouter.post('/export', summary="导出定时任务", description="导出定时任务")
|
@JobRouter.post('/export', summary="导出定时任务", description="导出定时任务")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: JobQueryParam = Depends(),
|
search: JobQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出定时任务
|
导出定时任务
|
||||||
@@ -151,7 +151,7 @@ async def export_obj_list_controller(
|
|||||||
|
|
||||||
@JobRouter.delete("/clear", summary="清空定时任务日志", description="清空定时任务日志")
|
@JobRouter.delete("/clear", summary="清空定时任务日志", description="清空定时任务日志")
|
||||||
async def clear_obj_log_controller(
|
async def clear_obj_log_controller(
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
清空定时任务日志
|
清空定时任务日志
|
||||||
@@ -170,7 +170,7 @@ async def clear_obj_log_controller(
|
|||||||
async def option_obj_controller(
|
async def option_obj_controller(
|
||||||
id: int = Body(..., description="定时任务ID"),
|
id: int = Body(..., description="定时任务ID"),
|
||||||
option: int = Body(..., description="操作类型 1: 暂停 2: 恢复 3: 重启"),
|
option: int = Body(..., description="操作类型 1: 暂停 2: 恢复 3: 重启"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
暂停/恢复/重启定时任务
|
暂停/恢复/重启定时任务
|
||||||
@@ -187,7 +187,7 @@ async def option_obj_controller(
|
|||||||
logger.info(f"操作定时任务成功: {id}")
|
logger.info(f"操作定时任务成功: {id}")
|
||||||
return SuccessResponse(msg="操作定时任务成功")
|
return SuccessResponse(msg="操作定时任务成功")
|
||||||
|
|
||||||
@JobRouter.get("/log", summary="获取定时任务日志", description="获取定时任务日志", dependencies=[Depends(AuthPermission(["app:job:query"]))])
|
@JobRouter.get("/log", summary="获取定时任务日志", description="获取定时任务日志", dependencies=[Depends(AuthPermission(["module_application:job:query"]))])
|
||||||
async def get_job_log_controller():
|
async def get_job_log_controller():
|
||||||
"""
|
"""
|
||||||
获取定时任务日志
|
获取定时任务日志
|
||||||
@@ -221,7 +221,7 @@ async def get_job_log_controller():
|
|||||||
@JobRouter.get("/log/detail/{id}", summary="获取定时任务日志详情", description="获取定时任务日志详情")
|
@JobRouter.get("/log/detail/{id}", summary="获取定时任务日志详情", description="获取定时任务日志详情")
|
||||||
async def get_job_log_detail_controller(
|
async def get_job_log_detail_controller(
|
||||||
id: int = Path(..., description="定时任务日志ID"),
|
id: int = Path(..., description="定时任务日志ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取定时任务日志详情
|
获取定时任务日志详情
|
||||||
@@ -242,7 +242,7 @@ async def get_job_log_detail_controller(
|
|||||||
async def get_job_log_list_controller(
|
async def get_job_log_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: JobLogQueryParam = Depends(),
|
search: JobLogQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询定时任务日志
|
查询定时任务日志
|
||||||
@@ -265,7 +265,7 @@ async def get_job_log_list_controller(
|
|||||||
@JobRouter.delete("/log/delete", summary="删除定时任务日志", description="删除定时任务日志")
|
@JobRouter.delete("/log/delete", summary="删除定时任务日志", description="删除定时任务日志")
|
||||||
async def delete_job_log_controller(
|
async def delete_job_log_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除定时任务日志
|
删除定时任务日志
|
||||||
@@ -284,7 +284,7 @@ async def delete_job_log_controller(
|
|||||||
|
|
||||||
@JobRouter.delete("/log/clear", summary="清空定时任务日志", description="清空定时任务日志")
|
@JobRouter.delete("/log/clear", summary="清空定时任务日志", description="清空定时任务日志")
|
||||||
async def clear_job_log_controller(
|
async def clear_job_log_controller(
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
清空定时任务日志
|
清空定时任务日志
|
||||||
@@ -303,7 +303,7 @@ async def clear_job_log_controller(
|
|||||||
@JobRouter.post('/log/export', summary="导出定时任务日志", description="导出定时任务日志")
|
@JobRouter.post('/log/export', summary="导出定时任务日志", description="导出定时任务日志")
|
||||||
async def export_job_log_list_controller(
|
async def export_job_log_list_controller(
|
||||||
search: JobLogQueryParam = Depends(),
|
search: JobLogQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:job:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:job:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出定时任务日志
|
导出定时任务日志
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ MyAppRouter = APIRouter(route_class=OperationLogRoute, prefix="/myapp", tags=["
|
|||||||
@MyAppRouter.get("/detail/{id}", summary="获取应用详情", description="获取应用详情")
|
@MyAppRouter.get("/detail/{id}", summary="获取应用详情", description="获取应用详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="应用ID"),
|
id: int = Path(..., description="应用ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取应用详情
|
获取应用详情
|
||||||
@@ -44,7 +44,7 @@ async def get_obj_detail_controller(
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: ApplicationQueryParam = Depends(),
|
search: ApplicationQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询应用列表
|
查询应用列表
|
||||||
@@ -65,7 +65,7 @@ async def get_obj_list_controller(
|
|||||||
@MyAppRouter.post("/create", summary="创建应用", description="创建应用")
|
@MyAppRouter.post("/create", summary="创建应用", description="创建应用")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: ApplicationCreateSchema,
|
data: ApplicationCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建应用
|
创建应用
|
||||||
@@ -85,7 +85,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: ApplicationUpdateSchema,
|
data: ApplicationUpdateSchema,
|
||||||
id: int = Path(..., description="应用ID"),
|
id: int = Path(..., description="应用ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改应用
|
修改应用
|
||||||
@@ -105,7 +105,7 @@ async def update_obj_controller(
|
|||||||
@MyAppRouter.delete("/delete", summary="删除应用", description="删除应用")
|
@MyAppRouter.delete("/delete", summary="删除应用", description="删除应用")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除应用
|
删除应用
|
||||||
@@ -124,7 +124,7 @@ async def delete_obj_controller(
|
|||||||
@MyAppRouter.patch("/available/setting", summary="批量修改应用状态", description="批量修改应用状态")
|
@MyAppRouter.patch("/available/setting", summary="批量修改应用状态", description="批量修改应用状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["app:myapp:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_application:myapp:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改应用状态
|
批量修改应用状态
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from .service import FileService
|
|||||||
|
|
||||||
FileRouter = APIRouter(route_class=OperationLogRoute, prefix="/file", tags=["文件管理"])
|
FileRouter = APIRouter(route_class=OperationLogRoute, prefix="/file", tags=["文件管理"])
|
||||||
|
|
||||||
@FileRouter.post("/upload", summary="上传文件", description="上传文件",dependencies=[Depends(AuthPermission(["common:file:upload"]))])
|
@FileRouter.post("/upload", summary="上传文件", description="上传文件",dependencies=[Depends(AuthPermission(["module_common:file:upload"]))])
|
||||||
async def upload_controller(
|
async def upload_controller(
|
||||||
file: UploadFile,
|
file: UploadFile,
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -32,7 +32,7 @@ async def upload_controller(
|
|||||||
logger.info(f"上传文件成功 {result_dict}")
|
logger.info(f"上传文件成功 {result_dict}")
|
||||||
return SuccessResponse(data=result_dict, msg="上传文件成功")
|
return SuccessResponse(data=result_dict, msg="上传文件成功")
|
||||||
|
|
||||||
@FileRouter.post("/download", summary="下载文件", description="下载文件", dependencies=[Depends(AuthPermission(["common:file:download"]))])
|
@FileRouter.post("/download", summary="下载文件", description="下载文件", dependencies=[Depends(AuthPermission(["module_common:file:download"]))])
|
||||||
async def download_controller(
|
async def download_controller(
|
||||||
background_tasks: BackgroundTasks,
|
background_tasks: BackgroundTasks,
|
||||||
file_path: str = Body(..., description="文件路径"),
|
file_path: str = Body(..., description="文件路径"),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ DemoRouter = APIRouter(route_class=OperationLogRoute, prefix="/demo", tags=["示
|
|||||||
@DemoRouter.get("/detail/{id}", summary="获取示例详情", description="获取示例详情")
|
@DemoRouter.get("/detail/{id}", summary="获取示例详情", description="获取示例详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="示例ID"),
|
id: int = Path(..., description="示例ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取示例详情
|
获取示例详情
|
||||||
@@ -45,7 +45,7 @@ async def get_obj_detail_controller(
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: DemoQueryParam = Depends(),
|
search: DemoQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询示例列表
|
查询示例列表
|
||||||
@@ -72,7 +72,7 @@ async def get_obj_list_controller(
|
|||||||
@DemoRouter.post("/create", summary="创建示例", description="创建示例")
|
@DemoRouter.post("/create", summary="创建示例", description="创建示例")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: DemoCreateSchema,
|
data: DemoCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建示例
|
创建示例
|
||||||
@@ -92,7 +92,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: DemoUpdateSchema,
|
data: DemoUpdateSchema,
|
||||||
id: int = Path(..., description="示例ID"),
|
id: int = Path(..., description="示例ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改示例
|
修改示例
|
||||||
@@ -112,7 +112,7 @@ async def update_obj_controller(
|
|||||||
@DemoRouter.delete("/delete", summary="删除示例", description="删除示例")
|
@DemoRouter.delete("/delete", summary="删除示例", description="删除示例")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除示例
|
删除示例
|
||||||
@@ -131,7 +131,7 @@ async def delete_obj_controller(
|
|||||||
@DemoRouter.patch("/available/setting", summary="批量修改示例状态", description="批量修改示例状态")
|
@DemoRouter.patch("/available/setting", summary="批量修改示例状态", description="批量修改示例状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改示例状态
|
批量修改示例状态
|
||||||
@@ -150,7 +150,7 @@ async def batch_set_available_obj_controller(
|
|||||||
@DemoRouter.post('/export', summary="导出示例", description="导出示例")
|
@DemoRouter.post('/export', summary="导出示例", description="导出示例")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: DemoQueryParam = Depends(),
|
search: DemoQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出示例
|
导出示例
|
||||||
@@ -177,7 +177,7 @@ async def export_obj_list_controller(
|
|||||||
@DemoRouter.post('/import', summary="导入示例", description="导入示例")
|
@DemoRouter.post('/import', summary="导入示例", description="导入示例")
|
||||||
async def import_obj_list_controller(
|
async def import_obj_list_controller(
|
||||||
file: UploadFile,
|
file: UploadFile,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:demo:import"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:demo:import"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
导入示例
|
导入示例
|
||||||
@@ -193,7 +193,7 @@ async def import_obj_list_controller(
|
|||||||
logger.info(f"导入示例成功: {batch_import_result}")
|
logger.info(f"导入示例成功: {batch_import_result}")
|
||||||
return SuccessResponse(data=batch_import_result, msg="导入示例成功")
|
return SuccessResponse(data=batch_import_result, msg="导入示例成功")
|
||||||
|
|
||||||
@DemoRouter.post('/download/template', summary="获取示例导入模板", description="获取示例导入模板", dependencies=[Depends(AuthPermission(["generator:demo:download"]))])
|
@DemoRouter.post('/download/template', summary="获取示例导入模板", description="获取示例导入模板", dependencies=[Depends(AuthPermission(["module_generator:demo:download"]))])
|
||||||
async def export_obj_template_controller() -> StreamingResponse:
|
async def export_obj_template_controller() -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
获取示例导入模板
|
获取示例导入模板
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ GenRouter = APIRouter(route_class=OperationLogRoute, prefix='/gencode', tags=["
|
|||||||
async def gen_table_list_controller(
|
async def gen_table_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: GenTableQueryParam = Depends(),
|
search: GenTableQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询代码生成业务表列表
|
查询代码生成业务表列表
|
||||||
@@ -47,7 +47,7 @@ async def gen_table_list_controller(
|
|||||||
async def get_gen_db_table_list_controller(
|
async def get_gen_db_table_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: GenTableQueryParam = Depends(),
|
search: GenTableQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:dblist:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:dblist:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询数据库表列表
|
查询数据库表列表
|
||||||
@@ -69,7 +69,7 @@ async def get_gen_db_table_list_controller(
|
|||||||
@GenRouter.post("/import", summary="导入表结构", description="导入表结构")
|
@GenRouter.post("/import", summary="导入表结构", description="导入表结构")
|
||||||
async def import_gen_table_controller(
|
async def import_gen_table_controller(
|
||||||
table_names: List[str] = Body(..., description="表名列表"),
|
table_names: List[str] = Body(..., description="表名列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:import"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:import"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
导入表结构
|
导入表结构
|
||||||
@@ -90,7 +90,7 @@ async def import_gen_table_controller(
|
|||||||
@GenRouter.get("/detail/{table_id}", summary="获取业务表详细信息", description="获取业务表详细信息")
|
@GenRouter.get("/detail/{table_id}", summary="获取业务表详细信息", description="获取业务表详细信息")
|
||||||
async def gen_table_detail_controller(
|
async def gen_table_detail_controller(
|
||||||
table_id: int = Path(..., description="业务表ID"),
|
table_id: int = Path(..., description="业务表ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取业务表详细信息
|
获取业务表详细信息
|
||||||
@@ -110,7 +110,7 @@ async def gen_table_detail_controller(
|
|||||||
@GenRouter.post("/create", summary="创建表结构", description="创建表结构")
|
@GenRouter.post("/create", summary="创建表结构", description="创建表结构")
|
||||||
async def create_table_controller(
|
async def create_table_controller(
|
||||||
sql: str = Body(..., description="SQL语句,用于创建表结构"),
|
sql: str = Body(..., description="SQL语句,用于创建表结构"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:create"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:create"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建表结构
|
创建表结构
|
||||||
@@ -131,7 +131,7 @@ async def create_table_controller(
|
|||||||
async def update_gen_table_controller(
|
async def update_gen_table_controller(
|
||||||
table_id: int = Path(..., description="业务表ID"),
|
table_id: int = Path(..., description="业务表ID"),
|
||||||
data: GenTableSchema = Body(..., description="业务表信息"),
|
data: GenTableSchema = Body(..., description="业务表信息"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:update"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:update"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
编辑业务表信息
|
编辑业务表信息
|
||||||
@@ -152,7 +152,7 @@ async def update_gen_table_controller(
|
|||||||
@GenRouter.delete("/delete", summary="删除业务表信息", description="删除业务表信息")
|
@GenRouter.delete("/delete", summary="删除业务表信息", description="删除业务表信息")
|
||||||
async def delete_gen_table_controller(
|
async def delete_gen_table_controller(
|
||||||
ids: List[int] = Body(..., description="业务表ID列表"),
|
ids: List[int] = Body(..., description="业务表ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除业务表信息
|
删除业务表信息
|
||||||
@@ -172,7 +172,7 @@ async def delete_gen_table_controller(
|
|||||||
@GenRouter.patch("/batch/output", summary="批量生成代码", description="批量生成代码")
|
@GenRouter.patch("/batch/output", summary="批量生成代码", description="批量生成代码")
|
||||||
async def batch_gen_code_controller(
|
async def batch_gen_code_controller(
|
||||||
table_names: List[str] = Body(..., description="表名列表"),
|
table_names: List[str] = Body(..., description="表名列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:operate"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:operate"]))
|
||||||
) -> StreamResponse:
|
) -> StreamResponse:
|
||||||
"""
|
"""
|
||||||
批量生成代码
|
批量生成代码
|
||||||
@@ -196,7 +196,7 @@ async def batch_gen_code_controller(
|
|||||||
@GenRouter.post("/output/{table_name}", summary="生成代码到指定路径", description="生成代码到指定路径")
|
@GenRouter.post("/output/{table_name}", summary="生成代码到指定路径", description="生成代码到指定路径")
|
||||||
async def gen_code_local_controller(
|
async def gen_code_local_controller(
|
||||||
table_name: str = Path(..., description="表名"),
|
table_name: str = Path(..., description="表名"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:code"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:code"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
生成代码到指定路径
|
生成代码到指定路径
|
||||||
@@ -216,7 +216,7 @@ async def gen_code_local_controller(
|
|||||||
@GenRouter.get("/preview/{table_id}", summary="预览代码", description="预览代码")
|
@GenRouter.get("/preview/{table_id}", summary="预览代码", description="预览代码")
|
||||||
async def preview_code_controller(
|
async def preview_code_controller(
|
||||||
table_id: int = Path(..., description="业务表ID"),
|
table_id: int = Path(..., description="业务表ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:gencode:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:gencode:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
预览代码
|
预览代码
|
||||||
@@ -236,7 +236,7 @@ async def preview_code_controller(
|
|||||||
@GenRouter.post("/sync_db/{table_name}", summary="同步数据库", description="同步数据库")
|
@GenRouter.post("/sync_db/{table_name}", summary="同步数据库", description="同步数据库")
|
||||||
async def sync_db_controller(
|
async def sync_db_controller(
|
||||||
table_name: str = Path(..., description="表名"),
|
table_name: str = Path(..., description="表名"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["generator:db:sync"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_generator:db:sync"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
同步数据库
|
同步数据库
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from typing import Optional, List, Dict, Any
|
from typing import Optional, List
|
||||||
from sqlalchemy import String, Integer, ForeignKey, Boolean, JSON, Text
|
from sqlalchemy import String, Integer, ForeignKey, Boolean
|
||||||
from sqlalchemy.orm import Mapped, mapped_column, relationship, validates
|
from sqlalchemy.orm import Mapped, mapped_column, relationship, validates
|
||||||
from sqlalchemy.sql import expression
|
from sqlalchemy.sql import expression
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -17,7 +17,7 @@ CacheRouter = APIRouter(route_class=OperationLogRoute, prefix="/cache", tags=["
|
|||||||
|
|
||||||
@CacheRouter.get(
|
@CacheRouter.get(
|
||||||
'/info',
|
'/info',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:query']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:query']))],
|
||||||
summary="获取缓存监控信息",
|
summary="获取缓存监控信息",
|
||||||
description="获取缓存监控信息"
|
description="获取缓存监控信息"
|
||||||
)
|
)
|
||||||
@@ -37,7 +37,7 @@ async def get_monitor_cache_info_controller(
|
|||||||
|
|
||||||
@CacheRouter.get(
|
@CacheRouter.get(
|
||||||
'/get/names',
|
'/get/names',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:query']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:query']))],
|
||||||
summary="获取缓存名称列表",
|
summary="获取缓存名称列表",
|
||||||
description="获取缓存名称列表"
|
description="获取缓存名称列表"
|
||||||
)
|
)
|
||||||
@@ -55,7 +55,7 @@ async def get_monitor_cache_name_controller() -> JSONResponse:
|
|||||||
|
|
||||||
@CacheRouter.get(
|
@CacheRouter.get(
|
||||||
'/get/keys/{cache_name}',
|
'/get/keys/{cache_name}',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:query']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:query']))],
|
||||||
summary="获取缓存键名列表",
|
summary="获取缓存键名列表",
|
||||||
description="获取缓存键名列表"
|
description="获取缓存键名列表"
|
||||||
)
|
)
|
||||||
@@ -79,7 +79,7 @@ async def get_monitor_cache_key_controller(
|
|||||||
|
|
||||||
@CacheRouter.get(
|
@CacheRouter.get(
|
||||||
'/get/value/{cache_name}/{cache_key}',
|
'/get/value/{cache_name}/{cache_key}',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:query']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:query']))],
|
||||||
summary="获取缓存值",
|
summary="获取缓存值",
|
||||||
description="获取缓存值"
|
description="获取缓存值"
|
||||||
)
|
)
|
||||||
@@ -105,7 +105,7 @@ async def get_monitor_cache_value_controller(
|
|||||||
|
|
||||||
@CacheRouter.delete(
|
@CacheRouter.delete(
|
||||||
'/delete/name/{cache_name}',
|
'/delete/name/{cache_name}',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:delete']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:delete']))],
|
||||||
summary="清除指定缓存名称的所有缓存",
|
summary="清除指定缓存名称的所有缓存",
|
||||||
description="清除指定缓存名称的所有缓存"
|
description="清除指定缓存名称的所有缓存"
|
||||||
)
|
)
|
||||||
@@ -131,7 +131,7 @@ async def clear_monitor_cache_name_controller(
|
|||||||
|
|
||||||
@CacheRouter.delete(
|
@CacheRouter.delete(
|
||||||
'/delete/key/{cache_key}',
|
'/delete/key/{cache_key}',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:delete']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:delete']))],
|
||||||
summary="清除指定缓存键",
|
summary="清除指定缓存键",
|
||||||
description="清除指定缓存键"
|
description="清除指定缓存键"
|
||||||
)
|
)
|
||||||
@@ -157,7 +157,7 @@ async def clear_monitor_cache_key_controller(
|
|||||||
|
|
||||||
@CacheRouter.delete(
|
@CacheRouter.delete(
|
||||||
'/delete/all',
|
'/delete/all',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:cache:delete']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:cache:delete']))],
|
||||||
summary="清除所有缓存",
|
summary="清除所有缓存",
|
||||||
description="清除所有缓存"
|
description="清除所有缓存"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ OnlineRouter = APIRouter(route_class=OperationLogRoute, prefix="/online", tags=[
|
|||||||
|
|
||||||
@OnlineRouter.get(
|
@OnlineRouter.get(
|
||||||
'/list',
|
'/list',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:online:query']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:online:query']))],
|
||||||
summary="获取在线用户列表",
|
summary="获取在线用户列表",
|
||||||
description="获取在线用户列表"
|
description="获取在线用户列表"
|
||||||
)
|
)
|
||||||
@@ -48,7 +48,7 @@ async def get_online_list_controller(
|
|||||||
|
|
||||||
@OnlineRouter.delete(
|
@OnlineRouter.delete(
|
||||||
'/delete',
|
'/delete',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:online:delete']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:online:delete']))],
|
||||||
summary="强制下线",
|
summary="强制下线",
|
||||||
description="强制下线"
|
description="强制下线"
|
||||||
)
|
)
|
||||||
@@ -76,7 +76,7 @@ async def delete_online_controller(
|
|||||||
|
|
||||||
@OnlineRouter.delete(
|
@OnlineRouter.delete(
|
||||||
'/clear',
|
'/clear',
|
||||||
dependencies=[Depends(AuthPermission(['monitor:online:delete']))],
|
dependencies=[Depends(AuthPermission(['module_monitor:online:delete']))],
|
||||||
summary="清除所有在线用户",
|
summary="清除所有在线用户",
|
||||||
description="清除所有在线用户"
|
description="清除所有在线用户"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ ResourceRouter = APIRouter(route_class=OperationLogRoute, prefix="/resource", ta
|
|||||||
"/list",
|
"/list",
|
||||||
summary="获取目录列表",
|
summary="获取目录列表",
|
||||||
description="获取指定目录下的文件和子目录列表",
|
description="获取指定目录下的文件和子目录列表",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:query"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:query"]))]
|
||||||
)
|
)
|
||||||
async def get_directory_list_controller(
|
async def get_directory_list_controller(
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -64,7 +64,7 @@ async def get_directory_list_controller(
|
|||||||
"/upload",
|
"/upload",
|
||||||
summary="上传文件",
|
summary="上传文件",
|
||||||
description="上传文件到指定目录",
|
description="上传文件到指定目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:upload"]))])
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:upload"]))])
|
||||||
async def upload_file_controller(
|
async def upload_file_controller(
|
||||||
file: UploadFile,
|
file: UploadFile,
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -94,7 +94,7 @@ async def upload_file_controller(
|
|||||||
"/download",
|
"/download",
|
||||||
summary="下载文件",
|
summary="下载文件",
|
||||||
description="下载指定文件",
|
description="下载指定文件",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:download"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:download"]))]
|
||||||
)
|
)
|
||||||
async def download_file_controller(
|
async def download_file_controller(
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -131,7 +131,7 @@ async def download_file_controller(
|
|||||||
"/delete",
|
"/delete",
|
||||||
summary="删除文件",
|
summary="删除文件",
|
||||||
description="删除指定文件或目录",
|
description="删除指定文件或目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:delete"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:delete"]))]
|
||||||
)
|
)
|
||||||
async def delete_files_controller(
|
async def delete_files_controller(
|
||||||
paths: List[str] = Body(..., description="文件路径列表")
|
paths: List[str] = Body(..., description="文件路径列表")
|
||||||
@@ -154,7 +154,7 @@ async def delete_files_controller(
|
|||||||
"/move",
|
"/move",
|
||||||
summary="移动文件",
|
summary="移动文件",
|
||||||
description="移动文件或目录",
|
description="移动文件或目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:move"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:move"]))]
|
||||||
)
|
)
|
||||||
async def move_file_controller(
|
async def move_file_controller(
|
||||||
data: ResourceMoveSchema
|
data: ResourceMoveSchema
|
||||||
@@ -177,7 +177,7 @@ async def move_file_controller(
|
|||||||
"/copy",
|
"/copy",
|
||||||
summary="复制文件",
|
summary="复制文件",
|
||||||
description="复制文件或目录",
|
description="复制文件或目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:copy"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:copy"]))]
|
||||||
)
|
)
|
||||||
async def copy_file_controller(
|
async def copy_file_controller(
|
||||||
data: ResourceCopySchema
|
data: ResourceCopySchema
|
||||||
@@ -200,7 +200,7 @@ async def copy_file_controller(
|
|||||||
"/rename",
|
"/rename",
|
||||||
summary="重命名文件",
|
summary="重命名文件",
|
||||||
description="重命名文件或目录",
|
description="重命名文件或目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:rename"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:rename"]))]
|
||||||
)
|
)
|
||||||
async def rename_file_controller(
|
async def rename_file_controller(
|
||||||
data: ResourceRenameSchema
|
data: ResourceRenameSchema
|
||||||
@@ -223,7 +223,7 @@ async def rename_file_controller(
|
|||||||
"/create-dir",
|
"/create-dir",
|
||||||
summary="创建目录",
|
summary="创建目录",
|
||||||
description="在指定路径创建新目录",
|
description="在指定路径创建新目录",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:create_dir"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:create_dir"]))]
|
||||||
)
|
)
|
||||||
async def create_directory_controller(
|
async def create_directory_controller(
|
||||||
data: ResourceCreateDirSchema
|
data: ResourceCreateDirSchema
|
||||||
@@ -246,7 +246,7 @@ async def create_directory_controller(
|
|||||||
"/export",
|
"/export",
|
||||||
summary="导出资源列表",
|
summary="导出资源列表",
|
||||||
description="导出资源列表",
|
description="导出资源列表",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:resource:export"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:resource:export"]))]
|
||||||
)
|
)
|
||||||
async def export_resource_list_controller(
|
async def export_resource_list_controller(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ ServerRouter = APIRouter(route_class=OperationLogRoute, prefix="/server", tags=[
|
|||||||
'/info',
|
'/info',
|
||||||
summary="查询服务器监控信息",
|
summary="查询服务器监控信息",
|
||||||
description="查询服务器监控信息",
|
description="查询服务器监控信息",
|
||||||
dependencies=[Depends(AuthPermission(["monitor:server:query"]))]
|
dependencies=[Depends(AuthPermission(["module_monitor:server:query"]))]
|
||||||
)
|
)
|
||||||
async def get_monitor_server_info_controller() -> JSONResponse:
|
async def get_monitor_server_info_controller() -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ DeptRouter = APIRouter(route_class=OperationLogRoute, prefix="/dept", tags=["部
|
|||||||
@DeptRouter.get("/tree", summary="查询部门树", description="查询部门树")
|
@DeptRouter.get("/tree", summary="查询部门树", description="查询部门树")
|
||||||
async def get_dept_tree_controller(
|
async def get_dept_tree_controller(
|
||||||
search: DeptQueryParam = Depends(),
|
search: DeptQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询部门树
|
查询部门树
|
||||||
@@ -47,7 +47,7 @@ async def get_dept_tree_controller(
|
|||||||
@DeptRouter.get("/detail/{id}", summary="查询部门详情", description="查询部门详情")
|
@DeptRouter.get("/detail/{id}", summary="查询部门详情", description="查询部门详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="部门ID"),
|
id: int = Path(..., description="部门ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询部门详情
|
查询部门详情
|
||||||
@@ -70,7 +70,7 @@ async def get_obj_detail_controller(
|
|||||||
@DeptRouter.post("/create", summary="创建部门", description="创建部门")
|
@DeptRouter.post("/create", summary="创建部门", description="创建部门")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: DeptCreateSchema,
|
data: DeptCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建部门
|
创建部门
|
||||||
@@ -94,7 +94,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: DeptUpdateSchema,
|
data: DeptUpdateSchema,
|
||||||
id: int = Path(..., description="部门ID"),
|
id: int = Path(..., description="部门ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改部门
|
修改部门
|
||||||
@@ -118,7 +118,7 @@ async def update_obj_controller(
|
|||||||
@DeptRouter.delete("/delete", summary="删除部门", description="删除部门")
|
@DeptRouter.delete("/delete", summary="删除部门", description="删除部门")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除部门
|
删除部门
|
||||||
@@ -141,7 +141,7 @@ async def delete_obj_controller(
|
|||||||
@DeptRouter.patch("/available/setting", summary="批量修改部门状态", description="批量修改部门状态")
|
@DeptRouter.patch("/available/setting", summary="批量修改部门状态", description="批量修改部门状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dept:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dept:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改部门状态
|
批量修改部门状态
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ DictRouter = APIRouter(route_class=OperationLogRoute, prefix="/dict", tags=["字
|
|||||||
@DictRouter.get("/type/detail/{id}", summary="获取字典类型详情", description="获取字典类型详情")
|
@DictRouter.get("/type/detail/{id}", summary="获取字典类型详情", description="获取字典类型详情")
|
||||||
async def get_type_detail_controller(
|
async def get_type_detail_controller(
|
||||||
id: int = Path(..., description="字典类型ID"),
|
id: int = Path(..., description="字典类型ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取字典类型详情
|
获取字典类型详情
|
||||||
@@ -52,7 +52,7 @@ async def get_type_detail_controller(
|
|||||||
async def get_type_list_controller(
|
async def get_type_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: DictTypeQueryParam = Depends(),
|
search: DictTypeQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询字典类型列表
|
查询字典类型列表
|
||||||
@@ -75,7 +75,7 @@ async def get_type_list_controller(
|
|||||||
|
|
||||||
@DictRouter.get("/type/optionselect", summary="获取全部字典类型", description="获取全部字典类型")
|
@DictRouter.get("/type/optionselect", summary="获取全部字典类型", description="获取全部字典类型")
|
||||||
async def get_type_loptionselect_controller(
|
async def get_type_loptionselect_controller(
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取全部字典类型
|
获取全部字典类型
|
||||||
@@ -97,7 +97,7 @@ async def get_type_loptionselect_controller(
|
|||||||
async def create_type_controller(
|
async def create_type_controller(
|
||||||
data: DictTypeCreateSchema,
|
data: DictTypeCreateSchema,
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建字典类型
|
创建字典类型
|
||||||
@@ -122,7 +122,7 @@ async def update_type_controller(
|
|||||||
data: DictTypeUpdateSchema,
|
data: DictTypeUpdateSchema,
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
id: int = Path(..., description="字典类型ID"),
|
id: int = Path(..., description="字典类型ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改字典类型
|
修改字典类型
|
||||||
@@ -147,7 +147,7 @@ async def update_type_controller(
|
|||||||
async def delete_type_controller(
|
async def delete_type_controller(
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除字典类型
|
删除字典类型
|
||||||
@@ -170,7 +170,7 @@ async def delete_type_controller(
|
|||||||
@DictRouter.patch("/type/available/setting", summary="批量修改字典类型状态", description="批量修改字典类型状态")
|
@DictRouter.patch("/type/available/setting", summary="批量修改字典类型状态", description="批量修改字典类型状态")
|
||||||
async def batch_set_available_dict_type_controller(
|
async def batch_set_available_dict_type_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改字典类型状态
|
批量修改字典类型状态
|
||||||
@@ -192,7 +192,7 @@ async def batch_set_available_dict_type_controller(
|
|||||||
@DictRouter.post('/type/export', summary="导出字典类型", description="导出字典类型")
|
@DictRouter.post('/type/export', summary="导出字典类型", description="导出字典类型")
|
||||||
async def export_type_list_controller(
|
async def export_type_list_controller(
|
||||||
search: DictTypeQueryParam = Depends(),
|
search: DictTypeQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_type:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出字典类型
|
导出字典类型
|
||||||
@@ -223,7 +223,7 @@ async def export_type_list_controller(
|
|||||||
@DictRouter.get("/data/detail/{id}", summary="获取字典数据详情", description="获取字典数据详情")
|
@DictRouter.get("/data/detail/{id}", summary="获取字典数据详情", description="获取字典数据详情")
|
||||||
async def get_data_detail_controller(
|
async def get_data_detail_controller(
|
||||||
id: int = Path(..., description="字典数据ID"),
|
id: int = Path(..., description="字典数据ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取字典数据详情
|
获取字典数据详情
|
||||||
@@ -246,7 +246,7 @@ async def get_data_detail_controller(
|
|||||||
async def get_data_list_controller(
|
async def get_data_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: DictDataQueryParam = Depends(),
|
search: DictDataQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询字典数据
|
查询字典数据
|
||||||
@@ -274,7 +274,7 @@ async def get_data_list_controller(
|
|||||||
async def create_data_controller(
|
async def create_data_controller(
|
||||||
data: DictDataCreateSchema,
|
data: DictDataCreateSchema,
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建字典数据
|
创建字典数据
|
||||||
@@ -299,7 +299,7 @@ async def update_data_controller(
|
|||||||
data: DictDataUpdateSchema,
|
data: DictDataUpdateSchema,
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
id: int = Path(..., description="字典数据ID"),
|
id: int = Path(..., description="字典数据ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改字典数据
|
修改字典数据
|
||||||
@@ -324,7 +324,7 @@ async def update_data_controller(
|
|||||||
async def delete_data_controller(
|
async def delete_data_controller(
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除字典数据
|
删除字典数据
|
||||||
@@ -347,7 +347,7 @@ async def delete_data_controller(
|
|||||||
@DictRouter.patch("/data/available/setting", summary="批量修改字典数据状态", description="批量修改字典数据状态")
|
@DictRouter.patch("/data/available/setting", summary="批量修改字典数据状态", description="批量修改字典数据状态")
|
||||||
async def batch_set_available_dict_data_controller(
|
async def batch_set_available_dict_data_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改字典数据状态
|
批量修改字典数据状态
|
||||||
@@ -370,7 +370,7 @@ async def batch_set_available_dict_data_controller(
|
|||||||
async def export_data_list_controller(
|
async def export_data_list_controller(
|
||||||
search: DictDataQueryParam = Depends(),
|
search: DictDataQueryParam = Depends(),
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:dict_data:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出字典数据
|
导出字典数据
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ LogRouter = APIRouter(route_class=OperationLogRoute, prefix="/log", tags=["日
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: OperationLogQueryParam = Depends(),
|
search: OperationLogQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:log:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:log:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询日志
|
查询日志
|
||||||
@@ -47,7 +47,7 @@ async def get_obj_list_controller(
|
|||||||
@LogRouter.get("/detail/{id}", summary="日志详情", description="日志详情")
|
@LogRouter.get("/detail/{id}", summary="日志详情", description="日志详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="操作日志ID"),
|
id: int = Path(..., description="操作日志ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:log:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:log:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取日志详情
|
获取日志详情
|
||||||
@@ -67,7 +67,7 @@ async def get_obj_detail_controller(
|
|||||||
@LogRouter.delete("/delete", summary="删除日志", description="删除日志")
|
@LogRouter.delete("/delete", summary="删除日志", description="删除日志")
|
||||||
async def delete_obj_log_controller(
|
async def delete_obj_log_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:log:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:log:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除日志
|
删除日志
|
||||||
@@ -87,7 +87,7 @@ async def delete_obj_log_controller(
|
|||||||
@LogRouter.post("/export", summary="导出日志", description="导出日志")
|
@LogRouter.post("/export", summary="导出日志", description="导出日志")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: OperationLogQueryParam = Depends(),
|
search: OperationLogQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:log:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:log:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出日志
|
导出日志
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ MenuRouter = APIRouter(route_class=OperationLogRoute, prefix="/menu", tags=["菜
|
|||||||
@MenuRouter.get("/tree", summary="查询菜单树", description="查询菜单树")
|
@MenuRouter.get("/tree", summary="查询菜单树", description="查询菜单树")
|
||||||
async def get_menu_tree_controller(
|
async def get_menu_tree_controller(
|
||||||
search: MenuQueryParam = Depends(),
|
search: MenuQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询菜单树。
|
查询菜单树。
|
||||||
@@ -42,7 +42,7 @@ async def get_menu_tree_controller(
|
|||||||
@MenuRouter.get("/detail/{id}", summary="查询菜单详情", description="查询菜单详情")
|
@MenuRouter.get("/detail/{id}", summary="查询菜单详情", description="查询菜单详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="菜单ID"),
|
id: int = Path(..., description="菜单ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询菜单详情。
|
查询菜单详情。
|
||||||
@@ -61,7 +61,7 @@ async def get_obj_detail_controller(
|
|||||||
@MenuRouter.post("/create", summary="创建菜单", description="创建菜单")
|
@MenuRouter.post("/create", summary="创建菜单", description="创建菜单")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: MenuCreateSchema,
|
data: MenuCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建菜单。
|
创建菜单。
|
||||||
@@ -81,7 +81,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: MenuUpdateSchema,
|
data: MenuUpdateSchema,
|
||||||
id: int = Path(..., description="菜单ID"),
|
id: int = Path(..., description="菜单ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改菜单。
|
修改菜单。
|
||||||
@@ -101,7 +101,7 @@ async def update_obj_controller(
|
|||||||
@MenuRouter.delete("/delete", summary="删除菜单", description="删除菜单")
|
@MenuRouter.delete("/delete", summary="删除菜单", description="删除菜单")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除菜单。
|
删除菜单。
|
||||||
@@ -120,7 +120,7 @@ async def delete_obj_controller(
|
|||||||
@MenuRouter.patch("/available/setting", summary="批量修改菜单状态", description="批量修改菜单状态")
|
@MenuRouter.patch("/available/setting", summary="批量修改菜单状态", description="批量修改菜单状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:menu:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:menu:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改菜单状态。
|
批量修改菜单状态。
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class MenuModel(ModelMixin):
|
|||||||
type: Mapped[int] = mapped_column(Integer, nullable=False, default=2, comment='菜单类型(1:目录 2:菜单 3:按钮/权限 4:链接)')
|
type: Mapped[int] = mapped_column(Integer, nullable=False, default=2, comment='菜单类型(1:目录 2:菜单 3:按钮/权限 4:链接)')
|
||||||
order: Mapped[int] = mapped_column(Integer, nullable=False, default=999, comment='显示排序')
|
order: Mapped[int] = mapped_column(Integer, nullable=False, default=999, comment='显示排序')
|
||||||
status: Mapped[bool] = mapped_column(Boolean(), default=True, nullable=False, comment="是否启用(True:启用 False:禁用)")
|
status: Mapped[bool] = mapped_column(Boolean(), default=True, nullable=False, comment="是否启用(True:启用 False:禁用)")
|
||||||
permission: Mapped[Optional[str]] = mapped_column(String(100), comment='权限标识(如:system:user:list)')
|
permission: Mapped[Optional[str]] = mapped_column(String(100), comment='权限标识(如:module_system:user:list)')
|
||||||
icon: Mapped[Optional[str]] = mapped_column(String(50), comment='菜单图标')
|
icon: Mapped[Optional[str]] = mapped_column(String(50), comment='菜单图标')
|
||||||
route_name: Mapped[Optional[str]] = mapped_column(String(100), comment='路由名称')
|
route_name: Mapped[Optional[str]] = mapped_column(String(100), comment='路由名称')
|
||||||
route_path: Mapped[Optional[str]] = mapped_column(String(200), comment='路由路径')
|
route_path: Mapped[Optional[str]] = mapped_column(String(200), comment='路由路径')
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ NoticeRouter = APIRouter(route_class=OperationLogRoute, prefix="/notice", tags=[
|
|||||||
@NoticeRouter.get("/detail/{id}", summary="获取公告详情", description="获取公告详情")
|
@NoticeRouter.get("/detail/{id}", summary="获取公告详情", description="获取公告详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="公告ID"),
|
id: int = Path(..., description="公告ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取公告详情。
|
获取公告详情。
|
||||||
@@ -45,7 +45,7 @@ async def get_obj_detail_controller(
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: NoticeQueryParam = Depends(),
|
search: NoticeQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询公告。
|
查询公告。
|
||||||
@@ -66,7 +66,7 @@ async def get_obj_list_controller(
|
|||||||
@NoticeRouter.post("/create", summary="创建公告", description="创建公告")
|
@NoticeRouter.post("/create", summary="创建公告", description="创建公告")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: NoticeCreateSchema,
|
data: NoticeCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建公告。
|
创建公告。
|
||||||
@@ -86,7 +86,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: NoticeUpdateSchema,
|
data: NoticeUpdateSchema,
|
||||||
id: int = Path(..., description="公告ID"),
|
id: int = Path(..., description="公告ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改公告。
|
修改公告。
|
||||||
@@ -106,7 +106,7 @@ async def update_obj_controller(
|
|||||||
@NoticeRouter.delete("/delete", summary="删除公告", description="删除公告")
|
@NoticeRouter.delete("/delete", summary="删除公告", description="删除公告")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除公告。
|
删除公告。
|
||||||
@@ -125,7 +125,7 @@ async def delete_obj_controller(
|
|||||||
@NoticeRouter.patch("/available/setting", summary="批量修改公告状态", description="批量修改公告状态")
|
@NoticeRouter.patch("/available/setting", summary="批量修改公告状态", description="批量修改公告状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:patch"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:patch"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改公告状态。
|
批量修改公告状态。
|
||||||
@@ -144,7 +144,7 @@ async def batch_set_available_obj_controller(
|
|||||||
@NoticeRouter.post('/export', summary="导出公告", description="导出公告")
|
@NoticeRouter.post('/export', summary="导出公告", description="导出公告")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: NoticeQueryParam = Depends(),
|
search: NoticeQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:notice:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:notice:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出公告。
|
导出公告。
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ ParamsRouter = APIRouter(route_class=OperationLogRoute, prefix="/param", tags=["
|
|||||||
@ParamsRouter.get("/detail/{id}", summary="获取参数详情", description="获取参数详情")
|
@ParamsRouter.get("/detail/{id}", summary="获取参数详情", description="获取参数详情")
|
||||||
async def get_type_detail_controller(
|
async def get_type_detail_controller(
|
||||||
id: int = Path(..., description="参数ID"),
|
id: int = Path(..., description="参数ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
获取参数详情
|
获取参数详情
|
||||||
@@ -43,7 +43,7 @@ async def get_type_detail_controller(
|
|||||||
@ParamsRouter.get("/key/{config_key}", summary="根据配置键获取参数详情", description="根据配置键获取参数详情")
|
@ParamsRouter.get("/key/{config_key}", summary="根据配置键获取参数详情", description="根据配置键获取参数详情")
|
||||||
async def get_obj_by_key_controller(
|
async def get_obj_by_key_controller(
|
||||||
config_key: str = Path(..., description="配置键"),
|
config_key: str = Path(..., description="配置键"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
根据配置键获取参数详情
|
根据配置键获取参数详情
|
||||||
@@ -63,7 +63,7 @@ async def get_obj_by_key_controller(
|
|||||||
@ParamsRouter.get("/value/{config_key}", summary="根据配置键获取参数值", description="根据配置键获取参数值")
|
@ParamsRouter.get("/value/{config_key}", summary="根据配置键获取参数值", description="根据配置键获取参数值")
|
||||||
async def get_config_value_by_key_controller(
|
async def get_config_value_by_key_controller(
|
||||||
config_key: str = Path(..., description="配置键"),
|
config_key: str = Path(..., description="配置键"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:query"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:query"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
根据配置键获取参数值
|
根据配置键获取参数值
|
||||||
@@ -82,7 +82,7 @@ async def get_config_value_by_key_controller(
|
|||||||
|
|
||||||
@ParamsRouter.get("/list", summary="获取参数列表", description="获取参数列表")
|
@ParamsRouter.get("/list", summary="获取参数列表", description="获取参数列表")
|
||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:query"])),
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: ParamsQueryParam = Depends(),
|
search: ParamsQueryParam = Depends(),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
@@ -107,7 +107,7 @@ async def get_obj_list_controller(
|
|||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: ParamsCreateSchema,
|
data: ParamsCreateSchema,
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:create"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:create"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建参数
|
创建参数
|
||||||
@@ -130,7 +130,7 @@ async def update_objs_controller(
|
|||||||
data: ParamsUpdateSchema,
|
data: ParamsUpdateSchema,
|
||||||
id: int = Path(..., description="参数ID"),
|
id: int = Path(..., description="参数ID"),
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:update"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:update"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改参数
|
修改参数
|
||||||
@@ -153,7 +153,7 @@ async def update_objs_controller(
|
|||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
redis: Redis = Depends(redis_getter),
|
redis: Redis = Depends(redis_getter),
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:delete"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:delete"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除参数
|
删除参数
|
||||||
@@ -174,7 +174,7 @@ async def delete_obj_controller(
|
|||||||
@ParamsRouter.post('/export', summary="导出参数", description="导出参数")
|
@ParamsRouter.post('/export', summary="导出参数", description="导出参数")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: ParamsQueryParam = Depends(),
|
search: ParamsQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:param:export"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:param:export"]))
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出参数
|
导出参数
|
||||||
@@ -199,7 +199,7 @@ async def export_obj_list_controller(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ParamsRouter.post("/upload", summary="上传文件", dependencies=[Depends(AuthPermission(["system:param:upload"]))])
|
@ParamsRouter.post("/upload", summary="上传文件", dependencies=[Depends(AuthPermission(["module_system:param:upload"]))])
|
||||||
async def upload_file_controller(
|
async def upload_file_controller(
|
||||||
file: UploadFile,
|
file: UploadFile,
|
||||||
request: Request
|
request: Request
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ PositionRouter = APIRouter(route_class=OperationLogRoute, prefix="/position", ta
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: PositionQueryParam = Depends(),
|
search: PositionQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询岗位列表
|
查询岗位列表
|
||||||
@@ -52,7 +52,7 @@ async def get_obj_list_controller(
|
|||||||
@PositionRouter.get("/detail/{id}", summary="查询岗位详情", description="查询岗位详情")
|
@PositionRouter.get("/detail/{id}", summary="查询岗位详情", description="查询岗位详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="岗位ID"),
|
id: int = Path(..., description="岗位ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询岗位详情
|
查询岗位详情
|
||||||
@@ -72,7 +72,7 @@ async def get_obj_detail_controller(
|
|||||||
@PositionRouter.post("/create", summary="创建岗位", description="创建岗位")
|
@PositionRouter.post("/create", summary="创建岗位", description="创建岗位")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: PositionCreateSchema,
|
data: PositionCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:create"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:create"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建岗位
|
创建岗位
|
||||||
@@ -93,7 +93,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: PositionUpdateSchema,
|
data: PositionUpdateSchema,
|
||||||
id: int = Path(..., description="岗位ID"),
|
id: int = Path(..., description="岗位ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:update"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:update"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改岗位
|
修改岗位
|
||||||
@@ -114,7 +114,7 @@ async def update_obj_controller(
|
|||||||
@PositionRouter.delete("/delete", summary="删除岗位", description="删除岗位")
|
@PositionRouter.delete("/delete", summary="删除岗位", description="删除岗位")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:delete"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:delete"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除岗位
|
删除岗位
|
||||||
@@ -134,7 +134,7 @@ async def delete_obj_controller(
|
|||||||
@PositionRouter.patch("/available/setting", summary="批量修改岗位状态", description="批量修改岗位状态")
|
@PositionRouter.patch("/available/setting", summary="批量修改岗位状态", description="批量修改岗位状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:patch"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:patch"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改岗位状态
|
批量修改岗位状态
|
||||||
@@ -154,7 +154,7 @@ async def batch_set_available_obj_controller(
|
|||||||
@PositionRouter.post('/export', summary="导出岗位", description="导出岗位")
|
@PositionRouter.post('/export', summary="导出岗位", description="导出岗位")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: PositionQueryParam = Depends(),
|
search: PositionQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:position:export"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:position:export"])),
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出岗位
|
导出岗位
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ RoleRouter = APIRouter(route_class=OperationLogRoute, prefix="/role", tags=["角
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: RoleQueryParam = Depends(),
|
search: RoleQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询角色
|
查询角色
|
||||||
@@ -53,7 +53,7 @@ async def get_obj_list_controller(
|
|||||||
@RoleRouter.get("/detail/{id}", summary="查询角色详情", description="查询角色详情")
|
@RoleRouter.get("/detail/{id}", summary="查询角色详情", description="查询角色详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="角色ID"),
|
id: int = Path(..., description="角色ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询角色详情
|
查询角色详情
|
||||||
@@ -73,7 +73,7 @@ async def get_obj_detail_controller(
|
|||||||
@RoleRouter.post("/create", summary="创建角色", description="创建角色")
|
@RoleRouter.post("/create", summary="创建角色", description="创建角色")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: RoleCreateSchema,
|
data: RoleCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:create"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:create"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建角色
|
创建角色
|
||||||
@@ -94,7 +94,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: RoleUpdateSchema,
|
data: RoleUpdateSchema,
|
||||||
id: int = Path(..., description="角色ID"),
|
id: int = Path(..., description="角色ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:update"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:update"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改角色
|
修改角色
|
||||||
@@ -115,7 +115,7 @@ async def update_obj_controller(
|
|||||||
@RoleRouter.delete("/delete", summary="删除角色", description="删除角色")
|
@RoleRouter.delete("/delete", summary="删除角色", description="删除角色")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:delete"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:delete"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除角色
|
删除角色
|
||||||
@@ -135,7 +135,7 @@ async def delete_obj_controller(
|
|||||||
@RoleRouter.patch("/available/setting", summary="批量修改角色状态", description="批量修改角色状态")
|
@RoleRouter.patch("/available/setting", summary="批量修改角色状态", description="批量修改角色状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:patch"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:patch"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改角色状态
|
批量修改角色状态
|
||||||
@@ -155,7 +155,7 @@ async def batch_set_available_obj_controller(
|
|||||||
@RoleRouter.patch("/permission/setting", summary="角色授权", description="角色授权")
|
@RoleRouter.patch("/permission/setting", summary="角色授权", description="角色授权")
|
||||||
async def set_role_permission_controller(
|
async def set_role_permission_controller(
|
||||||
data: RolePermissionSettingSchema,
|
data: RolePermissionSettingSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:permission"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:permission"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
角色授权
|
角色授权
|
||||||
@@ -175,7 +175,7 @@ async def set_role_permission_controller(
|
|||||||
@RoleRouter.post('/export', summary="导出角色", description="导出角色")
|
@RoleRouter.post('/export', summary="导出角色", description="导出角色")
|
||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
search: RoleQueryParam = Depends(),
|
search: RoleQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:role:export"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:role:export"])),
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出角色
|
导出角色
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
@@ -0,0 +1,214 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from fastapi import APIRouter, Body, Depends, Path, UploadFile
|
||||||
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
|
from app.common.response import StreamResponse, SuccessResponse
|
||||||
|
from app.utils.common_util import bytes2file_response
|
||||||
|
from app.core.base_params import PaginationQueryParam
|
||||||
|
from app.core.dependencies import AuthPermission
|
||||||
|
from app.core.router_class import OperationLogRoute
|
||||||
|
from app.core.base_schema import BatchSetAvailable
|
||||||
|
from app.core.logger import logger
|
||||||
|
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||||
|
from .param import TenantQueryParam
|
||||||
|
from .service import TenantService
|
||||||
|
from .schema import (
|
||||||
|
TenantCreateSchema,
|
||||||
|
TenantUpdateSchema
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
TenantRouter = APIRouter(route_class=OperationLogRoute, prefix="/tenant", tags=["租户模块"])
|
||||||
|
|
||||||
|
@TenantRouter.get("/detail/{id}", summary="获取租户详情", description="获取租户详情")
|
||||||
|
async def get_obj_detail_controller(
|
||||||
|
id: int = Path(..., description="租户ID"),
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:query"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
获取租户详情
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- id (int): 租户ID
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含租户详情的JSON响应
|
||||||
|
"""
|
||||||
|
result_dict = await TenantService.detail_service(id=id, auth=auth)
|
||||||
|
logger.info(f"获取租户详情成功 {id}")
|
||||||
|
return SuccessResponse(data=result_dict, msg="获取租户详情成功")
|
||||||
|
|
||||||
|
@TenantRouter.get("/list", summary="查询租户列表", description="查询租户列表")
|
||||||
|
async def get_obj_list_controller(
|
||||||
|
page: PaginationQueryParam = Depends(),
|
||||||
|
search: TenantQueryParam = Depends(),
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:query"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
查询租户列表
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- page (PaginationQueryParam): 分页查询参数
|
||||||
|
- search (TenantQueryParam): 查询参数
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含租户列表分页信息的JSON响应
|
||||||
|
"""
|
||||||
|
# 使用数据库分页而不是应用层分页
|
||||||
|
result_dict = await TenantService.page_service(
|
||||||
|
auth=auth,
|
||||||
|
page_no=page.page_no if page.page_no is not None else 1,
|
||||||
|
page_size=page.page_size if page.page_size is not None else 10,
|
||||||
|
search=search,
|
||||||
|
order_by=page.order_by
|
||||||
|
)
|
||||||
|
logger.info("查询租户列表成功")
|
||||||
|
return SuccessResponse(data=result_dict, msg="查询租户列表成功")
|
||||||
|
|
||||||
|
@TenantRouter.post("/create", summary="创建租户", description="创建租户")
|
||||||
|
async def create_obj_controller(
|
||||||
|
data: TenantCreateSchema,
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:create"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
创建租户
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- data (TenantCreateSchema): 租户创建模型
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含创建租户详情的JSON响应
|
||||||
|
"""
|
||||||
|
result_dict = await TenantService.create_service(auth=auth, data=data)
|
||||||
|
logger.info(f"创建租户成功: {result_dict.get('name')}")
|
||||||
|
return SuccessResponse(data=result_dict, msg="创建租户成功")
|
||||||
|
|
||||||
|
@TenantRouter.put("/update/{id}", summary="修改租户", description="修改租户")
|
||||||
|
async def update_obj_controller(
|
||||||
|
data: TenantUpdateSchema,
|
||||||
|
id: int = Path(..., description="租户ID"),
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:update"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
修改租户
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- data (TenantUpdateSchema): 租户更新模型
|
||||||
|
- id (int): 租户ID
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含修改租户详情的JSON响应
|
||||||
|
"""
|
||||||
|
result_dict = await TenantService.update_service(auth=auth, id=id, data=data)
|
||||||
|
logger.info(f"修改租户成功: {result_dict.get('name')}")
|
||||||
|
return SuccessResponse(data=result_dict, msg="修改租户成功")
|
||||||
|
|
||||||
|
@TenantRouter.delete("/delete", summary="删除租户", description="删除租户")
|
||||||
|
async def delete_obj_controller(
|
||||||
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:delete"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
删除租户
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- ids (list[int]): 租户ID列表
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含删除租户详情的JSON响应
|
||||||
|
"""
|
||||||
|
await TenantService.delete_service(auth=auth, ids=ids)
|
||||||
|
logger.info(f"删除租户成功: {ids}")
|
||||||
|
return SuccessResponse(msg="删除租户成功")
|
||||||
|
|
||||||
|
@TenantRouter.patch("/available/setting", summary="批量修改租户状态", description="批量修改租户状态")
|
||||||
|
async def batch_set_available_obj_controller(
|
||||||
|
data: BatchSetAvailable,
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:patch"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
批量修改租户状态
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- data (BatchSetAvailable): 批量修改租户状态模型
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含批量修改租户状态详情的JSON响应
|
||||||
|
"""
|
||||||
|
await TenantService.set_available_service(auth=auth, data=data)
|
||||||
|
logger.info(f"批量修改租户状态成功: {data.ids}")
|
||||||
|
return SuccessResponse(msg="批量修改租户状态成功")
|
||||||
|
|
||||||
|
@TenantRouter.post('/export', summary="导出租户", description="导出租户")
|
||||||
|
async def export_obj_list_controller(
|
||||||
|
search: TenantQueryParam = Depends(),
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:export"]))
|
||||||
|
) -> StreamingResponse:
|
||||||
|
"""
|
||||||
|
导出租户
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- search (TenantQueryParam): 查询参数
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- StreamingResponse: 包含租户列表的Excel文件流响应
|
||||||
|
"""
|
||||||
|
result_dict_list = await TenantService.list_service(search=search, auth=auth)
|
||||||
|
export_result = await TenantService.batch_export_service(obj_list=result_dict_list)
|
||||||
|
logger.info('导出租户成功')
|
||||||
|
|
||||||
|
return StreamResponse(
|
||||||
|
data=bytes2file_response(export_result),
|
||||||
|
media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
headers={
|
||||||
|
'Content-Disposition': 'attachment; filename=example.xlsx'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
@TenantRouter.post('/import', summary="导入租户", description="导入租户")
|
||||||
|
async def import_obj_list_controller(
|
||||||
|
file: UploadFile,
|
||||||
|
auth: AuthSchema = Depends(AuthPermission(["module_system:tenant:import"]))
|
||||||
|
) -> JSONResponse:
|
||||||
|
"""
|
||||||
|
导入租户
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- file (UploadFile): 导入的Excel文件
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- JSONResponse: 包含导入租户详情的JSON响应
|
||||||
|
"""
|
||||||
|
batch_import_result = await TenantService.batch_import_service(file=file, auth=auth, update_support=True)
|
||||||
|
logger.info(f"导入租户成功: {batch_import_result}")
|
||||||
|
return SuccessResponse(data=batch_import_result, msg="导入租户成功")
|
||||||
|
|
||||||
|
@TenantRouter.post('/download/template', summary="获取租户导入模板", description="获取租户导入模板", dependencies=[Depends(AuthPermission(["module_system:tenant:download"]))])
|
||||||
|
async def export_obj_template_controller() -> StreamingResponse:
|
||||||
|
"""
|
||||||
|
获取租户导入模板
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- StreamingResponse: 包含租户导入模板的Excel文件流响应
|
||||||
|
"""
|
||||||
|
example_import_template_result = await TenantService.import_template_download_service()
|
||||||
|
logger.info('获取租户导入模板成功')
|
||||||
|
|
||||||
|
return StreamResponse(
|
||||||
|
data=bytes2file_response(example_import_template_result),
|
||||||
|
media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
headers={
|
||||||
|
'Content-Disposition': f'attachment; filename={urllib.parse.quote("租户导入模板.xlsx")}',
|
||||||
|
'Access-Control-Expose-Headers': 'Content-Disposition'
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from typing import Dict, List, Optional, Sequence, Union, Any
|
||||||
|
|
||||||
|
from app.core.base_crud import CRUDBase
|
||||||
|
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||||
|
from .model import TenantModel
|
||||||
|
from .schema import TenantCreateSchema, TenantUpdateSchema, TenantOutSchema
|
||||||
|
|
||||||
|
|
||||||
|
class TenantCRUD(CRUDBase[TenantModel, TenantCreateSchema, TenantUpdateSchema]):
|
||||||
|
"""租户数据层"""
|
||||||
|
|
||||||
|
def __init__(self, auth: AuthSchema) -> None:
|
||||||
|
"""
|
||||||
|
初始化CRUD数据层
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
"""
|
||||||
|
super().__init__(model=TenantModel, auth=auth)
|
||||||
|
|
||||||
|
async def get_by_id_crud(self, id: int, preload: Optional[List[Union[str, Any]]] = None) -> Optional[TenantModel]:
|
||||||
|
"""
|
||||||
|
详情
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- id (int): 租户ID
|
||||||
|
- preload (Optional[List[Union[str, Any]]]): 预加载关系,未提供时使用模型默认项
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Optional[TenantModel]: 租户模型实例或None
|
||||||
|
"""
|
||||||
|
return await self.get(id=id, preload=preload)
|
||||||
|
|
||||||
|
async def list_crud(self, search: Optional[Dict] = None, order_by: Optional[List[Dict[str, str]]] = None, preload: Optional[List[Union[str, Any]]] = None) -> Sequence[TenantModel]:
|
||||||
|
"""
|
||||||
|
列表查询
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- search (Optional[Dict]): 查询参数
|
||||||
|
- order_by (Optional[List[Dict[str, str]]]): 排序参数
|
||||||
|
- preload (Optional[List[Union[str, Any]]]): 预加载关系,未提供时使用模型默认项
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Sequence[TenantModel]: 租户模型实例序列
|
||||||
|
"""
|
||||||
|
return await self.list(search=search, order_by=order_by, preload=preload)
|
||||||
|
|
||||||
|
async def create_crud(self, data: TenantCreateSchema) -> Optional[TenantModel]:
|
||||||
|
"""
|
||||||
|
创建
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- data (TenantCreateSchema): 租户创建模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Optional[TenantModel]: 租户模型实例或None
|
||||||
|
"""
|
||||||
|
return await self.create(data=data)
|
||||||
|
|
||||||
|
async def update_crud(self, id: int, data: TenantUpdateSchema) -> Optional[TenantModel]:
|
||||||
|
"""
|
||||||
|
更新
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- id (int): 租户ID
|
||||||
|
- data (TenantUpdateSchema): 租户更新模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Optional[TenantModel]: 租户模型实例或None
|
||||||
|
"""
|
||||||
|
return await self.update(id=id, data=data)
|
||||||
|
|
||||||
|
async def delete_crud(self, ids: List[int]) -> None:
|
||||||
|
"""
|
||||||
|
批量删除
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- ids (List[int]): 租户ID列表
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- None
|
||||||
|
"""
|
||||||
|
return await self.delete(ids=ids)
|
||||||
|
|
||||||
|
async def set_available_crud(self, ids: List[int], status: bool) -> None:
|
||||||
|
"""
|
||||||
|
批量设置可用状态
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- ids (List[int]): 租户ID列表
|
||||||
|
- status (bool): 可用状态
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- None
|
||||||
|
"""
|
||||||
|
return await self.set(ids=ids, status=status)
|
||||||
|
|
||||||
|
async def page_crud(self, offset: int, limit: int, order_by: Optional[List[Dict[str, str]]] = None, search: Optional[Dict] = None, preload: Optional[List[Union[str, Any]]] = None) -> Dict:
|
||||||
|
"""
|
||||||
|
分页查询
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- offset (int): 偏移量
|
||||||
|
- limit (int): 每页数量
|
||||||
|
- order_by (Optional[List[Dict[str, str]]]): 排序参数
|
||||||
|
- search (Optional[Dict]): 查询参数
|
||||||
|
- preload (Optional[List[Union[str, Any]]]): 预加载关系,未提供时使用模型默认项
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Dict: 分页数据
|
||||||
|
"""
|
||||||
|
order_by_list = order_by or [{'id': 'asc'}]
|
||||||
|
search_dict = search or {}
|
||||||
|
|
||||||
|
return await self.page(
|
||||||
|
offset=offset,
|
||||||
|
limit=limit,
|
||||||
|
order_by=order_by_list,
|
||||||
|
search=search_dict,
|
||||||
|
out_schema=TenantOutSchema,
|
||||||
|
preload=preload
|
||||||
|
)
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
from sqlalchemy import Boolean, String
|
||||||
|
from sqlalchemy.orm import Mapped, mapped_column, validates
|
||||||
|
|
||||||
|
from app.core.base_model import ModelMixin
|
||||||
|
|
||||||
|
|
||||||
|
class TenantModel(ModelMixin):
|
||||||
|
"""
|
||||||
|
租户表
|
||||||
|
"""
|
||||||
|
__tablename__ = 'system_tenant'
|
||||||
|
__table_args__ = ({'comment': '租户表'})
|
||||||
|
|
||||||
|
name: Mapped[Optional[str]] = mapped_column(String(64), nullable=True, default='', comment='租户名称')
|
||||||
|
status: Mapped[bool] = mapped_column(Boolean(), default=True, nullable=False, comment="是否启用(True:启用 False:禁用)")
|
||||||
|
|
||||||
|
@validates('name')
|
||||||
|
def validate_name(self, key: str, name: str) -> str:
|
||||||
|
"""验证名称不为空"""
|
||||||
|
if not name or not name.strip():
|
||||||
|
raise ValueError('名称不能为空')
|
||||||
|
return name
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
from fastapi import Query
|
||||||
|
|
||||||
|
from app.core.validator import DateTimeStr
|
||||||
|
|
||||||
|
class TenantQueryParam:
|
||||||
|
"""租户查询参数"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
name: Optional[str] = Query(None, description="租户名称"),
|
||||||
|
status: Optional[bool] = Query(None, description="状态用(True:启用 False:禁用)"),
|
||||||
|
creator: Optional[int] = Query(None, description="创建人"),
|
||||||
|
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2025-01-01 00:00:00"),
|
||||||
|
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2025-12-31 23:59:59"),
|
||||||
|
) -> None:
|
||||||
|
|
||||||
|
# 模糊查询字段
|
||||||
|
self.name = ("like", name)
|
||||||
|
|
||||||
|
# 精确查询字段
|
||||||
|
self.creator_id = creator
|
||||||
|
self.status = status
|
||||||
|
|
||||||
|
# 时间范围查询
|
||||||
|
if start_time and end_time:
|
||||||
|
self.created_at = ("between", (start_time, end_time))
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
|
||||||
|
|
||||||
|
from app.core.base_schema import BaseSchema
|
||||||
|
|
||||||
|
|
||||||
|
class TenantCreateSchema(BaseModel):
|
||||||
|
"""新增模型"""
|
||||||
|
name: str = Field(..., max_length=50, description='租户名称')
|
||||||
|
status: bool = Field(True, description="是否启用(True:启用 False:禁用)")
|
||||||
|
description: Optional[str] = Field(default=None, max_length=255, description="描述")
|
||||||
|
|
||||||
|
@field_validator('name')
|
||||||
|
@classmethod
|
||||||
|
def _validate_name(cls, v: str) -> str:
|
||||||
|
v = v.strip()
|
||||||
|
if not v:
|
||||||
|
raise ValueError('名称不能为空')
|
||||||
|
return v
|
||||||
|
|
||||||
|
@model_validator(mode='before')
|
||||||
|
@classmethod
|
||||||
|
def _normalize(cls, data):
|
||||||
|
if isinstance(data, dict):
|
||||||
|
for key in ('name', 'description'):
|
||||||
|
val = data.get(key)
|
||||||
|
if isinstance(val, str):
|
||||||
|
val = val.strip()
|
||||||
|
if key == 'description' and val == '':
|
||||||
|
val = None
|
||||||
|
data[key] = val
|
||||||
|
# status兼容
|
||||||
|
val = data.get('status')
|
||||||
|
if isinstance(val, str):
|
||||||
|
lowered = val.strip().lower()
|
||||||
|
if lowered in {'true', '1', 'y', 'yes'}:
|
||||||
|
data['status'] = True
|
||||||
|
elif lowered in {'false', '0', 'n', 'no'}:
|
||||||
|
data['status'] = False
|
||||||
|
elif isinstance(val, int):
|
||||||
|
data['status'] = bool(val)
|
||||||
|
return data
|
||||||
|
|
||||||
|
@model_validator(mode='wrap')
|
||||||
|
@classmethod
|
||||||
|
def _wrap(cls, data, handler):
|
||||||
|
# 进一步处理:压缩名称/描述中的多余空白,并支持更多 status 同义词
|
||||||
|
if isinstance(data, dict):
|
||||||
|
name = data.get('name')
|
||||||
|
if isinstance(name, str):
|
||||||
|
data['name'] = ' '.join(name.split())
|
||||||
|
status_val = data.get('status')
|
||||||
|
if isinstance(status_val, str):
|
||||||
|
lowered = status_val.strip().lower()
|
||||||
|
if lowered in {'enabled', 'enable', 'on'}:
|
||||||
|
data['status'] = True
|
||||||
|
elif lowered in {'disabled', 'disable', 'off'}:
|
||||||
|
data['status'] = False
|
||||||
|
desc = data.get('description')
|
||||||
|
if isinstance(desc, str):
|
||||||
|
data['description'] = ' '.join(desc.split())
|
||||||
|
result = handler(data)
|
||||||
|
return result
|
||||||
|
|
||||||
|
@model_validator(mode='after')
|
||||||
|
def _check_disabled_requires_description(self):
|
||||||
|
# 业务示例:禁用时必须填写描述
|
||||||
|
if self.status is False and (self.description is None or (isinstance(self.description, str) and self.description.strip() == '')):
|
||||||
|
raise ValueError('禁用时必须填写描述')
|
||||||
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
class TenantUpdateSchema(TenantCreateSchema):
|
||||||
|
"""更新模型"""
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class TenantOutSchema(TenantCreateSchema, BaseSchema):
|
||||||
|
"""响应模型"""
|
||||||
|
model_config = ConfigDict(from_attributes=True)
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import io
|
||||||
|
from typing import Any, List, Dict, Optional
|
||||||
|
from fastapi import UploadFile
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from app.core.base_schema import BatchSetAvailable
|
||||||
|
from app.core.exceptions import CustomException
|
||||||
|
from app.utils.excel_util import ExcelUtil
|
||||||
|
from app.core.logger import logger
|
||||||
|
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||||
|
from .schema import TenantCreateSchema, TenantUpdateSchema, TenantOutSchema
|
||||||
|
from .param import TenantQueryParam
|
||||||
|
from .crud import TenantCRUD
|
||||||
|
|
||||||
|
|
||||||
|
class TenantService:
|
||||||
|
"""
|
||||||
|
租户管理模块服务层
|
||||||
|
"""
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def detail_service(cls, auth: AuthSchema, id: int) -> Dict:
|
||||||
|
"""
|
||||||
|
详情
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- id (int): 租户ID
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Dict: 租户模型实例字典
|
||||||
|
"""
|
||||||
|
obj = await TenantCRUD(auth).get_by_id_crud(id=id)
|
||||||
|
if not obj:
|
||||||
|
raise CustomException(msg="该数据不存在")
|
||||||
|
return TenantOutSchema.model_validate(obj).model_dump()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def list_service(cls, auth: AuthSchema, search: Optional[TenantQueryParam] = None, order_by: Optional[List[Dict[str, str]]] = None) -> List[Dict]:
|
||||||
|
"""
|
||||||
|
列表查询
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- search (Optional[TenantQueryParam]): 查询参数
|
||||||
|
- order_by (Optional[List[Dict[str, str]]]): 排序参数
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- List[Dict]: 租户模型实例字典列表
|
||||||
|
"""
|
||||||
|
search_dict = search.__dict__ if search else None
|
||||||
|
obj_list = await TenantCRUD(auth).list_crud(search=search_dict, order_by=order_by)
|
||||||
|
return [TenantOutSchema.model_validate(obj).model_dump() for obj in obj_list]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def page_service(cls, auth: AuthSchema, page_no: int, page_size: int, search: Optional[TenantQueryParam] = None, order_by: Optional[List[Dict[str, str]]] = None) -> Dict:
|
||||||
|
"""
|
||||||
|
分页查询
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- page_no (int): 页码
|
||||||
|
- page_size (int): 每页数量
|
||||||
|
- search (Optional[TenantQueryParam]): 查询参数
|
||||||
|
- order_by (Optional[List[Dict[str, str]]]): 排序参数
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Dict: 分页数据
|
||||||
|
"""
|
||||||
|
search_dict = search.__dict__ if search else {}
|
||||||
|
order_by_list = order_by or [{'id': 'asc'}]
|
||||||
|
offset = (page_no - 1) * page_size
|
||||||
|
|
||||||
|
result = await TenantCRUD(auth).page_crud(
|
||||||
|
offset=offset,
|
||||||
|
limit=page_size,
|
||||||
|
order_by=order_by_list,
|
||||||
|
search=search_dict
|
||||||
|
)
|
||||||
|
return result
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def create_service(cls, auth: AuthSchema, data: TenantCreateSchema) -> Dict:
|
||||||
|
"""
|
||||||
|
创建
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- data (TenantCreateSchema): 租户创建模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Dict: 租户模型实例字典
|
||||||
|
"""
|
||||||
|
obj = await TenantCRUD(auth).get(name=data.name)
|
||||||
|
if obj:
|
||||||
|
raise CustomException(msg='创建失败,名称已存在')
|
||||||
|
obj = await TenantCRUD(auth).create_crud(data=data)
|
||||||
|
return TenantOutSchema.model_validate(obj).model_dump()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def update_service(cls, auth: AuthSchema, id: int, data: TenantUpdateSchema) -> Dict:
|
||||||
|
"""
|
||||||
|
更新
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- id (int): 租户ID
|
||||||
|
- data (TenantUpdateSchema): 租户更新模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- Dict: 租户模型实例字典
|
||||||
|
"""
|
||||||
|
# 检查数据是否存在
|
||||||
|
obj = await TenantCRUD(auth).get_by_id_crud(id=id)
|
||||||
|
if not obj:
|
||||||
|
raise CustomException(msg='更新失败,该数据不存在')
|
||||||
|
|
||||||
|
# 检查名称是否重复
|
||||||
|
exist_obj = await TenantCRUD(auth).get(name=data.name)
|
||||||
|
if exist_obj and exist_obj.id != id:
|
||||||
|
raise CustomException(msg='更新失败,名称重复')
|
||||||
|
|
||||||
|
obj = await TenantCRUD(auth).update_crud(id=id, data=data)
|
||||||
|
return TenantOutSchema.model_validate(obj).model_dump()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def delete_service(cls, auth: AuthSchema, ids: List[int]) -> None:
|
||||||
|
"""
|
||||||
|
删除
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- ids (List[int]): 租户ID列表
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- None
|
||||||
|
"""
|
||||||
|
if len(ids) < 1:
|
||||||
|
raise CustomException(msg='删除失败,删除对象不能为空')
|
||||||
|
|
||||||
|
# 检查所有要删除的数据是否存在
|
||||||
|
for id in ids:
|
||||||
|
obj = await TenantCRUD(auth).get_by_id_crud(id=id)
|
||||||
|
if not obj:
|
||||||
|
raise CustomException(msg=f'删除失败,ID为{id}的数据不存在')
|
||||||
|
|
||||||
|
await TenantCRUD(auth).delete_crud(ids=ids)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def set_available_service(cls, auth: AuthSchema, data: BatchSetAvailable) -> None:
|
||||||
|
"""
|
||||||
|
批量设置状态
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- data (BatchSetAvailable): 批量设置状态模型
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- None
|
||||||
|
"""
|
||||||
|
await TenantCRUD(auth).set_available_crud(ids=data.ids, status=data.status)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def batch_export_service(cls, obj_list: List[Dict[str, Any]]) -> bytes:
|
||||||
|
"""
|
||||||
|
批量导出
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- obj_list (List[Dict[str, Any]]): 租户模型实例字典列表
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- bytes: Excel文件字节流
|
||||||
|
"""
|
||||||
|
mapping_dict = {
|
||||||
|
'id': '编号',
|
||||||
|
'name': '名称',
|
||||||
|
'status': '状态',
|
||||||
|
'description': '备注',
|
||||||
|
'created_at': '创建时间',
|
||||||
|
'updated_at': '更新时间',
|
||||||
|
'creator': '创建者',
|
||||||
|
}
|
||||||
|
|
||||||
|
# 复制数据并转换状态
|
||||||
|
data = obj_list.copy()
|
||||||
|
for item in data:
|
||||||
|
# 处理状态
|
||||||
|
item['status'] = '正常' if item.get('status') else '停用'
|
||||||
|
# 处理创建者
|
||||||
|
creator_info = item.get('creator')
|
||||||
|
if isinstance(creator_info, dict):
|
||||||
|
item['creator'] = creator_info.get('name', '未知')
|
||||||
|
else:
|
||||||
|
item['creator'] = '未知'
|
||||||
|
|
||||||
|
return ExcelUtil.export_list2excel(list_data=data, mapping_dict=mapping_dict)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def batch_import_service(cls, auth: AuthSchema, file: UploadFile, update_support: bool = False) -> str:
|
||||||
|
"""
|
||||||
|
批量导入
|
||||||
|
|
||||||
|
参数:
|
||||||
|
- auth (AuthSchema): 认证信息模型
|
||||||
|
- file (UploadFile): 上传的Excel文件
|
||||||
|
- update_support (bool): 是否支持更新存在数据
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- str: 导入结果信息
|
||||||
|
"""
|
||||||
|
|
||||||
|
header_dict = {
|
||||||
|
'名称': 'name',
|
||||||
|
'状态': 'status',
|
||||||
|
'描述': 'description'
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
# 读取Excel文件
|
||||||
|
contents = await file.read()
|
||||||
|
df = pd.read_excel(io.BytesIO(contents))
|
||||||
|
await file.close()
|
||||||
|
|
||||||
|
if df.empty:
|
||||||
|
raise CustomException(msg="导入文件为空")
|
||||||
|
|
||||||
|
# 检查表头是否完整
|
||||||
|
missing_headers = [header for header in header_dict.keys() if header not in df.columns]
|
||||||
|
if missing_headers:
|
||||||
|
raise CustomException(msg=f"导入文件缺少必要的列: {', '.join(missing_headers)}")
|
||||||
|
|
||||||
|
# 重命名列名
|
||||||
|
df.rename(columns=header_dict, inplace=True)
|
||||||
|
|
||||||
|
# 验证必填字段
|
||||||
|
required_fields = ['name', 'status']
|
||||||
|
for field in required_fields:
|
||||||
|
missing_rows = df[df[field].isnull()].index.tolist()
|
||||||
|
raise CustomException(msg=f"{[k for k,v in header_dict.items() if v == field][0]}不能为空,第{[i+1 for i in missing_rows]}行")
|
||||||
|
|
||||||
|
error_msgs = []
|
||||||
|
success_count = 0
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
# 处理每一行数据
|
||||||
|
for index, row in df.iterrows():
|
||||||
|
count += 1
|
||||||
|
try:
|
||||||
|
# 数据转换前的类型检查
|
||||||
|
try:
|
||||||
|
status = True if row['status'] == '正常' else False
|
||||||
|
except ValueError:
|
||||||
|
error_msgs.append(f"第{count}行: 状态必须是'正常'或'停用'")
|
||||||
|
continue
|
||||||
|
|
||||||
|
# 构建用户数据
|
||||||
|
data = {
|
||||||
|
"name": str(row['name']),
|
||||||
|
"status": status,
|
||||||
|
"description": str(row['description']),
|
||||||
|
}
|
||||||
|
|
||||||
|
# 处理用户导入
|
||||||
|
exists_obj = await TenantCRUD(auth).get(name=data["name"])
|
||||||
|
if exists_obj:
|
||||||
|
if update_support:
|
||||||
|
await TenantCRUD(auth).update(id=exists_obj.id, data=data)
|
||||||
|
success_count += 1
|
||||||
|
else:
|
||||||
|
error_msgs.append(f"第{count}行: 对象 {data['name']} 已存在")
|
||||||
|
else:
|
||||||
|
await TenantCRUD(auth).create(data=data)
|
||||||
|
success_count += 1
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
error_msgs.append(f"第{count}行: {str(e)}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
# 返回详细的导入结果
|
||||||
|
result = f"成功导入 {success_count} 条数据"
|
||||||
|
if error_msgs:
|
||||||
|
result += "\n错误信息:\n" + "\n".join(error_msgs)
|
||||||
|
return result
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"批量导入用户失败: {str(e)}")
|
||||||
|
raise CustomException(msg=f"导入失败: {str(e)}")
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
async def import_template_download_service(cls) -> bytes:
|
||||||
|
"""
|
||||||
|
下载导入模板
|
||||||
|
|
||||||
|
返回:
|
||||||
|
- bytes: Excel文件字节流
|
||||||
|
"""
|
||||||
|
header_list = ['名称', '状态', '描述']
|
||||||
|
selector_header_list = ['状态']
|
||||||
|
option_list = [{'状态': ['正常', '停用']}]
|
||||||
|
return ExcelUtil.get_excel_template(
|
||||||
|
header_list=header_list,
|
||||||
|
selector_header_list=selector_header_list,
|
||||||
|
option_list=option_list
|
||||||
|
)
|
||||||
@@ -172,7 +172,7 @@ async def forget_password_controller(
|
|||||||
async def get_obj_list_controller(
|
async def get_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: UserQueryParam = Depends(),
|
search: UserQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询用户
|
查询用户
|
||||||
@@ -194,7 +194,7 @@ async def get_obj_list_controller(
|
|||||||
@UserRouter.get("/detail/{id}", summary="查询用户详情", description="查询用户详情")
|
@UserRouter.get("/detail/{id}", summary="查询用户详情", description="查询用户详情")
|
||||||
async def get_obj_detail_controller(
|
async def get_obj_detail_controller(
|
||||||
id: int = Path(..., description="用户ID"),
|
id: int = Path(..., description="用户ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:query"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:query"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
查询用户详情
|
查询用户详情
|
||||||
@@ -214,7 +214,7 @@ async def get_obj_detail_controller(
|
|||||||
@UserRouter.post("/create", summary="创建用户", description="创建用户")
|
@UserRouter.post("/create", summary="创建用户", description="创建用户")
|
||||||
async def create_obj_controller(
|
async def create_obj_controller(
|
||||||
data: UserCreateSchema,
|
data: UserCreateSchema,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:create"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:create"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
创建用户
|
创建用户
|
||||||
@@ -239,7 +239,7 @@ async def create_obj_controller(
|
|||||||
async def update_obj_controller(
|
async def update_obj_controller(
|
||||||
data: UserUpdateSchema,
|
data: UserUpdateSchema,
|
||||||
id: int = Path(..., description="用户ID"),
|
id: int = Path(..., description="用户ID"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:update"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:update"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
修改用户
|
修改用户
|
||||||
@@ -260,7 +260,7 @@ async def update_obj_controller(
|
|||||||
@UserRouter.delete("/delete", summary="删除用户", description="删除用户")
|
@UserRouter.delete("/delete", summary="删除用户", description="删除用户")
|
||||||
async def delete_obj_controller(
|
async def delete_obj_controller(
|
||||||
ids: list[int] = Body(..., description="ID列表"),
|
ids: list[int] = Body(..., description="ID列表"),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:delete"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:delete"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
删除用户
|
删除用户
|
||||||
@@ -280,7 +280,7 @@ async def delete_obj_controller(
|
|||||||
@UserRouter.patch("/available/setting", summary="批量修改用户状态", description="批量修改用户状态")
|
@UserRouter.patch("/available/setting", summary="批量修改用户状态", description="批量修改用户状态")
|
||||||
async def batch_set_available_obj_controller(
|
async def batch_set_available_obj_controller(
|
||||||
data: BatchSetAvailable,
|
data: BatchSetAvailable,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:patch"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:patch"])),
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
批量修改用户状态
|
批量修改用户状态
|
||||||
@@ -297,7 +297,7 @@ async def batch_set_available_obj_controller(
|
|||||||
return SuccessResponse(msg="批量修改用户状态成功")
|
return SuccessResponse(msg="批量修改用户状态成功")
|
||||||
|
|
||||||
|
|
||||||
@UserRouter.post('/import/template', summary="获取用户导入模板", description="获取用户导入模板", dependencies=[Depends(AuthPermission(["system:user:import"]))])
|
@UserRouter.post('/import/template', summary="获取用户导入模板", description="获取用户导入模板", dependencies=[Depends(AuthPermission(["module_system:user:import"]))])
|
||||||
async def export_obj_template_controller()-> StreamingResponse:
|
async def export_obj_template_controller()-> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
获取用户导入模板
|
获取用户导入模板
|
||||||
@@ -322,7 +322,7 @@ async def export_obj_template_controller()-> StreamingResponse:
|
|||||||
async def export_obj_list_controller(
|
async def export_obj_list_controller(
|
||||||
page: PaginationQueryParam = Depends(),
|
page: PaginationQueryParam = Depends(),
|
||||||
search: UserQueryParam = Depends(),
|
search: UserQueryParam = Depends(),
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:export"])),
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:export"])),
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
"""
|
"""
|
||||||
导出用户
|
导出用户
|
||||||
@@ -351,7 +351,7 @@ async def export_obj_list_controller(
|
|||||||
@UserRouter.post('/import/data', summary="导入用户", description="导入用户")
|
@UserRouter.post('/import/data', summary="导入用户", description="导入用户")
|
||||||
async def import_obj_list_controller(
|
async def import_obj_list_controller(
|
||||||
file: UploadFile,
|
file: UploadFile,
|
||||||
auth: AuthSchema = Depends(AuthPermission(["system:user:import"]))
|
auth: AuthSchema = Depends(AuthPermission(["module_system:user:import"]))
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
"""
|
"""
|
||||||
导入用户
|
导入用户
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
"type": 2,
|
"type": 2,
|
||||||
"icon": "menu",
|
"icon": "menu",
|
||||||
"order": 1,
|
"order": 1,
|
||||||
"permission": "system:menu:query",
|
"permission": "module_system:menu:query",
|
||||||
"route_name": "Menu",
|
"route_name": "Menu",
|
||||||
"route_path": "/system/menu",
|
"route_path": "/system/menu",
|
||||||
"component_path": "module_system/menu/index",
|
"component_path": "module_system/menu/index",
|
||||||
@@ -155,6 +155,160 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "租户管理",
|
||||||
|
"type": 2,
|
||||||
|
"icon": "el-icon-DataLine",
|
||||||
|
"order": 3,
|
||||||
|
"permission": "module_system:tenant:query",
|
||||||
|
"route_name": "Tenant",
|
||||||
|
"route_path": "/system/tenant",
|
||||||
|
"component_path": "module_system/tenant/index",
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "租户管理",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "创建租户",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"permission": "module_system:tenant:create",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "创建租户",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "更新租户",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 2,
|
||||||
|
"permission": "module_system:tenant:update",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "更新租户",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "删除租户",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 3,
|
||||||
|
"permission": "module_system:tenant:delete",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "删除租户",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "批量修改租户状态",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 4,
|
||||||
|
"permission": "module_system:tenant:patch",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "批量修改租户状态",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "导出租户",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 5,
|
||||||
|
"permission": "module_system:tenant:export",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "导出租户",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "导入租户",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 6,
|
||||||
|
"permission": "module_system:tenant:import",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "导入租户",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "下载导入租户模版",
|
||||||
|
"type": 3,
|
||||||
|
"icon": null,
|
||||||
|
"order": 7,
|
||||||
|
"permission": "module_system:tenant:download",
|
||||||
|
"route_name": null,
|
||||||
|
"route_path": null,
|
||||||
|
"component_path": null,
|
||||||
|
"status": true,
|
||||||
|
"keep_alive": true,
|
||||||
|
"hidden": false,
|
||||||
|
"always_show": false,
|
||||||
|
"title": "下载导入租户模版",
|
||||||
|
"params": null,
|
||||||
|
"affix": false,
|
||||||
|
"redirect": null,
|
||||||
|
"description": "初始化数据"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "部门管理",
|
"name": "部门管理",
|
||||||
"type": 2,
|
"type": 2,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from jinja2.environment import Environment
|
from jinja2.environment import Environment
|
||||||
from jinja2 import Environment, FileSystemLoader, select_autoescape, Template
|
from jinja2 import Environment, FileSystemLoader, select_autoescape, Template
|
||||||
from typing import Dict, List, Any, Set
|
from typing import List, Any, Set
|
||||||
|
|
||||||
from app.common.constant import GenConstant
|
from app.common.constant import GenConstant
|
||||||
from app.config.setting import settings
|
from app.config.setting import settings
|
||||||
@@ -179,7 +179,7 @@ class Jinja2TemplateUtil:
|
|||||||
'model.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/model.py',
|
'model.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/model.py',
|
||||||
'param.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/param.py',
|
'param.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/param.py',
|
||||||
'schema.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/schema.py',
|
'schema.py.j2': f'{cls.BACKEND_PROJECT_PATH}/app/api/v1/{module_name}/{business_name}/schema.py',
|
||||||
'sql.sql.j2': f'{cls.BACKEND_PROJECT_PATH}/sql/{module_name}/{business_name}_menu.sql',
|
'sql.sql.j2': f'{cls.BACKEND_PROJECT_PATH}/sql/menu/{module_name}/{business_name}.sql',
|
||||||
'api.ts.j2': f'{cls.FRONTEND_PROJECT_PATH}/src/api/{module_name}/{business_name}.ts',
|
'api.ts.j2': f'{cls.FRONTEND_PROJECT_PATH}/src/api/{module_name}/{business_name}.ts',
|
||||||
'index.vue.j2': f'{cls.FRONTEND_PROJECT_PATH}/src/views/{module_name}/{business_name}/index.vue'
|
'index.vue.j2': f'{cls.FRONTEND_PROJECT_PATH}/src/views/{module_name}/{business_name}/index.vue'
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+104
-104
@@ -1719,7 +1719,7 @@ COMMENT ON COLUMN public.system_menu.status IS '是否启用(True:启用 False:
|
|||||||
-- Name: COLUMN system_menu.permission; Type: COMMENT; Schema: public; Owner: tao
|
-- Name: COLUMN system_menu.permission; Type: COMMENT; Schema: public; Owner: tao
|
||||||
--
|
--
|
||||||
|
|
||||||
COMMENT ON COLUMN public.system_menu.permission IS '权限标识(如:system:user:list)';
|
COMMENT ON COLUMN public.system_menu.permission IS '权限标识(如:module_system:user:list)';
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -2884,110 +2884,110 @@ COPY public.system_menu (id, name, type, "order", status, permission, icon, rout
|
|||||||
5 代码管理 1 5 t \N code Gencode /gencode \N /gencode/backcode f f f 代码管理 null f \N 代码管理 2025-11-08 01:37:41.103241 2025-11-08 01:37:41.103242
|
5 代码管理 1 5 t \N code Gencode /gencode \N /gencode/backcode f f f 代码管理 null f \N 代码管理 2025-11-08 01:37:41.103241 2025-11-08 01:37:41.103242
|
||||||
6 接口管理 1 6 t \N document Common /common \N /common/docs f f f 接口管理 null f \N 初始化数据 2025-11-08 01:37:41.103242 2025-11-08 01:37:41.103242
|
6 接口管理 1 6 t \N document Common /common \N /common/docs f f f 接口管理 null f \N 初始化数据 2025-11-08 01:37:41.103242 2025-11-08 01:37:41.103242
|
||||||
7 工作台 2 1 t dashboard:workplace:query el-icon-PieChart Workplace /dashboard/workplace dashboard/workplace \N f t f 工作台 null f 1 初始化数据 2025-11-08 01:37:41.109195 2025-11-08 01:37:41.1092
|
7 工作台 2 1 t dashboard:workplace:query el-icon-PieChart Workplace /dashboard/workplace dashboard/workplace \N f t f 工作台 null f 1 初始化数据 2025-11-08 01:37:41.109195 2025-11-08 01:37:41.1092
|
||||||
8 菜单管理 2 1 t system:menu:query menu Menu /system/menu system/menu/index \N f t f 菜单管理 null f 2 初始化数据 2025-11-08 01:37:41.1092 2025-11-08 01:37:41.109201
|
8 菜单管理 2 1 t module_system:menu:query menu Menu /system/menu system/menu/index \N f t f 菜单管理 null f 2 初始化数据 2025-11-08 01:37:41.1092 2025-11-08 01:37:41.109201
|
||||||
9 部门管理 2 2 t system:dept:query tree Dept /system/dept system/dept/index \N f t f 部门管理 null f 2 初始化数据 2025-11-08 01:37:41.109201 2025-11-08 01:37:41.109201
|
9 部门管理 2 2 t module_system:dept:query tree Dept /system/dept system/dept/index \N f t f 部门管理 null f 2 初始化数据 2025-11-08 01:37:41.109201 2025-11-08 01:37:41.109201
|
||||||
10 岗位管理 2 3 t system:position:query el-icon-Coordinate Position /system/position system/position/index \N f t f 岗位管理 null f 2 初始化数据 2025-11-08 01:37:41.109202 2025-11-08 01:37:41.109202
|
10 岗位管理 2 3 t module_system:position:query el-icon-Coordinate Position /system/position system/position/index \N f t f 岗位管理 null f 2 初始化数据 2025-11-08 01:37:41.109202 2025-11-08 01:37:41.109202
|
||||||
11 角色管理 2 4 t system:role:query role Role /system/role system/role/index \N f t f 角色管理 null f 2 初始化数据 2025-11-08 01:37:41.109203 2025-11-08 01:37:41.109203
|
11 角色管理 2 4 t module_system:role:query role Role /system/role system/role/index \N f t f 角色管理 null f 2 初始化数据 2025-11-08 01:37:41.109203 2025-11-08 01:37:41.109203
|
||||||
12 用户管理 2 5 t system:user:query el-icon-User User /system/user system/user/index \N f t f 用户管理 null f 2 初始化数据 2025-11-08 01:37:41.109203 2025-11-08 01:37:41.109204
|
12 用户管理 2 5 t module_system:user:query el-icon-User User /system/user system/user/index \N f t f 用户管理 null f 2 初始化数据 2025-11-08 01:37:41.109203 2025-11-08 01:37:41.109204
|
||||||
13 日志管理 2 6 t system:log:query el-icon-Aim Log /system/log system/log/index \N f t f 日志管理 null f 2 初始化数据 2025-11-08 01:37:41.109204 2025-11-08 01:37:41.109204
|
13 日志管理 2 6 t module_system:log:query el-icon-Aim Log /system/log system/log/index \N f t f 日志管理 null f 2 初始化数据 2025-11-08 01:37:41.109204 2025-11-08 01:37:41.109204
|
||||||
14 公告管理 2 7 t system:notice:query bell Notice /system/notice system/notice/index \N f t f 公告管理 null f 2 初始化数据 2025-11-08 01:37:41.109205 2025-11-08 01:37:41.109205
|
14 公告管理 2 7 t module_system:notice:query bell Notice /system/notice system/notice/index \N f t f 公告管理 null f 2 初始化数据 2025-11-08 01:37:41.109205 2025-11-08 01:37:41.109205
|
||||||
15 参数管理 2 8 t system:param:query setting Params /system/param system/param/index \N f t f 参数管理 null f 2 初始化数据 2025-11-08 01:37:41.109206 2025-11-08 01:37:41.109206
|
15 参数管理 2 8 t module_system:param:query setting Params /system/param system/param/index \N f t f 参数管理 null f 2 初始化数据 2025-11-08 01:37:41.109206 2025-11-08 01:37:41.109206
|
||||||
16 字典管理 2 9 t system:dict_type:query dict Dict /system/dict system/dict/index \N f t f 字典管理 null f 2 初始化数据 2025-11-08 01:37:41.109206 2025-11-08 01:37:41.109207
|
16 字典管理 2 9 t module_system:dict_type:query dict Dict /system/dict system/dict/index \N f t f 字典管理 null f 2 初始化数据 2025-11-08 01:37:41.109206 2025-11-08 01:37:41.109207
|
||||||
17 我的应用 2 1 t app:myapp:query el-icon-ShoppingCartFull MYAPP /application/myapp application/myapp/index \N f t f 我的应用 null f 3 初始化数据 2025-11-08 01:37:41.109207 2025-11-08 01:37:41.109207
|
17 我的应用 2 1 t module_application:myapp:query el-icon-ShoppingCartFull MYAPP /application/myapp application/myapp/index \N f t f 我的应用 null f 3 初始化数据 2025-11-08 01:37:41.109207 2025-11-08 01:37:41.109207
|
||||||
18 任务管理 2 2 t app:job:query el-icon-DataLine Job /application/job application/job/index \N f t f 任务管理 null f 3 初始化数据 2025-11-08 01:37:41.109208 2025-11-08 01:37:41.109208
|
18 任务管理 2 2 t module_application:job:query el-icon-DataLine Job /application/job application/job/index \N f t f 任务管理 null f 3 初始化数据 2025-11-08 01:37:41.109208 2025-11-08 01:37:41.109208
|
||||||
19 AI智能助手 2 3 t app:ai:chat el-icon-ToiletPaper AI /application/ai application/ai/index \N f t f AI智能助手 null f 3 AI智能助手 2025-11-08 01:37:41.109208 2025-11-08 01:37:41.109209
|
19 AI智能助手 2 3 t module_application:ai:chat el-icon-ToiletPaper AI /application/ai application/ai/index \N f t f AI智能助手 null f 3 AI智能助手 2025-11-08 01:37:41.109208 2025-11-08 01:37:41.109209
|
||||||
20 流程管理 2 4 t app:workflow:query el-icon-ShoppingBag Workflow /application/workflow application/workflow/index \N f t f 我的流程 null f 3 我的流程 2025-11-08 01:37:41.109209 2025-11-08 01:37:41.109209
|
20 流程管理 2 4 t app:workflow:query el-icon-ShoppingBag Workflow /application/workflow application/workflow/index \N f t f 我的流程 null f 3 我的流程 2025-11-08 01:37:41.109209 2025-11-08 01:37:41.109209
|
||||||
21 在线用户 2 1 t monitor:online:query el-icon-Headset MonitorOnline /monitor/online monitor/online/index \N f f f 在线用户 null f 4 初始化数据 2025-11-08 01:37:41.10921 2025-11-08 01:37:41.10921
|
21 在线用户 2 1 t module_monitor:online:query el-icon-Headset MonitorOnline /monitor/online monitor/online/index \N f f f 在线用户 null f 4 初始化数据 2025-11-08 01:37:41.10921 2025-11-08 01:37:41.10921
|
||||||
22 服务器监控 2 2 t monitor:server:query el-icon-Odometer MonitorServer /monitor/server monitor/server/index \N f f f 服务器监控 null f 4 初始化数据 2025-11-08 01:37:41.10921 2025-11-08 01:37:41.109211
|
22 服务器监控 2 2 t module_monitor:server:query el-icon-Odometer MonitorServer /monitor/server monitor/server/index \N f f f 服务器监控 null f 4 初始化数据 2025-11-08 01:37:41.10921 2025-11-08 01:37:41.109211
|
||||||
23 缓存监控 2 3 t monitor:cache:query el-icon-Stopwatch MonitorCache /monitor/cache monitor/cache/index \N f f f 缓存监控 null f 4 初始化数据 2025-11-08 01:37:41.109211 2025-11-08 01:37:41.109211
|
23 缓存监控 2 3 t module_monitor:cache:query el-icon-Stopwatch MonitorCache /monitor/cache monitor/cache/index \N f f f 缓存监控 null f 4 初始化数据 2025-11-08 01:37:41.109211 2025-11-08 01:37:41.109211
|
||||||
24 文件管理 2 4 t monitor:resource:query el-icon-Files Resource /monitor/resource monitor/resource/index \N f t f 文件管理 null f 4 初始化数据 2025-11-08 01:37:41.109212 2025-11-08 01:37:41.109212
|
24 文件管理 2 4 t module_monitor:resource:query el-icon-Files Resource /monitor/resource monitor/resource/index \N f t f 文件管理 null f 4 初始化数据 2025-11-08 01:37:41.109212 2025-11-08 01:37:41.109212
|
||||||
25 代码生成 2 1 t generator:gencode:query code Backcode /gencode/backcode gencode/backcode/index \N f t f 代码生成 null f 5 代码生成 2025-11-08 01:37:41.109213 2025-11-08 01:37:41.109213
|
25 代码生成 2 1 t module_generator:gencode:query code Backcode /gencode/backcode gencode/backcode/index \N f t f 代码生成 null f 5 代码生成 2025-11-08 01:37:41.109213 2025-11-08 01:37:41.109213
|
||||||
26 示例管理 2 3 t generator:demo:query el-icon-DataLine Demo /gencode/demo gencode/demo/index \N f t f 示例管理 null f 5 初始化数据 2025-11-08 01:37:41.109213 2025-11-08 01:37:41.109214
|
26 示例管理 2 3 t module_generator:demo:query el-icon-DataLine Demo /gencode/demo gencode/demo/index \N f t f 示例管理 null f 5 初始化数据 2025-11-08 01:37:41.109213 2025-11-08 01:37:41.109214
|
||||||
27 Swagger文档 4 1 t common:docs:query api Docs /common/docs common/docs/index \N f f f Swagger文档 null f 6 初始化数据 2025-11-08 01:37:41.109214 2025-11-08 01:37:41.109214
|
27 Swagger文档 4 1 t module_common:docs:query api Docs /common/docs common/docs/index \N f f f Swagger文档 null f 6 初始化数据 2025-11-08 01:37:41.109214 2025-11-08 01:37:41.109214
|
||||||
28 Redoc文档 4 2 t common:redoc:query el-icon-Document Redoc /common/redoc common/redoc/index \N f f f Redoc文档 null f 6 初始化数据 2025-11-08 01:37:41.109215 2025-11-08 01:37:41.109215
|
28 Redoc文档 4 2 t module_common:redoc:query el-icon-Document Redoc /common/redoc common/redoc/index \N f f f Redoc文档 null f 6 初始化数据 2025-11-08 01:37:41.109215 2025-11-08 01:37:41.109215
|
||||||
29 创建菜单 3 1 t system:menu:create \N \N \N \N \N f t f 创建菜单 null f 8 初始化数据 2025-11-08 01:37:41.115178 2025-11-08 01:37:41.115179
|
29 创建菜单 3 1 t module_system:menu:create \N \N \N \N \N f t f 创建菜单 null f 8 初始化数据 2025-11-08 01:37:41.115178 2025-11-08 01:37:41.115179
|
||||||
30 修改菜单 3 2 t system:menu:update \N \N \N \N \N f t f 修改菜单 null f 8 初始化数据 2025-11-08 01:37:41.115179 2025-11-08 01:37:41.115179
|
30 修改菜单 3 2 t module_system:menu:update \N \N \N \N \N f t f 修改菜单 null f 8 初始化数据 2025-11-08 01:37:41.115179 2025-11-08 01:37:41.115179
|
||||||
31 删除菜单 3 3 t system:menu:delete \N \N \N \N \N f t f 删除菜单 null f 8 初始化数据 2025-11-08 01:37:41.11518 2025-11-08 01:37:41.11518
|
31 删除菜单 3 3 t module_system:menu:delete \N \N \N \N \N f t f 删除菜单 null f 8 初始化数据 2025-11-08 01:37:41.11518 2025-11-08 01:37:41.11518
|
||||||
32 批量修改菜单状态 3 4 t system:menu:patch \N \N \N \N \N f t f 批量修改菜单状态 null f 8 初始化数据 2025-11-08 01:37:41.115181 2025-11-08 01:37:41.115181
|
32 批量修改菜单状态 3 4 t module_system:menu:patch \N \N \N \N \N f t f 批量修改菜单状态 null f 8 初始化数据 2025-11-08 01:37:41.115181 2025-11-08 01:37:41.115181
|
||||||
33 创建部门 3 1 t system:dept:create \N \N \N \N \N f t f 创建部门 null f 9 初始化数据 2025-11-08 01:37:41.115181 2025-11-08 01:37:41.115182
|
33 创建部门 3 1 t module_system:dept:create \N \N \N \N \N f t f 创建部门 null f 9 初始化数据 2025-11-08 01:37:41.115181 2025-11-08 01:37:41.115182
|
||||||
34 修改部门 3 2 t system:dept:update \N \N \N \N \N f t f 修改部门 null f 9 初始化数据 2025-11-08 01:37:41.115182 2025-11-08 01:37:41.115182
|
34 修改部门 3 2 t module_system:dept:update \N \N \N \N \N f t f 修改部门 null f 9 初始化数据 2025-11-08 01:37:41.115182 2025-11-08 01:37:41.115182
|
||||||
35 删除部门 3 3 t system:dept:delete \N \N \N \N \N f t f 删除部门 null f 9 初始化数据 2025-11-08 01:37:41.115183 2025-11-08 01:37:41.115183
|
35 删除部门 3 3 t module_system:dept:delete \N \N \N \N \N f t f 删除部门 null f 9 初始化数据 2025-11-08 01:37:41.115183 2025-11-08 01:37:41.115183
|
||||||
36 批量修改部门状态 3 4 t system:dept:patch \N \N \N \N \N f t f 批量修改部门状态 null f 9 初始化数据 2025-11-08 01:37:41.115184 2025-11-08 01:37:41.115184
|
36 批量修改部门状态 3 4 t module_system:dept:patch \N \N \N \N \N f t f 批量修改部门状态 null f 9 初始化数据 2025-11-08 01:37:41.115184 2025-11-08 01:37:41.115184
|
||||||
37 创建岗位 3 1 t system:position:create \N \N \N \N \N f t f 创建岗位 null f 10 初始化数据 2025-11-08 01:37:41.115184 2025-11-08 01:37:41.115185
|
37 创建岗位 3 1 t module_system:position:create \N \N \N \N \N f t f 创建岗位 null f 10 初始化数据 2025-11-08 01:37:41.115184 2025-11-08 01:37:41.115185
|
||||||
38 修改岗位 3 2 t system:position:update \N \N \N \N \N f t f 修改岗位 null f 10 初始化数据 2025-11-08 01:37:41.115185 2025-11-08 01:37:41.115185
|
38 修改岗位 3 2 t module_system:position:update \N \N \N \N \N f t f 修改岗位 null f 10 初始化数据 2025-11-08 01:37:41.115185 2025-11-08 01:37:41.115185
|
||||||
39 删除岗位 3 3 t system:position:delete \N \N \N \N \N f t f 修改岗位 null f 10 初始化数据 2025-11-08 01:37:41.115186 2025-11-08 01:37:41.115186
|
39 删除岗位 3 3 t module_system:position:delete \N \N \N \N \N f t f 修改岗位 null f 10 初始化数据 2025-11-08 01:37:41.115186 2025-11-08 01:37:41.115186
|
||||||
40 批量修改岗位状态 3 4 t system:position:patch \N \N \N \N \N f t f 批量修改岗位状态 null f 10 初始化数据 2025-11-08 01:37:41.115186 2025-11-08 01:37:41.115187
|
40 批量修改岗位状态 3 4 t module_system:position:patch \N \N \N \N \N f t f 批量修改岗位状态 null f 10 初始化数据 2025-11-08 01:37:41.115186 2025-11-08 01:37:41.115187
|
||||||
41 岗位导出 3 5 t system:position:export \N \N \N \N \N f t f 岗位导出 null f 10 初始化数据 2025-11-08 01:37:41.115187 2025-11-08 01:37:41.115188
|
41 岗位导出 3 5 t module_system:position:export \N \N \N \N \N f t f 岗位导出 null f 10 初始化数据 2025-11-08 01:37:41.115187 2025-11-08 01:37:41.115188
|
||||||
42 设置角色权限 3 8 t system:role:permission \N \N \N \N \N f t f 设置角色权限 null f 10 初始化数据 2025-11-08 01:37:41.115188 2025-11-08 01:37:41.115188
|
42 设置角色权限 3 8 t module_system:role:permission \N \N \N \N \N f t f 设置角色权限 null f 10 初始化数据 2025-11-08 01:37:41.115188 2025-11-08 01:37:41.115188
|
||||||
43 创建角色 3 1 t system:role:create \N \N \N \N \N f t f 创建角色 null f 11 初始化数据 2025-11-08 01:37:41.115189 2025-11-08 01:37:41.115189
|
43 创建角色 3 1 t module_system:role:create \N \N \N \N \N f t f 创建角色 null f 11 初始化数据 2025-11-08 01:37:41.115189 2025-11-08 01:37:41.115189
|
||||||
44 修改角色 3 2 t system:role:update \N \N \N \N \N f t f 修改角色 null f 11 初始化数据 2025-11-08 01:37:41.115189 2025-11-08 01:37:41.11519
|
44 修改角色 3 2 t module_system:role:update \N \N \N \N \N f t f 修改角色 null f 11 初始化数据 2025-11-08 01:37:41.115189 2025-11-08 01:37:41.11519
|
||||||
45 删除角色 3 3 t system:role:delete \N \N \N \N \N f t f 删除角色 null f 11 初始化数据 2025-11-08 01:37:41.11519 2025-11-08 01:37:41.11519
|
45 删除角色 3 3 t module_system:role:delete \N \N \N \N \N f t f 删除角色 null f 11 初始化数据 2025-11-08 01:37:41.11519 2025-11-08 01:37:41.11519
|
||||||
46 批量修改角色状态 3 4 t system:role:patch \N \N \N \N \N f t f 批量修改角色状态 null f 11 初始化数据 2025-11-08 01:37:41.115191 2025-11-08 01:37:41.115191
|
46 批量修改角色状态 3 4 t module_system:role:patch \N \N \N \N \N f t f 批量修改角色状态 null f 11 初始化数据 2025-11-08 01:37:41.115191 2025-11-08 01:37:41.115191
|
||||||
47 角色导出 3 6 t system:role:export \N \N \N \N \N f t f 角色导出 null f 11 初始化数据 2025-11-08 01:37:41.115192 2025-11-08 01:37:41.115192
|
47 角色导出 3 6 t module_system:role:export \N \N \N \N \N f t f 角色导出 null f 11 初始化数据 2025-11-08 01:37:41.115192 2025-11-08 01:37:41.115192
|
||||||
48 创建用户 3 1 t system:user:create \N \N \N \N \N f t f 创建用户 null f 12 初始化数据 2025-11-08 01:37:41.115192 2025-11-08 01:37:41.115193
|
48 创建用户 3 1 t module_system:user:create \N \N \N \N \N f t f 创建用户 null f 12 初始化数据 2025-11-08 01:37:41.115192 2025-11-08 01:37:41.115193
|
||||||
49 修改用户 3 2 t system:user:update \N \N \N \N \N f t f 修改用户 null f 12 初始化数据 2025-11-08 01:37:41.115193 2025-11-08 01:37:41.115193
|
49 修改用户 3 2 t module_system:user:update \N \N \N \N \N f t f 修改用户 null f 12 初始化数据 2025-11-08 01:37:41.115193 2025-11-08 01:37:41.115193
|
||||||
50 删除用户 3 3 t system:user:delete \N \N \N \N \N f t f 删除用户 null f 12 初始化数据 2025-11-08 01:37:41.115194 2025-11-08 01:37:41.115194
|
50 删除用户 3 3 t module_system:user:delete \N \N \N \N \N f t f 删除用户 null f 12 初始化数据 2025-11-08 01:37:41.115194 2025-11-08 01:37:41.115194
|
||||||
51 批量修改用户状态 3 4 t system:user:patch \N \N \N \N \N f t f 批量修改用户状态 null f 12 初始化数据 2025-11-08 01:37:41.115194 2025-11-08 01:37:41.115195
|
51 批量修改用户状态 3 4 t module_system:user:patch \N \N \N \N \N f t f 批量修改用户状态 null f 12 初始化数据 2025-11-08 01:37:41.115194 2025-11-08 01:37:41.115195
|
||||||
52 导出用户 3 5 t system:user:export \N \N \N \N \N f t f 导出用户 null f 12 初始化数据 2025-11-08 01:37:41.115195 2025-11-08 01:37:41.115196
|
52 导出用户 3 5 t module_system:user:export \N \N \N \N \N f t f 导出用户 null f 12 初始化数据 2025-11-08 01:37:41.115195 2025-11-08 01:37:41.115196
|
||||||
53 导入用户 3 6 t system:user:import \N \N \N \N \N f t f 导入用户 null f 12 初始化数据 2025-11-08 01:37:41.115196 2025-11-08 01:37:41.115196
|
53 导入用户 3 6 t module_system:user:import \N \N \N \N \N f t f 导入用户 null f 12 初始化数据 2025-11-08 01:37:41.115196 2025-11-08 01:37:41.115196
|
||||||
54 日志删除 3 1 t system:operation_log:delete \N \N \N \N \N f t f 日志删除 null f 13 初始化数据 2025-11-08 01:37:41.115197 2025-11-08 01:37:41.115197
|
54 日志删除 3 1 t module_system:operation_log:delete \N \N \N \N \N f t f 日志删除 null f 13 初始化数据 2025-11-08 01:37:41.115197 2025-11-08 01:37:41.115197
|
||||||
55 日志导出 3 2 t system:operation_log:export \N \N \N \N \N f t f 日志导出 null f 13 初始化数据 2025-11-08 01:37:41.115197 2025-11-08 01:37:41.115198
|
55 日志导出 3 2 t module_system:operation_log:export \N \N \N \N \N f t f 日志导出 null f 13 初始化数据 2025-11-08 01:37:41.115197 2025-11-08 01:37:41.115198
|
||||||
56 公告创建 3 1 t system:notice:create \N \N \N \N \N f t f 公告创建 null f 14 初始化数据 2025-11-08 01:37:41.115198 2025-11-08 01:37:41.115198
|
56 公告创建 3 1 t module_system:notice:create \N \N \N \N \N f t f 公告创建 null f 14 初始化数据 2025-11-08 01:37:41.115198 2025-11-08 01:37:41.115198
|
||||||
57 公告修改 3 2 t system:notice:update \N \N \N \N \N f t f 修改用户 null f 14 初始化数据 2025-11-08 01:37:41.115199 2025-11-08 01:37:41.115199
|
57 公告修改 3 2 t module_system:notice:update \N \N \N \N \N f t f 修改用户 null f 14 初始化数据 2025-11-08 01:37:41.115199 2025-11-08 01:37:41.115199
|
||||||
58 公告删除 3 3 t system:notice:delete \N \N \N \N \N f t f 公告删除 null f 14 初始化数据 2025-11-08 01:37:41.115199 2025-11-08 01:37:41.1152
|
58 公告删除 3 3 t module_system:notice:delete \N \N \N \N \N f t f 公告删除 null f 14 初始化数据 2025-11-08 01:37:41.115199 2025-11-08 01:37:41.1152
|
||||||
59 公告导出 3 4 t system:notice:export \N \N \N \N \N f t f 公告导出 null f 14 初始化数据 2025-11-08 01:37:41.1152 2025-11-08 01:37:41.1152
|
59 公告导出 3 4 t module_system:notice:export \N \N \N \N \N f t f 公告导出 null f 14 初始化数据 2025-11-08 01:37:41.1152 2025-11-08 01:37:41.1152
|
||||||
60 公告批量修改状态 3 5 t system:notice:patch \N \N \N \N \N f t f 公告批量修改状态 null f 14 初始化数据 2025-11-08 01:37:41.115201 2025-11-08 01:37:41.115201
|
60 公告批量修改状态 3 5 t module_system:notice:patch \N \N \N \N \N f t f 公告批量修改状态 null f 14 初始化数据 2025-11-08 01:37:41.115201 2025-11-08 01:37:41.115201
|
||||||
61 创建参数 3 1 t system:param:create \N \N \N \N \N f t f 创建参数 null f 15 初始化数据 2025-11-08 01:37:41.115202 2025-11-08 01:37:41.115202
|
61 创建参数 3 1 t module_system:param:create \N \N \N \N \N f t f 创建参数 null f 15 初始化数据 2025-11-08 01:37:41.115202 2025-11-08 01:37:41.115202
|
||||||
62 修改参数 3 2 t system:param:update \N \N \N \N \N f t f 修改参数 null f 15 初始化数据 2025-11-08 01:37:41.115202 2025-11-08 01:37:41.115203
|
62 修改参数 3 2 t module_system:param:update \N \N \N \N \N f t f 修改参数 null f 15 初始化数据 2025-11-08 01:37:41.115202 2025-11-08 01:37:41.115203
|
||||||
63 删除参数 3 3 t system:param:delete \N \N \N \N \N f t f 删除参数 null f 15 初始化数据 2025-11-08 01:37:41.115203 2025-11-08 01:37:41.115203
|
63 删除参数 3 3 t module_system:param:delete \N \N \N \N \N f t f 删除参数 null f 15 初始化数据 2025-11-08 01:37:41.115203 2025-11-08 01:37:41.115203
|
||||||
64 导出参数 3 4 t system:param:export \N \N \N \N \N f t f 导出参数 null f 15 初始化数据 2025-11-08 01:37:41.115204 2025-11-08 01:37:41.115204
|
64 导出参数 3 4 t module_system:param:export \N \N \N \N \N f t f 导出参数 null f 15 初始化数据 2025-11-08 01:37:41.115204 2025-11-08 01:37:41.115204
|
||||||
65 参数上传 3 5 t system:param:upload \N \N \N \N \N f t f 参数上传 null f 15 初始化数据 2025-11-08 01:37:41.115204 2025-11-08 01:37:41.115205
|
65 参数上传 3 5 t module_system:param:upload \N \N \N \N \N f t f 参数上传 null f 15 初始化数据 2025-11-08 01:37:41.115204 2025-11-08 01:37:41.115205
|
||||||
66 创建字典类型 3 1 t system:dict_type:create \N \N \N \N \N f t f 创建字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115205 2025-11-08 01:37:41.115205
|
66 创建字典类型 3 1 t module_system:dict_type:create \N \N \N \N \N f t f 创建字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115205 2025-11-08 01:37:41.115205
|
||||||
67 修改字典类型 3 2 t system:dict_type:update \N \N \N \N \N f t f 修改字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115206 2025-11-08 01:37:41.115206
|
67 修改字典类型 3 2 t module_system:dict_type:update \N \N \N \N \N f t f 修改字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115206 2025-11-08 01:37:41.115206
|
||||||
68 删除字典类型 3 3 t system:dict_type:delete \N \N \N \N \N f t f 删除字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115206 2025-11-08 01:37:41.115207
|
68 删除字典类型 3 3 t module_system:dict_type:delete \N \N \N \N \N f t f 删除字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115206 2025-11-08 01:37:41.115207
|
||||||
69 导出字典类型 3 4 t system:dict_type:export \N \N \N \N \N f t f 导出字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115207 2025-11-08 01:37:41.115207
|
69 导出字典类型 3 4 t module_system:dict_type:export \N \N \N \N \N f t f 导出字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115207 2025-11-08 01:37:41.115207
|
||||||
70 批量修改字典状态 3 5 t system:dict_type:patch \N \N \N \N \N f t f 导出字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115208 2025-11-08 01:37:41.115208
|
70 批量修改字典状态 3 5 t module_system:dict_type:patch \N \N \N \N \N f t f 导出字典类型 null f 16 初始化数据 2025-11-08 01:37:41.115208 2025-11-08 01:37:41.115208
|
||||||
71 字典数据查询 3 6 t system:dict_data:query \N \N \N \N \N f t f 字典数据查询 null f 16 初始化数据 2025-11-08 01:37:41.115208 2025-11-08 01:37:41.115209
|
71 字典数据查询 3 6 t module_system:dict_data:query \N \N \N \N \N f t f 字典数据查询 null f 16 初始化数据 2025-11-08 01:37:41.115208 2025-11-08 01:37:41.115209
|
||||||
72 创建字典数据 3 7 t system:dict_data:create \N \N \N \N \N f t f 创建字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115209 2025-11-08 01:37:41.115209
|
72 创建字典数据 3 7 t module_system:dict_data:create \N \N \N \N \N f t f 创建字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115209 2025-11-08 01:37:41.115209
|
||||||
73 修改字典数据 3 8 t system:dict_data:update \N \N \N \N \N f t f 修改字典数据 null f 16 初始化数据 2025-11-08 01:37:41.11521 2025-11-08 01:37:41.11521
|
73 修改字典数据 3 8 t module_system:dict_data:update \N \N \N \N \N f t f 修改字典数据 null f 16 初始化数据 2025-11-08 01:37:41.11521 2025-11-08 01:37:41.11521
|
||||||
74 删除字典数据 3 9 t system:dict_data:delete \N \N \N \N \N f t f 删除字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115211 2025-11-08 01:37:41.115211
|
74 删除字典数据 3 9 t module_system:dict_data:delete \N \N \N \N \N f t f 删除字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115211 2025-11-08 01:37:41.115211
|
||||||
75 导出字典数据 3 10 t system:dict_data:export \N \N \N \N \N f t f 导出字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115211 2025-11-08 01:37:41.115212
|
75 导出字典数据 3 10 t module_system:dict_data:export \N \N \N \N \N f t f 导出字典数据 null f 16 初始化数据 2025-11-08 01:37:41.115211 2025-11-08 01:37:41.115212
|
||||||
76 批量修改字典数据状态 3 11 t system:dict_data:patch \N \N \N \N \N f t f 批量修改字典数据状态 null f 16 初始化数据 2025-11-08 01:37:41.115212 2025-11-08 01:37:41.115212
|
76 批量修改字典数据状态 3 11 t module_system:dict_data:patch \N \N \N \N \N f t f 批量修改字典数据状态 null f 16 初始化数据 2025-11-08 01:37:41.115212 2025-11-08 01:37:41.115212
|
||||||
77 创建应用 3 1 t app:myapp:create \N \N \N \N \N f t f 创建应用 null f 17 初始化数据 2025-11-08 01:37:41.115213 2025-11-08 01:37:41.115213
|
77 创建应用 3 1 t module_application:myapp:create \N \N \N \N \N f t f 创建应用 null f 17 初始化数据 2025-11-08 01:37:41.115213 2025-11-08 01:37:41.115213
|
||||||
78 修改应用 3 2 t app:myapp:update \N \N \N \N \N f t f 修改应用 null f 17 初始化数据 2025-11-08 01:37:41.115213 2025-11-08 01:37:41.115214
|
78 修改应用 3 2 t module_application:myapp:update \N \N \N \N \N f t f 修改应用 null f 17 初始化数据 2025-11-08 01:37:41.115213 2025-11-08 01:37:41.115214
|
||||||
79 删除应用 3 3 t app:myapp:delete \N \N \N \N \N f t f 删除应用 null f 17 初始化数据 2025-11-08 01:37:41.115214 2025-11-08 01:37:41.115214
|
79 删除应用 3 3 t module_application:myapp:delete \N \N \N \N \N f t f 删除应用 null f 17 初始化数据 2025-11-08 01:37:41.115214 2025-11-08 01:37:41.115214
|
||||||
80 批量修改应用状态 3 4 t app:myapp:patch \N \N \N \N \N f t f 批量修改应用状态 null f 17 初始化数据 2025-11-08 01:37:41.115215 2025-11-08 01:37:41.115215
|
80 批量修改应用状态 3 4 t module_application:myapp:patch \N \N \N \N \N f t f 批量修改应用状态 null f 17 初始化数据 2025-11-08 01:37:41.115215 2025-11-08 01:37:41.115215
|
||||||
81 创建任务 3 1 t app:job:create \N \N \N \N \N f t f 创建任务 null f 18 初始化数据 2025-11-08 01:37:41.115215 2025-11-08 01:37:41.115216
|
81 创建任务 3 1 t module_application:job:create \N \N \N \N \N f t f 创建任务 null f 18 初始化数据 2025-11-08 01:37:41.115215 2025-11-08 01:37:41.115216
|
||||||
82 修改和操作任务 3 2 t app:job:update \N \N \N \N \N f t f 修改和操作任务 null f 18 初始化数据 2025-11-08 01:37:41.115216 2025-11-08 01:37:41.115216
|
82 修改和操作任务 3 2 t module_application:job:update \N \N \N \N \N f t f 修改和操作任务 null f 18 初始化数据 2025-11-08 01:37:41.115216 2025-11-08 01:37:41.115216
|
||||||
83 删除和清除任务 3 3 t app:job:delete \N \N \N \N \N f t f 删除和清除任务 null f 18 初始化数据 2025-11-08 01:37:41.115217 2025-11-08 01:37:41.115217
|
83 删除和清除任务 3 3 t module_application:job:delete \N \N \N \N \N f t f 删除和清除任务 null f 18 初始化数据 2025-11-08 01:37:41.115217 2025-11-08 01:37:41.115217
|
||||||
84 导出定时任务 3 4 t app:job:export \N \N \N \N \N f t f 导出定时任务 null f 18 初始化数据 2025-11-08 01:37:41.115217 2025-11-08 01:37:41.115218
|
84 导出定时任务 3 4 t module_application:job:export \N \N \N \N \N f t f 导出定时任务 null f 18 初始化数据 2025-11-08 01:37:41.115217 2025-11-08 01:37:41.115218
|
||||||
85 智能对话 3 1 t app:ai:chat \N \N \N \N \N f t f 智能对话 null f 19 智能对话 2025-11-08 01:37:41.115218 2025-11-08 01:37:41.115218
|
85 智能对话 3 1 t module_application:ai:chat \N \N \N \N \N f t f 智能对话 null f 19 智能对话 2025-11-08 01:37:41.115218 2025-11-08 01:37:41.115218
|
||||||
86 在线用户强制下线 3 1 t monitor:online:delete \N \N \N \N \N f f f 在线用户强制下线 null f 21 初始化数据 2025-11-08 01:37:41.115219 2025-11-08 01:37:41.115219
|
86 在线用户强制下线 3 1 t module_monitor:online:delete \N \N \N \N \N f f f 在线用户强制下线 null f 21 初始化数据 2025-11-08 01:37:41.115219 2025-11-08 01:37:41.115219
|
||||||
87 清除缓存 3 1 t monitor:cache:delete \N \N \N \N \N f f f 清除缓存 null f 23 初始化数据 2025-11-08 01:37:41.115219 2025-11-08 01:37:41.11522
|
87 清除缓存 3 1 t module_monitor:cache:delete \N \N \N \N \N f f f 清除缓存 null f 23 初始化数据 2025-11-08 01:37:41.115219 2025-11-08 01:37:41.11522
|
||||||
88 文件上传 3 1 t monitor:resource:upload \N \N \N \N \N f t f 文件上传 null f 24 初始化数据 2025-11-08 01:37:41.11522 2025-11-08 01:37:41.11522
|
88 文件上传 3 1 t module_monitor:resource:upload \N \N \N \N \N f t f 文件上传 null f 24 初始化数据 2025-11-08 01:37:41.11522 2025-11-08 01:37:41.11522
|
||||||
89 文件下载 3 2 t monitor:resource:download \N \N \N \N \N f t f 文件下载 null f 24 初始化数据 2025-11-08 01:37:41.115221 2025-11-08 01:37:41.115221
|
89 文件下载 3 2 t module_monitor:resource:download \N \N \N \N \N f t f 文件下载 null f 24 初始化数据 2025-11-08 01:37:41.115221 2025-11-08 01:37:41.115221
|
||||||
90 文件删除 3 3 t monitor:resource:delete \N \N \N \N \N f t f 文件删除 null f 24 初始化数据 2025-11-08 01:37:41.115222 2025-11-08 01:37:41.115222
|
90 文件删除 3 3 t module_monitor:resource:delete \N \N \N \N \N f t f 文件删除 null f 24 初始化数据 2025-11-08 01:37:41.115222 2025-11-08 01:37:41.115222
|
||||||
91 文件移动 3 4 t monitor:resource:move \N \N \N \N \N f t f 文件移动 null f 24 初始化数据 2025-11-08 01:37:41.115222 2025-11-08 01:37:41.115223
|
91 文件移动 3 4 t module_monitor:resource:move \N \N \N \N \N f t f 文件移动 null f 24 初始化数据 2025-11-08 01:37:41.115222 2025-11-08 01:37:41.115223
|
||||||
92 文件复制 3 5 t rmonitor:resource:copy \N \N \N \N \N f t f 文件复制 null f 24 初始化数据 2025-11-08 01:37:41.115223 2025-11-08 01:37:41.115223
|
92 文件复制 3 5 t rmodule_monitor:resource:copy \N \N \N \N \N f t f 文件复制 null f 24 初始化数据 2025-11-08 01:37:41.115223 2025-11-08 01:37:41.115223
|
||||||
93 文件重命名 3 6 t monitor:resource:rename \N \N \N \N \N f t f 文件重命名 null f 24 初始化数据 2025-11-08 01:37:41.115224 2025-11-08 01:37:41.115224
|
93 文件重命名 3 6 t module_monitor:resource:rename \N \N \N \N \N f t f 文件重命名 null f 24 初始化数据 2025-11-08 01:37:41.115224 2025-11-08 01:37:41.115224
|
||||||
94 创建目录 3 7 t monitor:resource:create_dir \N \N \N \N \N f t f 创建目录 null f 24 初始化数据 2025-11-08 01:37:41.115224 2025-11-08 01:37:41.115225
|
94 创建目录 3 7 t module_monitor:resource:create_dir \N \N \N \N \N f t f 创建目录 null f 24 初始化数据 2025-11-08 01:37:41.115224 2025-11-08 01:37:41.115225
|
||||||
95 导出文件列表 3 9 t rmonitor:resource:export \N \N \N \N \N f t f 导出文件列表 null f 24 初始化数据 2025-11-08 01:37:41.115225 2025-11-08 01:37:41.115225
|
95 导出文件列表 3 9 t rmodule_monitor:resource:export \N \N \N \N \N f t f 导出文件列表 null f 24 初始化数据 2025-11-08 01:37:41.115225 2025-11-08 01:37:41.115225
|
||||||
96 查询代码生成业务表列表 3 1 t generator:gencode:query \N \N \N \N \N f t f 查询代码生成业务表列表 null f 25 查询代码生成业务表列表 2025-11-08 01:37:41.115226 2025-11-08 01:37:41.115226
|
96 查询代码生成业务表列表 3 1 t module_generator:gencode:query \N \N \N \N \N f t f 查询代码生成业务表列表 null f 25 查询代码生成业务表列表 2025-11-08 01:37:41.115226 2025-11-08 01:37:41.115226
|
||||||
97 创建表结构 3 2 t generator:gencode:create \N \N \N \N \N f t f 创建表结构 null f 25 创建表结构 2025-11-08 01:37:41.115226 2025-11-08 01:37:41.115227
|
97 创建表结构 3 2 t module_generator:gencode:create \N \N \N \N \N f t f 创建表结构 null f 25 创建表结构 2025-11-08 01:37:41.115226 2025-11-08 01:37:41.115227
|
||||||
98 编辑业务表信息 3 3 t generator:gencode:update \N \N \N \N \N f t f 编辑业务表信息 null f 25 编辑业务表信息 2025-11-08 01:37:41.115227 2025-11-08 01:37:41.115227
|
98 编辑业务表信息 3 3 t module_generator:gencode:update \N \N \N \N \N f t f 编辑业务表信息 null f 25 编辑业务表信息 2025-11-08 01:37:41.115227 2025-11-08 01:37:41.115227
|
||||||
99 删除业务表信息 3 4 t generator:gencode:delete \N \N \N \N \N f t f 删除业务表信息 null f 25 删除业务表信息 2025-11-08 01:37:41.115228 2025-11-08 01:37:41.115228
|
99 删除业务表信息 3 4 t module_generator:gencode:delete \N \N \N \N \N f t f 删除业务表信息 null f 25 删除业务表信息 2025-11-08 01:37:41.115228 2025-11-08 01:37:41.115228
|
||||||
100 导入表结构 3 5 t generator:gencode:import \N \N \N \N \N f t f 导入表结构 null f 25 导入表结构 2025-11-08 01:37:41.115228 2025-11-08 01:37:41.115229
|
100 导入表结构 3 5 t module_generator:gencode:import \N \N \N \N \N f t f 导入表结构 null f 25 导入表结构 2025-11-08 01:37:41.115228 2025-11-08 01:37:41.115229
|
||||||
101 批量生成代码 3 6 t generator:gencode:operate \N \N \N \N \N f t f 批量生成代码 null f 25 批量生成代码 2025-11-08 01:37:41.115229 2025-11-08 01:37:41.115229
|
101 批量生成代码 3 6 t module_generator:gencode:operate \N \N \N \N \N f t f 批量生成代码 null f 25 批量生成代码 2025-11-08 01:37:41.115229 2025-11-08 01:37:41.115229
|
||||||
102 生成代码到指定路径 3 7 t generator:gencode:code \N \N \N \N \N f t f 生成代码到指定路径 null f 25 生成代码到指定路径 2025-11-08 01:37:41.11523 2025-11-08 01:37:41.11523
|
102 生成代码到指定路径 3 7 t module_generator:gencode:code \N \N \N \N \N f t f 生成代码到指定路径 null f 25 生成代码到指定路径 2025-11-08 01:37:41.11523 2025-11-08 01:37:41.11523
|
||||||
103 查询数据库表列表 3 8 t generator:dblist:query \N \N \N \N \N f t f 查询数据库表列表 null f 25 查询数据库表列表 2025-11-08 01:37:41.11523 2025-11-08 01:37:41.115231
|
103 查询数据库表列表 3 8 t module_generator:dblist:query \N \N \N \N \N f t f 查询数据库表列表 null f 25 查询数据库表列表 2025-11-08 01:37:41.11523 2025-11-08 01:37:41.115231
|
||||||
104 同步数据库 3 9 t generator:db:sync \N \N \N \N \N f t f 同步数据库 null f 25 同步数据库 2025-11-08 01:37:41.115231 2025-11-08 01:37:41.115231
|
104 同步数据库 3 9 t module_generator:db:sync \N \N \N \N \N f t f 同步数据库 null f 25 同步数据库 2025-11-08 01:37:41.115231 2025-11-08 01:37:41.115231
|
||||||
105 创建示例 3 1 t generator:demo:create \N \N \N \N \N f t f 创建示例 null f 26 初始化数据 2025-11-08 01:37:41.115232 2025-11-08 01:37:41.115232
|
105 创建示例 3 1 t module_generator:demo:create \N \N \N \N \N f t f 创建示例 null f 26 初始化数据 2025-11-08 01:37:41.115232 2025-11-08 01:37:41.115232
|
||||||
106 更新示例 3 2 t generator:demo:update \N \N \N \N \N f t f 更新示例 null f 26 初始化数据 2025-11-08 01:37:41.115232 2025-11-08 01:37:41.115233
|
106 更新示例 3 2 t module_generator:demo:update \N \N \N \N \N f t f 更新示例 null f 26 初始化数据 2025-11-08 01:37:41.115232 2025-11-08 01:37:41.115233
|
||||||
107 删除示例 3 3 t generator:demo:delete \N \N \N \N \N f t f 删除示例 null f 26 初始化数据 2025-11-08 01:37:41.115233 2025-11-08 01:37:41.115234
|
107 删除示例 3 3 t module_generator:demo:delete \N \N \N \N \N f t f 删除示例 null f 26 初始化数据 2025-11-08 01:37:41.115233 2025-11-08 01:37:41.115234
|
||||||
108 批量修改示例状态 3 4 t generator:demo:patch \N \N \N \N \N f t f 批量修改示例状态 null f 26 初始化数据 2025-11-08 01:37:41.115234 2025-11-08 01:37:41.115234
|
108 批量修改示例状态 3 4 t module_generator:demo:patch \N \N \N \N \N f t f 批量修改示例状态 null f 26 初始化数据 2025-11-08 01:37:41.115234 2025-11-08 01:37:41.115234
|
||||||
109 导出示例 3 5 t generator:demo:export \N \N \N \N \N f t f 导出示例 null f 26 初始化数据 2025-11-08 01:37:41.115235 2025-11-08 01:37:41.115235
|
109 导出示例 3 5 t module_generator:demo:export \N \N \N \N \N f t f 导出示例 null f 26 初始化数据 2025-11-08 01:37:41.115235 2025-11-08 01:37:41.115235
|
||||||
110 导入示例 3 6 t generator:demo:import \N \N \N \N \N f t f 导入示例 null f 26 初始化数据 2025-11-08 01:37:41.115235 2025-11-08 01:37:41.115236
|
110 导入示例 3 6 t module_generator:demo:import \N \N \N \N \N f t f 导入示例 null f 26 初始化数据 2025-11-08 01:37:41.115235 2025-11-08 01:37:41.115236
|
||||||
111 下载导入示例模版 3 7 t generator:demo:download \N \N \N \N \N f t f 下载导入示例模版 null f 26 初始化数据 2025-11-08 01:37:41.115236 2025-11-08 01:37:41.115236
|
111 下载导入示例模版 3 7 t module_generator:demo:download \N \N \N \N \N f t f 下载导入示例模版 null f 26 初始化数据 2025-11-08 01:37:41.115236 2025-11-08 01:37:41.115236
|
||||||
\.
|
\.
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/tenant";
|
||||||
|
|
||||||
|
const TenantAPI = {
|
||||||
|
list(query: ObjPageQuery) {
|
||||||
|
return request<ApiResponse<PageResult<ObjTable[]>>>({
|
||||||
|
url: `${API_PATH}/list`,
|
||||||
|
method: "get",
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
detail(query: number) {
|
||||||
|
return request<ApiResponse<ObjTable>>({
|
||||||
|
url: `${API_PATH}/detail/${query}`,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
create(body: ObjForm) {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/create`,
|
||||||
|
method: "post",
|
||||||
|
data: body,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
update(id: number, body: ObjForm) {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/update/${id}`,
|
||||||
|
method: "put",
|
||||||
|
data: body,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
delete(body: number[]) {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/delete`,
|
||||||
|
method: "delete",
|
||||||
|
data: body,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
batch(body: BatchType) {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/available/setting`,
|
||||||
|
method: "patch",
|
||||||
|
data: body,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
export(body: ObjPageQuery) {
|
||||||
|
return request<Blob>({
|
||||||
|
url: `${API_PATH}/export`,
|
||||||
|
method: "post",
|
||||||
|
data: body,
|
||||||
|
responseType: "blob",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
download() {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/download/template`,
|
||||||
|
method: "post",
|
||||||
|
responseType: "blob",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
import(body: FormData) {
|
||||||
|
return request<ApiResponse>({
|
||||||
|
url: `${API_PATH}/import`,
|
||||||
|
method: "post",
|
||||||
|
data: body,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "multipart/form-data",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TenantAPI;
|
||||||
|
|
||||||
|
export interface ObjPageQuery extends PageQuery {
|
||||||
|
/** 示例标题 */
|
||||||
|
name?: string;
|
||||||
|
/** 示例状态 */
|
||||||
|
status?: boolean;
|
||||||
|
/** 开始时间 */
|
||||||
|
start_time?: string;
|
||||||
|
/** 结束时间 */
|
||||||
|
end_time?: string;
|
||||||
|
/** 创建人 */
|
||||||
|
creator?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ObjTable {
|
||||||
|
index?: number;
|
||||||
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
status?: boolean;
|
||||||
|
description?: string;
|
||||||
|
created_at?: string;
|
||||||
|
updated_at?: string;
|
||||||
|
// creator?: creatorType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ObjForm {
|
||||||
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
status?: boolean;
|
||||||
|
description?: string;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
// Common section
|
// Common section
|
||||||
common: {
|
module_common: {
|
||||||
confirm: "Confirm",
|
confirm: "Confirm",
|
||||||
cancel: "Cancel",
|
cancel: "Cancel",
|
||||||
reset: "Reset",
|
reset: "Reset",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
// 公共部分
|
// 公共部分
|
||||||
common: {
|
module_common: {
|
||||||
confirm: "确定",
|
confirm: "确定",
|
||||||
cancel: "取消",
|
cancel: "取消",
|
||||||
reset: "重置",
|
reset: "重置",
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
@change="handleFileChange"
|
@change="handleFileChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button v-hasPerm="['system:user:update']" type="primary" :icon="Camera" class="upload-trigger"/>
|
<el-button v-hasPerm="['module_system:user:update']" type="primary" :icon="Camera" class="upload-trigger"/>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-hasPerm="['system:user:update']" type="primary" :loading="infoSubmitting" icon="edit" @click="handleSave">保存更改</el-button>
|
<el-button v-hasPerm="['module_system:user:update']" type="primary" :loading="infoSubmitting" icon="edit" @click="handleSave">保存更改</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,8 +44,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['app:job:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_application:job:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['app:job:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_application:job:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link
|
<el-link
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:create']"
|
v-hasPerm="['module_application:job:create']"
|
||||||
type="success"
|
type="success"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
@click="handleOpenDialog('create')"
|
@click="handleOpenDialog('create')"
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:delete']"
|
v-hasPerm="['module_application:job:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
:disabled="selectIds.length === 0"
|
:disabled="selectIds.length === 0"
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:export']"
|
v-hasPerm="['module_application:job:export']"
|
||||||
type="warning"
|
type="warning"
|
||||||
icon="download"
|
icon="download"
|
||||||
circle
|
circle
|
||||||
@@ -120,13 +120,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="清除">
|
<el-tooltip content="清除">
|
||||||
<el-button v-hasPerm="['app:job:clear']" type="danger" icon="delete" circle @click="handleClear"/>
|
<el-button v-hasPerm="['module_application:job:clear']" type="danger" icon="delete" circle @click="handleClear"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:refresh']"
|
v-hasPerm="['module_application:job:refresh']"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="refresh"
|
icon="refresh"
|
||||||
circle
|
circle
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:update']"
|
v-hasPerm="['module_application:job:update']"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['app:job:delete']"
|
v-hasPerm="['module_application:job:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -249,7 +249,7 @@
|
|||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown v-hasPerm="['app:job:status']" trigger="click">
|
<el-dropdown v-hasPerm="['module_application:job:status']" trigger="click">
|
||||||
<el-button type="warning" size="small" link icon="ArrowDown">更多</el-button>
|
<el-button type="warning" size="small" link icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -581,7 +581,7 @@
|
|||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['app:job:detail']" type="primary" @click="handleCloseDialog" >确定</el-button>
|
<el-button v-else v-hasPerm="['module_application:job:detail']" type="primary" @click="handleCloseDialog" >确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -942,7 +942,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导出配置(用于导出弹窗)
|
// 导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'app:job',
|
permPrefix: 'module_application:job',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<el-input v-model="queryFormData.table_comment" placeholder="请输入表描述" clearable style="width: 200px" @keyup.enter="handleQuery"/>
|
<el-input v-model="queryFormData.table_comment" placeholder="请输入表描述" clearable style="width: 200px" @keyup.enter="handleQuery"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['generator:gencode:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['generator:gencode:query']" icon="refresh" @click="handleRefresh">重置</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:query']" icon="refresh" @click="handleRefresh">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -34,16 +34,16 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:gencode:create']" type="primary" plain icon="Plus" @click="createTableVisible = true;">创建</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:create']" type="primary" plain icon="Plus" @click="createTableVisible = true;">创建</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:gencode:import']" type="success" plain icon="Upload" @click="handleImportClick">导入</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:import']" type="success" plain icon="Upload" @click="handleImportClick">导入</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:gencode:delete']" type="danger" plain icon="Delete" :disabled="ids.length === 0" @click="handleDelete()">批量删除</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:delete']" type="danger" plain icon="Delete" :disabled="ids.length === 0" @click="handleDelete()">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:gencode:code']" type="warning" plain icon="Download" :disabled="!canGenerate" @click="handleGenTable('0')">批量生成</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:code']" type="warning" plain icon="Download" :disabled="!canGenerate" @click="handleGenTable('0')">批量生成</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['generator:gencode:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_generator:gencode:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -97,9 +97,9 @@
|
|||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'updated_at')?.show" label="更新时间" prop="updated_at" />
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'updated_at')?.show" label="更新时间" prop="updated_at" />
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" label="操作" align="center" min-width="120" class-name="small-padding fixed-width">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" label="操作" align="center" min-width="120" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['generator:gencode:update']" link type="primary" :icon="MagicStick" @click="handlePreviewTable(scope.row)">代码生成</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:update']" link type="primary" :icon="MagicStick" @click="handlePreviewTable(scope.row)">代码生成</el-button>
|
||||||
<el-button v-hasPerm="['generator:gencode:delete']" link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:delete']" link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
<el-button v-hasPerm="['generator:gencode:sync']" link type="success" icon="Refresh" @click="handleSynchDb(scope.row)">同步</el-button>
|
<el-button v-hasPerm="['module_generator:gencode:sync']" link type="success" icon="Refresh" @click="handleSynchDb(scope.row)">同步</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -298,6 +298,25 @@
|
|||||||
<el-input v-model="info.description" type="textarea" :rows="3"></el-input>
|
<el-input v-model="info.description" type="textarea" :rows="3"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-divider>生成文件路径</el-divider>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-descriptions
|
||||||
|
:column="2"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端控制层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/controller.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端业务层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/service.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端数据层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/crud.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端实体层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/model.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端访问层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/param.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,后端序列化层'">backend/app/api/v1/{{ info.module_name }}/{{ info.business_name }}/schema.py</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,数据库业务菜单'">backend/sql/menu/{{ info.module_name }}.{{ info.business_name }}.sql</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,前端接口层'">frontend/src/api/{{ info.module_name }}/{{ info.business_name }}.ts</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="info.function_name + '功能,前端视图层'">frontend/src/views/{{ info.module_name }}/{{ info.business_name }}/index.vue</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -546,7 +565,7 @@
|
|||||||
<!-- 公共按钮:关闭 -->
|
<!-- 公共按钮:关闭 -->
|
||||||
<el-button :icon="Close" @click="close">关闭</el-button>
|
<el-button :icon="Close" @click="close">关闭</el-button>
|
||||||
<el-button v-if="activeStep != 0" type="success" :icon="Back" @click="prevStep">上一步</el-button>
|
<el-button v-if="activeStep != 0" type="success" :icon="Back" @click="prevStep">上一步</el-button>
|
||||||
<el-button v-if="activeStep != 2" v-hasPerm="['generator:gencode:update']" type="warning" :icon="Edit" :loading="loading" @click="submitForm">保存配置</el-button>
|
<el-button v-if="activeStep != 2" v-hasPerm="['module_generator:gencode:update']" type="warning" :icon="Edit" :loading="loading" @click="submitForm">保存配置</el-button>
|
||||||
<el-button v-if="activeStep != 2" type="primary" @click="nextStep">下一步<el-icon class="el-icon--right"><Right /></el-icon></el-button>
|
<el-button v-if="activeStep != 2" type="primary" @click="nextStep">下一步<el-icon class="el-icon--right"><Right /></el-icon></el-button>
|
||||||
<el-button v-if="activeStep === 2" type="warning" :icon="Download" :loading="loading" @click="handleGenTable('0', info)">下载代码</el-button>
|
<el-button v-if="activeStep === 2" type="warning" :icon="Download" :loading="loading" @click="handleGenTable('0', info)">下载代码</el-button>
|
||||||
<el-button v-if="activeStep === 2" type="primary" :icon="FolderOpened" :loading="loading" @click="handleGenTable('1', info)">写入本地</el-button>
|
<el-button v-if="activeStep === 2" type="primary" :icon="FolderOpened" :loading="loading" @click="handleGenTable('1', info)">写入本地</el-button>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item >
|
<el-form-item >
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['generator:demo:query']"
|
v-hasPerm="['module_generator:demo:query']"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="search"
|
icon="search"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['generator:demo:query']"
|
v-hasPerm="['module_generator:demo:query']"
|
||||||
icon="refresh"
|
icon="refresh"
|
||||||
@click="handleResetQuery"
|
@click="handleResetQuery"
|
||||||
>
|
>
|
||||||
@@ -86,13 +86,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:demo:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_generator:demo:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['generator:demo:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_generator:demo:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['generator:demo:batch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_generator:demo:batch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -108,12 +108,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导入">
|
<el-tooltip content="导入">
|
||||||
<el-button v-hasPerm="['generator:demo:import']" type="success" icon="upload" circle @click="handleOpenImportDialog" />
|
<el-button v-hasPerm="['module_generator:demo:import']" type="success" icon="upload" circle @click="handleOpenImportDialog" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['generator:demo:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
<el-button v-hasPerm="['module_generator:demo:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['generator:demo:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
<el-button v-hasPerm="['module_generator:demo:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -171,9 +171,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="180">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['generator:demo:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_generator:demo:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['generator:demo:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_generator:demo:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['generator:demo:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_generator:demo:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -233,8 +233,8 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['generator:demo:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_generator:demo:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['sgenerator:demo:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['smodule_generator:demo:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -312,7 +312,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置
|
// 导入/导出配置
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'generator:demo',
|
permPrefix: 'module_generator:demo',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
importTemplate: () => ExampleAPI.downloadTemplate(),
|
importTemplate: () => ExampleAPI.downloadTemplate(),
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
|
|||||||
+7
-7
@@ -124,7 +124,7 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button v-hasPerm="['monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheNames"/>
|
<el-button v-hasPerm="['module_monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheNames"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column prop="cache_name" label="缓存名称" show-overflow-tooltip>
|
<el-table-column prop="cache_name" label="缓存名称" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-hasPerm="['monitor:cache:view']" type="primary" link @click="getCacheKeyList(row)">{{ row.cache_name }}</el-button>
|
<el-button v-hasPerm="['module_monitor:cache:view']" type="primary" link @click="getCacheKeyList(row)">{{ row.cache_name }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-popconfirm class="box-item" :title="`确认删除缓存 ${row.cache_name} 吗?`" placement="top" @confirm="handleClearCacheName(row)">
|
<el-popconfirm class="box-item" :title="`确认删除缓存 ${row.cache_name} 吗?`" placement="top" @confirm="handleClearCacheName(row)">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button v-hasPerm="['monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
|
<el-button v-hasPerm="['module_monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button v-hasPerm="['monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheKeys"/>
|
<el-button v-hasPerm="['module_monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheKeys"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -178,14 +178,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column prop="cacheKey" label="缓存键名" show-overflow-tooltip>
|
<el-table-column prop="cacheKey" label="缓存键名" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-hasPerm="['monitor:cache:detail']" type="primary" link @click="handleCacheValue(row.cacheKey)">{{ row.cacheKey}}</el-button>
|
<el-button v-hasPerm="['module_monitor:cache:detail']" type="primary" link @click="handleCacheValue(row.cacheKey)">{{ row.cacheKey}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="60" align="center">
|
<el-table-column label="操作" width="60" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-popconfirm class="box-item" :title="`确认删除键 ${row.cacheKey} 吗?`" placement="top" @confirm="handleClearCacheKey(row.cacheKey)">
|
<el-popconfirm class="box-item" :title="`确认删除键 ${row.cacheKey} 吗?`" placement="top" @confirm="handleClearCacheKey(row.cacheKey)">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button v-hasPerm="['monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
|
<el-button v-hasPerm="['module_monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button v-hasPerm="['monitor:cache:delete_all']" type="danger" link icon="delete" @click="handleClearCacheAll">清理全部</el-button>
|
<el-button v-hasPerm="['module_monitor:cache:delete_all']" type="danger" link icon="delete" @click="handleClearCacheAll">清理全部</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['monitor:online:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_monitor:online:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['monitor:online:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_monitor:online:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['monitor:online:force_logout']" type="danger" icon="delete" @click="handleClear">强退所有</el-button>
|
<el-button v-hasPerm="['module_monitor:online:force_logout']" type="danger" icon="delete" @click="handleClear">强退所有</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['monitor:online:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_monitor:online:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'login_time')?.show" key="login_time" label="登录时间" prop="login_time" min-width="180" />
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'login_time')?.show" key="login_time" label="登录时间" prop="login_time" min-width="180" />
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" key="operation" fixed="right" label="操作" min-width="100">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" key="operation" fixed="right" label="操作" min-width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['monitor:online:force_logout']" type="danger" size="small" link icon="delete" @click="handleSubmit(scope.row.session_id)">强退
|
<el-button v-hasPerm="['module_monitor:online:force_logout']" type="danger" size="small" link icon="delete" @click="handleSubmit(scope.row.session_id)">强退
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['monitor:resource:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -52,34 +52,34 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['monitor:resource:upload']" type="success" icon="plus" @click="handleUpload">上传文件</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:upload']" type="success" icon="plus" @click="handleUpload">上传文件</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['monitor:resource:create_dir']" type="primary" icon="folder-add" @click="handleCreateDir">新建文件夹</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:create_dir']" type="primary" icon="folder-add" @click="handleCreateDir">新建文件夹</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['monitor:resource:delete']" type="danger" icon="delete" :disabled="selectedItems.length === 0" @click="handleBatchDelete">批量删除</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:delete']" type="danger" icon="delete" :disabled="selectedItems.length === 0" @click="handleBatchDelete">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-table__toolbar--right">
|
<div class="data-table__toolbar--right">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-checkbox v-model="showHiddenFiles" v-hasPerm="['monitor:resource:show_hidden']" @change="handleShowHiddenChange">
|
<el-checkbox v-model="showHiddenFiles" v-hasPerm="['module_monitor:resource:show_hidden']" @change="handleShowHiddenChange">
|
||||||
显示隐藏文件
|
显示隐藏文件
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['monitor:resource:view_list']"
|
v-hasPerm="['module_monitor:resource:view_list']"
|
||||||
:type="viewMode === 'list' ? 'primary' : ''"
|
:type="viewMode === 'list' ? 'primary' : ''"
|
||||||
@click="viewMode = 'list'"
|
@click="viewMode = 'list'"
|
||||||
>
|
>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['monitor:resource:view_grid']"
|
v-hasPerm="['module_monitor:resource:view_grid']"
|
||||||
:type="viewMode === 'grid' ? 'primary' : ''"
|
:type="viewMode === 'grid' ? 'primary' : ''"
|
||||||
@click="viewMode = 'grid'"
|
@click="viewMode = 'grid'"
|
||||||
>
|
>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['monitor:resource:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_monitor:resource:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
<Document v-else />
|
<Document v-else />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span
|
<span
|
||||||
v-hasPerm="['monitor:resource:preview']"
|
v-hasPerm="['module_monitor:resource:preview']"
|
||||||
:class="{ 'file-name-clickable': true }"
|
:class="{ 'file-name-clickable': true }"
|
||||||
@click="handleFileNameClick(row)"
|
@click="handleFileNameClick(row)"
|
||||||
>
|
>
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!row.is_dir"
|
v-if="!row.is_dir"
|
||||||
v-hasPerm="['monitor:resource:download']"
|
v-hasPerm="['module_monitor:resource:download']"
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -150,10 +150,10 @@
|
|||||||
>
|
>
|
||||||
下载
|
下载
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:rename']" type="primary" size="small" link icon="edit" @click="handleRename(row)">
|
<el-button v-hasPerm="['module_monitor:resource:rename']" type="primary" size="small" link icon="edit" @click="handleRename(row)">
|
||||||
重命名
|
重命名
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:delete']" type="danger" size="small" link icon="delete" @click="handleDelete(row)">
|
<el-button v-hasPerm="['module_monitor:resource:delete']" type="danger" size="small" link icon="delete" @click="handleDelete(row)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
</el-upload>
|
</el-upload>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="uploadDialogVisible = false">取消</el-button>
|
<el-button @click="uploadDialogVisible = false">取消</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:upload']" type="primary" :loading="uploading" @click="handleUploadConfirm">
|
<el-button v-hasPerm="['module_monitor:resource:upload']" type="primary" :loading="uploading" @click="handleUploadConfirm">
|
||||||
确定上传
|
确定上传
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -244,7 +244,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="createDirDialogVisible = false">取消</el-button>
|
<el-button @click="createDirDialogVisible = false">取消</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:create_dir']" type="primary" @click="handleCreateDirConfirm">确定</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:create_dir']" type="primary" @click="handleCreateDirConfirm">确定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="renameDialogVisible = false">取消</el-button>
|
<el-button @click="renameDialogVisible = false">取消</el-button>
|
||||||
<el-button v-hasPerm="['monitor:resource:rename']" type="primary" @click="handleRenameConfirm">确定</el-button>
|
<el-button v-hasPerm="['module_monitor:resource:rename']" type="primary" @click="handleRenameConfirm">确定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:dept:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:dept:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:dept:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:dept:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -60,13 +60,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dept:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:dept:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dept:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:dept:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:dept:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:dept:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -124,10 +124,10 @@
|
|||||||
|
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:dept:create']" type="success" size="small" link icon="plus" @click="handleOpenDialog('create', undefined, scope.row.id)">新增</el-button>
|
<el-button v-hasPerm="['module_system:dept:create']" type="success" size="small" link icon="plus" @click="handleOpenDialog('create', undefined, scope.row.id)">新增</el-button>
|
||||||
<el-button v-hasPerm="['system:dept:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:dept:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:dept:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:dept:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:dept:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:dept:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -183,8 +183,8 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:dept:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:dept:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:dept:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:dept:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -68,13 +68,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dict_data:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:dict_data:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dict_data:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:dict_data:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:dict_data:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:dict_data:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:dict_data:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
<el-button v-hasPerm="['module_system:dict_data:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -147,8 +147,8 @@
|
|||||||
<el-table-column fixed="right" label="操作" align="center" min-width="200">
|
<el-table-column fixed="right" label="操作" align="center" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_data:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:dict_data:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_data:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:dict_data:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -571,7 +571,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导出配置(用于导出弹窗)
|
// 导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:dict_data',
|
permPrefix: 'module_system:dict_data',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:dict_type:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_type:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -70,13 +70,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dict_type:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:dict_type:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:dict_type:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:dict_type:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
||||||
更多
|
更多
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -94,12 +94,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:dict_type:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
<el-button v-hasPerm="['module_system:dict_type:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:dict_type:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_system:dict_type:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -152,10 +152,10 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="260">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="260">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:dict_data:query']" type="warning" size="small" link icon="document" @click="handleDictDataDrawer(scope.row.dict_type, scope.row.dict_name)">字典</el-button>
|
<el-button v-hasPerm="['module_system:dict_data:query']" type="warning" size="small" link icon="document" @click="handleDictDataDrawer(scope.row.dict_type, scope.row.dict_name)">字典</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_type:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_type:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:dict_type:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:dict_type:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -210,8 +210,8 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:dict_type:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:dict_type:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:dict_type:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:dict_type:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -531,7 +531,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导出配置(用于导出弹窗)
|
// 导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:dict_type',
|
permPrefix: 'module_system:dict_type',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:log:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:log:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:log:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:log:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:log:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:log:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,12 +75,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:log:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
<el-button v-hasPerm="['module_system:log:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:log:refresh']" type="default" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_system:log:refresh']" type="default" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -138,8 +138,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="center" min-width="150">
|
<el-table-column label="操作" fixed="right" align="center" min-width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:log:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:log:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:log:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:log:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-hasPerm="['system:log:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-hasPerm="['module_system:log:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -430,7 +430,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置(用于导出弹窗)
|
// 导入/导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:log',
|
permPrefix: 'module_system:log',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:menu:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:menu:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:menu:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:menu:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -60,13 +60,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:menu:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:menu:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:menu:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:menu:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:menu:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:menu:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:menu:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_system:menu:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -166,10 +166,10 @@
|
|||||||
|
|
||||||
<el-table-column fixed="right" label="操作" align="center" min-width="260">
|
<el-table-column fixed="right" label="操作" align="center" min-width="260">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-if="scope.row.type == MenuTypeEnum.CATALOG || scope.row.type == MenuTypeEnum.MENU" v-hasPerm="['system:menu:create']" type="success" link size="small" icon="plus" @click.stop="handleOpenDialog('create', undefined, scope.row.id)">新增</el-button>
|
<el-button v-if="scope.row.type == MenuTypeEnum.CATALOG || scope.row.type == MenuTypeEnum.MENU" v-hasPerm="['module_system:menu:create']" type="success" link size="small" icon="plus" @click.stop="handleOpenDialog('create', undefined, scope.row.id)">新增</el-button>
|
||||||
<el-button v-hasPerm="['system:menu:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:menu:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:menu:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:menu:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:menu:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:menu:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -463,8 +463,8 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:menu:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:menu:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:menu:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:menu:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:notice:query']" type="primary" icon="search" native-type="submit">
|
<el-button v-hasPerm="['module_system:notice:query']" type="primary" icon="search" native-type="submit">
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPerm="['system:notice:query']" icon="refresh" @click="handleResetQuery">
|
<el-button v-hasPerm="['module_system:notice:query']" icon="refresh" @click="handleResetQuery">
|
||||||
重置
|
重置
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
@@ -81,13 +81,13 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:notice:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:notice:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:notice:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:notice:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:notice:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:notice:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -103,12 +103,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:notice:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
<el-button v-hasPerm="['module_system:notice:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:notice:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
<el-button v-hasPerm="['module_system:notice:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -165,9 +165,9 @@
|
|||||||
|
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:notice:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:notice:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:notice:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:notice:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:notice:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:notice:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -254,8 +254,8 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:notice:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:notice:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:notice:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:notice:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -560,7 +560,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置(用于导出弹窗)
|
// 导入/导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:notice',
|
permPrefix: 'module_system:notice',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -247,7 +247,7 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-hasPerm="['system:config:update']" type="primary" :disabled="!hasChanges" @click="submitChanges">保存</el-button>
|
<el-button v-hasPerm="['module_system:config:update']" type="primary" :disabled="!hasChanges" @click="submitChanges">保存</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:config:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:config:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:config:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:config:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -69,10 +69,10 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:config:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:config:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:config:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:config:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,16 +80,16 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:config:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
<el-button v-hasPerm="['module_system:config:export']" type="warning" icon="download" circle @click="handleOpenExportsModal"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:config:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_system:config:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:config:filter']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:config:filter']" trigger="click">
|
||||||
<el-button type="default" icon="operation" circle />
|
<el-button type="default" icon="operation" circle />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
@@ -134,9 +134,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:config:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:config:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:config:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:config:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:config:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:config:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -193,8 +193,8 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:config:create']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:config:create']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:config:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:config:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -472,7 +472,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置(用于导出弹窗)
|
// 导入/导出配置(用于导出弹窗)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:config',
|
permPrefix: 'module_system:config',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:position:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:position:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:position:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:position:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -67,16 +67,16 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:position:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:position:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:position:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:position:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:position:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:position:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu v-hasPerm="['system:position:filter']">
|
<el-dropdown-menu v-hasPerm="['module_system:position:filter']">
|
||||||
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
||||||
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -89,12 +89,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:position:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
<el-button v-hasPerm="['module_system:position:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:position:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
<el-button v-hasPerm="['module_system:position:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -144,9 +144,9 @@
|
|||||||
|
|
||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-hasPerm="['system:position:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
<el-button v-hasPerm="['module_system:position:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
<el-button v-hasPerm="['system:position:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
<el-button v-hasPerm="['module_system:position:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
<el-button v-hasPerm="['system:position:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
<el-button v-hasPerm="['module_system:position:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -201,8 +201,8 @@
|
|||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['system:position:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_system:position:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:position:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:position:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -492,7 +492,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置(用于导出)
|
// 导入/导出配置(用于导出)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:position',
|
permPrefix: 'module_system:position',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
@@ -533,7 +533,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置(仅用于导出)
|
// 导入/导出配置(仅用于导出)
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:position',
|
permPrefix: 'module_system:position',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:role:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:role:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:role:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:role:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -67,18 +67,18 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:role:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:role:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:role:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:role:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:role:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:role:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
||||||
更多
|
更多
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu v-hasPerm="['system:role:filter']">
|
<el-dropdown-menu v-hasPerm="['module_system:role:filter']">
|
||||||
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
||||||
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -91,12 +91,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:role:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
<el-button v-hasPerm="['module_system:role:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:role:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
<el-button v-hasPerm="['module_system:role:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="280">
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="280">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:role:permission']"
|
v-hasPerm="['module_system:role:permission']"
|
||||||
type="warning"
|
type="warning"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenAssignPermDialog(scope.row.id, scope.row.name)"
|
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenAssignPermDialog(scope.row.id, scope.row.name)"
|
||||||
>分配权限</el-button>
|
>分配权限</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:role:detail']"
|
v-hasPerm="['module_system:role:detail']"
|
||||||
type="info"
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
@click="handleOpenDialog('detail', scope.row.id)"
|
@click="handleOpenDialog('detail', scope.row.id)"
|
||||||
>详情</el-button>
|
>详情</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:role:update']"
|
v-hasPerm="['module_system:role:update']"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenDialog('update', scope.row.id)"
|
@click="scope.row.id === 1 ? ElMessage.warning('系统默认角色,不可操作') : handleOpenDialog('update', scope.row.id)"
|
||||||
>编辑</el-button>
|
>编辑</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:role:delete']"
|
v-hasPerm="['module_system:role:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -260,7 +260,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="handleCloseDialog">取 消</el-button>
|
<el-button @click="handleCloseDialog">取 消</el-button>
|
||||||
<el-button v-hasPerm="['system:role:submit']" type="primary" @click="handleSubmit">确 定</el-button>
|
<el-button v-hasPerm="['module_system:role:submit']" type="primary" @click="handleSubmit">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -578,7 +578,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置
|
// 导入/导出配置
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:role',
|
permPrefix: 'module_system:role',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
const query: any = { ...params };
|
const query: any = { ...params };
|
||||||
|
|||||||
@@ -0,0 +1,594 @@
|
|||||||
|
<!-- 演示示例 -->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索区域 -->
|
||||||
|
<div v-show="visible" class="search-container">
|
||||||
|
<el-form
|
||||||
|
ref="queryFormRef"
|
||||||
|
:model="queryFormData"
|
||||||
|
label-suffix=":"
|
||||||
|
:inline="true"
|
||||||
|
@submit.prevent="handleQuery"
|
||||||
|
>
|
||||||
|
<el-form-item prop="name" label="名称">
|
||||||
|
<el-input v-model="queryFormData.name" placeholder="请输入名称" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="status" label="状态" >
|
||||||
|
<el-select v-model="queryFormData.status" placeholder="请选择状态" style="width: 170px;" clearable>
|
||||||
|
<el-option value="true" label="启用" />
|
||||||
|
<el-option value="false" label="停用" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="isExpand" prop="creator" label="创建人">
|
||||||
|
<UserTableSelect
|
||||||
|
v-model="queryFormData.creator"
|
||||||
|
@confirm-click="handleConfirm"
|
||||||
|
@clear-click="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 时间范围,收起状态下隐藏 -->
|
||||||
|
<el-form-item v-if="isExpand" prop="start_time" label="创建时间">
|
||||||
|
<DatePicker
|
||||||
|
v-model="dateRange"
|
||||||
|
@update:model-value="handleDateRangeChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
|
<el-form-item >
|
||||||
|
<el-button
|
||||||
|
v-hasPerm="['module_generator:tenant:query']"
|
||||||
|
type="primary"
|
||||||
|
icon="search"
|
||||||
|
@click="handleQuery"
|
||||||
|
>
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPerm="['module_generator:tenant:query']"
|
||||||
|
icon="refresh"
|
||||||
|
@click="handleResetQuery"
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
<!-- 展开/收起 -->
|
||||||
|
<template v-if="isExpandable">
|
||||||
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
|
{{ isExpand ? "收起" : "展开" }}
|
||||||
|
<el-icon>
|
||||||
|
<template v-if="isExpand">
|
||||||
|
<ArrowUp />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<ArrowDown />
|
||||||
|
</template>
|
||||||
|
</el-icon>
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 内容区域 -->
|
||||||
|
<el-card class="data-table">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>
|
||||||
|
演示示例列表
|
||||||
|
<el-tooltip content="演示示例列表">
|
||||||
|
<QuestionFilled class="w-4 h-4 mx-1" />
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 功能区域 -->
|
||||||
|
<div class="data-table__toolbar">
|
||||||
|
<div class="data-table__toolbar--left">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-dropdown v-hasPerm="['module_generator:tenant:batch']" trigger="click">
|
||||||
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">更多</el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="data-table__toolbar--right">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-tooltip content="导入">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:import']" type="success" icon="upload" circle @click="handleOpenImportDialog" />
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-tooltip content="导出">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-tooltip content="搜索显示/隐藏">
|
||||||
|
<el-button v-hasPerm="['*:*:*']" type="info" icon="search" circle @click="visible = !visible" />
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-tooltip content="刷新">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:refresh']" type="primary" icon="refresh" circle @click="handleRefresh" />
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-popover placement="bottom" trigger="click">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="danger" icon="operation" circle></el-button>
|
||||||
|
</template>
|
||||||
|
<el-scrollbar max-height="350px">
|
||||||
|
<template v-for="column in tableColumns" :key="column.prop">
|
||||||
|
<el-checkbox v-if="column.prop" v-model="column.show" :label="column.label" />
|
||||||
|
</template>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-popover>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 表格区域:系统配置列表 -->
|
||||||
|
<el-table ref="tableRef" v-loading="loading" :data="pageTableData" highlight-current-row class="data-table__content" height="450" border stripe @selection-change="handleSelectionChange">
|
||||||
|
<template #empty>
|
||||||
|
<el-empty :image-size="80" description="暂无数据" />
|
||||||
|
</template>
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'selection')?.show" type="selection" min-width="55" align="center"/>
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'index')?.show" fixed label="序号" min-width="60">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ (queryFormData.page_no - 1) * queryFormData.page_size + scope.$index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'name')?.show" label="名称" prop="name" min-width="140" />
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'status')?.show" label="状态" prop="status" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.status ? 'success' : 'info'">
|
||||||
|
{{ scope.row.status ? '启用' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'description')?.show" label="描述" prop="description" min-width="140" />
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'created_at')?.show" label="创建时间" prop="created_at" min-width="180" />
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'updated_at')?.show" label="更新时间" prop="updated_at" min-width="180" />
|
||||||
|
<el-table-column v-if="tableColumns.find((col) => col.prop === 'creator')?.show" label="创建人" prop="creator" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag>{{ scope.row.creator?.name }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" fixed="right" label="操作" align="center" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:detail']" type="info" size="small" link icon="document" @click="handleOpenDialog('detail', scope.row.id)">详情</el-button>
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:update']" type="primary" size="small" link icon="edit" @click="handleOpenDialog('update', scope.row.id)">编辑</el-button>
|
||||||
|
<el-button v-hasPerm="['module_generator:tenant:delete']" type="danger" size="small" link icon="delete" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 分页区域 -->
|
||||||
|
<template #footer>
|
||||||
|
<pagination v-model:total="total" v-model:page="queryFormData.page_no" v-model:limit="queryFormData.page_size" @pagination="loadingData" />
|
||||||
|
</template>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 弹窗区域 -->
|
||||||
|
<el-dialog v-model="dialogVisible.visible" :title="dialogVisible.title" @close="handleCloseDialog">
|
||||||
|
<!-- 详情 -->
|
||||||
|
<template v-if="dialogVisible.type === 'detail'">
|
||||||
|
<el-descriptions :column="4" border>
|
||||||
|
<el-descriptions-item label="名称" :span="2">
|
||||||
|
{{ detailFormData.name }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="状态" :span="2">
|
||||||
|
<el-tag :type="detailFormData.status ? 'success' : 'danger'">
|
||||||
|
{{ detailFormData.status ? '启用' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="描述" :span="2">
|
||||||
|
{{ detailFormData.description }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<!-- <el-descriptions-item label="创建人" :span="2">
|
||||||
|
{{ detailFormData.creator?.name }}
|
||||||
|
</el-descriptions-item> -->
|
||||||
|
<el-descriptions-item label="创建时间" :span="2">
|
||||||
|
{{ detailFormData.created_at }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="更新时间" :span="2">
|
||||||
|
{{ detailFormData.updated_at }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</template>
|
||||||
|
<!-- 新增、编辑表单 -->
|
||||||
|
<template v-else>
|
||||||
|
<el-form ref="dataFormRef" :model="formData" :rules="rules" label-suffix=":" label-width="auto" label-position="right">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入名称" :maxlength="50" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio :value="true">启用</el-radio>
|
||||||
|
<el-radio :value="false">停用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述" prop="description">
|
||||||
|
<el-input v-model="formData.description" :rows="4" :maxlength="100" show-word-limit type="textarea" placeholder="请输入描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<!-- 详情弹窗不需要确定按钮的提交逻辑 -->
|
||||||
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
|
<el-button v-if="dialogVisible.type !== 'detail'" v-hasPerm="['module_generator:tenant:submit']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
|
<el-button v-else v-hasPerm="['smodule_generator:tenant:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<ImportModal
|
||||||
|
v-model="importDialogVisible"
|
||||||
|
:content-config="curdContentConfig"
|
||||||
|
@upload="handleUpload"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 导出弹窗 -->
|
||||||
|
<ExportModal
|
||||||
|
v-model="exportsDialogVisible"
|
||||||
|
:content-config="curdContentConfig"
|
||||||
|
:query-params="queryFormData"
|
||||||
|
:page-data="pageTableData"
|
||||||
|
:selection-data="selectionRows"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineOptions({
|
||||||
|
name: "Example",
|
||||||
|
inheritAttrs: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
import { ref, reactive, onMounted } from "vue";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import { ResultEnum } from "@/enums/api/result.enum";
|
||||||
|
import ImportModal from "@/components/CURD/ImportModal.vue";
|
||||||
|
import ExportModal from "@/components/CURD/ExportModal.vue";
|
||||||
|
import DatePicker from "@/components/DatePicker/index.vue";
|
||||||
|
import type { IContentConfig } from "@/components/CURD/types";
|
||||||
|
import { QuestionFilled, ArrowUp, ArrowDown } from "@element-plus/icons-vue";
|
||||||
|
import { formatToDateTime } from "@/utils/dateUtil";
|
||||||
|
import TenantAPI, { ObjTable, ObjForm, ObjPageQuery } from "@/api/module_system/tenant";
|
||||||
|
|
||||||
|
|
||||||
|
const visible = ref(true);
|
||||||
|
const queryFormRef = ref();
|
||||||
|
const dataFormRef = ref();
|
||||||
|
const total = ref(0);
|
||||||
|
const selectIds = ref<number[]>([]);
|
||||||
|
const selectionRows = ref<ObjTable[]>([]);
|
||||||
|
const loading = ref(false);
|
||||||
|
const isExpand = ref(false);
|
||||||
|
const isExpandable = ref(true);
|
||||||
|
|
||||||
|
// 分页表单
|
||||||
|
const pageTableData = ref<ObjTable[]>([]);
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const tableColumns = ref([
|
||||||
|
{ prop: 'selection', label: '选择框', show: true },
|
||||||
|
{ prop: 'index', label: '序号', show: true },
|
||||||
|
{ prop: 'name', label: '名称', show: true },
|
||||||
|
{ prop: 'status', label: '状态', show: true },
|
||||||
|
{ prop: 'description', label: '描述', show: true },
|
||||||
|
{ prop: 'created_at', label: '创建时间', show: true },
|
||||||
|
{ prop: 'updated_at', label: '更新时间', show: true },
|
||||||
|
{ prop: 'creator', label: '创建人', show: true },
|
||||||
|
{ prop: 'operation', label: '操作', show: true }
|
||||||
|
])
|
||||||
|
|
||||||
|
// 仅用于导出字段的列(排除非数据列及嵌套对象列)
|
||||||
|
const exportColumns = [
|
||||||
|
{ prop: 'name', label: '名称' },
|
||||||
|
{ prop: 'status', label: '状态' },
|
||||||
|
{ prop: 'description', label: '描述' },
|
||||||
|
{ prop: 'created_at', label: '创建时间' },
|
||||||
|
{ prop: 'updated_at', label: '更新时间' },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 导入/导出配置
|
||||||
|
const curdContentConfig = {
|
||||||
|
permPrefix: 'module_generator:tenant',
|
||||||
|
cols: exportColumns as any,
|
||||||
|
importTemplate: () => TenantAPI.download(),
|
||||||
|
exportsAction: async (params: any) => {
|
||||||
|
const query: any = { ...params };
|
||||||
|
if (typeof query.status === 'string') {
|
||||||
|
query.status = query.status === 'true';
|
||||||
|
}
|
||||||
|
query.page_no = 1;
|
||||||
|
query.page_size = 9999;
|
||||||
|
const all: any[] = [];
|
||||||
|
while (true) {
|
||||||
|
const res = await TenantAPI.list(query);
|
||||||
|
const items = res.data?.data?.items || [];
|
||||||
|
const total = res.data?.data?.total || 0;
|
||||||
|
all.push(...items);
|
||||||
|
if (all.length >= total || items.length === 0) break;
|
||||||
|
query.page_no += 1;
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
},
|
||||||
|
} as unknown as IContentConfig;
|
||||||
|
// 详情表单
|
||||||
|
const detailFormData = ref<ObjTable>({});
|
||||||
|
// 日期范围临时变量
|
||||||
|
const dateRange = ref<[Date, Date] | []>([]);
|
||||||
|
|
||||||
|
// 处理日期范围变化
|
||||||
|
function handleDateRangeChange(range: [Date, Date]) {
|
||||||
|
dateRange.value = range;
|
||||||
|
if (range && range.length === 2) {
|
||||||
|
queryFormData.start_time = formatToDateTime(range[0]);
|
||||||
|
queryFormData.end_time = formatToDateTime(range[1]);
|
||||||
|
} else {
|
||||||
|
queryFormData.start_time = undefined;
|
||||||
|
queryFormData.end_time = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询参数
|
||||||
|
const queryFormData = reactive<ObjPageQuery>({
|
||||||
|
page_no: 1,
|
||||||
|
page_size: 10,
|
||||||
|
name: undefined,
|
||||||
|
status: undefined,
|
||||||
|
start_time: undefined,
|
||||||
|
end_time: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 编辑表单
|
||||||
|
const formData = reactive<ObjForm>({
|
||||||
|
id: undefined,
|
||||||
|
name: '',
|
||||||
|
status: true,
|
||||||
|
description: undefined,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 弹窗状态
|
||||||
|
const dialogVisible = reactive({
|
||||||
|
title: "",
|
||||||
|
visible: false,
|
||||||
|
type: 'create' as 'create' | 'update' | 'detail',
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
status: [{ required: true, message: "请选择状态", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// 导入弹窗显示状态
|
||||||
|
const importDialogVisible = ref(false);
|
||||||
|
|
||||||
|
// 导出弹窗显示状态
|
||||||
|
const exportsDialogVisible = ref(false);
|
||||||
|
|
||||||
|
// 打开导入弹窗
|
||||||
|
function handleOpenImportDialog() {
|
||||||
|
importDialogVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开导出弹窗
|
||||||
|
function handleOpenExportsModal() {
|
||||||
|
exportsDialogVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表刷新
|
||||||
|
async function handleRefresh() {
|
||||||
|
await loadingData();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 加载表格数据
|
||||||
|
async function loadingData() {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const response = await TenantAPI.list(queryFormData);
|
||||||
|
pageTableData.value = response.data.data.items;
|
||||||
|
total.value = response.data.data.total;
|
||||||
|
}
|
||||||
|
catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询(重置页码后获取数据)
|
||||||
|
async function handleQuery() {
|
||||||
|
queryFormData.page_no = 1;
|
||||||
|
loadingData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择创建人后触发查询
|
||||||
|
function handleConfirm() {
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置查询
|
||||||
|
async function handleResetQuery() {
|
||||||
|
queryFormRef.value.resetFields();
|
||||||
|
queryFormData.page_no = 1;
|
||||||
|
// 重置日期范围选择器
|
||||||
|
dateRange.value = [];
|
||||||
|
queryFormData.start_time = undefined;
|
||||||
|
queryFormData.end_time = undefined;
|
||||||
|
loadingData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义初始表单数据常量
|
||||||
|
const initialFormData: ObjForm = {
|
||||||
|
id: undefined,
|
||||||
|
name: '',
|
||||||
|
status: true,
|
||||||
|
description: '',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置表单
|
||||||
|
async function resetForm() {
|
||||||
|
if (dataFormRef.value) {
|
||||||
|
dataFormRef.value.resetFields();
|
||||||
|
dataFormRef.value.clearValidate();
|
||||||
|
}
|
||||||
|
// 完全重置 formData 为初始状态
|
||||||
|
Object.assign(formData, initialFormData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 行复选框选中项变化
|
||||||
|
async function handleSelectionChange(selection: any) {
|
||||||
|
selectIds.value = selection.map((item: any) => item.id);
|
||||||
|
selectionRows.value = selection;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
async function handleCloseDialog() {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
resetForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
async function handleOpenDialog(type: 'create' | 'update' | 'detail', id?: number) {
|
||||||
|
dialogVisible.type = type;
|
||||||
|
if (id) {
|
||||||
|
const response = await TenantAPI.detail(id);
|
||||||
|
if (type === 'detail') {
|
||||||
|
dialogVisible.title = "详情";
|
||||||
|
Object.assign(detailFormData.value, response.data.data);
|
||||||
|
} else if (type === 'update') {
|
||||||
|
dialogVisible.title = "修改";
|
||||||
|
Object.assign(formData, response.data.data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dialogVisible.title = "新增示例";
|
||||||
|
formData.id = undefined;
|
||||||
|
}
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单(防抖)
|
||||||
|
async function handleSubmit() {
|
||||||
|
// 表单校验
|
||||||
|
dataFormRef.value.validate(async (valid: any) => {
|
||||||
|
if (valid) {
|
||||||
|
loading.value = true;
|
||||||
|
// 根据弹窗传入的参数(deatil\create\update)判断走什么逻辑
|
||||||
|
const id = formData.id;
|
||||||
|
if (id) {
|
||||||
|
try {
|
||||||
|
await TenantAPI.update(id, { id, ...formData })
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
resetForm();
|
||||||
|
handleCloseDialog();
|
||||||
|
handleResetQuery();
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
await TenantAPI.create(formData)
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
resetForm();
|
||||||
|
handleCloseDialog();
|
||||||
|
handleResetQuery();
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除、批量删除
|
||||||
|
async function handleDelete(ids: number[]) {
|
||||||
|
ElMessageBox.confirm("确认删除该项数据?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
await TenantAPI.delete(ids);
|
||||||
|
handleResetQuery();
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessageBox.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量启用/停用
|
||||||
|
async function handleMoreClick(status: boolean) {
|
||||||
|
if (selectIds.value.length) {
|
||||||
|
ElMessageBox.confirm(`确认${status ? '启用' : '停用'}该项数据?`, "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
await TenantAPI.batch({ ids: selectIds.value, status });
|
||||||
|
handleResetQuery();
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessageBox.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理上传
|
||||||
|
const handleUpload = async (formData: FormData) => {
|
||||||
|
try {
|
||||||
|
const response = await TenantAPI.import(formData);
|
||||||
|
if (response.data.code === ResultEnum.SUCCESS) {
|
||||||
|
ElMessage.success(`${response.data.msg},${response.data.data}`);
|
||||||
|
importDialogVisible.value = false;
|
||||||
|
await handleQuery();
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadingData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查询、重置、展开/收起按钮 -->
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
<el-form-item class="search-buttons">
|
<el-form-item class="search-buttons">
|
||||||
<el-button v-hasPerm="['system:user:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
<el-button v-hasPerm="['module_system:user:query']" type="primary" icon="search" native-type="submit">查询</el-button>
|
||||||
<el-button v-hasPerm="['system:user:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
<el-button v-hasPerm="['module_system:user:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||||
<!-- 展开/收起 -->
|
<!-- 展开/收起 -->
|
||||||
<template v-if="isExpandable">
|
<template v-if="isExpandable">
|
||||||
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
@@ -77,18 +77,18 @@
|
|||||||
<div class="data-table__toolbar--left">
|
<div class="data-table__toolbar--left">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:user:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
<el-button v-hasPerm="['module_system:user:create']" type="success" icon="plus" @click="handleOpenDialog('create')">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPerm="['system:user:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
<el-button v-hasPerm="['module_system:user:delete']" type="danger" icon="delete" :disabled="selectIds.length === 0" @click="handleDelete(selectIds)">批量删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-dropdown v-hasPerm="['system:user:patch']" trigger="click">
|
<el-dropdown v-hasPerm="['module_system:user:patch']" trigger="click">
|
||||||
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
<el-button type="default" :disabled="selectIds.length === 0" icon="ArrowDown">
|
||||||
更多
|
更多
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu v-hasPerm="['system:user:filter']">
|
<el-dropdown-menu v-hasPerm="['module_system:user:filter']">
|
||||||
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
<el-dropdown-item icon="Check" @click="handleMoreClick(true)">批量启用</el-dropdown-item>
|
||||||
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
<el-dropdown-item icon="CircleClose" @click="handleMoreClick(false)">批量停用</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -102,17 +102,17 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导入">
|
<el-tooltip content="导入">
|
||||||
<el-button v-hasPerm="['system:user:import']" type="info" icon="upload" circle @click="handleOpenImportDialog" />
|
<el-button v-hasPerm="['module_system:user:import']" type="info" icon="upload" circle @click="handleOpenImportDialog" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="导出">
|
<el-tooltip content="导出">
|
||||||
<el-button v-hasPerm="['system:user:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
<el-button v-hasPerm="['module_system:user:export']" type="warning" icon="download" circle @click="handleOpenExportsModal" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-tooltip content="刷新">
|
<el-tooltip content="刷新">
|
||||||
<el-button v-hasPerm="['system:user:refresh']" type="default" icon="refresh" circle @click="handleRefresh"/>
|
<el-button v-hasPerm="['module_system:user:refresh']" type="default" icon="refresh" circle @click="handleRefresh"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
<el-table-column fixed="right" label="操作" align="center" min-width="280">
|
<el-table-column fixed="right" label="操作" align="center" min-width="280">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:user:update']"
|
v-hasPerm="['module_system:user:update']"
|
||||||
type="warning"
|
type="warning"
|
||||||
icon="RefreshLeft"
|
icon="RefreshLeft"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
@click="scope.row.is_superuser === true ? ElMessage.warning('系统超管角色,不可操作') : hancleResetPassword(scope.row)"
|
@click="scope.row.is_superuser === true ? ElMessage.warning('系统超管角色,不可操作') : hancleResetPassword(scope.row)"
|
||||||
>重置密码</el-button>
|
>重置密码</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:user:detail']"
|
v-hasPerm="['module_system:user:detail']"
|
||||||
type="info"
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
@click="handleOpenDialog('detail', scope.row.id)"
|
@click="handleOpenDialog('detail', scope.row.id)"
|
||||||
>详情</el-button>
|
>详情</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:user:update']"
|
v-hasPerm="['module_system:user:update']"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
@click="scope.row.is_superuser === true ? ElMessage.warning('系统超管角色,不可操作') : handleOpenDialog('update', scope.row.id)"
|
@click="scope.row.is_superuser === true ? ElMessage.warning('系统超管角色,不可操作') : handleOpenDialog('update', scope.row.id)"
|
||||||
>编辑</el-button>
|
>编辑</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPerm="['system:user:delete']"
|
v-hasPerm="['module_system:user:delete']"
|
||||||
type="danger"
|
type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@@ -333,8 +333,8 @@
|
|||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button v-if="dialogVisible.type === 'create' || dialogVisible.type === 'update'" v-hasPerm="['system:user:create']" type="primary" @click="handleSubmit">确定</el-button>
|
<el-button v-if="dialogVisible.type === 'create' || dialogVisible.type === 'update'" v-hasPerm="['module_system:user:create']" type="primary" @click="handleSubmit">确定</el-button>
|
||||||
<el-button v-else v-hasPerm="['system:user:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
<el-button v-else v-hasPerm="['module_system:user:detail']" type="primary" @click="handleCloseDialog">确定</el-button>
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -495,7 +495,7 @@ const exportColumns = [
|
|||||||
|
|
||||||
// 导入/导出配置
|
// 导入/导出配置
|
||||||
const curdContentConfig = {
|
const curdContentConfig = {
|
||||||
permPrefix: 'system:user',
|
permPrefix: 'module_system:user',
|
||||||
cols: exportColumns as any,
|
cols: exportColumns as any,
|
||||||
importTemplate: () => UserAPI.downloadTemplate(),
|
importTemplate: () => UserAPI.downloadTemplate(),
|
||||||
exportsAction: async (params: any) => {
|
exportsAction: async (params: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user