Commit 0c7fe56c authored by ninglx's avatar ninglx

展示版本基本完成

parent 22eab69a
......@@ -2,33 +2,12 @@ const map_config = {
SYS_ID: 'CAFC20296895433784C193457A870DFD',
MAP_CENTER: [112.96284186666799, 28.187102143508625],
MAP_ZOOM: 17.048587811931856,
MAX_ZOOM: 20,
MAP_PITCH: 0,
MAP_ROTATE: 90,
MAP_STYLE: 'http://192.168.2.78:9000/style-changsha.json', // 高精
}
const ws_config = {
// BASE_URL: 'ws://192.168.2.156:17021/holows/subscribe',
BASE_URL: 'ws://192.168.2.78:17021/holows/subscribe',
CROSS_CONTROL: 'ws://192.168.2.78:9000/utc/signalStatus/',
}
const api_config = {
CROSS_STOP_LINE: '/develop/sgw/dbInterface/zh_changsha_18q3_0303/hd_506_rxhdzxx/multiTable/A443EF992884', // 获取停止线接口
}
const video_config = {
intersectionGroupsVideoUrl: 'http://192.168.2.80/live?app=demo&stream=cloudpoint-1',
//2023-04-11 10:29:36_2023-04-11 10:34:36
groupViewStartTime: '2023-04-11 10:29:36',
//2023-04-10 00:47:20_2023-04-10 00:49:46
accidentViewStartTime: '2023-04-10 00:47:20',
//2023-04-09 01:28:10_2023-04-09 01:28:40
dangerViewStartTime: '2023-04-09 01:28:10',
dronesViewStartTime: '2023-04-09 01:28:10',
mobileViewStartTime: '2023-04-11 20:58:45',
phaseViewStartTime: '2023-04-10 17:21:04',
slowViewStartTime: '2023-04-10 01:22:12',
SLConflictViewStartTime: '2023-04-08 17:28:31',
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ export default {
camera: require('../../assets/images/holo/spxj.png'),
sign: require('../../assets/images/holo/xhj.png'),
homeCamera: require('../../assets/images/sc/crossCamera.png'),
mobileEquip: require('../../assets/images/sc/mobileEquip.png'),
// light11: require('../../assets/images/sc/leftRed.png'),
// light12: require('../../assets/images/sc/leftYellow.png'),
......
import fetch from '@/utils/fetch'
// 路口停止线获取
export const getLinesByCross = (params) => fetch(api_config.CROSS_STOP_LINE, params, 'POST', {})
// export const getLinesByCross = (params) => fetch(api_config.CROSS_STOP_LINE, params, 'POST', {})
// 根据不同场景请求左侧cameraList
export const getCameraListByType = (data) => fetch('/holo/event-camera/list', data, 'GET')
......
......@@ -321,7 +321,7 @@ export function addVehicleLayer(scene, msg) {
return pointLayer
}
// 车辆圆点图层
// 设备
export function addMobilePoint(scene, msg) {
const pointLayer = new PointLayer({zIndex: 2})
.source(msg, {
......@@ -329,12 +329,12 @@ export function addMobilePoint(scene, msg) {
type: 'json', x: 'longitude', y: 'latitude',
},
})
.shape('circle')
.style({
blur: 1,
})
.size(24)
.color('#e21918')
.shape('mobileEquip')
// .style({
// blur: 1,
// })
.size(28)
// .color('#e21918')
scene.addLayer(pointLayer)
return pointLayer
}
......@@ -110,7 +110,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -159,7 +159,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1
......@@ -355,7 +355,7 @@ export default {
// console.log('count...', window.tb.world.children.length)
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
this.$refs.right.startVideo()
......@@ -364,11 +364,8 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.accidentViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
this.$refs.right.startVideo(videoTime)
this.$refs.refVideo.startVideo()
this.$refs.right.startVideo()
this.msgStart = false
}
let start = performance.now();
......
......@@ -102,7 +102,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -148,7 +148,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -301,7 +301,7 @@ export default {
// }
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
this.$refs.rightDangerVideo.startVideo()
......@@ -310,11 +310,8 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.dangerViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
this.$refs.rightDangerVideo.startVideo(videoTime)
this.$refs.refVideo.startVideo()
this.$refs.rightDangerVideo.startVideo()
this.msgStart = false
}
......
......@@ -91,7 +91,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -135,7 +135,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -271,7 +271,7 @@ export default {
}
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
}
......@@ -279,10 +279,7 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.dronesViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
this.$refs.refVideo.startVideo()
// this.$refs.refVideo1.startVideo(videoTime)
this.msgStart = false
}
......
......@@ -101,7 +101,7 @@ export default {
lastMsg: [],
timeout: null,
msgStart: true,
dianyunUrl: video_config.intersectionGroupsVideoUrl,
types: [],
haveVideo: false,
timers: [],
......@@ -166,7 +166,7 @@ export default {
units: "meters",
scale: 0.8,
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
};
window.tb.loadObj(options, (model) => {
vehicleModelTypes[`car${key}`] = model;
......@@ -454,7 +454,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
this.changeVehicleDetail(this.selectVehicle)
},
// 根据处理后的数组新增-删除-更新模型
......@@ -510,7 +510,7 @@ export default {
// }
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
console.log('index 重置 ',)
console.log('last 重置', this.lastMsg[0].dateTime)
console.log('current 重置', msg[0].dateTime)
......@@ -524,13 +524,10 @@ export default {
this.$store.commit('setCurrentTime', msg[0].dateTime)
// console.log('msg.length',msg.length)
if (this.msgStart) {
let realTimeStart = new Date(video_config.groupViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
for (let item of popups) {
item.$children[0].setTime(videoTime)
item.$children[0].setTime()
}
this.$refs.groupViewPointCamera.setTime(videoTime)
this.$refs.groupViewPointCamera.setTime()
this.msgStart = false
}
let start = performance.now();
......
......@@ -171,6 +171,7 @@ export default {
components: {msgCard},
data() {
return {
flag: 0,
eventTypeUnitMap: {
11: '',
16: '',
......@@ -291,7 +292,7 @@ export default {
this.getFiveIndexes()
let timer = setInterval(() => {
this.getFiveIndexes()
}, 1000 * 60)
}, 1000)
this.timers.push(timer)
// 冲突点监测
// pedNonAnalysis().then((res) => {
......@@ -339,6 +340,20 @@ export default {
getOverDatas().then(res => {
console.log('5指标', res.content)
this.overDatas = res.content
// if (this.flag === 360) {
// this.flag = 0
// }
// if (this.flag % 60 !== 1) {
// delete res.content.maxQueueLength
// delete res.content.maxStopNumber
// delete res.content.maxTravelTime
// }
// console.log('ressss', this.flag, res.content)
// for (let key in res.content) {
// this.overDatas[key] = res.content[key]
// }
// this.flag += 1
})
},
tabsHandleClick(tab) {
......
......@@ -93,7 +93,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -161,7 +161,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -298,7 +298,7 @@ export default {
}
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideoL.startVideo()
this.$refs.refVideoR.startVideo()
......@@ -307,11 +307,8 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.mobileViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideoL.startVideo(videoTime)
this.$refs.refVideoR.startVideo(videoTime)
this.$refs.refVideoL.startVideo()
this.$refs.refVideoR.startVideo()
this.msgStart = false
}
let start = performance.now();
......
......@@ -35,7 +35,7 @@ import dict from "../../config/holo/dictionary";
import wsSource from "../../config/holo/wsSource";
import {initWs} from "../../config/holo/websocket";
import * as l7Tools from "../../utils/l7Tools";
import {getLinesByCross} from "../../dao/api";
// import {getLinesByCross} from "../../dao/api";
let map,
scene,
......@@ -78,7 +78,7 @@ export default {
bounds: '',
crossLineInfo: false,
licenseState: false,
lastMsg:[],
lastMsg: [],
};
},
watch: {},
......@@ -100,7 +100,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -149,7 +149,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -453,18 +453,18 @@ export default {
// }
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
}
this.lastMsg = msg
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.phaseViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
// let realTimeStart = new Date(video_config.phaseViewStartTime).getTime()
// let getTimeStart = new Date(msg[0].dateTime).getTime()
// let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo()
this.msgStart = false
}
let start = performance.now();
......
......@@ -299,7 +299,7 @@ export default {
.value-image {
width: 491px;
height: 373px;
background-image: url("../../../assets/images/sc/kfpic.png");
background-image: url("../../../assets/images/sc/kf.png");
background-size: 100% 100%;
border: 1px solid #0d7fd7;
}
......
......@@ -4,6 +4,7 @@
<div class="cardInner">
<div class="comp">
<cross-control crossId="12F6L08J630"/>
<!-- <cross-control crossId="12F6S08J7P0"/>-->
</div>
<!-- :span-method="objectSpanMethod"-->
<el-table
......
......@@ -102,7 +102,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
getCrossCamerasAndPolygons() {
getPasserbyPolygon().then(res => {
......@@ -150,10 +150,10 @@ export default {
this.timeout = setTimeout(() => {
this.initWebS()
}, 5000)
this.getCrossCamerasAndPolygons()
setInterval(() => {
this.getCrossCamerasAndPolygons()
}, 1000)
// this.getCrossCamerasAndPolygons()
// setInterval(() => {
// this.getCrossCamerasAndPolygons()
// }, 1000)
map.addControl(new mapboxgl.NavigationControl({showZoom: false}), 'top-right');
});
scene.on("zoomend", (e) => {
......@@ -184,7 +184,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -329,7 +329,7 @@ export default {
// }
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
}
......@@ -337,10 +337,10 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.slowViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
// let realTimeStart = new Date(video_config.slowViewStartTime).getTime()
// let getTimeStart = new Date(msg[0].dateTime).getTime()
// let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo()
this.msgStart = false
}
let start = performance.now();
......
......@@ -36,7 +36,7 @@ import wsSource from "../../config/holo/wsSource";
import {initWs} from "../../config/holo/websocket";
import * as l7Tools from "../../utils/l7Tools";
import conflictDetail from "./mapPopup/conflictDetail.vue";
import {getLinesByCross} from "../../dao/api";
// import {getLinesByCross} from "../../dao/api";
const ConflictDetail = Vue.extend(conflictDetail)
......@@ -98,7 +98,7 @@ export default {
input.select()
document.execCommand('copy')
document.body.removeChild(input)
ELEMENT.Message(e.detail.userData.data.id)
// ELEMENT.Message(e.detail.userData.data.id)
},
init() {
[map, scene] = this.$refs.wMap.initMap();
......@@ -145,7 +145,7 @@ export default {
type: "gltf",
units: "meters",
adjustment: {x: 0.5, y: 1, z: -0.6},
bbox: true,
bbox: false,
}, (model) => {
vehicleModelTypes[`car${key}`] = model;
this.vehicleModelsNum += 1;
......@@ -437,7 +437,7 @@ export default {
this.licenseState = !this.licenseState
},
callCar(msg) {
if (this.lastMsg.length && Math.abs(new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000 > 5) {
if (this.lastMsg.length && ((new Date(this.lastMsg[0].dateTime).getTime() - new Date(msg[0].dateTime).getTime()) / 1000) > 5) {
// if (this.lastMsg.length && new Date(this.lastMsg[0].dateTime).getTime() > new Date(msg[0].dateTime).getTime()) {
this.$refs.refVideo.startVideo()
}
......@@ -445,10 +445,10 @@ export default {
if (scene && this.vehicleModelsNum === 8) {
this.$store.commit('setCurrentTime', msg[0].dateTime)
if (this.msgStart) {
let realTimeStart = new Date(video_config.SLConflictViewStartTime).getTime()
let getTimeStart = new Date(msg[0].dateTime).getTime()
let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo(videoTime)
// let realTimeStart = new Date(video_config.SLConflictViewStartTime).getTime()
// let getTimeStart = new Date(msg[0].dateTime).getTime()
// let videoTime = (getTimeStart - realTimeStart) / 1000
this.$refs.refVideo.startVideo()
this.msgStart = false
}
let start = performance.now();
......
......@@ -314,7 +314,7 @@ export default {
.value-image {
width: 491px;
height: 373px;
background-image: url("../../../assets/images/sc/ctpic.png");
background-image: url("../../../assets/images/sc/zz.png");
background-size: 100% 100%;
border: 1px solid #0d7fd7;
}
......
......@@ -4,6 +4,8 @@
<div class="cardInner">
<div class="comp">
<cross-control crossId="12F6S08J8T0"/>
<!-- <cross-control crossId="12F6S08J7P0"/>-->
</div>
<el-table
:header-cell-style="{backgroundColor:'rgba(1, 43, 83, 1)',color:'rgba(217, 237, 255, 1)'}"
......
......@@ -9,9 +9,7 @@ const map_config = {
MAP_STYLE_XL: 'http://192.168.2.78:9000/style-changsha.json', // 高精带路口箭头
RASTER_ROAD: 'http://192.168.2.78:9000/tile?lid=traffic&get=map&cache=off&x={x}&y={y}&z={z}' // 路况
}
const api_config = {
CROSS_STOP_LINE: '/develop/sgw/dbInterface/zh_suzhou_18q3/hd_506_rxhdzxx/multiTable/50FA40F152FF', // 获取停止线接口
}
const ws_config = {
BASE_URL: 'ws://192.168.2.78:17021/holows/subscribe', // 实时轨迹
CROSS_CONTROL: 'ws://192.168.2.78:9000/utc/signalStatus/' // 路口详情 - 灯态相位推送
......@@ -19,9 +17,11 @@ const ws_config = {
const cesium_config = {
center: [112.96364, 28.18825], // cesium中心点
zoomHeight: 1800, // cesium相机默认高度
baseMap: 'http://192.168.2.78:9000/styles/OSM%20OpenMapTiles/{z}/{x}/{y}@2x.png', // cesium标清底图
tile3dURL: 'http://192.168.2.78:9090/cs_3dtiles/tileset.json', // 3D tile 三维路口模型
}
const video_config = {
homeTimeStart:'2023-04-16 23:10:27:267',
}
......
......@@ -44,6 +44,9 @@ export default {
// }),
terrainProvider: new Cesium.EllipsoidTerrainProvider({}), // 地形
});
viewer.scene.light = new Cesium.DirectionalLight({
direction: new Cesium.Cartesian3(0.354925, -0.890918, -0.283358)
})
// tileset三维场景
const tileset = new Cesium.Cesium3DTileset({
url: cesium_config.tile3dURL,
......
//
// let socket
// // readyState: 0-正在连接 1-已经连接 2-连接正在关闭 3-已关闭或没连接成功
// function onOpen(e, data) {
// console.log(e,data)
// console.log('open && send ...', data.name)
// socket.send(data.sendData)
// }
//
// function onError(e, data) {
// console.log('ws error...', e, data)
// }
//
// function onClose(e, data) {
// console.log('ws close...', e, data)
// // setTimeout(() => {
// // initWs(data)
// // }, 5000)
// }
//
// export function initWs(data) {
// if (typeof WebSocket === undefined) {
// console.error('您的浏览器不支持socket')
// } else {
// // socket = new WebSocket(data.url)
// socket = new ReconnectingWebSocket(data.url)
// // 监听socket连接open
// socket.onopen = (e) => onOpen(e, data)
// // 监听socket错误信息
// socket.onerror = (e) => onError(e, data)
// // 断开连接
// socket.onclose = (e) => onClose(e, data)
// return {
// name: data.name,
// url: data.url,
// status: data.status,
// ws: socket,
// }
// }
// }
let sockets = []
let socket
// readyState: 0-正在连接 1-已经连接 2-连接正在关闭 3-已关闭或没连接成功
function onOpen(e, data) {
console.log(e,data)
console.log('open && send ...', data.name)
socket.send(data.sendData)
for (let it of sockets) {
if (it.name === data.name && it.ws.readyState === 1) {
it.ws.send(data.sendData)
}
}
}
function onError(e, data) {
......@@ -13,28 +58,25 @@ function onError(e, data) {
function onClose(e, data) {
console.log('ws close...', e, data)
// setTimeout(() => {
// initWs(data)
// }, 5000)
}
export function initWs(data) {
if (typeof WebSocket === undefined) {
console.error('您的浏览器不支持socket')
} else {
// socket = new WebSocket(data.url)
socket = new ReconnectingWebSocket(data.url)
let currentSocket = new ReconnectingWebSocket(data.url)
// 监听socket连接open
socket.onopen = (e) => onOpen(e, data)
currentSocket.onopen = (e) => onOpen(e, data)
// 监听socket错误信息
socket.onerror = (e) => onError(e, data)
currentSocket.onerror = (e) => onError(e, data)
// 断开连接
socket.onclose = (e) => onClose(e, data)
currentSocket.onclose = (e) => onClose(e, data)
sockets.push({
name: data.name, ws: currentSocket,
})
return {
name: data.name,
url: data.url,
status: data.status,
ws: socket,
name: data.name, url: data.url, status: data.status, ws: currentSocket,
}
}
}
......@@ -2,6 +2,8 @@ import fetch from '@/utils/fetch'
export const crossInfo = () => fetch('/holo/base-cross-info/list', {}, 'GET')
// 顶部轮询5指标
export const getOverDatas = () => fetch('/holo/area-index-analysis/realtime', {}, 'GET')
export const eventInfo = (data) => fetch('/holo/event-info/list', data, 'GET')
......@@ -59,4 +61,4 @@ export const equip_signal = () => fetch('/holo/device-signal/list', {}, 'GET')
export const equip_weather = () => fetch('/holo/device-weather/list', {}, 'GET')
// 路口停止线获取
export const getLinesByCross = (params) => fetch(api_config.CROSS_STOP_LINE, params, 'POST', {})
\ No newline at end of file
// export const getLinesByCross = (params) => fetch(api_config.CROSS_STOP_LINE, params, 'POST', {})
\ No newline at end of file
......@@ -799,7 +799,7 @@ export default {
border: 1px solid #04396f;
z-index: 2;
height: calc(100% - 45px);
position: absolute;
position: absolute !important;
left: 0;
top: 42px;
width: 40%;
......
......@@ -3,7 +3,9 @@
<div v-if="model.equip_type === 'camera'" class="equip_camera">
<div class="header">{{ model.installLocation || '暂无安装地址信息' }}</div>
<div class="main">
<camera-video :auto-play="true" style="height: 100%" :video-data="model.videoUrl"/>
<!-- <camera-video :auto-play="true" style="height: 100%" :video-data="model.videoUrl"/>-->
<local-camera1 style="height: 100%; width: 100%" :border="false" :showClose="false" v-if="videoURL" ref="videoItem"
class="videoItem" :video-data="videoURL"/>
</div>
</div>
<div v-else-if="model.equip_type === 'weather'" class="equip_weather">
......@@ -40,18 +42,37 @@
<script>
import dict from '../../../config/holo/dictionary'
import CameraVideo from "../../../components/Standard/cameraVideo.vue";
import LocalCamera1 from "../localCamera1.vue";
export default {
name: "passerbyPopup",
props: ["model"],
components: {CameraVideo},
components: {LocalCamera1, CameraVideo},
data() {
return {
dict
dict,
videoURL: null,
};
},
mounted() {
console.log('equp', this.model)
if (this.model.equip_type === 'camera') {
if (this.model.crossId === '12F6S08J7P0') {
this.videoURL = 'lkqz_2'
}
if (this.model.crossId === '12F6S08J8T0') {
this.videoURL = 'lkqz_1'
}
if (this.model.crossId === '12F6L08J630') {
this.videoURL = 'lkqz_3'
}
this.$nextTick(() => {
this.$refs.videoItem.setTime()
})
} else {
this.videoURL = null
}
},
methods: {},
computed: {},
......@@ -128,7 +149,7 @@ export default {
.equip_camera {
width: 448px;
height: 328px;
height: 300px;
background-image: url("../../../assets/images/holo/videobackgorund.png");
background-repeat: no-repeat;
background-size: 100% 100%;
......
This diff is collapsed.
......@@ -12,6 +12,7 @@ export function addVehiclePic(scene, msg) {
return `carColor${val}`
})
// .shape('carPic')
.size(3.5)
.style({
unit: 'meter', rotation: 0,
......
<template>
<div :class="['cameraVideo',border?'cameraVideoBorder':'']">
<div class="vCloseButton" v-show="showClose" @click="closeM">
<div class="el-icon-close"></div>
</div>
<span v-show="border" class="top-left"></span>
<span v-show="border" class="top-right"></span>
<span v-show="border" class="bottom-left"></span>
<span v-show="border" class="bottom-right"></span>
<video v-if="videoData" muted width="100%" loop :class="[reverse?'reverse':'']"
class="videoControl" :id="videoData">
<source :src="url" type="video/mp4">
您的浏览器不支持 video 属性。
</video>
</div>
</template>
<script>
export default {
name: "localCamera1",
props: ["videoData", 'border', 'reverse','showClose'],
watch: {},
data() {
return {};
},
methods: {
setTime(time) {
this.$nextTick(() => {
let el = document.getElementById(this.videoData)
console.log('bofang...', time || 0)
if (time) {
el.currentTime = time
el.play()
} else {
console.log('视频重置。。。', new Date().getTime() / 1000)
el.currentTime = 0
el.play()
}
})
},
closeM() {
this.$emit('closeM')
}
},
computed: {
url() {
return `/cdn/video/${this.videoData}.mp4`
}
},
mounted() {
this.$nextTick(() => {
})
},
beforeDestroy() {
console.log("video beforeDestroy");
},
};
</script>
<style lang="less" scoped>
.reverse {
rotate: 180deg;
}
.cameraVideo {
position: relative;
.videoControl {
position: absolute;
width: 100%;
height: 100%;
//width: calc(100% - 5px);
//height: calc(100% - 5px);
padding: 1px;
}
}
.cameraVideoBorder {
border: 1px solid #022950;
}
.top-left {
position: absolute;
left: -2px;
top: -2px;
padding: 6px;
border-style: solid;
border-color: #1889f1;
border-width: 2px 0 0 2px;
}
.top-right {
position: absolute;
right: -2px;
top: -2px;
padding: 6px;
border-style: solid;
border-color: #1889f1;
border-width: 2px 2px 0 0;
}
.bottom-left {
position: absolute;
right: -2px;
bottom: -2px;
padding: 6px;
border-style: solid;
border-color: #1889f1;
border-width: 0 2px 2px 0;
}
.bottom-right {
position: absolute;
left: -2px;
bottom: -2px;
padding: 6px;
border-style: solid;
border-color: #1889f1;
border-width: 0 0 2px 2px;
}
.vCloseButton {
z-index: 9999;
background-color: rgba(13, 127, 215, 0.7);
position: absolute;
right: 4px;
top: 4px;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
cursor: pointer;
}
.vCloseButton:hover {
background-color: rgba(13, 127, 215, 0.9);
}
</style>
......@@ -13,12 +13,12 @@
<div class="title comm">实时车辆</div>
</div>
<div class="over_item">
<div class="number comm">{{ speed }} km/h</div>
<div class="number comm">{{ speed }}km/h</div>
<div class="title comm">平均速度</div>
</div>
<div class="over_item">
<div class="number comm">{{ crowd / 1000 }} km</div>
<div class="title comm">拥堵里程</div>
<div class="number comm">{{ maxTravelTime }}min</div>
<div class="title comm">最大行程时间</div>
</div>
</div>
<div class="left_box aside" :class="[{ hide_left: !show }]">
......@@ -166,7 +166,7 @@ import {
eventAnalysis,
areaRecent,
pedNonAnalysis,
eventAlarm,
eventAlarm, getOverDatas,
} from "../../dao/situation";
import {getFontSize} from "../../config/holo/fontSize.js";
import {Chart} from "highcharts-vue";
......@@ -216,7 +216,7 @@ export default {
fontSize: 12,
charts: {},
speed: "",
crowd: "",
maxTravelTime: "",
trafIndex: "",
realTimeNum: "",
timers: []
......@@ -289,6 +289,11 @@ export default {
},
mounted() {
// 区域指数 && 上侧指标
this.getOverDataTop()
let timer1 = setInterval(() => {
this.getOverDataTop()
}, 1000 * 60)
this.getIndexes()
let timer = setInterval(() => {
this.getIndexes()
......@@ -355,17 +360,26 @@ export default {
});
},
methods: {
getOverDataTop(){
getOverDatas().then((res) => {
console.log('111111111',res)
this.speed = res.content.avgTravelSpeed
this.trafIndex = res.content.trafficIndex
this.realTimeNum = res.content.inWayVehicleNum
this.maxTravelTime = res.content.maxTravelTime
})
},
getIndexes() {
areaList().then((res) => {
// console.log("区域指数", res);
this.speed =
res.content.timeList[res.content.timeList.length - 1].valList[2];
this.crowd =
res.content.timeList[res.content.timeList.length - 1].valList[4];
this.trafIndex =
res.content.timeList[res.content.timeList.length - 1].valList[0];
this.realTimeNum =
res.content.timeList[res.content.timeList.length - 1].valList[3];
// this.speed =
// res.content.timeList[res.content.timeList.length - 1].valList[2];
// this.crowd =
// res.content.timeList[res.content.timeList.length - 1].valList[4];
// this.trafIndex =
// res.content.timeList[res.content.timeList.length - 1].valList[0];
// this.realTimeNum =
// res.content.timeList[res.content.timeList.length - 1].valList[3];
this.$nextTick(() => {
this.regionalIndex(res.content);
for (let key in this.regionalIndexData) {
......
......@@ -319,6 +319,18 @@ export default {
// this.videoURL = 'http://10.102.1.180:80/live?app=demo&stream=mp4-133';
// this.$refs.cameraVideo.loadVideo()
this.playMultiVehicle(cars)
// 劳动西路
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(
112.962981,
28.182855
, 350),
orientation: {
heading: Cesium.Math.toRadians(0), // 旋转角度
pitch: Cesium.Math.toRadians(-90.0), // 相机方向
},
duration: 0.5
});
},
// 交通拥堵轨迹回溯
playFullTrack(data) {
......@@ -360,7 +372,7 @@ export default {
tArray.push({start: thisCarStart, stop: thisCarStop}) // 最后一段
}
}
console.log('tarray', tArray)
// console.log('tarray', tArray)
this.addEntityProperty({
viewer: viewer,
data: path,
......@@ -405,7 +417,7 @@ export default {
// 循环执行,即为2,到达终止时间,重新从起点时间开始
viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
viewer.flyTo(viewer.entities, {duration: 0.5})
// viewer.flyTo(viewer.entities, {duration: 0.5})
this.switchTimeLine(true)
this.showProgress = true
},
......@@ -507,18 +519,20 @@ export default {
if (viewer.trackedEntity) {
let position = this.currentEntity.position.getValue(viewer.clock.currentTime)
let angle = this.currentEntity.angleProperty.getValue(viewer.clock.currentTime)
let ellipsoid = viewer.scene.globe.ellipsoid
let cartographic = ellipsoid.cartesianToCartographic(position); // 笛卡尔坐标 => 经纬度 (弧度表示)
let lat = Cesium.Math.toDegrees(cartographic.latitude);
let lng = Cesium.Math.toDegrees(cartographic.longitude);
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(lng, lat, 2),
orientation: {
heading: Cesium.Math.toRadians(angle), // east, default value is 0.0 (north)
pitch: Cesium.Math.toRadians(-5), // default value (looking down)
roll: 0
}
});
if (position && angle) {
let ellipsoid = viewer.scene.globe.ellipsoid
let cartographic = ellipsoid.cartesianToCartographic(position); // 笛卡尔坐标 => 经纬度 (弧度表示)
let lat = Cesium.Math.toDegrees(cartographic.latitude);
let lng = Cesium.Math.toDegrees(cartographic.longitude);
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(lng, lat, 2),
orientation: {
heading: Cesium.Math.toRadians(angle), // east, default value is 0.0 (north)
pitch: Cesium.Math.toRadians(-5), // default value (looking down)
roll: 0
}
});
}
}
// let position = this.currentEntity.position.getValue(viewer.clock.currentTime)
// let orientation = this.currentEntity.orientation.getValue(viewer.clock.currentTime)
......@@ -753,29 +767,30 @@ export default {
// 车辆详情弹窗及更新
viewer.clock.onTick.addEventListener(() => {
if (viewer.clock.shouldAnimate) {
let position = this.currentEntity.position.getValue(viewer.clock.currentTime)
let ellipsoid = viewer.scene.globe.ellipsoid
let cartographic = ellipsoid.cartesianToCartographic(position); // 笛卡尔坐标 => 经纬度 (弧度表示)
let lat = Cesium.Math.toDegrees(cartographic.latitude);
let lng = Cesium.Math.toDegrees(cartographic.longitude);
if (!popup) {
popup = new CesiumPopup({
title: '信息'
})
.setPosition(Cesium.Cartesian3.fromDegrees(lng, lat, 1.5))
.setHTML(`<div id="cesium_vehicle_popup" ></div>`)
.addTo(viewer).setTitle('')
.setOffset([-100, -180])
new VehiclePopup({
propsData: {
model: this.currentTimeRowData
},
}).$mount('#cesium_vehicle_popup')
} else {
this.refreshSpeed()
popup?.setOffset([-100, -180])
popup.setPosition(Cesium.Cartesian3.fromDegrees(lng, lat, 1.5))
if (position) {
let ellipsoid = viewer.scene.globe.ellipsoid
let cartographic = ellipsoid.cartesianToCartographic(position); // 笛卡尔坐标 => 经纬度 (弧度表示)
let lat = Cesium.Math.toDegrees(cartographic.latitude);
let lng = Cesium.Math.toDegrees(cartographic.longitude);
if (!popup) {
popup = new CesiumPopup({
title: '信息'
})
.setPosition(Cesium.Cartesian3.fromDegrees(lng, lat, 1.5))
.setHTML(`<div id="cesium_vehicle_popup" ></div>`)
.addTo(viewer).setTitle('')
.setOffset([-100, -180])
new VehiclePopup({
propsData: {
model: this.currentTimeRowData
},
}).$mount('#cesium_vehicle_popup')
} else {
this.refreshSpeed()
popup?.setOffset([-100, -180])
popup.setPosition(Cesium.Cartesian3.fromDegrees(lng, lat, 1.5))
}
}
} else {
this.playStatus = false
......
......@@ -201,8 +201,9 @@ export default {
searchForm: {
//startTime: '2023-04-07 14:00:00',
//endTime: '2023-04-07 15:00:00',
startTime:'2023-04-10 00:46:20',
endTime:'2023-04-10 00:49:46',
//
startTime:'2023-04-09 01:28:01',
endTime:'2023-04-09 01:28:40',
eventCategory: '',
crossId: '',
objectType: '',
......
......@@ -255,6 +255,8 @@ export default {
function: '',
// startTime: '2023-03-14 08:00:00',
// endTime: '2023-03-14 08:10:00',
// 2023-04-08 23:00:00
//2023-04-08 23:30:00
startTime: '2023-04-08 23:11:51',
endTime: '2023-04-08 23:12:14',
},
......@@ -270,13 +272,13 @@ export default {
// this.getDict()
},
mounted() {
this.$nextTick(() => {
let date = new Date() // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
this.searchForm.endTime = this.convertToString(date)
let start = date.getTime() - 1000 * 60 * 10
let st = new Date(start)
this.searchForm.startTime = this.convertToString(st)
})
// this.$nextTick(() => {
// let date = new Date() // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
// this.searchForm.endTime = this.convertToString(date)
// let start = date.getTime() - 1000 * 60 * 10
// let st = new Date(start)
// this.searchForm.startTime = this.convertToString(st)
// })
},
methods: {
convertToString(date) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment