mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
refactor(api): 统一API路径常量并优化前端代码结构
feat(backend): 更新路由前缀和查询参数处理 style(backend): 调整导入顺序和清理无用导入 refactor(frontend): 重构工作台页面交互和样式 fix(frontend): 修复代码生成页面查询表单和表格展示
This commit is contained in:
@@ -19,7 +19,7 @@ from .schema import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
MyAppRouter = APIRouter(route_class=OperationLogRoute, prefix="/application", tags=["应用管理"])
|
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(
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ class GenTableQueryParam:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
table_name: Optional[str] = Query(None, description="表名称"),
|
table_name: Optional[str] = Query(None, description="表名称"),
|
||||||
status: Optional[bool] = Query(None, description="是否启用"),
|
table_comment: Optional[str] = Query(None, description="表注释"),
|
||||||
creator: Optional[int] = Query(None, description="创建人"),
|
creator: Optional[int] = Query(None, description="创建人"),
|
||||||
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
||||||
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
||||||
) -> None:
|
) -> None:
|
||||||
# 存储查询条件,不直接赋值给父类属性
|
# 存储查询条件,不直接赋值给父类属性
|
||||||
self.table_name = ("like", table_name)
|
self.table_name = ("like", table_name)
|
||||||
|
self.table_comment = ("like", table_comment)
|
||||||
|
|
||||||
# 精确查询字段
|
# 精确查询字段
|
||||||
self.creator_id = creator
|
self.creator_id = creator
|
||||||
self.status = status
|
|
||||||
|
|
||||||
# 时间范围查询
|
# 时间范围查询
|
||||||
if start_time and end_time:
|
if start_time and end_time:
|
||||||
@@ -38,7 +38,6 @@ class GenTableColumnQueryParam:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
column_name: Optional[str] = Query(None, description="列名称"),
|
column_name: Optional[str] = Query(None, description="列名称"),
|
||||||
status: Optional[bool] = Query(None, description="是否启用"),
|
|
||||||
creator: Optional[int] = Query(None, description="创建人"),
|
creator: Optional[int] = Query(None, description="创建人"),
|
||||||
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
||||||
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
||||||
@@ -48,7 +47,6 @@ class GenTableColumnQueryParam:
|
|||||||
|
|
||||||
# 精确查询字段
|
# 精确查询字段
|
||||||
self.creator_id = creator
|
self.creator_id = creator
|
||||||
self.status = status
|
|
||||||
|
|
||||||
# 时间范围查询
|
# 时间范围查询
|
||||||
if start_time and end_time:
|
if start_time and end_time:
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class GenTableCreateSchema(BaseModel):
|
|||||||
"""
|
"""
|
||||||
代码生成业务表对应pydantic模型
|
代码生成业务表对应pydantic模型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_config = ConfigDict(from_attributes=True)
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
|
||||||
table_name: str = Field(default=..., description='表名称')
|
table_name: str = Field(default=..., description='表名称')
|
||||||
@@ -80,7 +79,6 @@ class GenTableUpdateSchema(GenTableCreateSchema):
|
|||||||
"""
|
"""
|
||||||
代码生成业务表模型
|
代码生成业务表模型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pk_column: Optional['GenTableColumnUpdateSchema'] = Field(default=None, description='主键信息')
|
pk_column: Optional['GenTableColumnUpdateSchema'] = Field(default=None, description='主键信息')
|
||||||
sub_table: Optional['GenTableUpdateSchema'] = Field(default=None, description='子表信息')
|
sub_table: Optional['GenTableUpdateSchema'] = Field(default=None, description='子表信息')
|
||||||
columns: List['GenTableColumnUpdateSchema'] = Field(default=..., description='表列信息')
|
columns: List['GenTableColumnUpdateSchema'] = Field(default=..., description='表列信息')
|
||||||
@@ -110,7 +108,6 @@ class GenTableDeleteSchema(BaseModel):
|
|||||||
"""
|
"""
|
||||||
删除代码生成业务表模型
|
删除代码生成业务表模型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_config = ConfigDict(alias_generator=to_camel)
|
model_config = ConfigDict(alias_generator=to_camel)
|
||||||
|
|
||||||
table_ids: str = Field(description='需要删除的代码生成业务表ID')
|
table_ids: str = Field(description='需要删除的代码生成业务表ID')
|
||||||
@@ -120,7 +117,6 @@ class GenTableColumnCreateSchema(BaseModel):
|
|||||||
"""
|
"""
|
||||||
代码生成业务表字段对应pydantic模型
|
代码生成业务表字段对应pydantic模型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||||
|
|
||||||
table_id: Optional[int] = Field(default=None, description='归属表编号')
|
table_id: Optional[int] = Field(default=None, description='归属表编号')
|
||||||
@@ -199,7 +195,6 @@ class GenTableColumnDeleteSchema(BaseModel):
|
|||||||
"""
|
"""
|
||||||
删除代码生成业务表字段模型
|
删除代码生成业务表字段模型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_config = ConfigDict(from_attributes=True)
|
model_config = ConfigDict(from_attributes=True)
|
||||||
|
|
||||||
column_ids: str = Field(description='需要删除的代码生成业务表字段ID')
|
column_ids: str = Field(description='需要删除的代码生成业务表字段ID')
|
||||||
|
|||||||
@@ -4,14 +4,13 @@
|
|||||||
提供跨数据库兼容的基础模型类和类型装饰器
|
提供跨数据库兼容的基础模型类和类型装饰器
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
import re
|
import re
|
||||||
|
from datetime import datetime
|
||||||
from typing import Literal, Optional, Dict, Any, Union
|
from typing import Literal, Optional, Dict, Any, Union
|
||||||
|
|
||||||
from sqlalchemy import Boolean, String, Integer, DateTime, ForeignKey, Text, BigInteger
|
from sqlalchemy import Integer, DateTime, Text
|
||||||
from sqlalchemy.dialects.postgresql import UUID
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncAttrs
|
from sqlalchemy.ext.asyncio import AsyncAttrs
|
||||||
from sqlalchemy.orm import relationship, DeclarativeBase, Mapped, declared_attr, mapped_column, MappedAsDataclass
|
from sqlalchemy.orm import relationship, DeclarativeBase, Mapped, declared_attr, mapped_column
|
||||||
from sqlalchemy.engine.row import Row
|
from sqlalchemy.engine.row import Row
|
||||||
from sqlalchemy.orm.collections import InstrumentedList
|
from sqlalchemy.orm.collections import InstrumentedList
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/application/myapp";
|
||||||
|
|
||||||
export const ApplicationAPI = {
|
export const ApplicationAPI = {
|
||||||
/**
|
/**
|
||||||
* 获取应用详情
|
* 获取应用详情
|
||||||
@@ -7,7 +9,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
getApplicationDetail(id: number) {
|
getApplicationDetail(id: number) {
|
||||||
return request<ApiResponse<ApplicationInfo>>({
|
return request<ApiResponse<ApplicationInfo>>({
|
||||||
url: `/application/application/detail/${id}`,
|
url: `${API_PATH}/detail/${id}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -18,7 +20,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
getApplicationList(query: ApplicationPageQuery) {
|
getApplicationList(query: ApplicationPageQuery) {
|
||||||
return request<ApiResponse<PageResult<ApplicationInfo[]>>>({
|
return request<ApiResponse<PageResult<ApplicationInfo[]>>>({
|
||||||
url: `/application/application/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -30,7 +32,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
createApplication(body: ApplicationForm) {
|
createApplication(body: ApplicationForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/application/application/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -43,7 +45,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
updateApplication(id: number, body: ApplicationForm) {
|
updateApplication(id: number, body: ApplicationForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/application/application/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -55,7 +57,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
deleteApplication(body: number[]) {
|
deleteApplication(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/application/application/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -67,7 +69,7 @@ export const ApplicationAPI = {
|
|||||||
*/
|
*/
|
||||||
batchAvailableApplication(body: BatchType) {
|
batchAvailableApplication(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/application/application/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/example/demo";
|
||||||
|
|
||||||
const ExampleAPI = {
|
const ExampleAPI = {
|
||||||
getExampleList(query: ExamplePageQuery) {
|
getExampleList(query: ExamplePageQuery) {
|
||||||
return request<ApiResponse<PageResult<ExampleTable[]>>>({
|
return request<ApiResponse<PageResult<ExampleTable[]>>>({
|
||||||
url: `/example/demo/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
getExampleDetail(query: number) {
|
getExampleDetail(query: number) {
|
||||||
return request<ApiResponse<ExampleTable>>({
|
return request<ApiResponse<ExampleTable>>({
|
||||||
url: `/example/demo/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createExample(body: ExampleForm) {
|
createExample(body: ExampleForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
updateExample(id: number, body: ExampleForm) {
|
updateExample(id: number, body: ExampleForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
deleteExample(body: number[]) {
|
deleteExample(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
batchAvailableExample(body: BatchType) {
|
batchAvailableExample(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -50,7 +52,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
exportExample(body: ExamplePageQuery) {
|
exportExample(body: ExamplePageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/example/demo/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -59,7 +61,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
downloadTemplate() {
|
downloadTemplate() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/download/template`,
|
url: `${API_PATH}/download/template`,
|
||||||
method: "post",
|
method: "post",
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
});
|
});
|
||||||
@@ -67,7 +69,7 @@ const ExampleAPI = {
|
|||||||
|
|
||||||
importExample(body: any) {
|
importExample(body: any) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/example/demo/import`,
|
url: `${API_PATH}/import`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
const GENERATOR_BASE_URL = "/gencode";
|
const API_PATH = "/generator/gencode";
|
||||||
|
|
||||||
const GencodeAPI = {
|
const GencodeAPI = {
|
||||||
|
|
||||||
// 查询生成表数据
|
// 查询生成表数据
|
||||||
listTable(query: TablePageQuery) {
|
listTable(query: TablePageQuery) {
|
||||||
return request<PageResult<GenTableOutVO>>({
|
return request<ApiResponse<PageResult<GenTableOutVO>>>({
|
||||||
url: `${GENERATOR_BASE_URL}/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询db数据库列表
|
// 查询db数据库列表
|
||||||
listDbTable(query: TablePageQuery) {
|
listDbTable(query: DBTablePageQuery) {
|
||||||
return request<PageResult<TablePageVO>>({
|
return request<ApiResponse<PageResult<TablePageVO>>>({
|
||||||
url: `${GENERATOR_BASE_URL}/db/list`,
|
url: `${API_PATH}/db/list`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询表详细信息
|
// 查询表详细信息
|
||||||
getGenTableDetail(tableId: number) {
|
getGenTableDetail(table_id: number) {
|
||||||
return request<GenTableDetailResult>({
|
return request<ApiResponse<GenTableDetailResult>>({
|
||||||
url: `${GENERATOR_BASE_URL}/detail/${tableId}`,
|
url: `${API_PATH}/detail/${table_id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 创建表
|
// 创建表
|
||||||
createTable(sql: string) {
|
createTable(sql: string) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: { sql }
|
params: { sql }
|
||||||
})
|
})
|
||||||
@@ -41,8 +40,8 @@ const GencodeAPI = {
|
|||||||
|
|
||||||
// 修改代码生成信息
|
// 修改代码生成信息
|
||||||
updateGenTable(data: GenTableUpdateSchema) {
|
updateGenTable(data: GenTableUpdateSchema) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/update`,
|
url: `${API_PATH}/update`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -50,8 +49,8 @@ const GencodeAPI = {
|
|||||||
|
|
||||||
// 导入表
|
// 导入表
|
||||||
importTable(tables: string[]) {
|
importTable(tables: string[]) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/import`,
|
url: `${API_PATH}/import`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: { tables }
|
data: { tables }
|
||||||
})
|
})
|
||||||
@@ -60,16 +59,16 @@ const GencodeAPI = {
|
|||||||
|
|
||||||
// 预览生成代码
|
// 预览生成代码
|
||||||
previewTable(tableId: number) {
|
previewTable(tableId: number) {
|
||||||
return request<GeneratorPreviewVO[]>({
|
return request<ApiResponse<GeneratorPreviewVO[]>>({
|
||||||
url: `${GENERATOR_BASE_URL}/preview/${tableId}`,
|
url: `${API_PATH}/preview/${tableId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除表数据
|
// 删除表数据
|
||||||
deleteTable(tableIds: number[]) {
|
deleteTable(tableIds: number[]) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: tableIds
|
data: tableIds
|
||||||
})
|
})
|
||||||
@@ -78,7 +77,7 @@ const GencodeAPI = {
|
|||||||
// 批量生成代码
|
// 批量生成代码
|
||||||
batchGenCode(tables: string) {
|
batchGenCode(tables: string) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `${GENERATOR_BASE_URL}/batch/out`,
|
url: `${API_PATH}/batch/out`,
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
params: { tables },
|
params: { tables },
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
@@ -87,16 +86,16 @@ const GencodeAPI = {
|
|||||||
|
|
||||||
// 生成代码到指定路径
|
// 生成代码到指定路径
|
||||||
genCodeToPath(tableName: string) {
|
genCodeToPath(tableName: string) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/out/path/${tableName}`,
|
url: `${API_PATH}/out/path/${tableName}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 同步数据库
|
// 同步数据库
|
||||||
syncDb(tableName: string) {
|
syncDb(tableName: string) {
|
||||||
return request({
|
return request<ApiResponse>({
|
||||||
url: `${GENERATOR_BASE_URL}/sync/db/${tableName}`,
|
url: `${API_PATH}/sync/db/${tableName}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -109,33 +108,45 @@ export interface GeneratorPreviewVO {
|
|||||||
/** 文件生成路径 */
|
/** 文件生成路径 */
|
||||||
path: string;
|
path: string;
|
||||||
/** 文件名称 */
|
/** 文件名称 */
|
||||||
fileName: string;
|
file_name: string;
|
||||||
/** 文件内容 */
|
/** 文件内容 */
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 数据表分页查询参数 */
|
/** 数据表分页查询参数 */
|
||||||
export interface TablePageQuery extends PageQuery {
|
export interface TablePageQuery extends PageQuery {
|
||||||
/** 关键字(表名) */
|
/** 表名称 */
|
||||||
keywords?: string;
|
table_name?: string;
|
||||||
|
/** 表描述 */
|
||||||
|
table_comment?: string;
|
||||||
|
/** 开始时间 */
|
||||||
|
start_time?: string;
|
||||||
|
/** 结束时间 */
|
||||||
|
end_time?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 数据库表分页查询参数 */
|
||||||
|
export interface DBTablePageQuery extends PageQuery {
|
||||||
|
/** 数据库列名称 */
|
||||||
|
column_name?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 数据表分页对象 */
|
/** 数据表分页对象 */
|
||||||
export interface TablePageVO {
|
export interface TablePageVO {
|
||||||
/** 表名称 */
|
/** 表名称 */
|
||||||
tableName: string;
|
table_name: string;
|
||||||
|
|
||||||
/** 表描述 */
|
/** 表描述 */
|
||||||
tableComment: string;
|
table_comment: string;
|
||||||
|
|
||||||
/** 存储引擎 */
|
/** 存储引擎 */
|
||||||
engine: string;
|
engine: string;
|
||||||
|
|
||||||
/** 字符集排序规则 */
|
/** 字符集排序规则 */
|
||||||
tableCollation: string;
|
table_collation: string;
|
||||||
|
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
createTime: string;
|
create_time: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 代码生成表输出对象 */
|
/** 代码生成表输出对象 */
|
||||||
@@ -143,45 +154,45 @@ export interface GenTableOutVO {
|
|||||||
/** 主键 */
|
/** 主键 */
|
||||||
id?: number;
|
id?: number;
|
||||||
/** 表名称 */
|
/** 表名称 */
|
||||||
tableName: string;
|
table_name: string;
|
||||||
/** 表描述 */
|
/** 表描述 */
|
||||||
tableComment: string;
|
table_comment: string;
|
||||||
/** 关联子表的表名 */
|
/** 关联子表的表名 */
|
||||||
subTableName?: string;
|
sub_table_name?: string;
|
||||||
/** 子表关联的外键名 */
|
/** 子表关联的外键名 */
|
||||||
subTableFkName: string;
|
sub_table_fk_name: string;
|
||||||
/** 实体类名称 */
|
/** 实体类名称 */
|
||||||
className: string;
|
class_name: string;
|
||||||
/** 使用的模板(crud单表操作 tree树表操作) */
|
/** 使用的模板(crud单表操作 tree树表操作) */
|
||||||
tplCategory?: string;
|
tpl_category?: string;
|
||||||
/** 前端模板类型(element-ui模版 element-plus模版) */
|
/** 前端模板类型(element-ui模版 element-plus模版) */
|
||||||
tplWebType?: string;
|
tpl_web_type?: string;
|
||||||
/** 生成包路径 */
|
/** 生成包路径 */
|
||||||
packageName: string;
|
package_name: string;
|
||||||
/** 生成模块名 */
|
/** 生成模块名 */
|
||||||
moduleName: string;
|
module_name: string;
|
||||||
/** 生成业务名 */
|
/** 生成业务名 */
|
||||||
businessName: string;
|
business_name: string;
|
||||||
/** 生成功能名 */
|
/** 生成功能名 */
|
||||||
functionName: string;
|
function_name: string;
|
||||||
/** 生成功能作者 */
|
/** 生成功能作者 */
|
||||||
functionAuthor?: string;
|
function_author?: string;
|
||||||
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
||||||
genType?: string;
|
gen_type?: string;
|
||||||
/** 生成路径(不填默认项目路径) */
|
/** 生成路径(不填默认项目路径) */
|
||||||
genPath?: string;
|
gen_path?: string;
|
||||||
/** 其它生成选项 */
|
/** 其它生成选项 */
|
||||||
options?: string;
|
options?: string;
|
||||||
/** 树编码字段 */
|
/** 树编码字段 */
|
||||||
treeCode?: string;
|
tree_code?: string;
|
||||||
/** 树父编码字段 */
|
/** 树父编码字段 */
|
||||||
treeParentCode?: string;
|
tree_parent_code?: string;
|
||||||
/** 树名称字段 */
|
/** 树名称字段 */
|
||||||
treeName?: string;
|
tree_name?: string;
|
||||||
/** 上级菜单ID字段 */
|
/** 上级菜单ID字段 */
|
||||||
parentMenuId?: number;
|
parent_menu_id?: number;
|
||||||
/** 上级菜单名称字段 */
|
/** 上级菜单名称字段 */
|
||||||
parentMenuName?: string;
|
parent_menu_name?: string;
|
||||||
/** 是否为子表 */
|
/** 是否为子表 */
|
||||||
sub?: boolean;
|
sub?: boolean;
|
||||||
/** 是否为树表 */
|
/** 是否为树表 */
|
||||||
@@ -193,9 +204,9 @@ export interface GenTableOutVO {
|
|||||||
/** 代码生成表更新模型 */
|
/** 代码生成表更新模型 */
|
||||||
export interface GenTableUpdateSchema extends GenTableOutVO {
|
export interface GenTableUpdateSchema extends GenTableOutVO {
|
||||||
/** 主键信息 */
|
/** 主键信息 */
|
||||||
pkColumn?: GenTableColumnUpdateSchema;
|
pk_column?: GenTableColumnUpdateSchema;
|
||||||
/** 子表信息 */
|
/** 子表信息 */
|
||||||
subTable?: GenTableUpdateSchema;
|
sub_table?: GenTableUpdateSchema;
|
||||||
/** 表列信息 */
|
/** 表列信息 */
|
||||||
columns: GenTableColumnUpdateSchema[];
|
columns: GenTableColumnUpdateSchema[];
|
||||||
}
|
}
|
||||||
@@ -205,43 +216,43 @@ export interface GenTableColumnUpdateSchema {
|
|||||||
/** 主键 */
|
/** 主键 */
|
||||||
id?: number;
|
id?: number;
|
||||||
/** 归属表编号 */
|
/** 归属表编号 */
|
||||||
tableId?: number;
|
table_id?: number;
|
||||||
/** 列名称 */
|
/** 列名称 */
|
||||||
columnName: string;
|
column_name: string;
|
||||||
/** 列描述 */
|
/** 列描述 */
|
||||||
columnComment?: string;
|
column_comment?: string;
|
||||||
/** 列类型 */
|
/** 列类型 */
|
||||||
columnType: string;
|
column_type: string;
|
||||||
/** PYTHON类型 */
|
/** PYTHON类型 */
|
||||||
pythonType?: string;
|
python_type?: string;
|
||||||
/** PYTHON字段名 */
|
/** PYTHON字段名 */
|
||||||
pythonField: string;
|
python_field: string;
|
||||||
/** 是否主键(1是) */
|
/** 是否主键(1是) */
|
||||||
isPk?: string;
|
is_pk?: string;
|
||||||
/** 是否自增(1是) */
|
/** 是否自增(1是) */
|
||||||
isIncrement?: string;
|
is_increment?: string;
|
||||||
/** 是否必填(1是) */
|
/** 是否必填(1是) */
|
||||||
isRequired?: string;
|
is_required?: string;
|
||||||
/** 是否唯一(1是) */
|
/** 是否唯一(1是) */
|
||||||
isUnique?: string;
|
is_unique?: string;
|
||||||
/** 是否为插入字段(1是) */
|
/** 是否为插入字段(1是) */
|
||||||
isInsert?: string;
|
is_insert?: string;
|
||||||
/** 是否编辑字段(1是) */
|
/** 是否编辑字段(1是) */
|
||||||
isEdit?: string;
|
is_edit?: string;
|
||||||
/** 是否列表字段(1是) */
|
/** 是否列表字段(1是) */
|
||||||
isList?: string;
|
is_list?: string;
|
||||||
/** 是否查询字段(1是) */
|
/** 是否查询字段(1是) */
|
||||||
isQuery?: string;
|
is_query?: string;
|
||||||
/** 查询方式(等于、不等于、大于、小于、范围) */
|
/** 查询方式(等于、不等于、大于、小于、范围) */
|
||||||
queryType?: string;
|
query_type?: string;
|
||||||
/** 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件) */
|
/** 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件) */
|
||||||
htmlType: string;
|
html_type: string;
|
||||||
/** 字典类型 */
|
/** 字典类型 */
|
||||||
dictType: string;
|
dict_type: string;
|
||||||
/** 排序 */
|
/** 排序 */
|
||||||
sort?: number;
|
sort?: number;
|
||||||
/** 字段大写形式 */
|
/** 字段大写形式 */
|
||||||
capPythonField?: string;
|
cap_python_field?: string;
|
||||||
/** 是否主键 */
|
/** 是否主键 */
|
||||||
pk?: boolean;
|
pk?: boolean;
|
||||||
/** 是否自增 */
|
/** 是否自增 */
|
||||||
@@ -259,9 +270,9 @@ export interface GenTableColumnUpdateSchema {
|
|||||||
/** 是否查询字段 */
|
/** 是否查询字段 */
|
||||||
query?: boolean;
|
query?: boolean;
|
||||||
/** 是否为基类字段 */
|
/** 是否为基类字段 */
|
||||||
superColumn?: boolean;
|
super_column?: boolean;
|
||||||
/** 是否为基类字段白名单 */
|
/** 是否为基类字段白名单 */
|
||||||
usableColumn?: boolean;
|
usable_column?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表详情查询结果 */
|
/** 表详情查询结果 */
|
||||||
|
|||||||
@@ -1,51 +1,53 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/monitor/cache";
|
||||||
|
|
||||||
const CacheAPI = {
|
const CacheAPI = {
|
||||||
getCacheInfo() {
|
getCacheInfo() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/info`,
|
url: `${API_PATH}/info`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getCacheNames() {
|
getCacheNames() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/get/names`,
|
url: `${API_PATH}/get/names`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getCacheKeys(cacheName: string) {
|
getCacheKeys(cacheName: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/get/keys/${cacheName}`,
|
url: `${API_PATH}/get/keys/${cacheName}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getCacheValue(cacheName: string, cacheKey: string) {
|
getCacheValue(cacheName: string, cacheKey: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/get/value/${cacheName}/${cacheKey}`,
|
url: `${API_PATH}/get/value/${cacheName}/${cacheKey}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteCacheName(cacheName: string) {
|
deleteCacheName(cacheName: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/delete/name/${cacheName}`,
|
url: `${API_PATH}/delete/name/${cacheName}`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteCacheKey(cacheKey: string) {
|
deleteCacheKey(cacheKey: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/cache/delete/key/${cacheKey}`,
|
url: `${API_PATH}/delete/key/${cacheKey}`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteCacheAll() {
|
deleteCacheAll() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: "/monitor/cache/delete/all",
|
url: `${API_PATH}/delete/all`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/monitor/job";
|
||||||
|
|
||||||
const JobAPI = {
|
const JobAPI = {
|
||||||
getJobList(query: JobPageQuery) {
|
getJobList(query: JobPageQuery) {
|
||||||
return request<ApiResponse<PageResult<JobTable[]>>>({
|
return request<ApiResponse<PageResult<JobTable[]>>>({
|
||||||
url: `/monitor/job/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const JobAPI = {
|
|||||||
|
|
||||||
getJobDetail(query: number) {
|
getJobDetail(query: number) {
|
||||||
return request<ApiResponse<JobTable>>({
|
return request<ApiResponse<JobTable>>({
|
||||||
url: `/monitor/job/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createJob(body: JobForm) {
|
createJob(body: JobForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const JobAPI = {
|
|||||||
|
|
||||||
updateJob(id: number, body: JobForm) {
|
updateJob(id: number, body: JobForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const JobAPI = {
|
|||||||
|
|
||||||
deleteJob(body: number[]) {
|
deleteJob(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const JobAPI = {
|
|||||||
|
|
||||||
exportJob(body: JobPageQuery) {
|
exportJob(body: JobPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/monitor/job/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -51,14 +53,14 @@ const JobAPI = {
|
|||||||
|
|
||||||
clearJob() {
|
clearJob() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/clear`,
|
url: `${API_PATH}/clear`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
OptionJob(params: JobOptionData) {
|
OptionJob(params: JobOptionData) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/option`,
|
url: `${API_PATH}/option`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
@@ -67,7 +69,7 @@ const JobAPI = {
|
|||||||
// 获取定时任务运行日志(实时状态)
|
// 获取定时任务运行日志(实时状态)
|
||||||
getJobRunLog() {
|
getJobRunLog() {
|
||||||
return request<ApiResponse<JobRunLog[]>>({
|
return request<ApiResponse<JobRunLog[]>>({
|
||||||
url: `/monitor/job/log`,
|
url: `${API_PATH}/log`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -75,7 +77,7 @@ const JobAPI = {
|
|||||||
// 获取定时任务日志详情
|
// 获取定时任务日志详情
|
||||||
getJobLogDetail(id: number) {
|
getJobLogDetail(id: number) {
|
||||||
return request<ApiResponse<JobLogDetail>>({
|
return request<ApiResponse<JobLogDetail>>({
|
||||||
url: `/monitor/job/log/detail/${id}`,
|
url: `${API_PATH}/log/detail/${id}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -83,7 +85,7 @@ const JobAPI = {
|
|||||||
// 查询定时任务日志列表
|
// 查询定时任务日志列表
|
||||||
getJobLogList(query: JobLogPageQuery) {
|
getJobLogList(query: JobLogPageQuery) {
|
||||||
return request<ApiResponse<PageResult<JobLogTable[]>>>({
|
return request<ApiResponse<PageResult<JobLogTable[]>>>({
|
||||||
url: `/monitor/job/log/list`,
|
url: `${API_PATH}/log/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -92,7 +94,7 @@ const JobAPI = {
|
|||||||
// 删除定时任务日志
|
// 删除定时任务日志
|
||||||
deleteJobLog(ids: number[]) {
|
deleteJobLog(ids: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/log/delete`,
|
url: `${API_PATH}/log/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: ids,
|
data: ids,
|
||||||
});
|
});
|
||||||
@@ -101,7 +103,7 @@ const JobAPI = {
|
|||||||
// 清空定时任务日志
|
// 清空定时任务日志
|
||||||
clearJobLog() {
|
clearJobLog() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/job/log/clear`,
|
url: `${API_PATH}/log/clear`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -109,7 +111,7 @@ const JobAPI = {
|
|||||||
// 导出定时任务日志
|
// 导出定时任务日志
|
||||||
exportJobLog(query: JobLogPageQuery) {
|
exportJobLog(query: JobLogPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/monitor/job/log/export`,
|
url: `${API_PATH}/log/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: query,
|
data: query,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/monitor/online";
|
||||||
|
|
||||||
const OnlineAPI = {
|
const OnlineAPI = {
|
||||||
// 查询在线用户列表
|
// 查询在线用户列表
|
||||||
getOnlineList(query: OnlineUserPageQuery) {
|
getOnlineList(query: OnlineUserPageQuery) {
|
||||||
return request<ApiResponse<PageResult<OnlineUserTable[]>>>({
|
return request<ApiResponse<PageResult<OnlineUserTable[]>>>({
|
||||||
url: `/monitor/online/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -13,7 +15,7 @@ const OnlineAPI = {
|
|||||||
// 强退用户
|
// 强退用户
|
||||||
deleteOnline(body: string) {
|
deleteOnline(body: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/online/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -22,7 +24,7 @@ const OnlineAPI = {
|
|||||||
// 强退用户
|
// 强退用户
|
||||||
clearOnline() {
|
clearOnline() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/online/clear`,
|
url: `${API_PATH}/clear`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/monitor/resource";
|
||||||
|
|
||||||
export const ResourceAPI = {
|
export const ResourceAPI = {
|
||||||
/**
|
/**
|
||||||
* 获取目录列表
|
* 获取目录列表
|
||||||
@@ -7,7 +9,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
getResourceList(query: ResourcePageQuery) {
|
getResourceList(query: ResourcePageQuery) {
|
||||||
return request<ApiResponse<PageResult<ResourceItem[]>>>({
|
return request<ApiResponse<PageResult<ResourceItem[]>>>({
|
||||||
url: `/monitor/resource/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -20,7 +22,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
uploadFile(formData: FormData) {
|
uploadFile(formData: FormData) {
|
||||||
return request<ApiResponse<ResourceUploadSchema>>({
|
return request<ApiResponse<ResourceUploadSchema>>({
|
||||||
url: `/monitor/resource/upload`,
|
url: `${API_PATH}/upload`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: formData,
|
data: formData,
|
||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
@@ -33,7 +35,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
downloadFile(path: string) {
|
downloadFile(path: string) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/monitor/resource/download`,
|
url: `${API_PATH}/download`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: { path },
|
params: { path },
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -46,7 +48,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
deleteResource(body: string[]) {
|
deleteResource(body: string[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/resource/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -58,7 +60,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
moveResource(body: ResourceMoveQuery) {
|
moveResource(body: ResourceMoveQuery) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/resource/move`,
|
url: `${API_PATH}/move`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -70,7 +72,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
copyResource(body: ResourceCopyQuery) {
|
copyResource(body: ResourceCopyQuery) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/resource/copy`,
|
url: `${API_PATH}/copy`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -82,7 +84,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
renameResource(body: ResourceRenameQuery) {
|
renameResource(body: ResourceRenameQuery) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/resource/rename`,
|
url: `${API_PATH}/rename`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -94,7 +96,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
createDirectory(body: ResourceCreateDirQuery) {
|
createDirectory(body: ResourceCreateDirQuery) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/resource/create-dir`,
|
url: `${API_PATH}/create-dir`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -106,7 +108,7 @@ export const ResourceAPI = {
|
|||||||
*/
|
*/
|
||||||
exportResource(body: ResourcePageQuery) {
|
exportResource(body: ResourcePageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/monitor/resource/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/monitor/server";
|
||||||
|
|
||||||
const ServerAPI = {
|
const ServerAPI = {
|
||||||
// 获取服务信息
|
// 获取服务信息
|
||||||
getServer() {
|
getServer() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/monitor/server/info`,
|
url: `${API_PATH}/info`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/auth";
|
||||||
|
|
||||||
const AuthAPI = {
|
const AuthAPI = {
|
||||||
login(body: LoginFormData) {
|
login(body: LoginFormData) {
|
||||||
return request<ApiResponse<LoginResult>>({
|
return request<ApiResponse<LoginResult>>({
|
||||||
url: `/system/auth/login`,
|
url: `${API_PATH}/login`,
|
||||||
method: "post",
|
method: "post",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
@@ -14,7 +16,7 @@ const AuthAPI = {
|
|||||||
|
|
||||||
refreshToken(body: RefreshToekenBody) {
|
refreshToken(body: RefreshToekenBody) {
|
||||||
return request<ApiResponse<LoginResult>>({
|
return request<ApiResponse<LoginResult>>({
|
||||||
url: `/system/auth/token/refresh`,
|
url: `${API_PATH}/token/refresh`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -22,14 +24,14 @@ const AuthAPI = {
|
|||||||
|
|
||||||
getCaptcha() {
|
getCaptcha() {
|
||||||
return request<ApiResponse<CaptchaInfo>>({
|
return request<ApiResponse<CaptchaInfo>>({
|
||||||
url: `/system/auth/captcha/get`,
|
url: `${API_PATH}/captcha/get`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
logout(body: LogoutBody) {
|
logout(body: LogoutBody) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/auth/logout`,
|
url: `${API_PATH}/logout`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/dept";
|
||||||
|
|
||||||
const DeptAPI = {
|
const DeptAPI = {
|
||||||
getDeptList(query?: DeptPageQuery) {
|
getDeptList(query?: DeptPageQuery) {
|
||||||
return request<ApiResponse<DeptTable[]>>({
|
return request<ApiResponse<DeptTable[]>>({
|
||||||
url: `/system/dept/tree`,
|
url: `${API_PATH}/tree`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const DeptAPI = {
|
|||||||
|
|
||||||
getDeptDetail(query: number) {
|
getDeptDetail(query: number) {
|
||||||
return request<ApiResponse<DeptTable>>({
|
return request<ApiResponse<DeptTable>>({
|
||||||
url: `/system/dept/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createDept(body: DeptForm) {
|
createDept(body: DeptForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dept/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const DeptAPI = {
|
|||||||
|
|
||||||
updateDept(id: number, body: DeptForm) {
|
updateDept(id: number, body: DeptForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dept/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const DeptAPI = {
|
|||||||
|
|
||||||
deleteDept(body: number[]) {
|
deleteDept(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dept/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const DeptAPI = {
|
|||||||
|
|
||||||
batchAvailableDept(body: BatchType) {
|
batchAvailableDept(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dept/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/dict";
|
||||||
|
|
||||||
const DictAPI = {
|
const DictAPI = {
|
||||||
getDictTypeList(query: DictPageQuery) {
|
getDictTypeList(query: DictPageQuery) {
|
||||||
return request<ApiResponse<PageResult<DictTable[]>>>({
|
return request<ApiResponse<PageResult<DictTable[]>>>({
|
||||||
url: `/system/dict/type/list`,
|
url: `${API_PATH}/type/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,21 +13,21 @@ const DictAPI = {
|
|||||||
|
|
||||||
getDictTypeOptionselect() {
|
getDictTypeOptionselect() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/type/optionselect`,
|
url: `${API_PATH}/type/optionselect`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getDictTypeDetail(query: number) {
|
getDictTypeDetail(query: number) {
|
||||||
return request<ApiResponse<DictTable>>({
|
return request<ApiResponse<DictTable>>({
|
||||||
url: `/system/dict/type/detail/${query}`,
|
url: `${API_PATH}/type/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createDictType(body: DictForm) {
|
createDictType(body: DictForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/type/create`,
|
url: `${API_PATH}/type/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -33,7 +35,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
updateDictType(id: number, body: DictForm) {
|
updateDictType(id: number, body: DictForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/type/update/${id}`,
|
url: `${API_PATH}/type/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -41,7 +43,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
deleteDictType(body: number[]) {
|
deleteDictType(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/type/delete`,
|
url: `${API_PATH}/type/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -49,7 +51,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
batchAvailableDict(body: BatchType) {
|
batchAvailableDict(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/type/available/setting`,
|
url: `${API_PATH}/type/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -57,7 +59,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
exportDictType(body: DictPageQuery) {
|
exportDictType(body: DictPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/dict/type/export`,
|
url: `${API_PATH}/type/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -66,7 +68,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
getDictDataList(query: DictDataPageQuery) {
|
getDictDataList(query: DictDataPageQuery) {
|
||||||
return request<ApiResponse<PageResult<DictDataTable[]>>>({
|
return request<ApiResponse<PageResult<DictDataTable[]>>>({
|
||||||
url: `/system/dict/data/list`,
|
url: `${API_PATH}/data/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -74,14 +76,14 @@ const DictAPI = {
|
|||||||
|
|
||||||
getDictDataDetail(query: number) {
|
getDictDataDetail(query: number) {
|
||||||
return request<ApiResponse<DictDataTable>>({
|
return request<ApiResponse<DictDataTable>>({
|
||||||
url: `/system/dict/data/detail/${query}`,
|
url: `${API_PATH}/data/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createDictData(body: DictDataForm) {
|
createDictData(body: DictDataForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/data/create`,
|
url: `${API_PATH}/data/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -89,7 +91,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
updateDictData(id: number, body: DictDataForm) {
|
updateDictData(id: number, body: DictDataForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/data/update/${id}`,
|
url: `${API_PATH}/data/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -97,7 +99,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
deleteDictData(body: number[]) {
|
deleteDictData(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/data/delete`,
|
url: `${API_PATH}/data/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -105,7 +107,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
batchAvailableDictData(body: BatchType) {
|
batchAvailableDictData(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/data/available/setting`,
|
url: `${API_PATH}/data/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -113,7 +115,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
exportDictData(body: DictDataPageQuery) {
|
exportDictData(body: DictDataPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/dict/data/export`,
|
url: `${API_PATH}/data/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -122,7 +124,7 @@ const DictAPI = {
|
|||||||
|
|
||||||
getInitDict(dict_type: string) {
|
getInitDict(dict_type: string) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/dict/data/info/${dict_type}`,
|
url: `${API_PATH}/data/info/${dict_type}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/log";
|
||||||
|
|
||||||
const LogAPI = {
|
const LogAPI = {
|
||||||
getLogList(query: LogPageQuery) {
|
getLogList(query: LogPageQuery) {
|
||||||
return request<ApiResponse<PageResult<LogTable[]>>>({
|
return request<ApiResponse<PageResult<LogTable[]>>>({
|
||||||
url: `/system/log/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const LogAPI = {
|
|||||||
|
|
||||||
getLogDetail(query: number) {
|
getLogDetail(query: number) {
|
||||||
return request<ApiResponse<LogTable>>({
|
return request<ApiResponse<LogTable>>({
|
||||||
url: `/system/log/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteLog(body: number[]) {
|
deleteLog(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/log/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const LogAPI = {
|
|||||||
|
|
||||||
exportLog(body: LogPageQuery) {
|
exportLog(body: LogPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/log/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/menu";
|
||||||
|
|
||||||
const MenuAPI = {
|
const MenuAPI = {
|
||||||
getMenuList(query?: MenuPageQuery) {
|
getMenuList(query?: MenuPageQuery) {
|
||||||
return request<ApiResponse<MenuTable[]>>({
|
return request<ApiResponse<MenuTable[]>>({
|
||||||
url: `/system/menu/tree`,
|
url: `${API_PATH}/tree`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const MenuAPI = {
|
|||||||
|
|
||||||
getMenuDetail(query: number) {
|
getMenuDetail(query: number) {
|
||||||
return request<ApiResponse<MenuTable>>({
|
return request<ApiResponse<MenuTable>>({
|
||||||
url: `/system/menu/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createMenu(body: MenuForm) {
|
createMenu(body: MenuForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/menu/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const MenuAPI = {
|
|||||||
|
|
||||||
updateMenu(id: number, body: MenuForm) {
|
updateMenu(id: number, body: MenuForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/menu/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const MenuAPI = {
|
|||||||
|
|
||||||
deleteMenu(body: number[]) {
|
deleteMenu(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/menu/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const MenuAPI = {
|
|||||||
|
|
||||||
batchAvailableMenu(body: BatchType) {
|
batchAvailableMenu(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/menu/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/notice";
|
||||||
|
|
||||||
const NoticeAPI = {
|
const NoticeAPI = {
|
||||||
getNoticeList(query: NoticePageQuery) {
|
getNoticeList(query: NoticePageQuery) {
|
||||||
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
||||||
url: `/system/notice/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,21 +13,21 @@ const NoticeAPI = {
|
|||||||
|
|
||||||
getNoticeListAvailable() {
|
getNoticeListAvailable() {
|
||||||
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
||||||
url: `/system/notice/available`,
|
url: `${API_PATH}/available`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getNoticeDetail(query: number) {
|
getNoticeDetail(query: number) {
|
||||||
return request<ApiResponse<NoticeTable>>({
|
return request<ApiResponse<NoticeTable>>({
|
||||||
url: `/system/notice/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createNotice(body: NoticeForm) {
|
createNotice(body: NoticeForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/notice/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -33,7 +35,7 @@ const NoticeAPI = {
|
|||||||
|
|
||||||
updateNotice(id: number, body: NoticeForm) {
|
updateNotice(id: number, body: NoticeForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/notice/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -41,7 +43,7 @@ const NoticeAPI = {
|
|||||||
|
|
||||||
deleteNotice(body: number[]) {
|
deleteNotice(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/notice/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -49,7 +51,7 @@ const NoticeAPI = {
|
|||||||
|
|
||||||
batchAvailableNotice(body: BatchType) {
|
batchAvailableNotice(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/notice/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -57,7 +59,7 @@ const NoticeAPI = {
|
|||||||
|
|
||||||
exportNotice(body: NoticePageQuery) {
|
exportNotice(body: NoticePageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/notice/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/param";
|
||||||
|
|
||||||
const ParamsAPI = {
|
const ParamsAPI = {
|
||||||
uploadFile(body: any) {
|
uploadFile(body: any) {
|
||||||
return request<ApiResponse<UploadFilePath>>({
|
return request<ApiResponse<UploadFilePath>>({
|
||||||
url: `/system/param/upload`,
|
url: `${API_PATH}/upload`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
@@ -12,14 +14,14 @@ const ParamsAPI = {
|
|||||||
|
|
||||||
getInitConfig() {
|
getInitConfig() {
|
||||||
return request<ApiResponse<ConfigTable[]>>({
|
return request<ApiResponse<ConfigTable[]>>({
|
||||||
url: `/system/param/info`,
|
url: `${API_PATH}/info`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getConfigList(query: ConfigPageQuery) {
|
getConfigList(query: ConfigPageQuery) {
|
||||||
return request<ApiResponse<PageResult<ConfigTable[]>>>({
|
return request<ApiResponse<PageResult<ConfigTable[]>>>({
|
||||||
url: `/system/param/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -27,14 +29,14 @@ const ParamsAPI = {
|
|||||||
|
|
||||||
getConfigDetail(query: number) {
|
getConfigDetail(query: number) {
|
||||||
return request<ApiResponse<ConfigTable>>({
|
return request<ApiResponse<ConfigTable>>({
|
||||||
url: `/system/param/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createConfig(body: ConfigForm) {
|
createConfig(body: ConfigForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/param/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const ParamsAPI = {
|
|||||||
|
|
||||||
updateConfig(id: number, body: ConfigForm) {
|
updateConfig(id: number, body: ConfigForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/param/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -50,7 +52,7 @@ const ParamsAPI = {
|
|||||||
|
|
||||||
deleteConfig(body: number[]) {
|
deleteConfig(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/param/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -58,7 +60,7 @@ const ParamsAPI = {
|
|||||||
|
|
||||||
exportConfig(body: ConfigPageQuery) {
|
exportConfig(body: ConfigPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/param/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/position";
|
||||||
|
|
||||||
const PositionAPI = {
|
const PositionAPI = {
|
||||||
getPositionList(query?: PositionPageQuery) {
|
getPositionList(query?: PositionPageQuery) {
|
||||||
return request<ApiResponse<PageResult<PositionTable[]>>>({
|
return request<ApiResponse<PageResult<PositionTable[]>>>({
|
||||||
url: `/system/position/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const PositionAPI = {
|
|||||||
|
|
||||||
getPositionDetail(query: number) {
|
getPositionDetail(query: number) {
|
||||||
return request<ApiResponse<PositionTable>>({
|
return request<ApiResponse<PositionTable>>({
|
||||||
url: `/system/position/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createPosition(body: PositionForm) {
|
createPosition(body: PositionForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/position/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const PositionAPI = {
|
|||||||
|
|
||||||
updatePosition(id: number, body: PositionForm) {
|
updatePosition(id: number, body: PositionForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/position/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const PositionAPI = {
|
|||||||
|
|
||||||
deletePosition(body: number[]) {
|
deletePosition(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/position/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const PositionAPI = {
|
|||||||
|
|
||||||
batchAvailablePosition(body: BatchType) {
|
batchAvailablePosition(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/position/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -50,7 +52,7 @@ const PositionAPI = {
|
|||||||
|
|
||||||
exportPosition(body: PositionPageQuery) {
|
exportPosition(body: PositionPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/position/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
const API_PATH = "/system/role";
|
||||||
|
|
||||||
const RoleAPI = {
|
const RoleAPI = {
|
||||||
getRoleList(query?: TablePageQuery) {
|
getRoleList(query?: TablePageQuery) {
|
||||||
return request<ApiResponse<PageResult<RoleTable[]>>>({
|
return request<ApiResponse<PageResult<RoleTable[]>>>({
|
||||||
url: `/system/role/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -11,14 +13,14 @@ const RoleAPI = {
|
|||||||
|
|
||||||
getRoleDetail(query: number) {
|
getRoleDetail(query: number) {
|
||||||
return request<ApiResponse<RoleTable>>({
|
return request<ApiResponse<RoleTable>>({
|
||||||
url: `/system/role/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createRole(body: RoleForm) {
|
createRole(body: RoleForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/role/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -26,7 +28,7 @@ const RoleAPI = {
|
|||||||
|
|
||||||
updateRole(id: number, body: RoleForm) {
|
updateRole(id: number, body: RoleForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/role/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -34,7 +36,7 @@ const RoleAPI = {
|
|||||||
|
|
||||||
deleteRole(body: number[]) {
|
deleteRole(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/role/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -42,7 +44,7 @@ const RoleAPI = {
|
|||||||
|
|
||||||
batchAvailableRole(body: BatchType) {
|
batchAvailableRole(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/role/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -50,7 +52,7 @@ const RoleAPI = {
|
|||||||
|
|
||||||
setPermission(body: permissionDataType) {
|
setPermission(body: permissionDataType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/role/permission/setting`,
|
url: `${API_PATH}/permission/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -58,7 +60,7 @@ const RoleAPI = {
|
|||||||
|
|
||||||
exportRole(body: TablePageQuery) {
|
exportRole(body: TablePageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/role/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import { MenuTable, MenuForm } from "@/api/system/menu";
|
import { MenuTable, MenuForm } from "@/api/system/menu";
|
||||||
|
|
||||||
|
const API_PATH = "/system/user";
|
||||||
|
|
||||||
export const UserAPI = {
|
export const UserAPI = {
|
||||||
getCurrentUserInfo() {
|
getCurrentUserInfo() {
|
||||||
return request<ApiResponse<UserInfo>>({
|
return request<ApiResponse<UserInfo>>({
|
||||||
url: `/system/user/current/info`,
|
url: `${API_PATH}/current/info`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadCurrentUserAvatar(body: any) {
|
uploadCurrentUserAvatar(body: any) {
|
||||||
return request<ApiResponse<UploadFilePath>>({
|
return request<ApiResponse<UploadFilePath>>({
|
||||||
url: `/system/user/current/avatar/upload`,
|
url: `${API_PATH}/current/avatar/upload`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
@@ -20,7 +22,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
updateCurrentUserInfo(body: InfoFormState) {
|
updateCurrentUserInfo(body: InfoFormState) {
|
||||||
return request<ApiResponse<UserInfo>>({
|
return request<ApiResponse<UserInfo>>({
|
||||||
url: `/system/user/current/info/update`,
|
url: `${API_PATH}/current/info/update`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -28,7 +30,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
changeCurrentUserPassword(body: PasswordFormState) {
|
changeCurrentUserPassword(body: PasswordFormState) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/current/password/change`,
|
url: `${API_PATH}/current/password/change`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -36,7 +38,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
resetUserPassword(body: ResetPasswordForm) {
|
resetUserPassword(body: ResetPasswordForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/reset/password`,
|
url: `${API_PATH}/reset/password`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -44,7 +46,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
registerUser(body: RegisterForm) {
|
registerUser(body: RegisterForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/register`,
|
url: `${API_PATH}/register`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -52,7 +54,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
forgetPassword(body: ForgetPasswordForm) {
|
forgetPassword(body: ForgetPasswordForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/forget/password`,
|
url: `${API_PATH}/forget/password`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -60,7 +62,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
getUserList(query: UserPageQuery) {
|
getUserList(query: UserPageQuery) {
|
||||||
return request<ApiResponse<PageResult<UserInfo[]>>>({
|
return request<ApiResponse<PageResult<UserInfo[]>>>({
|
||||||
url: `/system/user/list`,
|
url: `${API_PATH}/list`,
|
||||||
method: "get",
|
method: "get",
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -68,14 +70,14 @@ export const UserAPI = {
|
|||||||
|
|
||||||
getUserDetail(query: number) {
|
getUserDetail(query: number) {
|
||||||
return request<ApiResponse<UserInfo>>({
|
return request<ApiResponse<UserInfo>>({
|
||||||
url: `/system/user/detail/${query}`,
|
url: `${API_PATH}/detail/${query}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createUser(body: UserForm) {
|
createUser(body: UserForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/create`,
|
url: `${API_PATH}/create`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -83,7 +85,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
updateUser(id: number, body: UserForm) {
|
updateUser(id: number, body: UserForm) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/update/${id}`,
|
url: `${API_PATH}/update/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -91,7 +93,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
deleteUser(body: number[]) {
|
deleteUser(body: number[]) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/delete`,
|
url: `${API_PATH}/delete`,
|
||||||
method: "delete",
|
method: "delete",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -99,7 +101,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
batchAvailableUser(body: BatchType) {
|
batchAvailableUser(body: BatchType) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/available/setting`,
|
url: `${API_PATH}/available/setting`,
|
||||||
method: "patch",
|
method: "patch",
|
||||||
data: body,
|
data: body,
|
||||||
});
|
});
|
||||||
@@ -107,7 +109,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
exportUser(body: UserPageQuery) {
|
exportUser(body: UserPageQuery) {
|
||||||
return request<Blob>({
|
return request<Blob>({
|
||||||
url: `/system/user/export`,
|
url: `${API_PATH}/export`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
@@ -116,7 +118,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
downloadTemplate() {
|
downloadTemplate() {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/import/template`,
|
url: `${API_PATH}/import/template`,
|
||||||
method: "post",
|
method: "post",
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
});
|
});
|
||||||
@@ -124,7 +126,7 @@ export const UserAPI = {
|
|||||||
|
|
||||||
importUser(body: any) {
|
importUser(body: any) {
|
||||||
return request<ApiResponse>({
|
return request<ApiResponse>({
|
||||||
url: `/system/user/import/data`,
|
url: `${API_PATH}/import/data`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: body,
|
data: body,
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<span class="font-bold">通知公告</span>
|
<span class="font-bold">通知公告</span>
|
||||||
<ElLink href="https://service.fastapiadmin.com/" target="_blank" type="primary" underline="never">更多</ElLink>
|
<ElButton type="primary" link @click="goToNotice()">更多</ElButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-empty v-if="noticeList.length === 0" :image-size="80" description="暂无数据" />
|
<el-empty v-if="noticeList.length === 0" :image-size="80" description="暂无数据" />
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
<div class="flex justify-between items-center text-xs">
|
<div class="flex justify-between items-center text-xs">
|
||||||
<span class="text-[var(--el-text-color-regular)]">{{ item.creator?.name }} 发布</span>
|
<span class="text-[var(--el-text-color-regular)]">{{ item.creator?.name }} 发布</span>
|
||||||
<el-tooltip placement="top" :content="item.description || item.notice_content">
|
<el-tooltip placement="top" :content="item.description || item.notice_content">
|
||||||
<ElLink href="https://service.fastapiadmin.com/" target="_blank" type="primary">详情↗</ElLink>
|
<ElButton target="_blank" type="primary" link @click="goToNotice()">详情↗</ElButton>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,13 +128,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<ElButton size="small" type="danger" plain @click="clearBookmarks()">
|
<ElButton size="small" type="danger" plain @click="clearBookmarks()">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Close />
|
<Delete />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
{{ t('common.clear') }}
|
{{ t('common.clear') }}
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<ElRow v-if="quickLinks.length > 0" :gutter="12">
|
<ElRow v-if="quickLinks.length > 0" :gutter="8">
|
||||||
<ElCol
|
<ElCol
|
||||||
v-for="(item, index) in quickLinks"
|
v-for="(item, index) in quickLinks"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -142,8 +142,9 @@
|
|||||||
class="group mb-4"
|
class="group mb-4"
|
||||||
>
|
>
|
||||||
<ElButton
|
<ElButton
|
||||||
|
plain
|
||||||
type="default"
|
type="default"
|
||||||
class="w-full h-20 flex items-center justify-start px-4 relative"
|
class="w-full relative"
|
||||||
@click="handleQuickLinkClick(item)"
|
@click="handleQuickLinkClick(item)"
|
||||||
>
|
>
|
||||||
<el-icon v-if="item.icon && item.icon.startsWith('el-icon')">
|
<el-icon v-if="item.icon && item.icon.startsWith('el-icon')">
|
||||||
@@ -153,11 +154,12 @@
|
|||||||
<div v-else :class="`i-svg:menu mr-2`" />
|
<div v-else :class="`i-svg:menu mr-2`" />
|
||||||
|
|
||||||
<span>{{ item.title }}</span>
|
<span>{{ item.title }}</span>
|
||||||
<el-icon
|
<el-icon
|
||||||
|
color="var(--el-color-danger)"
|
||||||
class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 "
|
class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 "
|
||||||
@click.stop="handleDeleteLink(item)"
|
@click.stop="handleDeleteLink(item)"
|
||||||
>
|
>
|
||||||
<CircleCloseFilled />
|
<CircleClose />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
@@ -183,7 +185,7 @@ import NoticeAPI, { NoticeTable } from '@/api/system/notice';
|
|||||||
import { ref, onMounted, reactive } from 'vue';
|
import { ref, onMounted, reactive } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { QuestionFilled, Close, CircleCloseFilled } from "@element-plus/icons-vue";
|
import { QuestionFilled, Delete, CircleClose } from "@element-plus/icons-vue";
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import { quickStartManager, type QuickLink } from '@/utils/quickStartManager';
|
import { quickStartManager, type QuickLink } from '@/utils/quickStartManager';
|
||||||
|
|
||||||
@@ -215,6 +217,13 @@ const formatTime = (time: string | undefined) => {
|
|||||||
return date.toLocaleDateString();
|
return date.toLocaleDateString();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 跳转通知公告详情页
|
||||||
|
const goToNotice = () => {
|
||||||
|
router.push({ name: 'Notice' }).catch(() => {
|
||||||
|
ElMessage.warning(`公告通知跳转失败,请检查路由配置`);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 获取通知类型文本和颜色
|
// 获取通知类型文本和颜色
|
||||||
const getNoticeTypeText = (type: string | undefined) => {
|
const getNoticeTypeText = (type: string | undefined) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
@@ -1,39 +1,81 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form v-show="showSearch" ref="queryRef" :model="queryParams" :inline="true" >
|
<!-- 搜索区域 -->
|
||||||
<el-form-item label="表名称" prop="tableName">
|
<div class="search-container">
|
||||||
<el-input
|
<el-form ref="queryFormRef" :model="queryFormData" :inline="true" label-suffix=":">
|
||||||
v-model="queryParams.tableName"
|
<el-form-item prop="table_name" label="表名称">
|
||||||
placeholder="请输入表名称"
|
<el-input v-model="queryFormData.table_name" placeholder="请输入表名称" clearable />
|
||||||
clearable
|
</el-form-item>
|
||||||
style="width: 200px"
|
<el-form-item prop="status" label="状态">
|
||||||
@keyup.enter="handleQuery"
|
<el-select v-model="queryFormData.status" placeholder="请选择状态" style="width: 167.5px" clearable>
|
||||||
/>
|
<el-option value="true" label="启用" />
|
||||||
</el-form-item>
|
<el-option value="false" label="停用" />
|
||||||
<el-form-item label="表描述" prop="tableComment">
|
</el-select>
|
||||||
<el-input
|
</el-form-item>
|
||||||
v-model="queryParams.tableComment"
|
<!-- 时间范围,收起状态下隐藏 -->
|
||||||
placeholder="请输入表描述"
|
<el-form-item v-if="isExpand" prop="start_time" label="创建时间">
|
||||||
clearable
|
<DatePicker v-model="dateRange" @update:model-value="handleDateRangeChange"/>
|
||||||
style="width: 200px"
|
</el-form-item>
|
||||||
@keyup.enter="handleQuery"
|
<!-- 查询、重置、展开/收起按钮 -->
|
||||||
/>
|
<el-form-item class="search-buttons">
|
||||||
</el-form-item>
|
<el-button type="primary" icon="search" @click="handleQuery" v-hasPerm="['demo:example:query']">
|
||||||
<el-form-item label="创建时间" style="width: 308px">
|
查询
|
||||||
<el-date-picker
|
</el-button>
|
||||||
v-model="dateRange"
|
<el-button icon="refresh" @click="handleResetQuery" v-hasPerm="['demo:example:query']">
|
||||||
value-format="YYYY-MM-DD"
|
重置
|
||||||
type="daterange"
|
</el-button>
|
||||||
range-separator="-"
|
<!-- 展开/收起 -->
|
||||||
start-placeholder="开始日期"
|
<template v-if="isExpandable">
|
||||||
end-placeholder="结束日期"
|
<el-link class="ml-3" type="primary" underline="never" @click="isExpand = !isExpand">
|
||||||
></el-date-picker>
|
{{ isExpand ? "收起" : "展开" }}
|
||||||
</el-form-item>
|
<el-icon>
|
||||||
<el-form-item>
|
<template v-if="isExpand">
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery" v-hasPermi="['generator:gencode:query']">搜索</el-button>
|
<ArrowUp />
|
||||||
<el-button icon="Refresh" @click="resetQuery" v-hasPermi="['generator:gencode:query']">重置</el-button>
|
</template>
|
||||||
</el-form-item>
|
<template v-else>
|
||||||
</el-form>
|
<ArrowDown />
|
||||||
|
</template>
|
||||||
|
</el-icon>
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-form v-show="showSearch" ref="queryRef" :model="queryFormData" :inline="true" >
|
||||||
|
<el-form-item label="表名称" prop="table_name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryFormData.table_name"
|
||||||
|
placeholder="请输入表名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="表描述" prop="tableComment">
|
||||||
|
<el-input
|
||||||
|
v-model="queryFormData.tableComment"
|
||||||
|
placeholder="请输入表描述"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery" v-hasPermi="['generator:gencode:query']">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery" v-hasPermi="['generator:gencode:query']">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -91,13 +133,13 @@
|
|||||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||||
<el-table-column label="序号" type="index" width="50" align="center">
|
<el-table-column label="序号" type="index" width="50" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{(queryParams.page_no - 1) * queryParams.page_size + scope.$index + 1}}</span>
|
<span>{{(queryFormData.page_no - 1) * queryFormData.page_size + scope.$index + 1}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="表名称"
|
label="表名称"
|
||||||
align="center"
|
align="center"
|
||||||
prop="tableName"
|
prop="table_name"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -137,8 +179,8 @@
|
|||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
v-model:page="queryParams.page_no"
|
v-model:page="queryFormData.page_no"
|
||||||
v-model:limit="queryParams.page_size"
|
v-model:limit="queryFormData.page_size"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
<!-- 预览界面 -->
|
<!-- 预览界面 -->
|
||||||
@@ -185,11 +227,12 @@ const tableNames = ref([]);
|
|||||||
const dateRange = ref([]);
|
const dateRange = ref([]);
|
||||||
const uniqueId = ref("");
|
const uniqueId = ref("");
|
||||||
|
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryFormData: {
|
||||||
page_no: 1,
|
page_no: 1,
|
||||||
page_size: 10,
|
page_size: 10,
|
||||||
tableName: undefined,
|
table_name: undefined,
|
||||||
tableComment: undefined
|
tableComment: undefined
|
||||||
},
|
},
|
||||||
preview: {
|
preview: {
|
||||||
@@ -200,13 +243,13 @@ const data = reactive({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, preview } = toRefs(data);
|
const { queryFormData, preview } = toRefs(data);
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
const time = route.query.t;
|
const time = route.query.t;
|
||||||
if (time != null && time != uniqueId.value) {
|
if (time != null && time != uniqueId.value) {
|
||||||
uniqueId.value = time;
|
uniqueId.value = time;
|
||||||
queryParams.value.page_no = Number(route.query.page_no);
|
queryFormData.value.page_no = Number(route.query.page_no);
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryForm");
|
proxy.resetForm("queryForm");
|
||||||
getList();
|
getList();
|
||||||
@@ -216,7 +259,7 @@ onActivated(() => {
|
|||||||
/** 查询表集合 */
|
/** 查询表集合 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
GencodeAPI.listTable(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
GencodeAPI.listTable(proxy.addDateRange(queryFormData.value, dateRange.value)).then(response => {
|
||||||
tableList.value = response.rows;
|
tableList.value = response.rows;
|
||||||
total.value = response.total;
|
total.value = response.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -225,13 +268,13 @@ function getList() {
|
|||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.page_no = 1;
|
queryFormData.value.page_no = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成代码操作 */
|
/** 生成代码操作 */
|
||||||
function handleGenTable(row) {
|
function handleGenTable(row) {
|
||||||
const tbNames = row.tableName || tableNames.value;
|
const tbNames = row.table_name || tableNames.value;
|
||||||
if (tbNames == "") {
|
if (tbNames == "") {
|
||||||
proxy.$modal.msgError("请选择要生成的数据");
|
proxy.$modal.msgError("请选择要生成的数据");
|
||||||
return;
|
return;
|
||||||
@@ -255,7 +298,7 @@ function handleGenTable(row) {
|
|||||||
|
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
function handleSynchDb(row) {
|
function handleSynchDb(row) {
|
||||||
const tableName = row.tableName;
|
const tableName = row.table_name;
|
||||||
proxy.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function () {
|
proxy.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function () {
|
||||||
return GencodeAPI.syncDb(tableName);
|
return GencodeAPI.syncDb(tableName);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
@@ -297,7 +340,7 @@ function copyTextSuccess() {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.tableId);
|
ids.value = selection.map(item => item.tableId);
|
||||||
tableNames.value = selection.map(item => item.tableName);
|
tableNames.value = selection.map(item => item.table_name);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
@@ -305,7 +348,7 @@ function handleSelectionChange(selection) {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleEditTable(row) {
|
function handleEditTable(row) {
|
||||||
const tableId = row.tableId || ids.value[0];
|
const tableId = row.tableId || ids.value[0];
|
||||||
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { page_no: queryParams.value.page_no } });
|
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { page_no: queryFormData.value.page_no } });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
|
|||||||
Reference in New Issue
Block a user