import http from '@/api'
import { FlightTaskVO, FlightTaskForm, FlightTaskQuery } from '@/api/interface/als/flightTask'
/**
 * @name 查询飞行任务列表
 * @param query 参数
 * @returns 返回列表
 */
export const listFlightTaskApi = (query: FlightTaskQuery) => {
  return http.get<FlightTaskVO[]>('/als/flightTask/list', query, { loading: true })
}

/**
 * @name 查询飞行任务详细
 * @param id id
 * @returns returns
 */
export const getFlightTaskApi = (id: string | number) => {
  return http.get<FlightTaskVO>(`/als/flightTask/${id}`)
}

/**
 * @name 新增飞行任务
 * @param data data
 * @returns returns
 */
export const addFlightTaskApi = (data: FlightTaskForm) => {
  return http.post<any>('/als/flightTask', data, { loading: false })
}

/**
 * @name 修改飞行任务
 * @param data data
 * @returns returns
 */
export const updateFlightTaskApi = (data: FlightTaskForm) => {
  return http.put<any>('/als/flightTask', data, { loading: false })
}

/**
 * @name 删除飞行任务
 * @param id id
 * @returns returns
 */
export const delFlightTaskApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/flightTask/${id}`)
}

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

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

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