Commit 42b252d8 authored by ninglx's avatar ninglx

1

parent 631e3a2e
...@@ -3,27 +3,27 @@ ...@@ -3,27 +3,27 @@
element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)"> element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
<track-switcher :detetors="detetorsArray" :boxShow="boxesShow" @timeChange="timeChange" v-show="trackSwitcherVis" <track-switcher :detetors="detetorsArray" :boxShow="boxesShow" @timeChange="timeChange" v-show="trackSwitcherVis"
@closeRealTime="closeRealTime" @openRealTime="openRealTime"></track-switcher> @closeRealTime="closeRealTime" @openRealTime="openRealTime"></track-switcher>
<situation-time v-show="currentCheck === 'first' && timeState" class="situationTime" :time="situationTimeVal"/> <situation-time v-show="currentCheck === 'first' && timeState" class="situationTime" :time="situationTimeVal" />
<wMap :mapId="'situation-map'" ref="wMap"/> <wMap :mapId="'situation-map'" ref="wMap" />
<!--左右图表组件--> <!--左右图表组件-->
<message-boxes @playOverHistoryTrace="playOverHistoryTrace" @delWarningPopup="delWarningPopup" <message-boxes @playOverHistoryTrace="playOverHistoryTrace" @delWarningPopup="delWarningPopup"
@addWarningPopup="addWarningPopup" :show="boxesShow"/> @addWarningPopup="addWarningPopup" :show="boxesShow" />
<!--图层切换按钮--> <!--图层切换按钮-->
<layers-switch ref="switch" :show="boxesShow" @changeCheck="changeCheck" @visibleChange="visibleChange" <layers-switch ref="switch" :show="boxesShow" @changeCheck="changeCheck" @visibleChange="visibleChange"
:class="boxesShow ? 'generalSwitch' : 'rightSwitch'"/> :class="boxesShow ? 'generalSwitch' : 'rightSwitch'" />
<!--视频播放组件--> <!--视频播放组件-->
<video-list ref="videoList" v-if="showCameras.length" @updateCamera="updateCameraCPB" @resetCamera="resetCamera" <video-list ref="videoList" v-if="showCameras.length" @updateCamera="updateCameraCPB" @resetCamera="resetCamera"
@delVideo="deleteVideo" :showCameras="showCameras"/> @delVideo="deleteVideo" :showCameras="showCameras" />
<!--路口详情--> <!--路口详情-->
<cross-detail v-if="dialogVisible.crossDetail" @actionFinished="actionFinished" dialogId="crossDetail" <cross-detail v-if="dialogVisible.crossDetail" @actionFinished="actionFinished" dialogId="crossDetail"
:crossDetailData="crossDetailData"/> :crossDetailData="crossDetailData" />
<!--底部交通事件趋势分析--> <!--底部交通事件趋势分析-->
<traffic-events-tend @updateHeatMap="refreshEventLayer" v-if="currentCheck === 'third'"/> <traffic-events-tend @updateHeatMap="refreshEventLayer" v-if="currentCheck === 'third'" />
<!--设备图例控制--> <!--设备图例控制-->
<equipment-switch @equipmentChange="equipmentChange" v-if="currentCheck === 'fourth'"/> <equipment-switch @equipmentChange="equipmentChange" v-if="currentCheck === 'fourth'" />
<!--单车超限历史轨迹视频--> <!--单车超限历史轨迹视频-->
<sigalTraceVideos @isReady="singalHistoryVideoReady" :urls="hisUrls" :key="sigalKey" <sigalTraceVideos @isReady="singalHistoryVideoReady" :urls="hisUrls" :key="sigalKey" v-if="showHisVid">
v-if="showHisVid"></sigalTraceVideos> </sigalTraceVideos>
</div> </div>
</template> </template>
...@@ -35,7 +35,7 @@ import MessageBoxes from "./floatData/messageBoxes.vue"; ...@@ -35,7 +35,7 @@ import MessageBoxes from "./floatData/messageBoxes.vue";
import CrossDetail from "./crossDetail.vue"; import CrossDetail from "./crossDetail.vue";
import VideoList from "./floatData/videoList.vue"; import VideoList from "./floatData/videoList.vue";
import TrafficEventsTend from "./floatData/trafficEventsTend.vue"; import TrafficEventsTend from "./floatData/trafficEventsTend.vue";
import {initWs} from "../../config/holo/websocket"; import { initWs } from "../../config/holo/websocket";
import dict from "../../config/holo/dictionary"; import dict from "../../config/holo/dictionary";
import mapAssets from "../../config/holo/mapAssets"; import mapAssets from "../../config/holo/mapAssets";
import * as mapTools from "../../utils/mapboxTools"; import * as mapTools from "../../utils/mapboxTools";
...@@ -60,7 +60,7 @@ import { ...@@ -60,7 +60,7 @@ import {
equip_radar, equip_radar,
getDetetors, getDetetors,
} from "../../dao/situation"; } from "../../dao/situation";
import {convertPointsToGeo, convertPointsWktToGeo, convertToLineWithWkt} from "../../utils/mapboxTools"; import { convertPointsToGeo, convertPointsWktToGeo, convertToLineWithWkt } from "../../utils/mapboxTools";
const VehiclePopup = Vue.extend(vehicleDetail); const VehiclePopup = Vue.extend(vehicleDetail);
const EquipmentPopup = Vue.extend(equipmentPopup); const EquipmentPopup = Vue.extend(equipmentPopup);
...@@ -69,7 +69,7 @@ const AlarmPopup = Vue.extend(alarmPopup) ...@@ -69,7 +69,7 @@ const AlarmPopup = Vue.extend(alarmPopup)
let pulsingDots = []; let pulsingDots = [];
const canvasImages = [ const canvasImages = [
{size: 250, color: "252, 1, 26"}, { size: 250, color: "252, 1, 26" },
// {size: 400, color: "255,235,59"}, // {size: 400, color: "255,235,59"},
// {size: 400, color: "255, 141, 26"}, // {size: 400, color: "255, 141, 26"},
// {size: 400, color: "227, 5, 5"}, // {size: 400, color: "227, 5, 5"},
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
this.$EventBus.$on("emitPopupClose", ({id, overRun}) => { this.$EventBus.$on("emitPopupClose", ({ id, overRun }) => {
console.log('eventbus event received...', id) console.log('eventbus event received...', id)
vehiclePopups[`popup${id}`]?.remove(); vehiclePopups[`popup${id}`]?.remove();
delete vehiclePopups[`popup${id}`]; delete vehiclePopups[`popup${id}`];
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
// 重度拥堵: 3, // 重度拥堵: 3,
// 疑似事故: 4, // 疑似事故: 4,
// }; // };
let resItem = Object.assign({}, item, {longitude: item.lng, latitude: item.lat, type: 3}) let resItem = Object.assign({}, item, { longitude: item.lng, latitude: item.lat, type: 3 })
mapTools.addOrUpdateWarningWave(map, [resItem], item.eventSerialNumber); mapTools.addOrUpdateWarningWave(map, [resItem], item.eventSerialNumber);
// 上报产生的告警 弹窗提醒 定时销毁 // 上报产生的告警 弹窗提醒 定时销毁
let popup = new mapboxgl.Popup({ let popup = new mapboxgl.Popup({
...@@ -370,12 +370,12 @@ export default { ...@@ -370,12 +370,12 @@ export default {
this.closeWs('callCar1').then(() => { this.closeWs('callCar1').then(() => {
this.removeVehiclePopup() this.removeVehiclePopup()
this.overCarsPoints = {} this.overCarsPoints = {}
this.highLightCarTracks = {}
this.openRealTime() this.openRealTime()
}) })
this.backToRealTimer = null this.backToRealTimer = null
}, 1000 * 20) }, 1000 * 20)
if (socket.ws.readyState === 1) { if (socket.ws.readyState === 1) {
this.showHisVid = true
this.sockets.push(socket); this.sockets.push(socket);
delete this.historyWsToSend.urls delete this.historyWsToSend.urls
let msg = JSON.stringify(this.historyWsToSend) let msg = JSON.stringify(this.historyWsToSend)
...@@ -404,6 +404,8 @@ export default { ...@@ -404,6 +404,8 @@ export default {
// 开始请求视频 // 开始请求视频
this.sigalKey = sendMsg.globalId this.sigalKey = sendMsg.globalId
this.hisUrls = sendMsg.urls || [] this.hisUrls = sendMsg.urls || []
// this.hisUrls = ['videos/1.mp4']
this.showHisVid = true
this.$nextTick(() => { this.$nextTick(() => {
if (this.hisUrls.length) { if (this.hisUrls.length) {
this.loading = true this.loading = true
...@@ -485,7 +487,7 @@ export default { ...@@ -485,7 +487,7 @@ export default {
this.cLocation, this.cLocation,
offsetLength, // 相机向前偏移距离 offsetLength, // 相机向前偏移距离
this.cBearing, this.cBearing,
{units: "meters"} { units: "meters" }
).geometry.coordinates; ).geometry.coordinates;
map.flyTo({ map.flyTo({
center: translatedPoint, center: translatedPoint,
...@@ -537,13 +539,13 @@ export default { ...@@ -537,13 +539,13 @@ export default {
} }
for (let i = 0; i < pulsingDots.length; i++) { for (let i = 0; i < pulsingDots.length; i++) {
if (map && !map.hasImage(`pulsingDot${i}`)) if (map && !map.hasImage(`pulsingDot${i}`))
map.addImage(`pulsingDot${i}`, pulsingDots[i], {pixelRatio: 2}); map.addImage(`pulsingDot${i}`, pulsingDots[i], { pixelRatio: 2 });
} }
// 添加map icons图片资源 ---end // 添加map icons图片资源 ---end
this.loading = false; this.loading = false;
this.mixDraw(map); this.mixDraw(map);
map.addControl( map.addControl(
new mapboxgl.NavigationControl({showZoom: false}), new mapboxgl.NavigationControl({ showZoom: false }),
"bottom-right" "bottom-right"
); );
this.refreshBounds(); this.refreshBounds();
...@@ -654,7 +656,7 @@ export default { ...@@ -654,7 +656,7 @@ export default {
type: "gltf", type: "gltf",
units: "meters", units: "meters",
scale: 0.8, scale: 0.8,
adjustment: {x: 0.5, y: 1, z: -0.5}, adjustment: { x: 0.5, y: 1, z: -0.5 },
bbox: true, bbox: true,
}; };
window.tb.loadObj(options, (model) => { window.tb.loadObj(options, (model) => {
...@@ -751,7 +753,7 @@ export default { ...@@ -751,7 +753,7 @@ export default {
let centerP = turf.point([map.getCenter().lng, map.getCenter().lat]); let centerP = turf.point([map.getCenter().lng, map.getCenter().lat]);
// 取最近点的crossId // 取最近点的crossId
let nearest = turf.nearestPoint(centerP, this.crossGeo); let nearest = turf.nearestPoint(centerP, this.crossGeo);
this.firstCrossClick({features: [nearest]}) this.firstCrossClick({ features: [nearest] })
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 注册车辆实时ws // 注册车辆实时ws
...@@ -794,7 +796,7 @@ export default { ...@@ -794,7 +796,7 @@ export default {
}, },
// 交通事件热力图 & 点 // 交通事件热力图 & 点
refreshEventLayer(type) { refreshEventLayer(type) {
eventInfo({dayType: type}).then((res) => { eventInfo({ dayType: type }).then((res) => {
// 热力图 - 如果还未创建 先创建图层 赋值 // 热力图 - 如果还未创建 先创建图层 赋值
if (this.currentCheck === "third") { if (this.currentCheck === "third") {
mapTools.addOrUpdateEventHeat(map, res.content); mapTools.addOrUpdateEventHeat(map, res.content);
...@@ -866,7 +868,7 @@ export default { ...@@ -866,7 +868,7 @@ export default {
distance = 80; distance = 80;
} }
let bearing = map.getBearing(); // 平移方向,0 表示正北方向 let bearing = map.getBearing(); // 平移方向,0 表示正北方向
let options = {units: "meters"}; let options = { units: "meters" };
let translatedPoint = turf.destination( let translatedPoint = turf.destination(
prop.wkt.split(","), prop.wkt.split(","),
distance, distance,
...@@ -890,7 +892,7 @@ export default { ...@@ -890,7 +892,7 @@ export default {
.addClassName("equipmentPopup"); .addClassName("equipmentPopup");
popupInstance = new EquipmentPopup({ popupInstance = new EquipmentPopup({
propsData: { propsData: {
model: {equip_type: type, ...prop}, model: { equip_type: type, ...prop },
}, },
}); });
popupInstance.$mount("#equipment_popup"); popupInstance.$mount("#equipment_popup");
...@@ -956,7 +958,7 @@ export default { ...@@ -956,7 +958,7 @@ export default {
} }
model.setCoords([options.longitude, options.latitude]); model.setCoords([options.longitude, options.latitude]);
model.userData.data = options; model.userData.data = options;
model.setRotation({x: 90, y: 360 - options.courseAngle - 90, z: 0}); model.setRotation({ x: 90, y: 360 - options.courseAngle - 90, z: 0 });
}, },
// 更新超限车辆高亮波纹底盘 // 更新超限车辆高亮波纹底盘
updateOverCarLnglat() { updateOverCarLnglat() {
...@@ -1000,14 +1002,13 @@ export default { ...@@ -1000,14 +1002,13 @@ export default {
// 车辆详情弹窗内容 // 车辆详情弹窗内容
addCheckDetail(data) { addCheckDetail(data) {
console.log('添加弹窗...'); console.log('添加弹窗...');
if (vehiclePopups[`popup${data.id}`]) { if (vehiclePopups[`popup${data.id}`]) {
if (popupVises[`popup${data.id}`]) { if (popupVises[`popup${data.id}`]) {
vehiclePopups[`popup${data.id}`].setLngLat([ vehiclePopups[`popup${data.id}`].setLngLat([
data.longitude, data.longitude,
data.latitude, data.latitude,
]); ]);
vehiclePopupInstances[`popup${data.id}`].$props.model = data; vehiclePopupInstances[`popup${data.id}`] && (vehiclePopupInstances[`popup${data.id}`].$props.model = data)
} }
// 更新选中车辆的轨迹数据 // 更新选中车辆的轨迹数据
if (this.highLightCarTracks[data.id]) { if (this.highLightCarTracks[data.id]) {
...@@ -1119,6 +1120,7 @@ export default { ...@@ -1119,6 +1120,7 @@ export default {
} }
} else { } else {
vehiclePopups[`popup${item.id}`]?.remove(); vehiclePopups[`popup${item.id}`]?.remove();
delete this.highLightCarTracks[item.id]
delete this.selectVehicles[item.id] delete this.selectVehicles[item.id]
} }
} }
...@@ -1302,7 +1304,7 @@ export default { ...@@ -1302,7 +1304,7 @@ export default {
topMargin: 2, topMargin: 2,
}); });
license.setCoords([option.longitude, option.latitude, 4]); license.setCoords([option.longitude, option.latitude, 4]);
license.userData.data = {picLicense: option.picLicense}; license.userData.data = { picLicense: option.picLicense };
window.tb.add(license, `license${option.id}`); window.tb.add(license, `license${option.id}`);
licenseLabel[`license${option.id}`] = license; licenseLabel[`license${option.id}`] = license;
} }
...@@ -1475,7 +1477,7 @@ export default { ...@@ -1475,7 +1477,7 @@ export default {
box-shadow: none !important; box-shadow: none !important;
} }
.mapboxgl-ctrl-group button + button { .mapboxgl-ctrl-group button+button {
border-top: unset !important; border-top: unset !important;
} }
......
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