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