Quellcode durchsuchen

确认事件响警铃

wang_xy vor 1 Jahr
Ursprung
Commit
d0cb5f3eb5
1 geänderte Dateien mit 12 neuen und 7 gelöschten Zeilen
  1. 12 7
      src/views/forest.vue

+ 12 - 7
src/views/forest.vue

@@ -1110,11 +1110,14 @@ export default {
           this.nextbutton=true
         }
         if (this.eventList != null && this.eventList.length > 0) {
-          if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
-            that.$refs.bottomMenu.updateAlert();
-            that.$refs.up.play();
-          } else {
-            that.$refs.bottomMenu.updateAlertFalse();
+          for (let i in this.eventList) {
+            if (this.eventList[i].eventStatusValue == 'forest_event_status_1'||this.eventList[i].eventStatusValue == 'forest_event_status_7') {
+              that.$refs.bottomMenu.updateAlert();
+              that.$refs.up.play();
+              break;
+            } else {
+              that.$refs.bottomMenu.updateAlertFalse();
+            }
           }
         }
       })
@@ -1306,9 +1309,11 @@ export default {
               if (this.eventList.length > 9)
                 this.eventList.splice(10, 1)
               // 将收到的数据在地图上添加
+            if (res.data.eventStatusValue == 'forest_event_status_1'||res.data.eventStatusValue == 'forest_event_status_7') {
+              that.$refs.bottomMenu.updateAlert();
+              that.$refs.up.play();
+            }
               this.getWebSocketEvent(res.data)
-            this.$refs.bottomMenu.updateAlert();
-            this.$refs.up.play();
             //}
           }
         })