import http from '@/api'
import { SmTaskRecordVO, SmTaskRecordForm, SmTaskRecordQuery } from '@/api/interface/als/smTaskRecord'
/**
 * @name 查询定检任务记录列表
 * @param query 参数
 * @returns 返回列表
 */
export const listSmTaskRecordApi = (query: SmTaskRecordQuery) => {
  return http.get<SmTaskRecordVO[]>('/als/smTaskRecord/list', query, { loading: true })
}

/**
 * @name 查询定检任务记录详细
 * @param id id
 * @returns returns
 */
export const getSmTaskRecordApi = (id: string | number) => {
  return http.get<SmTaskRecordVO>(`/als/smTaskRecord/${id}`)
}

/**
 * @name 新增定检任务记录
 * @param data data
 * @returns returns
 */
export const addSmTaskRecordApi = (data: SmTaskRecordForm) => {
  return http.post<any>('/als/smTaskRecord', data, { loading: false })
}

/**
 * @name 修改定检任务记录
 * @param data data
 * @returns returns
 */
export const updateSmTaskRecordApi = (data: SmTaskRecordForm) => {
  return http.put<any>('/als/smTaskRecord', data, { loading: false })
}

/**
 * @name 删除定检任务记录
 * @param id id
 * @returns returns
 */
export const delSmTaskRecordApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/smTaskRecord/${id}`)
}

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

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

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