import http from '@/api'
import { TechnicalDocVO, TechnicalDocForm, TechnicalDocQuery } from '@/api/interface/als/technicalDoc'
/**
 * @name 查询技术资料列表
 * @param query 参数
 * @returns 返回列表
 */
export const listTechnicalDocApi = (query: TechnicalDocQuery) => {
  return http.get<TechnicalDocVO[]>('/als/technicalDoc/list', query, { loading: false })
}

/**
 * @name 查询技术资料详细
 * @param id id
 * @returns returns
 */
export const getTechnicalDocApi = (id: string | number) => {
  return http.get<TechnicalDocVO>(`/als/technicalDoc/${id}`)
}

/**
 * @name 新增技术资料
 * @param data data
 * @returns returns
 */
export const addTechnicalDocApi = (data: TechnicalDocForm) => {
  return http.post<any>('/als/technicalDoc', data, { loading: false })
}

/**
 * @name 修改技术资料
 * @param data data
 * @returns returns
 */
export const updateTechnicalDocApi = (data: TechnicalDocForm) => {
  return http.put<any>('/als/technicalDoc', data, { loading: false })
}

/**
 * @name 删除技术资料
 * @param id id
 * @returns returns
 */
export const delTechnicalDocApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/technicalDoc/${id}`)
}

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

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

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