This commit is contained in:
zengmingjie 2025-06-26 23:25:40 +08:00
parent 68aacde426
commit 534baec75d
2 changed files with 37 additions and 29 deletions

View File

@ -347,39 +347,45 @@ export default {
const match = newVal.some((item) => positionID.includes(item.id)); const match = newVal.some((item) => positionID.includes(item.id));
if (match) { if (match) {
newVal.forEach((newItem) => { newVal.forEach((newItem) => {
// BatchId if (newItem.drone_lon !== 0 && newItem.drone_lat !== 0) {
if (newItem.BatchId) { // BatchId
const existingTimer = this.droneTimers.get(newItem.BatchId); if (newItem.BatchId) {
if (existingTimer) { const existingTimer = this.droneTimers.get(newItem.BatchId);
clearInterval(existingTimer); // if (existingTimer) {
} clearInterval(existingTimer); //
}
// 15 // 15
newItem.currTime = window.mapConfig.currTime; newItem.currTime = window.mapConfig.currTime;
// //
const timer = this.startTimer(newItem); const timer = this.startTimer(newItem);
this.droneTimers.set(newItem.BatchId, timer); this.droneTimers.set(newItem.BatchId, timer);
// detailsShow // detailsShow
if (!(newItem.BatchId in this.droneStates)) { if (!(newItem.BatchId in this.droneStates)) {
this.$set(this.droneStates, newItem.BatchId, true); this.$set(this.droneStates, newItem.BatchId, true);
} }
// navigation-content // navigation-content
if (!(newItem.BatchId in this.navigationStates)) { if (!(newItem.BatchId in this.navigationStates)) {
this.$set(this.navigationStates, newItem.BatchId, false); this.$set(this.navigationStates, newItem.BatchId, false);
} }
// //
const existingIndex = this.drones.findIndex( const existingIndex = this.drones.findIndex(
(d) => d.BatchId === newItem.BatchId (d) => d.BatchId === newItem.BatchId
); );
newItem.times = moment(newItem.CreateTime).format("HH:mm:ss"); newItem.times = moment(newItem.CreateTime).format(
newItem.distance = parseInt(newItem.distance.toFixed(0)); "HH:mm:ss"
);
newItem.distance = parseInt(newItem.distance.toFixed(0));
if (existingIndex !== -1) { if (existingIndex !== -1) {
this.$set(this.drones, existingIndex, { ...newItem }); this.$set(this.drones, existingIndex, { ...newItem });
} else { } else {
this.$set(this.drones, this.drones.length, { ...newItem }); this.$set(this.drones, this.drones.length, {
...newItem
});
}
} }
} }
}); });

View File

@ -82,6 +82,8 @@ export default {
zoom: 13 zoom: 13
}); });
this.$store.commit("SET_POSITIONPOINT", false); this.$store.commit("SET_POSITIONPOINT", false);
} else {
this.$message.error("定位失败,请稍后重试");
} }
}, },
deep: true deep: true