Newer
Older
CloudBrainNew / src / api / smartTraffic.js
wangxitong on 29 Apr 2021 3 KB 0429 submit
import request from '@/utils/request'
import config from '@/utils/baseConfig'
import qs from 'qs'
// 智慧交通专项
// 实时城市拥堵指数
export function fetchGemIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/gemIndexNow',
    method: 'get'
  })
}

// 实时城市交通流量指数
export function fetchFlowIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/flowIndexNow',
    method: 'get'
  })
}

// 实时交通违法事故指数
export function fetchCaseIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseIndexNow',
    method: 'get'
  })
}
// 各路段拥堵指数
export function fetchRoadGemIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/gemIndexNowByRoad',
    method: 'get'
  })
}

// 各路段交通流量指数
export function fetchRoadFlowIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/gemIndexNowByRoad',
    // url: 'smartTraffic/flowIndexNowByRoad',
    method: 'get'
  })
}

// 各路段违法事故指数
export function fetchRoadCaseIndexNow () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/gemIndexNowByRoad',
    // url: 'smartTraffic/caseIndexNowByRoad',
    method: 'get'
  })
}

// 各类型违法事故排名
export function fetchCaseTypeRank (dataType) {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseTypeRank',
    method: 'get',
    params: {
      params: dataType
    }
  })
}

// 各路段违法事故排行
export function fetchCaseRoadRank () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseRoadRank',
    method: 'get'
  })
}

// 违章事故按区域统计
export function fetchCaseArea () {
  return request({
    baseURL: config.baseUrl,
    url: 'case/countByArea',
    // url: 'smartTraffic/caseCountByArea',
    method: 'get'
  })
}

// 违章事故数据来源统计
export function fetchCaseFrom () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseCountByFrom',
    method: 'get'
  })
}

// 近7日违章事故数量曲线
export function fetchCaseByDay () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseByDay',
    method: 'get'
  })
}

export function fetchCaseData (type) {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/' + type,
    method: 'get'
  })
}

export function fetchCaseCount () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/caseCount',
    method: 'get'
  })
}

// 摄像头数量情况
export function fetchCameraByType () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/cameraByType',
    method: 'get'
  })
}

// 摄像头在线情况统计
export function fetchCameraByStatus () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/cameraByStatus',
    method: 'get'
  })
}


export function fetchEventPoints () {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/eventPoints',
    method: 'get'
  })
}

export function fetchBlockPoints (params) {
  return request({
    baseURL: config.baseUrl,
    url: 'smartTraffic/blockPoints',
    method: 'get',
    params,
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}