mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-25 21:57:48 +00:00
1. 重构后端API路由、CRUD与模块结构,整合日志管理,移除废弃demo代码 2. 优化前端组件类型定义、样式与路由配置,修复权限判断逻辑 3. 调整默认排序规则、滚动条样式与工具类函数,更新依赖与配置文件 4. 修复多处类型不匹配与默认值问题,完善表单与菜单验证逻辑
89 lines
2.3 KiB
TypeScript
89 lines
2.3 KiB
TypeScript
import { request } from "@utils";
|
|
|
|
const API_PATH = "/system/ticket";
|
|
|
|
const TicketAPI = {
|
|
listTicket(query?: TicketPageQuery) {
|
|
return request<ApiResponse<PageResult<TicketTable>>>({
|
|
url: `${API_PATH}/list`,
|
|
method: "get",
|
|
params: query,
|
|
});
|
|
},
|
|
detailTicket(id: number) {
|
|
return request<ApiResponse<TicketTable>>({ url: `${API_PATH}/detail/${id}`, method: "get" });
|
|
},
|
|
createTicket(body: TicketCreateForm) {
|
|
return request<ApiResponse>({ url: `${API_PATH}/create`, method: "post", data: body });
|
|
},
|
|
updateTicket(id: number, body: TicketUpdateForm) {
|
|
return request<ApiResponse>({ url: `${API_PATH}/update/${id}`, method: "put", data: body });
|
|
},
|
|
deleteTicket(body: number[]) {
|
|
return request<ApiResponse>({ url: `${API_PATH}/delete`, method: "delete", data: body });
|
|
},
|
|
exportTicket(query?: TicketPageQuery) {
|
|
return request<ApiResponse<Blob>>({
|
|
url: `${API_PATH}/export`,
|
|
method: "get",
|
|
params: query,
|
|
responseType: "blob",
|
|
});
|
|
},
|
|
batchTicket(body: { ids: number[]; status: string }) {
|
|
return request<ApiResponse>({ url: `${API_PATH}/batch`, method: "put", data: body });
|
|
},
|
|
};
|
|
|
|
export default TicketAPI;
|
|
|
|
export interface TicketPageQuery extends PageQuery {
|
|
title?: string;
|
|
ticket_type?: string;
|
|
assigned_id?: number;
|
|
}
|
|
|
|
export interface TicketTable extends BaseType {
|
|
title: string;
|
|
ticket_content?: string;
|
|
summary?: string;
|
|
ticket_type: string;
|
|
images?: string;
|
|
reply?: string;
|
|
assigned_id?: number;
|
|
assigned_by?: { id: number; name: string; avatar?: string };
|
|
created_by?: { id: number; name: string; avatar?: string };
|
|
updated_by?: { id: number; name: string; avatar?: string };
|
|
}
|
|
|
|
export interface TicketCreateForm {
|
|
title: string;
|
|
ticket_content?: string;
|
|
summary?: string;
|
|
ticket_type: string;
|
|
images?: string;
|
|
description?: string;
|
|
}
|
|
|
|
export interface TicketUpdateForm {
|
|
title?: string;
|
|
ticket_content?: string;
|
|
summary?: string;
|
|
ticket_type?: string;
|
|
status?: number;
|
|
reply?: string;
|
|
assigned_id?: number;
|
|
description?: string;
|
|
}
|
|
|
|
export interface TicketForm extends BaseFormType {
|
|
id?: number;
|
|
title: string;
|
|
ticket_content?: string;
|
|
summary?: string;
|
|
ticket_type: string;
|
|
images?: string;
|
|
reply?: string;
|
|
assigned_id?: number;
|
|
}
|