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));
if (match) {
newVal.forEach((newItem) => {
// BatchId
if (newItem.BatchId) {
const existingTimer = this.droneTimers.get(newItem.BatchId);
if (existingTimer) {
clearInterval(existingTimer); //
}
if (newItem.drone_lon !== 0 && newItem.drone_lat !== 0) {
// BatchId
if (newItem.BatchId) {
const existingTimer = this.droneTimers.get(newItem.BatchId);
if (existingTimer) {
clearInterval(existingTimer); //
}
// 15
newItem.currTime = window.mapConfig.currTime;
//
const timer = this.startTimer(newItem);
this.droneTimers.set(newItem.BatchId, timer);
// 15
newItem.currTime = window.mapConfig.currTime;
//
const timer = this.startTimer(newItem);
this.droneTimers.set(newItem.BatchId, timer);
// detailsShow
if (!(newItem.BatchId in this.droneStates)) {
this.$set(this.droneStates, newItem.BatchId, true);
}
// navigation-content
if (!(newItem.BatchId in this.navigationStates)) {
this.$set(this.navigationStates, newItem.BatchId, false);
}
// detailsShow
if (!(newItem.BatchId in this.droneStates)) {
this.$set(this.droneStates, newItem.BatchId, true);
}
// navigation-content
if (!(newItem.BatchId in this.navigationStates)) {
this.$set(this.navigationStates, newItem.BatchId, false);
}
//
const existingIndex = this.drones.findIndex(
(d) => d.BatchId === newItem.BatchId
);
newItem.times = moment(newItem.CreateTime).format("HH:mm:ss");
newItem.distance = parseInt(newItem.distance.toFixed(0));
//
const existingIndex = this.drones.findIndex(
(d) => d.BatchId === newItem.BatchId
);
newItem.times = moment(newItem.CreateTime).format(
"HH:mm:ss"
);
newItem.distance = parseInt(newItem.distance.toFixed(0));
if (existingIndex !== -1) {
this.$set(this.drones, existingIndex, { ...newItem });
} else {
this.$set(this.drones, this.drones.length, { ...newItem });
if (existingIndex !== -1) {
this.$set(this.drones, existingIndex, { ...newItem });
} else {
this.$set(this.drones, this.drones.length, {
...newItem
});
}
}
}
});

View File

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