mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
1. 删除无用文件与废弃代码:移除locale枚举、element-plus插件、sse路由、api token模块等 2. 简化类型导入与依赖:移除大量未使用的类型导入,统一echarts导入方式 3. 优化配置与样式:调整gitignore、样式引入顺序,新增列表动画样式 4. 修复接口与模型:修正接口返回类型、查询参数配置,更新部门模型字段 5. 优化性能与体验:添加图片懒加载,优化加载逻辑与表格渲染 6. 调整环境配置:新增并更新开发/生产环境配置文件
187 lines
3.9 KiB
TypeScript
187 lines
3.9 KiB
TypeScript
import { request } from "@utils";
|
|
|
|
const API_PATH = "/system/dict";
|
|
|
|
const DictAPI = {
|
|
listDictType(query: DictPageQuery) {
|
|
return request<ApiResponse<PageResult<DictTable>>>({
|
|
url: `${API_PATH}/type/list`,
|
|
method: "get",
|
|
params: query,
|
|
});
|
|
},
|
|
|
|
optionDictType() {
|
|
return request<ApiResponse<DictTable[]>>({
|
|
url: `${API_PATH}/type/optionselect`,
|
|
method: "get",
|
|
});
|
|
},
|
|
|
|
detailDictType(query: number) {
|
|
return request<ApiResponse<DictTable>>({
|
|
url: `${API_PATH}/type/detail/${query}`,
|
|
method: "get",
|
|
});
|
|
},
|
|
|
|
createDictType(body: DictForm) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/type/create`,
|
|
method: "post",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
updateDictType(id: number, body: DictForm) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/type/update/${id}`,
|
|
method: "put",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
deleteDictType(body: number[]) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/type/delete`,
|
|
method: "delete",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
batchDictType(body: BatchType) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/type/status/batch`,
|
|
method: "patch",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
exportDictType(body: DictPageQuery) {
|
|
return request<Blob>({
|
|
url: `${API_PATH}/type/export`,
|
|
method: "post",
|
|
data: body,
|
|
responseType: "blob",
|
|
});
|
|
},
|
|
|
|
listDictData(query: DictDataPageQuery) {
|
|
return request<ApiResponse<PageResult<DictDataTable>>>({
|
|
url: `${API_PATH}/data/list`,
|
|
method: "get",
|
|
params: query,
|
|
});
|
|
},
|
|
|
|
detailDictData(query: number) {
|
|
return request<ApiResponse<DictDataTable>>({
|
|
url: `${API_PATH}/data/detail/${query}`,
|
|
method: "get",
|
|
});
|
|
},
|
|
|
|
createDictData(body: DictDataForm) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/data/create`,
|
|
method: "post",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
updateDictData(id: number, body: DictDataForm) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/data/update/${id}`,
|
|
method: "put",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
deleteDictData(body: number[]) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/data/delete`,
|
|
method: "delete",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
batchDictData(body: BatchType) {
|
|
return request<ApiResponse>({
|
|
url: `${API_PATH}/data/status/batch`,
|
|
method: "patch",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
exportDictData(query: DictDataPageQuery) {
|
|
return request<Blob>({
|
|
url: `${API_PATH}/data/export`,
|
|
method: "post",
|
|
data: query,
|
|
responseType: "blob",
|
|
});
|
|
},
|
|
|
|
getInitDict(dict_type: string) {
|
|
return request<ApiResponse<DictDataTable[]>>({
|
|
url: `${API_PATH}/data/info/${dict_type}`,
|
|
method: "get",
|
|
});
|
|
},
|
|
};
|
|
|
|
export default DictAPI;
|
|
|
|
export interface DictPageQuery extends PageQuery {
|
|
dict_name?: string;
|
|
dict_type?: string;
|
|
status?: number;
|
|
}
|
|
|
|
export interface DictDataPageQuery extends PageQuery {
|
|
dict_label?: string;
|
|
dict_type?: string;
|
|
dict_type_id?: number;
|
|
status?: number;
|
|
}
|
|
|
|
export interface DictTable extends BaseType {
|
|
dict_name?: string;
|
|
dict_type?: string;
|
|
status?: number;
|
|
description?: string;
|
|
}
|
|
|
|
export interface DictForm extends BaseFormType {
|
|
dict_name?: string;
|
|
dict_type?: string;
|
|
status?: number;
|
|
description?: string;
|
|
}
|
|
|
|
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?: number;
|
|
description?: string;
|
|
}
|
|
|
|
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?: number;
|
|
description?: string;
|
|
}
|