import { request } from "@utils"; const API_PATH = "/bre/selection_result"; const SelectionResultAPI = { getSelectionResultList(query: SelectionResultPageQuery) { return request>>({ url: `${API_PATH}/list`, method: "get", params: query, }); }, getSelectionResultDetail(query: number) { return request>({ url: `${API_PATH}/detail/${query}`, method: "get", }); }, getSelectionResultOptions() { return request>({ url: `${API_PATH}/options`, method: "get", }); }, createSelectionResult(body: SelectionResultForm) { return request({ url: `${API_PATH}/create`, method: "post", data: body, }); }, updateSelectionResult(id: number, body: SelectionResultForm) { return request({ url: `${API_PATH}/update/${id}`, method: "put", data: body, }); }, deleteSelectionResult(body: number[]) { return request({ url: `${API_PATH}/delete`, method: "delete", data: body, }); }, exportSelectionResult(body: SelectionResultPageQuery) { return request({ url: `${API_PATH}/export`, method: "post", data: body, responseType: "blob", }); }, downloadTemplateSelectionResult() { return request({ url: `${API_PATH}/download/template`, method: "post", responseType: "blob", }); }, importSelectionResult(body: FormData) { return request({ url: `${API_PATH}/import`, method: "post", data: body, headers: { "Content-Type": "multipart/form-data", }, }); }, }; export default SelectionResultAPI; export interface SelectionResultPageQuery extends PageQuery, UserByQueryParams { combination_id?: number; tree_id?: number; selection_year?: number; is_selected?: string; } export interface SelectionResultOption { value: number; label: string; } export interface SelectionResultTable extends BaseType { combination_id?: number; combination_name?: string; tree_id?: number; tree_name?: string; selection_year?: number; is_selected?: string; reason?: string; remark?: string; } export interface SelectionResultForm extends BaseFormType { combination_id?: number; tree_id?: number; selection_year?: number; is_selected?: string; reason?: string; remark?: string; }