import http from '@/api'
import { FlightSplitTaskVO, FlightSplitTaskForm, FlightSplitTaskQuery } from '@/api/interface/als/flightSplitTask'
/**
 * @name 查询飞行分解任务列表
 * @param query 参数
 * @returns 返回列表
 */
export const listFlightSplitTaskApi = (query: FlightSplitTaskQuery) => {
  return http.get<FlightSplitTaskVO[]>('/als/flightSplitTask/list', query, { loading: true })
}

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

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

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

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

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

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

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