import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/nh/alarmInfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/nh/alarmInfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/nh/alarmInfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const batchApplyError = (ids) => {
  return request({
    url: '/nh/alarmInfo/batchApplyError',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const batchClose = (ids) => {
  return request({
    url: '/nh/alarmInfo/batchClose',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const batchUnClose = (ids) => {
  return request({
    url: '/nh/alarmInfo/batchUnClose',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/nh/alarmInfo/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/nh/alarmInfo/submit',
    method: 'post',
    data: row
  })
}

export const turnMaintenance = (ids) => {
  return request({
    url: '/nh/alarmInfo/turnMaintenance',
    method: 'post',
    params: {
      id:ids,
    }
  })
}