import http from '@/api'
import { FaultDiagnosisVO, FaultDiagnosisForm, FaultDiagnosisQuery } from '@/api/interface/als/faultDiagnosis'
/**
 * @name 查询故障诊断列表
 * @param query 参数
 * @returns 返回列表
 */
export const listFaultDiagnosisApi = (query: FaultDiagnosisQuery) => {
  return http.get<FaultDiagnosisVO[]>('/als/faultDiagnosis/list', query, { loading: true })
}

/**
 * @name 查询故障诊断详细
 * @param id id
 * @returns returns
 */
export const getFaultDiagnosisApi = (id: string | number) => {
  return http.get<FaultDiagnosisVO>(`/als/faultDiagnosis/${id}`)
}

/**
 * @name 新增故障诊断
 * @param data data
 * @returns returns
 */
export const addFaultDiagnosisApi = (data: FaultDiagnosisForm) => {
  return http.post<any>('/als/faultDiagnosis', data, { loading: false })
}

/**
 * @name 修改故障诊断
 * @param data data
 * @returns returns
 */
export const updateFaultDiagnosisApi = (data: FaultDiagnosisForm) => {
  return http.put<any>('/als/faultDiagnosis', data, { loading: false })
}

/**
 * @name 删除故障诊断
 * @param id id
 * @returns returns
 */
export const delFaultDiagnosisApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/faultDiagnosis/${id}`)
}

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