init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user