Commit 54f8d08a authored by ninglx's avatar ninglx

按需求改动超限 & 处理bug

parent b32ec1ee
...@@ -158,7 +158,8 @@ export default { ...@@ -158,7 +158,8 @@ export default {
dict, dict,
activeName: '11', activeName: '11',
overData: [ overData: [
// { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 }, // { "plateNo": "京A895413", "inDirName": "东向西", "type": "1", "timeStamp": "2024-09-26 14:36:35",length:10 ,globalId:'10551050',videoUrls:['videos/1.mp4']},
// { "plateNo": "京A895413", "inDirName": "东向西", "type": "1", "timeStamp": "2024-09-26 14:36:34",length:10 ,globalId:'10551050',videoUrls:['videos/1.mp4']},
// { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 }, // { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 },
// { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 }, // { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 },
// { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 }, // { "plateNo": "京A895413", "inDirName": "东向西", "type": "105", "timeStamp": "2024-08-27 15:39:18",length:10 },
...@@ -236,6 +237,7 @@ export default { ...@@ -236,6 +237,7 @@ export default {
}, 1000 * 10); }, 1000 * 10);
this.timers.push(timer3); this.timers.push(timer3);
// 右下超限列表 // 右下超限列表
// todo
this.getOverData(); this.getOverData();
let timer4 = setInterval(() => { let timer4 = setInterval(() => {
this.getOverData(); this.getOverData();
...@@ -268,7 +270,6 @@ export default { ...@@ -268,7 +270,6 @@ export default {
"globalId": row.globalId, //车辆ID "globalId": row.globalId, //车辆ID
"overType": row.type, //超限类型 "overType": row.type, //超限类型
'urls': row.videoUrls, 'urls': row.videoUrls,
// 'urls': ['video/1.mp4','video/1.mp4'],
} }
if (row.type == '105') { if (row.type == '105') {
wsSend.vehicleHeight = row.length wsSend.vehicleHeight = row.length
......
...@@ -356,31 +356,27 @@ export default { ...@@ -356,31 +356,27 @@ export default {
callback: this.callCar, callback: this.callCar,
}); });
socket.ws.onopen = () => { socket.ws.onopen = () => {
if (this.backToRealTimer) { if (this.backToRealTimer) {
clearTimeout(this.backToRealTimer) clearTimeout(this.backToRealTimer)
this.backToRealTimer = null this.backToRealTimer = null
} }
this.backToRealTimer = setTimeout(() => { this.$nextTick(() => {
// vehiclePopups[`popup${id}`]?.remove(); this.backToRealTimer = setTimeout(() => {
// delete vehiclePopups[`popup${id}`]; this.closeWs('callCar1').then(() => {
// delete this.highLightCarTracks[id] this.removeVehiclePopup()
// delete this.overCarsPoints[id] this.overCarsPoints = {}
// popupVises[`popup${id}`] = false; this.highLightCarTracks = {}
this.closeWs('callCar1').then(() => { this.openRealTime()
this.removeVehiclePopup() })
this.overCarsPoints = {} this.backToRealTimer = null
this.highLightCarTracks = {} }, 1000 * 20)
this.openRealTime() })
})
this.backToRealTimer = null
}, 1000 * 20)
if (socket.ws.readyState === 1) { if (socket.ws.readyState === 1) {
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)
socket.ws.send(msg); socket.ws.send(msg);
// socket.ws.send('{"dataType":"OVER_RUN","timeStamp":"2024-09-13 16:44:30.000","endTime":"2024-09-13 16:44:40.000","globalId":"10552117","vehicleHeight":6,"vehicleWidth":2.55,"overType":1}') // socket.ws.send('{"dataType":"OVER_RUN","timeStamp":"2024-09-26 14:36:25:316","endTime":"2024-09-26 14:36:35:316","globalId":"10551050","vehicleHeight":6,"vehicleWidth":2.55,"overType":1}')
} }
}; };
}, },
...@@ -722,27 +718,27 @@ export default { ...@@ -722,27 +718,27 @@ export default {
}, },
switchfirst() { switchfirst() {
lastFrameTime = new Date().getTime(); lastFrameTime = new Date().getTime();
trackTimer = setInterval(() => { // trackTimer = setInterval(() => {
let currentTime = new Date().getTime(); // let currentTime = new Date().getTime();
if (currentTime - lastFrameTime > 60 * 1000) { // if (currentTime - lastFrameTime > 60 * 1000) {
if (!noTrackMsg) { // if (!noTrackMsg) {
noTrackMsg = ELEMENT.Message({ // noTrackMsg = ELEMENT.Message({
duration: 0, // duration: 0,
message: "暂无轨迹数据...", // message: "暂无轨迹数据...",
customClass: "noTrackMessageDialog", // customClass: "noTrackMessageDialog",
}); // });
window.tb?.clear(null, true); // window.tb?.clear(null, true);
window.tb?.update(); // window.tb?.update();
this.lastLocation = []; // this.lastLocation = [];
this.removeLayers("vehiclePic,vehicle,vehicleSelectWave"); // this.removeLayers("vehiclePic,vehicle,vehicleSelectWave");
} // }
} else { // } else {
if (noTrackMsg) { // if (noTrackMsg) {
noTrackMsg.close(); // noTrackMsg.close();
noTrackMsg = null; // noTrackMsg = null;
} // }
} // }
}, 100); // }, 100);
let arr = this.$store.state.dicts.CrossInfo.map(item => { let arr = this.$store.state.dicts.CrossInfo.map(item => {
[item.longitude, item.latitude] = item.location.split(",") [item.longitude, item.latitude] = item.location.split(",")
return item return item
...@@ -1067,15 +1063,12 @@ export default { ...@@ -1067,15 +1063,12 @@ export default {
} }
// 筛选可见区域 // 筛选可见区域
for (let i = 0; i < msg.length; i++) { for (let i = 0; i < msg.length; i++) {
// todo
if (!this.showHisVid) msg[i].overRun = null
// 缺失车牌号字段和非机动车类型 把车牌号字段置空 // 缺失车牌号字段和非机动车类型 把车牌号字段置空
if (!msg[i].picLicense || dict.noVehicleTypes.includes(msg[i].originalType)) { if (!msg[i].picLicense || dict.noVehicleTypes.includes(msg[i].originalType)) {
msg[i].picLicense = ""; msg[i].picLicense = "";
} }
// if (msg[i].id.toString().includes('120') && new Date().getMinutes() % 2 === 0) {
// msg[i].overRun = {
// overType: '1,2',
// }
// }
let pt = turf.point([msg[i].longitude, msg[i].latitude]); let pt = turf.point([msg[i].longitude, msg[i].latitude]);
let poly = turf.polygon(this.bounds); let poly = turf.polygon(this.bounds);
if (!turf.booleanPointInPolygon(pt, poly)) { if (!turf.booleanPointInPolygon(pt, poly)) {
...@@ -1084,12 +1077,10 @@ export default { ...@@ -1084,12 +1077,10 @@ export default {
} }
} }
if (msg.length > 0) { if (msg.length > 0) {
// console.log("车辆总数", msg.length);
// 第一帧 || 时间戳不相同 => 放行 // 第一帧 || 时间戳不相同 => 放行
if (msg.length === 1) { if (msg.length === 1) {
console.log('msg', msg); // console.log('msg', msg);
} }
// if (this.lastLocation.length === 0) {
this.situationTimeVal = msg[0].dateTime; this.situationTimeVal = msg[0].dateTime;
// zoom 大于 18 : 移除圆点和图片图层 // zoom 大于 18 : 移除圆点和图片图层
if (zoom >= 18) { if (zoom >= 18) {
...@@ -1159,11 +1150,13 @@ export default { ...@@ -1159,11 +1150,13 @@ export default {
} }
} else { } else {
delete this.overCarsPoints[item.id] delete this.overCarsPoints[item.id]
delete this.highLightCarTracks[item.id]
vehiclePopups[`popup${item.id}`]?.remove(); vehiclePopups[`popup${item.id}`]?.remove();
} }
} else { } else {
if (this.overCarsPoints[item.id]) { if (this.overCarsPoints[item.id]) {
delete this.overCarsPoints[item.id] delete this.overCarsPoints[item.id]
delete this.highLightCarTracks[item.id]
vehiclePopups[`popup${item.id}`]?.remove(); vehiclePopups[`popup${item.id}`]?.remove();
} }
} }
......
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