import request from '@/utils/request'

// 查询服务区用电属性列表
export function listAttr(query) {
  return request({
    url: '/ems/basecfg/elec/attr/list',
    method: 'get',
    params: query
  })
}

// 查询服务区用电属性详细
export function getAttr(id) {
  return request({
    url: '/ems/basecfg/elec/attr/' + id,
    method: 'get'
  })
}

// 新增服务区用电属性
export function addAttr(data) {
  return request({
    url: '/ems/basecfg/elec/attr',
    method: 'post',
    data: data
  })
}

// 修改服务区用电属性
export function updateAttr(data) {
  return request({
    url: '/ems/basecfg/elec/attr',
    method: 'put',
    data: data
  })
}

// 删除服务区用电属性
export function delAttr(id) {
  return request({
    url: '/ems/basecfg/elec/attr/' + id,
    method: 'delete'
  })
}
// 新增峰谷电价策略
export function addStrategy(data) {
  return request({
    url: '/ems/basecfg/elecPrice/strategy',
    method: 'post',
    data: data
  })
}
export function listStrategy(params) {
  return request({
    url: '/ems/basecfg/elecPrice/strategy/list',
    method: 'get',
    params
  })
}
export function updateStrategy(data) {
  return request({
    url: '/ems/basecfg/elecPrice/strategy',
    method: 'put',
    data: data
  })
}
export function delStrategy(id) {
  return request({
    url: '/ems/basecfg/elecPrice/strategy/' + id,
    method: 'delete'
  })
}
//商户计费配置
export function addCharging(data) {
  return request({
    url: '/ems/basecfg/elecPrice/coCharging',
    method: 'post',
    data: data
  })
}
export function listCharging(params) {
  return request({
    url: '/ems/basecfg/elecPrice/coCharging/list',
    method: 'get',
    params
  })
}
export function updateCharging(data) {
  return request({
    url: '/ems/basecfg/elecPrice/coCharging',
    method: 'put',
    data: data
  })
}
export function delCharging(id) {
  return request({
    url: '/ems/basecfg/elecPrice/coCharging/' + id,
    method: 'delete'
  })
}
