import request from '@/utils/request'

// 查询硬件统计
export function statisticsHardware() {
  return request({
    url: '/laboratory/hardware/statistics',
    method: 'get',
  })
}

// 查询硬件列表
export function listHardware(query) {
  return request({
    url: '/laboratory/hardware/list',
    method: 'get',
    params: query
  })
}

// 查询硬件下拉列表
export function optionHardware(data) {
  return request({
    url: '/laboratory/hardware/getFunList',
    method: 'post',
    data: data
  })
}


// 查询硬件类型下拉列表
export function queryHardwareType() {
  return request({
    url: '/laboratory/hardware/queryHardwareType',
    method: 'post'
  })
}



// 查询硬件详细
export function getHardware(id) {
  return request({
    url: '/laboratory/hardware/' + id,
    method: 'get'
  })
}

// 新增硬件
export function addHardware(data) {
  return request({
    url: '/laboratory/hardware',
    method: 'post',
    data: data
  })
}

// 修改硬件
export function updateHardware(data) {
  return request({
    url: '/laboratory/hardware',
    method: 'put',
    data: data
  })
}

// 删除硬件
export function delHardware(id) {
  return request({
    url: '/laboratory/hardware/' + id,
    method: 'delete'
  })
}


// 查询硬件列表
export function getHardwareDetail(query) {
  return request({
    url: '/laboratory/hardware/getHardwareDetail',
    method: 'get',
    params: query
  })
}


// 查询实验室布局图大小信息
export function getSubjectLayout(id) {
  return request({
    url: '/laboratory/layout/subId/' + id,
    method: 'get'
  })
}


// 硬件开关控制
export function hardWareControl(data) {
  return request({
    url: '/laboratory/subject/manger/control/'+data.id+'/' + data.switchVal,
    method: 'post'
  })
}

//警报器开关控制
export function alarmControl(data) {
  return request({
    url: '/laboratory/subject/manger/alarmControl/'+data.id+'/' + data.switchVal,
    method: 'post'
  })
}
