Files
dpb/backend/scripts/_backup_query_param/pedigree__api.ts.bak
T
34047007@qq.com b95053c52c init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
2026-08-06 00:17:49 +08:00

108 lines
2.2 KiB
Plaintext

import { request } from "@utils";
const API_PATH = "/bre/pedigree";
const PedigreeAPI = {
getPedigreeList(query: PedigreePageQuery) {
return request<ApiResponse<PageResult<PedigreeTable>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
getPedigreeDetail(query: number) {
return request<ApiResponse<PedigreeTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
getPedigreeOptions() {
return request<ApiResponse<PedigreeOption[]>>({
url: `${API_PATH}/options`,
method: "get",
});
},
createPedigree(body: PedigreeForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
updatePedigree(id: number, body: PedigreeForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
deletePedigree(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
exportPedigree(body: PedigreePageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
downloadTemplatePedigree() {
return request<Blob>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
importPedigree(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default PedigreeAPI;
export interface PedigreePageQuery extends PageQuery, UserByQueryParams {
combination_id?: number;
child_code?: string;
generation?: string;
}
export interface PedigreeOption {
value: number;
label: string;
}
export interface PedigreeTable extends BaseType {
combination_id?: number;
combination_name?: string;
child_code?: string;
generation?: string;
remark?: string;
}
export interface PedigreeForm extends BaseFormType {
combination_id?: number;
child_code?: string;
generation?: string;
remark?: string;
}