import http from '@/api'
import { PreProcessingVO, PreProcessingForm, PreProcessingQuery } from '@/api/interface/als/preProcessing'
/**
 * @name 查询预处理列表
 * @param query 参数
 * @returns 返回列表
 */
export const listPreProcessingApi = (query: PreProcessingQuery) => {
  return http.get<PreProcessingVO[]>('/als/preProcessing/list', query, { loading: true })
}

/**
 * @name 查询预处理详细
 * @param id id
 * @returns returns
 */
export const getPreProcessingApi = (id: string | number) => {
  return http.get<PreProcessingVO>(`/als/preProcessing/${id}`)
}

/**
 * @name 新增预处理
 * @param data data
 * @returns returns
 */
export const addPreProcessingApi = (data: PreProcessingForm) => {
  return http.post<any>('/als/preProcessing', data, { loading: false })
}

/**
 * @name 修改预处理
 * @param data data
 * @returns returns
 */
export const updatePreProcessingApi = (data: PreProcessingForm) => {
  return http.put<any>('/als/preProcessing', data, { loading: false })
}

/**
 * @name 删除预处理
 * @param id id
 * @returns returns
 */
export const delPreProcessingApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/preProcessing/${id}`)
}

/**
 * @name 下载模板
 * @returns returns
 */
export const importTemplateApi = () => {
  return http.downloadPost('/als/preProcessing/importTemplate', {})
}

/**
 * @name 导入数据
 * @returns returns
 */
export const importPreProcessingDataApi = (data: any) => {
  return http.post('/als/preProcessing/importData', data)
}

/**
 * @name 导出数据
 * @returns returns
 */
export const exportPreProcessingApi = (data: any) => {
  return http.post('/als/preProcessing/export', data)
}
