This commit is contained in:
		
							parent
							
								
									68aacde426
								
							
						
					
					
						commit
						534baec75d
					
				| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					                      });
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                  }
 | 
					                  }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              });
 | 
					              });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue