// import fetch from '@/utils/fetch'
import request from '../utils/request'
// 获取当前用户收藏的轨迹(重点车辆轨迹)
export const getAllFavTracks = (data) =>
    request({
        url: '/holo/attention-car/list',
        method: 'get',
        params: data
    })
// 按条件查询轨迹
export const queryVehicleTrack = (data) =>
    request({
        url: '/holo/carTrack/page',
        method: 'post',
        data: data
    })

// // 按车牌号和时间段查询某段轨迹详情
// export const queryTrackDetail = (data) => fetch('/holo/carTrack/replay', data, 'GET')
//
// // 收藏轨迹
// export const favTrack = (params) => fetch('/holo/attention-car/attention', {}, 'POST', params)
//
// // 取消收藏轨迹
// export const disFavTrack = (params) => fetch('/holo/attention-car/cancelAttention', {}, 'POST', params)

// // 获取交通事件多车轨迹列表  0
// export const eventTracksList = (data) => {
//     let send = Object.assign({}, data, {eventCategory: 0})
//     return  fetch('/holo/event-info/page', send, 'POST')
// }
//
// // 获取交通拥堵多车轨迹列表  5
// export const crowdTracksList = (data) => {
//     let send = Object.assign({}, data, {eventCategory: 5})
//     return fetch('/holo/event-info/page', send, 'POST')
// }

// 历史灯态
// export const getLightByTimeAndCrossId = (params) => {
//     return fetch('/utc/signalStatus/lightStatusHist', {}, 'POST', params)
// }
export const getLightByTimeAndCrossId = (data) =>
    request({
        url: '/utc/signalStatus/lightStatusHist',
        method: 'get',
        params: data,
    })

// 获取多车轨迹详情
// export const multiVehicleTrackDetail = (data) => fetch('/holo/carTrack/multi', data, 'GET')
export const multiVehicleTrackDetail = (data) =>
    request({
        url: '/holo/carTrack/multi',
        method: 'get',
        params: data,
        responseType: 'arraybuffer'
    })

// 获取轨迹对应视频流url
// export const getEventVideo = (data) => fetch('/nvr/playback', data, "GET")
export const getEventVideo = (data) =>
    request({
        url: '/nvr/playback',
        method: 'GET',
        params: data,
        showMsg: false,
    })