init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
import { request } from "@utils";
|
||||
|
||||
const API_PATH = "/bre/treatment";
|
||||
|
||||
const TreatmentAPI = {
|
||||
getTreatmentList(query: TreatmentPageQuery) {
|
||||
return request<ApiResponse<PageResult<TreatmentTable>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
getTreatmentDetail(query: number) {
|
||||
return request<ApiResponse<TreatmentTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getTreatmentOptions() {
|
||||
return request<ApiResponse<TreatmentOption[]>>({
|
||||
url: `${API_PATH}/options`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createTreatment(body: TreatmentForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updateTreatment(id: number, body: TreatmentForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deleteTreatment(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
exportTreatment(body: TreatmentPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
downloadTemplateTreatment() {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/download/template`,
|
||||
method: "post",
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
importTreatment(body: FormData) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/import`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default TreatmentAPI;
|
||||
|
||||
export interface TreatmentPageQuery extends PageQuery, UserByQueryParams {
|
||||
trial_study_id?: number;
|
||||
factor?: string;
|
||||
level?: string;
|
||||
}
|
||||
|
||||
export interface TreatmentOption {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface TreatmentTable extends BaseType {
|
||||
trial_study_id?: number;
|
||||
trial_study_name?: string;
|
||||
factor?: string;
|
||||
level?: string;
|
||||
description?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface TreatmentForm extends BaseFormType {
|
||||
trial_study_id?: number;
|
||||
factor?: string;
|
||||
level?: string;
|
||||
description?: string;
|
||||
remark?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user