import request from '@/utils/request'

// 查询动力箱柜列表
export function listPowerBox(query) {
  return request({
    url: '/ems/powerBox/list',
    method: 'get',
    params: query
  })
}

// 查询动力箱柜详细
export function getPowerBox(id) {
  return request({
    url: '/ems/powerBox/' + id,
    method: 'get'
  })
}

// 新增动力箱柜
export function addPowerBox(data) {
  return request({
    url: '/ems/powerBox',
    method: 'post',
    data: data
  })
}

// 修改动力箱柜
export function updatePowerBox(data) {
  return request({
    url: '/ems/powerBox',
    method: 'put',
    data: data
  })
}

// 删除动力箱柜
export function delPowerBox(id) {
  return request({
    url: '/ems/powerBox/' + id,
    method: 'delete'
  })
}
// 获取配电柜指标信息
export function getPowerIndexs(boxCode) {
  return request({
    url: '/ems/powerBoxIndex/latest/' + boxCode,
    method: 'get'
  })
}
// 获取空开指标信息
export function getEqptIndexs(boxCode) {
  return request({
    url: '/ems/elecBoxEqptIndex/latest/list?boxCode=' + boxCode,
    method: 'get'
  })
}

