import http from '@/api'
import { DataImportVO, DataImportForm, DataImportQuery } from '@/api/interface/als/dataImport'
/**
 * @name 查询数据导入信息列表
 * @param query 参数
 * @returns 返回列表
 */
export const listDataImportApi = (query: DataImportQuery) => {
  return http.get<DataImportVO[]>('/als/dataImport/list', query, { loading: true })
}

/**
 * @name 查询数据导入信息详细
 * @param id id
 * @returns returns
 */
export const getDataImportApi = (id: string | number) => {
  return http.get<DataImportVO>(`/als/dataImport/${id}`)
}

/**
 * @name 新增数据导入信息
 * @param data data
 * @returns returns
 */
export const addDataImportApi = (data: DataImportForm) => {
  return http.post<any>('/als/dataImport', data, { loading: false })
}

/**
 * @name 修改数据导入信息
 * @param data data
 * @returns returns
 */
export const updateDataImportApi = (data: DataImportForm) => {
  return http.put<any>('/als/dataImport', data, { loading: false })
}

/**
 * @name 删除数据导入信息
 * @param id id
 * @returns returns
 */
export const delDataImportApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/dataImport/${id}`)
}

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

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

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