import request from '@/utils/request'
import Vue from 'vue'
export function getGroupList(deviceType) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busGroupInfo/list',
    method: 'get',
    params: {
      deviceType: deviceType
    }
  })
}
// 查询识别报警列表
export function getControllerData(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'data/lampLatest',
    method: 'get',
    params
  })
}

export function getControllerHistory(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'data/lampHistory',
    method: 'get',
    params
  })
}

export function getBoxLatest(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'data/boxLatest',
    method: 'get',
    params
  })
}

export function getBoxHistory(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'data/boxHistory',
    method: 'get',
    params
  })
}

export function getQuantityListByStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'data/quantityListByStreet',
    method: 'get',
    params
  })
}

// 统计
export function staticsAlarmType(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/alarmType',
    method: 'get',
    params
  })
}
export function staticsLightTimeByStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/lightTimeByStreet',
    method: 'get',
    params
  })
}
export function staticsLightTimeByGrid(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/lightTimeByGrid',
    method: 'get',
    params
  })
}
export function staticsLightRateByStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/lightRateByStreet',
    method: 'get',
    params
  })
}
export function staticsLightRateByGrid(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/lightRateByGrid',
    method: 'get',
    params
  })
}
export function staticsQuantityByStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/quantityByStreet',
    method: 'get',
    params
  })
}
export function staticsQuantityByGrid(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/quantityByGrid',
    method: 'get',
    params
  })
}
export function staticsSaveRateByStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/saveRateByStreet',
    method: 'get',
    params
  })
}
export function staticsSaveRateByGrid(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面，否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'statics/saveRateByGrid',
    method: 'get',
    params
  })
}
