import request from '@/utils/request'
import {smart} from '@/api/commonApi'
// 设备控制配置

// 设备概览
// 控温设备 数量、在线设备、运行中、使用率
export function getDeviceControlHeat() {
  return request({
    url: smart + `/basic-device-control-heat/CountBasicDeviceControlHeat`,
    method: 'get',
  })
}
// 在线
export function getOnlineDeviceControlHeat() {
  return request({
    url: smart + `/basic-device-control-heat/OnlineBasicDeviceControlHeat`,
    method: 'get',
  })
}
// 使用率
export function getUsageRateDeviceControlHeat() {
  return request({
    url: smart + `/basic-device-control-heat/UsageRateCountBasicDeviceControlHeat`,
    method: 'get',
  })
}
// 运行中
export function getInServiceDeviceControlHeat() {
  return request({
    url: smart + `/basic-device-control-heat/InServiceCountBasicDeviceControlHeat`,
    method: 'get',
  })
}
// 照明设备-- 
// 设备数量
export function getCountOfZm() {
  return request({
    url: smart + `/basic-device-control-illumination/CountBasicDeviceControlIllumination`,
    method: 'get',
  })
}
// 照明 在线设备
export function getOnlineOfLighting() {
  return request({
    url: smart + `/basic-device-control-illumination/OnlineCountBasicDeviceControlIllumination`,
    method: 'get',
  })
}
// 使用率
export function getUsageRateOfLighting() {
  return request({
    url: smart + `/basic-device-control-illumination/UsageRateCountBasicDeviceControlIllumination`,
    method: 'get',
  })
}
// 运行中
export function getInServiceOfLighting() {
  return request({
    url: smart + `/basic-device-control-illumination/InServiceCountBasicDeviceControlIllumination`,
    method: 'get',
  })
}

// 通风设备-- 
// 设备数量
export function getCountOfVentilate() {
  return request({
    url: smart + `/basic-device-control-ventilate/CountBasicDeviceControlVentilate`,
    method: 'get',
  })
}
// 照明 在线设备
export function getOnlineOfVentilate() {
  return request({
    url: smart + `/basic-device-control-ventilate/OnlineCountBasicDeviceControlVentilate`,
    method: 'get',
  })
}
// 使用率
export function getUsageRateOfVentilate() {
  return request({
    url: smart + `/basic-device-control-ventilate/UsageRateCountBasicDeviceControlVentilate`,
    method: 'get',
  })
}
// 运行中
export function getInServiceOfVentilate() {
  return request({
    url: smart + `/basic-device-control-ventilate/InServiceCountBasicDeviceControlVentilate`,
    method: 'get',
  })
}
// 设备数量
export function getCountOfDevice() {
  return request({
    url: smart + `/basic-graphic-statistics/AllCountBasicDeviceControl`,
    method: 'get',
  })
}


// 通风设备  列表、运行记录、关闭
export function getVentilateList(params) {
  return request({
    url: smart + `/basic-device-control-ventilate/getAll`,
    method: 'get',
    params
  })
}
// 运行记录
export function getVentilateRecord(params) {
  return request({
    url: smart + `/basic-device-ventilate-record/getBasicDeviceVentilateRecord`,
    method: 'get',
    params
  })
}
// 关闭
export function updateVentilateItem(data) {
  return request({
    url: smart + `/basic-device-control-ventilate/updateBasicDeviceControlVentilate`,
    method: 'put',
    data
  })
}

// 照明设备控制  获取列表
export function getLightingList(params) {
  return request({
    url: smart + `/basic-device-control-illumination/getAll`,
    method: 'get',
    params
  })
}
// 运行记录
export function getLightingRecord(params) {
  return request({
    url: smart + `/basic-device-illumination-record/getByBasicDeviceIlluminationRecord`,
    method: 'get',
    params
  })
}
// 关闭
export function updateLightingItem(data) {
  return request({
    url: smart + `/basic-device-control-illumination/updateBasicDeviceControlIllumination`,
    method: 'put',
    data
  })
}

// 控温设备 - 获取列表

export function getHeatList(params) {
  return request({
    url: smart + `/basic-device-control-heat/getAll`,
    method: 'get',
    params
  })
}
// 运行记录
export function getHeatRecord(params) {
  return request({
    url: smart + `/basic-device-heat-record/getByBasicDeviceHeatRecord`,
    method: 'get',
    params
  })
}
// 关闭
export function updateHeatItem(data) {
  return request({
    url: smart + `/basic-device-control-heat/updateBasicDeviceControlHeat`,
    method: 'put',
    data
  })
}