feat: 统一状态字段类型为字符串并重构基础类型

refactor: 重构前后端状态字段类型从布尔值改为字符串
feat: 新增基础类型定义和通用类型接口
refactor: 移除不必要的时间范围字段并统一使用created_time
style: 更新前端组件以匹配新的字段命名
docs: 更新接口文档和类型定义
This commit is contained in:
zhangtao
2025-11-27 23:47:23 +08:00
parent 2c9d66e2a7
commit 0c86069efa
73 changed files with 590 additions and 754 deletions
+18 -37
View File
@@ -123,23 +123,16 @@ export default JobAPI;
export interface JobPageQuery extends PageQuery {
name?: string;
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
created_id?: number;
created_time?: string[];
}
export interface JobLogPageQuery extends PageQuery {
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
/** 任务ID */
job_id?: number;
job_name?: string;
status?: string;
created_time?: string[];
}
export interface JobOptionData {
@@ -147,9 +140,7 @@ export interface JobOptionData {
option?: number; //操作类型 1: 暂停 2: 恢复 3: 重启
}
export interface JobTable {
index?: number;
id: number;
export interface JobTable extends BaseType {
name: string;
func?: string;
trigger?: string;
@@ -162,15 +153,13 @@ export interface JobTable {
trigger_args?: string;
start_date?: string;
end_date?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
export interface JobForm {
id?: number;
export interface JobForm extends BaseFormType {
name?: string;
func?: string;
trigger?: string;
@@ -183,13 +172,10 @@ export interface JobForm {
trigger_args?: string;
start_date?: string;
end_date?: string;
status?: boolean;
description?: string;
}
// 定时任务运行日志接口(对应Scheduler实时状态)
export interface JobRunLog {
id: string;
export interface JobRunLog extends BaseType {
name: string;
trigger: string;
executor: string;
@@ -201,12 +187,11 @@ export interface JobRunLog {
coalesce: boolean;
max_instances: number;
next_run_time: string;
state: string;
tenant?: CommonType;
}
// 定时任务日志详情接口(对应数据库日志表)
export interface JobLogDetail {
id: number;
export interface JobLogDetail extends BaseType {
job_name: string;
job_group: string;
job_executor: string;
@@ -215,15 +200,12 @@ export interface JobLogDetail {
job_kwargs?: string;
job_trigger?: string;
job_message?: string;
status: boolean;
exception_info?: string;
create_time: string;
tenant?: CommonType;
}
// 定时任务日志列表接口(对应数据库日志表)
export interface JobLogTable {
index?: number;
id: number;
export interface JobLogTable extends BaseType {
job_name: string;
job_group: string;
job_executor: string;
@@ -232,7 +214,6 @@ export interface JobLogTable {
job_kwargs?: string;
job_trigger?: string;
job_message?: string;
status: boolean;
exception_info?: string;
create_time: string;
tenant?: CommonType;
}
+9 -37
View File
@@ -82,58 +82,30 @@ export default ApplicationAPI;
* 应用分页查询参数
*/
export interface ApplicationPageQuery extends PageQuery {
/** 应用名称 */
name?: string;
/** 是否启用 */
status?: boolean;
/** 创建人 */
creator?: number;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
/** 排序字段,格式:[{'field':'asc/desc'}] */
order_by?: string;
status?: string;
created_id?: number;
created_time?: string[];
}
/**
* 应用信息
*/
export interface ApplicationInfo {
/** 应用ID */
id?: number;
/** 应用名称 */
export interface ApplicationInfo extends BaseType {
name?: string;
/** 访问地址 */
access_url?: string;
/** 图标地址 */
icon_url?: string;
/** 是否启用 */
status?: boolean;
/** 应用描述 */
description?: string;
/** 创建时间 */
created_at?: string;
/** 更新时间 */
updated_at?: string;
/** 创建人 */
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
/**
* 应用表单
*/
export interface ApplicationForm {
/** 应用ID */
id?: number;
/** 应用名称 */
export interface ApplicationForm extends BaseFormType {
name: string;
/** 访问地址 */
access_url: string;
/** 图标地址 */
icon_url: string;
/** 是否启用 */
status: boolean;
/** 应用描述 */
description?: string;
}
+11 -19
View File
@@ -85,29 +85,21 @@ export interface DemoPageQuery extends PageQuery {
/** 示例标题 */
name?: string;
/** 示例状态 */
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
/** 创建人 */
creator?: number;
status?: string;
/** 创建时间 */
created_time?: string[];
// 创建人ID
created_id?: number;
}
export interface DemoTable {
index?: number;
id?: number;
export interface DemoTable extends BaseType {
name?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
export interface DemoForm {
id?: number;
export interface DemoForm extends BaseFormType {
name?: string;
status?: boolean;
description?: string;
}
+101
View File
@@ -0,0 +1,101 @@
import request from "@/utils/request";
const API_PATH = "/system/customer";
const CustomerAPI = {
listCustomer(query: CustomerPageQuery) {
return request<ApiResponse<PageResult<CustomerTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
detailCustomer(query: number) {
return request<ApiResponse<CustomerTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
createCustomer(body: CustomerForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updateCustomer(id: number, body: CustomerForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deleteCustomer(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batchCustomer(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
exportCustomer(body: CustomerPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
downloadCustomer() {
return request<ApiResponse>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
importCustomer(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default CustomerAPI;
export interface CustomerPageQuery extends PageQuery {
name?: string;
status?: string;
created_time?: string[];
}
export interface CustomerTable extends BaseType {
name?: string;
code?: string;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
}
export interface CustomerForm extends BaseFormType {
name?: string;
code?: string;
}
+13 -17
View File
@@ -55,35 +55,31 @@ export default DeptAPI;
export interface DeptPageQuery {
name?: string;
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
status?: string;
created_time?: string[];
}
export interface DeptTable {
index?: number;
id?: number;
export interface DeptTable extends BaseType {
name?: string;
order?: number;
code?: string;
leader?: string;
phone?: string;
email?: string;
parent_id?: number;
parent_name?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
children?: DeptTable[];
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
}
export interface DeptForm {
id?: number;
export interface DeptForm extends BaseFormType {
name?: string;
order?: number;
code?: string;
leader?: string;
phone?: string;
email?: string;
parent_id?: number;
status?: boolean;
description?: string;
}
+12 -36
View File
@@ -138,71 +138,47 @@ export interface DictPageQuery extends PageQuery {
/** 通知类型 */
dict_type?: string;
/** 通知状态 */
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
/** 创建时间 */
created_time?: string[];
}
export interface DictDataPageQuery extends PageQuery {
dict_label?: string;
dict_type?: string;
status?: boolean;
start_time?: string;
end_time?: string;
// 创建人ID
creator?: number;
dict_type_id?: number;
status?: string;
created_time?: string[];
}
export interface DictTable {
index?: number;
id?: number;
export interface DictTable extends BaseType {
dict_name?: string;
dict_type?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
}
export interface DictForm {
id?: number;
export interface DictForm extends BaseFormType {
dict_name?: string;
dict_type?: string;
status?: boolean;
description?: string;
}
export interface DictDataTable {
index?: number;
id?: number;
export interface DictDataTable extends BaseType {
dict_sort?: number;
dict_label?: string;
dict_value?: string;
dict_type_id?: number;
dict_type?: string;
css_class?: string;
list_class?: string;
is_default?: boolean;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
}
export interface DictDataForm {
id?: number;
export interface DictDataForm extends BaseFormType {
dict_sort?: number;
dict_label?: string;
dict_value?: string;
dict_type_id?: number;
dict_type?: string;
css_class?: string;
list_class?: string;
is_default?: boolean;
status?: boolean;
description?: string;
}
+7 -12
View File
@@ -42,16 +42,11 @@ export interface LogPageQuery extends PageQuery {
type?: number;
request_path?: string;
creator_name?: string;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
created_time?: string[];
created_id?: number;
}
export interface LogTable {
id?: number;
export interface LogTable extends BaseType {
type?: number; // 1 登录日志 2 操作日志
request_path?: string;
request_method?: string;
@@ -63,8 +58,8 @@ export interface LogTable {
request_payload?: string;
response_json?: string;
process_time?: string;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
+5 -16
View File
@@ -55,16 +55,12 @@ export default MenuAPI;
export interface MenuPageQuery {
name?: string;
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
status?: string;
/** 创建时间 */
created_time?: string[];
}
export interface MenuTable {
index?: number;
id?: number;
export interface MenuTable extends BaseType {
name?: string;
type?: number;
icon?: string;
@@ -82,15 +78,10 @@ export interface MenuTable {
title?: string;
params?: { key: string; value: string }[];
affix?: boolean;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
children?: MenuTable[];
}
export interface MenuForm {
id?: number;
export interface MenuForm extends BaseFormType {
name?: string;
type?: number;
icon?: string;
@@ -107,8 +98,6 @@ export interface MenuForm {
title?: string;
params?: KeyValue[];
affix?: boolean;
status?: boolean;
description?: string;
}
export interface KeyValue {
+9 -22
View File
@@ -70,38 +70,25 @@ const NoticeAPI = {
export default NoticeAPI;
export interface NoticePageQuery extends PageQuery {
/** 通知标题 */
notice_title?: string;
/** 通知类型 */
notice_type?: string;
/** 通知状态 */
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
created_time?: string[];
created_id?: number;
}
export interface NoticeTable {
index?: number;
id?: number;
export interface NoticeTable extends BaseType {
notice_title?: string;
notice_type?: string;
notice_content?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
export interface NoticeForm {
id?: number;
export interface NoticeForm extends BaseFormType {
notice_title?: string;
notice_type?: string;
notice_content?: string;
status?: boolean;
description?: string;
}
+4 -15
View File
@@ -77,31 +77,20 @@ export interface ConfigPageQuery extends PageQuery {
config_key?: string;
/** 配置类型 */
config_type?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
/** 创建时间 */
created_time?: string[];
}
export interface ConfigTable {
id?: number;
export interface ConfigTable extends BaseType {
config_name?: string;
config_key?: string;
config_value?: string;
config_type?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
}
export interface ConfigForm {
id?: number;
export interface ConfigForm extends BaseFormType {
config_name?: string;
config_key?: string;
config_value?: string;
config_type?: boolean;
description?: string;
}
+8 -19
View File
@@ -64,31 +64,20 @@ export default PositionAPI;
export interface PositionPageQuery extends PageQuery {
name?: string;
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
created_id?: number;
created_time?: string[];
}
export interface PositionTable {
index?: number;
id?: number;
export interface PositionTable extends BaseType {
name?: string;
order?: number;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
}
export interface PositionForm {
id?: number;
export interface PositionForm extends BaseFormType {
name?: string;
order?: number;
status?: boolean;
description?: string;
}
+9 -25
View File
@@ -72,49 +72,33 @@ export default RoleAPI;
export interface TablePageQuery extends PageQuery {
name?: string;
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
created_id?: number;
created_time?: string[];
}
export interface RoleTable {
index?: number;
id: number;
export interface RoleTable extends BaseType {
name: string;
order?: number;
code?: string;
data_scope?: number;
status?: boolean;
menus?: permissionMenuType[];
depts?: permissionDeptType[];
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
}
export interface RoleForm {
id?: number;
export interface RoleForm extends BaseFormType {
name?: string;
order?: number;
code?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
menus?: permissionMenuType[];
depts?: permissionDeptType[];
}
export interface permissionDataType {
data_scope: number;
role_ids: RoleTable["id"][];
menu_ids: permissionMenuType["id"][];
data_scope: number;
dept_ids: permissionDeptType["id"][];
}
+15 -23
View File
@@ -82,34 +82,26 @@ const TenantAPI = {
export default TenantAPI;
export interface TenantPageQuery extends PageQuery {
/** 示例标题 */
name?: string;
/** 示例状态 */
status?: boolean;
/** 开始时间 */
status?: string;
created_time?: string[];
}
export interface TenantTable extends BaseType {
name?: string;
code?: string;
start_time?: string;
/** 结束时间 */
end_time?: string;
/** 创建人 */
creator?: number;
max_user_count?: number;
enable_quota_limit?: boolean;
current_user_count?: number;
}
export interface TenantTable {
index?: number;
id?: number;
export interface TenantForm extends BaseFormType {
name?: string;
code?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
// creator?: creatorType;
}
export interface TenantForm {
id?: number;
name?: string;
code?: string;
status?: boolean;
description?: string;
start_time?: string;
end_time?: string;
max_user_count?: number;
enable_quota_limit?: boolean;
}
+22 -22
View File
@@ -141,26 +141,31 @@ export default UserAPI;
export interface ForgetPasswordForm {
username: string;
new_password: string;
mobile?: string;
confirmPassword: string;
}
export interface RegisterForm {
name: string;
mobile?: string;
username: string;
password: string;
role_ids?: number[];
customer_id?: number;
description?: string;
user_type?: string;
confirmPassword: string;
}
export interface UserPageQuery extends PageQuery {
username?: string;
name?: string;
status?: boolean;
mobile?: string;
email?: string;
dept_id?: number;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
// 创建人ID
creator?: number;
status?: string;
created_time?: string[];
created_id?: number;
}
export interface searchSelectDataType {
@@ -168,9 +173,7 @@ export interface searchSelectDataType {
status?: string;
}
export interface UserInfo {
index?: number;
id?: number;
export interface UserInfo extends BaseType {
username?: string;
name?: string;
avatar?: string;
@@ -189,12 +192,11 @@ export interface UserInfo {
position_names?: positionSelectorType["name"][];
position_ids?: positionSelectorType["id"][];
is_superuser?: boolean;
status?: boolean;
description?: string;
last_login?: string;
created_at?: string;
updated_at?: string;
creator?: creatorType;
created_by?: creatorType;
updated_by?: updatorType;
tenant?: CommonType;
customer?: CommonType;
}
export interface deptTreeType {
@@ -208,7 +210,7 @@ export interface roleSelectorType {
id?: number;
name?: string;
code?: string;
status?: boolean;
status?: string;
description?: string;
menus?: MenuForm[];
}
@@ -216,7 +218,7 @@ export interface roleSelectorType {
export interface positionSelectorType {
id?: number;
name?: string;
status?: boolean;
status?: string;
description?: string;
}
@@ -232,7 +234,8 @@ export interface InfoFormState {
positions?: positionSelectorType[];
roles?: roleSelectorType[];
avatar?: string;
created_at?: string;
created_time?: string;
updated_time?: string;
}
export interface PasswordFormState {
@@ -246,8 +249,7 @@ export interface ResetPasswordForm {
password: string;
}
export interface UserForm {
id?: number;
export interface UserForm extends BaseFormType {
username?: string;
name?: string;
dept_id?: number;
@@ -261,8 +263,6 @@ export interface UserForm {
email?: string;
mobile?: string;
is_superuser?: boolean;
status?: boolean;
description?: string;
}
export interface CurrentUserFormState {