import request from '@/utils/request'

//获取设备管理列表（下拉框）
export function getEquipmentList(query) {
  return request({
    url: '/hnyz/equipment/getEquipmentList',
    method: 'get',
    params: query
  })
}

// 查询设备管理列表
export function listEquipment(query) {
  return request({
    url: '/hnyz/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询设备管理详细
export function getEquipment(equipmentId) {
  return request({
    url: '/hnyz/equipment/' + equipmentId,
    method: 'get'
  })
}

// 新增设备管理
export function addEquipment(data) {
  return request({
    url: '/hnyz/equipment',
    method: 'post',
    data: data
  })
}

// 修改设备管理
export function updateEquipment(data) {
  return request({
    url: '/hnyz/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备管理
export function delEquipment(equipmentId) {
  return request({
    url: '/hnyz/equipment/' + equipmentId,
    method: 'delete'
  })
}

//启用状态修改
export function changeStatus(equipmentId, status) {
  return request({
    url: '/hnyz/equipment/changeStatus',
    method: 'put',
    data: {
      equipmentId: equipmentId,
      status: status
    }
  })
}