guanqb
2022-11-21 59c79ea5097621c0b08aa2d7636022fa18ca0403
轨迹接口对接
4 files modified
53 ■■■■■ changed files
src/api/police/index.js 2 ●●● patch | view | raw | blame | history
src/views/police/index.vue 47 ●●●●● patch | view | raw | blame | history
src/views/video/list.vue 2 ●●● patch | view | raw | blame | history
src/views/video/region.vue 2 ●●● patch | view | raw | blame | history
src/api/police/index.js
@@ -15,7 +15,7 @@
 * @param {*} params  包含 start 开始时间 -- end  结束时间  --   channelId 设备编号
 * @returns 
 */
export const getVideoList = (params) => {
export const getHistoricalTrack = (params) => {
    return request({
        url: `/position/history/${params.channelId}`,
        method: 'get',
src/views/police/index.vue
@@ -390,6 +390,7 @@
import phoneList from '@/assets/data/phone.js'
import zfList from '@/assets/data/zf.js'
import dtList from '@/assets/data/dt.js'
import { getHistoricalTrack } from '@/api/police/index.js'
let tc = null
let track = null
@@ -640,7 +641,7 @@
            tc.removeTrack(track)
        },
        lookTrack () {
        async lookTrack () {
            if (this.trackTime.length == 0) {
                this.$message({ message: "请选择开始时间", duration: 2000 })
                return
@@ -681,24 +682,27 @@
                type: 'VectorLayer'
            })
            let positionsArr = []
            await this.getHistoricalTrack('34020000001320000001').then(res => {
                positionsArr = res
            })
            let positionStr = ''
            positionsArr.forEach(item => {
                positionStr = positionStr + item.longitude + ',' + item.latitude + ';'
            })
            this.$EventBus.$emit('layerPolylineAdd', {
                layerName: 'polylineLayer',
                positions: '116.025000, 28.686000; 116.025000, 28.678000; 116.020000, 28.678000',
                positions: positionStr,
                material: global.DC.Color.RED,
                width: 6
            })
            let positionsStr = '116.025000, 28.686000; 116.025000, 28.678000; 116.020000, 28.678000'
            let positionsArr = positionsStr.split(';')
            let orginPositionArr = positionsArr[0].split(',')
            let endPositionArr = positionsArr[positionsArr.length - 1].split(',')
            this.$EventBus.$emit('layerPointAdd', {
                layerName: 'polylineLayer',
                type: "billboard",
                params: {
                    lng: orginPositionArr[0].trim(),
                    lat: orginPositionArr[1].trim(),
                    alt: 100,
                    lng: positionsArr[0].longitude,
                    lat: positionsArr[0].latitude,
                    alt: 0,
                    url: '/img/icon/orgin.png',
                }
            })
@@ -706,13 +710,14 @@
                layerName: 'polylineLayer',
                type: "billboard",
                params: {
                    lng: endPositionArr[0].trim(),
                    lat: endPositionArr[1].trim(),
                    alt: 100,
                    lng: positionsArr[positionsArr.length - 1].longitude,
                    lat: positionsArr[positionsArr.length - 1].latitude,
                    alt: 0,
                    url: '/img/icon/end.png',
                }
            })
            track = new global.DC.Track('116.025000, 28.686000; 116.025000, 28.678000; 116.020000, 28.678000', 20)
            track = new global.DC.Track(positionStr, 5000)
            track.setModel('/model/qiche.gltf', {
                scale: 1
@@ -722,9 +727,9 @@
            this.$EventBus.$emit('toPosition', {
                siteJd: 116.025000,
                siteWd: 28.686000,
                siteGd: 5000,
                siteJd: 114.928669,
                siteWd: 25.850383,
                siteGd: 500,
                siteHeading: 0,
                sitePitch: -90
            })
@@ -745,6 +750,14 @@
        boxResize (val) {
            this.boxShow = val
        },
        async getHistoricalTrack (id) {
            let positionArr = []
            await getHistoricalTrack({ channelId: id }).then(res => {
                positionArr = res.data.data
            })
            return positionArr
        },
    },
    destroyed () {
src/views/video/list.vue
@@ -138,11 +138,11 @@
            getVideoList(1, 10).then(res => {
                this.monitoringList = res.data.data.list
                this.monitoringSaveList = res.data.data.list
                console.log(111, this.monitoringSaveList)
                this.initMonitoringIcon()
            })
        },
        async getDevices (id) {
            let flvAddress = ''
            await getDevices(id).then(res => {
src/views/video/region.vue
@@ -41,7 +41,7 @@
                            @cell-click="rowClick"
                        >
                            <el-table-column prop="name" label="设备名称" min-width="50%"></el-table-column>
                            <el-table-column prop="manufacturer" label="设备类型" min-width="50%"></el-table-column>
                            <el-table-column prop="manufacture" label="设备类型" min-width="50%"></el-table-column>
                        </el-table>
                    </div>
                    <div class="pages">