import http from '@/api'
import { CarryChecklistVO, CarryChecklistForm, CarryChecklistQuery } from '@/api/interface/als/carryChecklist'
/**
 * @name 查询任务携行列表
 * @param query 参数
 * @returns 返回列表
 */
export const listCarryChecklistApi = (query: CarryChecklistQuery) => {
  return http.get<CarryChecklistVO[]>('/als/carryChecklist/list', query, { loading: true })
}

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

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

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

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

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

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

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