import http from '@/api'
import { MaintenanceDecisionVO, MaintenanceDecisionForm, MaintenanceDecisionQuery } from '@/api/interface/als/maintenanceDecision'
/**
 * @name 查询辅助维修决策列表
 * @param query 参数
 * @returns 返回列表
 */
export const listMaintenanceDecisionApi = (query: MaintenanceDecisionQuery) => {
  return http.get<MaintenanceDecisionVO[]>('/als/maintenanceDecision/list', query, { loading: true })
}

/**
 * @name 查询辅助维修决策详细
 * @param id id
 * @returns returns
 */
export const getMaintenanceDecisionApi = (id: string | number) => {
  return http.get<MaintenanceDecisionVO>(`/als/maintenanceDecision/${id}`)
}

/**
 * @name 新增辅助维修决策
 * @param data data
 * @returns returns
 */
export const addMaintenanceDecisionApi = (data: MaintenanceDecisionForm) => {
  return http.post<any>('/als/maintenanceDecision', data, { loading: false })
}

/**
 * @name 修改辅助维修决策
 * @param data data
 * @returns returns
 */
export const updateMaintenanceDecisionApi = (data: MaintenanceDecisionForm) => {
  return http.put<any>('/als/maintenanceDecision', data, { loading: false })
}

/**
 * @name 删除辅助维修决策
 * @param id id
 * @returns returns
 */
export const delMaintenanceDecisionApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/maintenanceDecision/${id}`)
}

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