init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
import { request } from "@utils";
|
||||
|
||||
const API_PATH = "/bre/plot";
|
||||
|
||||
const PlotAPI = {
|
||||
getPlotList(query: PlotPageQuery) {
|
||||
return request<ApiResponse<PageResult<PlotTable>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
getPlotDetail(query: number) {
|
||||
return request<ApiResponse<PlotTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createPlot(body: PlotForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updatePlot(id: number, body: PlotForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deletePlot(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
exportPlot(body: PlotPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
downloadTemplatePlot() {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/download/template`,
|
||||
method: "post",
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
importPlot(body: FormData) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/import`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
getPlotOptions() {
|
||||
return request<ApiResponse<PlotOption[]>>({
|
||||
url: `${API_PATH}/options`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default PlotAPI;
|
||||
|
||||
export interface PlotPageQuery extends PageQuery, UserByQueryParams {
|
||||
site_id?: number;
|
||||
plot_code?: string;
|
||||
row_orientation?: string;
|
||||
}
|
||||
|
||||
export interface PlotTable extends BaseType {
|
||||
site_id?: number;
|
||||
site_name?: string;
|
||||
plot_code?: string;
|
||||
row_orientation?: string;
|
||||
row_count?: number;
|
||||
col_count?: number;
|
||||
grid_note?: string;
|
||||
area?: number;
|
||||
}
|
||||
|
||||
export interface PlotForm extends BaseFormType {
|
||||
site_id?: number;
|
||||
plot_code?: string;
|
||||
row_orientation?: string;
|
||||
row_count?: number;
|
||||
col_count?: number;
|
||||
grid_note?: string;
|
||||
area?: number;
|
||||
}
|
||||
|
||||
export interface PlotOption {
|
||||
value: number;
|
||||
label: string;
|
||||
}
|
||||
Reference in New Issue
Block a user