소스 검색

websocket bug修复

王通 2 년 전
부모
커밋
64fd33b6ac
1개의 변경된 파일12개의 추가작업 그리고 10개의 파일을 삭제
  1. 12 10
      src/views/forest.vue

+ 12 - 10
src/views/forest.vue

@@ -502,7 +502,7 @@ import {getUserProfile} from "@/api/system/user";
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
     },
     mounted() {
-      
+
           // 初始化地图数据
           this.getSuperMapUrl();
       this.getBaseInfo()
@@ -616,7 +616,7 @@ import {getUserProfile} from "@/api/system/user";
     },
     /** ----------------------------------weosocket结束------------------------------------- */
     methods: {
-      
+
           //初始化地图数据
           getSuperMapUrl(){
             getUserProfile().then(response => {
@@ -1475,13 +1475,15 @@ import {getUserProfile} from "@/api/system/user";
             eventCode: data.eventCode
           }).then((res) => {
             if (res.data != undefined) {
-              //插入到第一条
-              this.eventList.unshift(res.data)
-              // 插入后删除最后一条 保证列表中为10条数据
-              if (this.eventList.length > 9)
-                this.eventList.splice(10, 1)
-              // 将收到的数据在地图上添加
-              this.getWebSocketEvent(res.data)
+              if (res.data.eventStatusValue !== "forest_event_status_1") {
+                //插入到第一条
+                this.eventList.unshift(res.data)
+                // 插入后删除最后一条 保证列表中为10条数据
+                if (this.eventList.length > 9)
+                  this.eventList.splice(10, 1)
+                // 将收到的数据在地图上添加
+                this.getWebSocketEvent(res.data)
+              }
             }
           })
         }
@@ -1718,4 +1720,4 @@ import {getUserProfile} from "@/api/system/user";
       background-color: #0f3655;
     }
   }
-</style>
+</style>