import http from '@/api'
import { SortieVO, SortieForm, SortieQuery } from '@/api/interface/als/sortie'
/**
 * @name 查询架次列表
 * @param query 参数
 * @returns 返回列表
 */
export const listSortieApi = (query: SortieQuery) => {
  return http.get<SortieVO[]>('/als/sortie/list', query, { loading: false })
}

/**
 * @name 查询架次详细
 * @param id id
 * @returns returns
 */
export const getSortieApi = (id: string | number) => {
  return http.get<SortieVO>(`/als/sortie/${id}`)
}

/**
 * @name 新增架次
 * @param data data
 * @returns returns
 */
export const addSortieApi = (data: SortieForm) => {
  return http.post<any>('/als/sortie', data, { loading: false })
}

/**
 * @name 修改架次
 * @param data data
 * @returns returns
 */
export const updateSortieApi = (data: SortieForm) => {
  return http.put<any>('/als/sortie', data, { loading: false })
}

/**
 * @name 删除架次
 * @param id id
 * @returns returns
 */
export const delSortieApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/sortie/${id}`)
}

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

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

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