mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-11 03:49:33 +00:00
chore: 初始化前端项目基础结构与配置
添加了项目所需的基础配置文件(.editorconfig、.gitignore、环境变量文件等),创建了通用工具函数、类型定义、枚举常量、路由配置、状态管理、国际化、自定义指令与插件等核心模块,新增了多个业务组件、布局组件与页面视图,并添加了大量SVG图标资源。
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/position";
|
||||
|
||||
const PositionAPI = {
|
||||
listPosition(query?: PositionPageQuery) {
|
||||
return request<ApiResponse<PageResult<PositionTable[]>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
detailPosition(query: number) {
|
||||
return request<ApiResponse<PositionTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createPosition(body: PositionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updatePosition(id: number, body: PositionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deletePosition(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
batchPosition(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
exportPosition(body: PositionPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default PositionAPI;
|
||||
|
||||
export interface PositionPageQuery extends PageQuery {
|
||||
name?: string;
|
||||
status?: string;
|
||||
created_id?: number;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface PositionTable extends BaseType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
created_by?: CommonType;
|
||||
updated_by?: CommonType;
|
||||
deleted_by?: CommonType;
|
||||
}
|
||||
|
||||
export interface PositionForm extends BaseFormType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user