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,6 +347,7 @@ 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) => {
if (newItem.drone_lon !== 0 && newItem.drone_lat !== 0) {
// BatchId // BatchId
if (newItem.BatchId) { if (newItem.BatchId) {
const existingTimer = this.droneTimers.get(newItem.BatchId); const existingTimer = this.droneTimers.get(newItem.BatchId);
@ -373,13 +374,18 @@ export default {
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(
"HH:mm:ss"
);
newItem.distance = parseInt(newItem.distance.toFixed(0)); 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