From 5c70cfe1f51eab3091b49cf1d3590b98693f5fd5 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期日, 08 十月 2023 17:59:11 +0800
Subject: [PATCH] 代码更新

---
 src/assets/js/mapMsg.js |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/assets/js/mapMsg.js b/src/assets/js/mapMsg.js
index d5015b3..b8e2beb 100644
--- a/src/assets/js/mapMsg.js
+++ b/src/assets/js/mapMsg.js
@@ -1,6 +1,6 @@
 import mapData from "../../../static/mapData";
-import { yzAdapter_Navigation } from "../../api/api";
 import rpc from "./rpc";
+import vueEvents from '@/utils/vueEvent.js'
 window.mapMsg = {
     setTimeInterval: null,
     testMsg(res) {
@@ -16,27 +16,26 @@
     init() {
         var that = this;
         window.addEventListener("message", res => {
-            console.log('message', res)
+            if (this.setTimeInterval) {
+                clearInterval(this.setTimeInterval);
+                this.setTimeInterval = null;
+
+            }
             if (res.data.status === "ok") {
-                if (this.setTimeInterval) {
-                    clearInterval(this.setTimeInterval);
-                    this.setTimeInterval = null;
-                    //
-                }
                 that.setMsgMatching(res.data.params);
             }
             this.setTimeInterval = setTimeout((res) => {
+                vueEvents.$emit("queryData", false);
                 rpc.setClearAllMsg();
                 rpc.setLineRoaming()
                 clearInterval(this.setTimeInterval);
                 this.setTimeInterval = null;
-            }, 70000)
+            }, 90000)
 
         });
     },
     //娑堟伅鍖归厤
     setMsgMatching(result) {
-        console.log("message", result)
         var param = result.message;
         var rest = mapData.msgMach.rest;
         var rom = mapData.msgMach.lineRoam;
@@ -49,6 +48,8 @@
 
         // 鍦板浘澶嶄綅
         if (valRest.length > 0) {
+
+            vueEvents.$emit("queryData", false);
             rpc.setClearAllMsg();
             rpc.setMapRest();
             return
@@ -60,6 +61,8 @@
             }
         })
         if (valRom.length > 0) {
+
+            vueEvents.$emit("queryData", false);
             rpc.setClearAllMsg();
             rpc.setLineRoaming()
             return

--
Gitblit v1.9.3