Ver código fonte

云图页面警报刷新

wang_xy 2 anos atrás
pai
commit
3863afe90d
1 arquivos alterados com 23 adições e 1 exclusões
  1. 23 1
      src/views/forest.vue

+ 23 - 1
src/views/forest.vue

@@ -381,8 +381,9 @@
         </div>
 
       </div>
-      <vBottomMenu ref="bottomMenu"></vBottomMenu>
+      <vBottomMenu ref="bottomMenu" @stopAudio="stopAudio" ></vBottomMenu>
     </div>
+    <audio id="resource" ref="up" :src="audioSrc" controls style="display: none;"></audio>
     <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="calendarDay" @getEventList="getEventList"
                         @getTodayEvents="getTodayEvents" @getFirespread="getFirespread"></eventdetailsdialog>
 
@@ -466,9 +467,22 @@ export default {
     // this.initWebSocket()
     /** ----------------------------------weosocket结束------------------------------------- */
     this.selectTaskList()//获取任务
+    setInterval(() => {
+      if(this.calendarDay == this.getCurrentDataStr()){
+        this.getTodayEvents(this.getCurrentDataStr(),true);
+        this.getDeptEventCount(this.getCurrentDataStr(),true);
+        this.getEventList(this.getCurrentDataStr(),true);
+        this.getEventByEventType(this.getCurrentDataStr(),true);
+        this.getEventByReportorOrder(this.getCurrentDataStr(),true);
+        this.getExposureStage(this.getCurrentDataStr(),true);
+      }
+    }, 10000)
+
   },
   data() {
     return {
+      //警报MP3文件
+      audioSrc:require('@/assets/jingbao.mp3'),
       calendarDay: this.getCurrentDataStr(),
       //基本情况
       forestInfo: '', //基本情况
@@ -915,6 +929,10 @@ export default {
         this.eventListAll = res.data
         that.markersList = []
         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();
+          }
           for (let i = 0; i < this.eventList.length; i++) {
             let markersMap = {
               lng: 124.59,
@@ -1001,6 +1019,10 @@ export default {
         }
       })
     },
+    stopAudio(){
+      this.$refs.up.pause();//停止播放音乐
+      this.$refs.up.currentTime = 0;
+    },
     getEventByEventType(day) {
       let that = this
       //右侧获取事件分类