import { get, put, post, deletes } from '@/http/index'

// 查询数据导入信息列表
export const getDataImport = async (data) => {
  return await get('/als/dataImport/list', data)
}

// 新增数据导入信息
export const addDataImport = async (data) => {
  return await post('/als/dataImport', data)
}

// 修改数据导入信息
export const updateDataImport = async (data) => {
  return await put('/als/dataImport', data)
}

// 删除数据导入信息
export const removeDataImport = async (id) => {
  return await deletes('/als/dataImport/' + id)
}

//  获取机种和机型树
export const getAircaftTypeAndModelTree = async (data) => {
  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
}

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

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

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