From 18d47efa0853d4435477b6d60842c715d89bccb9 Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期四, 12 十月 2023 23:48:20 +0800
Subject: [PATCH] 代码更新

---
 src/assets/js/rpc.js          |   12 ++++++++++--
 static/mapData.js             |    2 +-
 src/components/map/viewer.vue |    4 +++-
 src/assets/js/mapMsg.js       |   41 +++++++++++++++++++++++++----------------
 4 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/src/assets/js/mapMsg.js b/src/assets/js/mapMsg.js
index c71bcf1..cd523b1 100644
--- a/src/assets/js/mapMsg.js
+++ b/src/assets/js/mapMsg.js
@@ -16,23 +16,30 @@
     init() {
         var that = this;
         window.addEventListener("message", res => {
-            if (this.setTimeInterval) {
-                 clearInterval(this.setTimeInterval);
-                this.setTimeInterval = null;
-
-            }
             if (res.data.status === "ok") {
                 that.setMsgMatching(res.data.params);
             }
-            this.setTimeInterval = setTimeout((res) => {
-                vueEvents.$emit("queryData", false);
-                rpc.setClearAllMsg();
-                rpc.setLineRoaming()
-                clearInterval(this.setTimeInterval);
-                this.setTimeInterval = null;
-            }, 90000)
-
         });
+    },
+    clearTime(){
+        if (this.setTimeInterval) {
+            clearInterval(this.setTimeInterval);
+           this.setTimeInterval = null;
+       }
+       this.setTime();
+    },
+    setTime(){
+        if(this.setTimeInterval){
+            clearInterval(this.setTimeInterval);
+            this.setTimeInterval = null;
+        }
+        this.setTimeInterval = setTimeout((res) => {
+            vueEvents.$emit("queryData", false);
+            rpc.setClearAllMsg();
+            rpc.setLineRoaming()
+            clearInterval(this.setTimeInterval);
+            this.setTimeInterval = null;
+        }, 90000)
     },
     //娑堟伅鍖归厤
     setMsgMatching(result) {
@@ -41,7 +48,6 @@
         var rom = mapData.msgMach.lineRoam;
         var closeRomData = mapData.msgMach.closeRoam;
         var acceptData =mapData.msgMach.acceptMsg;
-        console.log(result)
         var valRest = rest.filter((rs) => {
             if (param.indexOf(rs) > -1) {
                 return rs;
@@ -50,7 +56,7 @@
 
         // 鍦板浘澶嶄綅
         if (valRest.length > 0) {
-
+            this.clearTime();
             vueEvents.$emit("queryData", false);
             rpc.setClearAllMsg();
             rpc.setMapRest();
@@ -65,6 +71,7 @@
         if (valRom.length > 0) {
 
             vueEvents.$emit("queryData", false);
+            this.clearTime();
             rpc.setClearAllMsg();
             rpc.setLineRoaming()
             return
@@ -76,6 +83,7 @@
             }
         });
         if (closeRom.length > 0) {
+            this.clearTime();
             rpc.setCloseLineRomaing();
             return
         }
@@ -85,8 +93,9 @@
             }
         })
         if (accept.length > 0) {
+            this.clearTime();
             rpc.getFuzzyQuery(result)
-        }
+        } 
         
         
         // else{
diff --git a/src/assets/js/rpc.js b/src/assets/js/rpc.js
index 337ca94..19864a9 100644
--- a/src/assets/js/rpc.js
+++ b/src/assets/js/rpc.js
@@ -92,10 +92,11 @@
 
             this.dataQuery = [];
             this.objArr = [];
-            this.pointrange = 2000;
+            this.pointrange = 6000;
             for (var i = 0; i < length; i++) {
                 var world = keyWorld[i].word;
-                if (world.indexOf('濂旈┌') > -1) {
+                if(world == '濂旈┌')return
+                if (world.indexOf('濂旈┌鍏徃') > -1) {
                     world = '濂旈┌';
                     this.pointrange = 12000
                 } else if (world.indexOf('浜笢') > -1) {
@@ -112,7 +113,14 @@
                     world = '鏈哄櫒浜�'
                 } else if (world.indexOf('姹借溅') > -1) {
                     world = '姹借溅'
+                }else if (world.indexOf('鍥�') > -1) {
+                   
+                }else if (world.indexOf('鍗氬ぇ') > -1 && world.indexOf('鍗氬ぇ澶у帵') == -1){
+                    world = '鍗氬ぇ'
+                } else{
+                    continue
                 }
+            
                 this.setFuzzyQueryData(world, i, length - 1);
             }
         }
diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue
index c000538..cc2a42a 100644
--- a/src/components/map/viewer.vue
+++ b/src/components/map/viewer.vue
@@ -144,7 +144,7 @@
       window.Viewer.scene.screenSpaceCameraController.minimumZoomDistance = 500
       mapMsg.init();
       rpc.clickToCoordinates();
-
+      mapMsg.setTime();
       //鏍囦細缂栬緫
       sgworld.Creator.SimpleGraphic.setEdit(true, {
         editProp: true,
@@ -354,12 +354,14 @@
   border-radius: 10px;
   cursor: pointer;
 }
+
 .bgbox {
   position: absolute;
   top: 0;
   left: 8px;
   z-index: -1;
 }
+
 .mid {
   position: absolute;
   top: 50%;
diff --git a/static/mapData.js b/static/mapData.js
index 4e0e31a..0293b8c 100644
--- a/static/mapData.js
+++ b/static/mapData.js
@@ -96,7 +96,7 @@
         lineRoam: ['婕父', '瀵艰埅'],
         closeRoam: ['鍋滄婕父', '鍋滄瀵艰埅'],
         localPage: ['涓�', '浜�', '涓�', '鍥�', '浜�', '鍏�'],
-        acceptMsg:['瀹氫綅','濂旈┌','浜笢','灏忕背','鍗氬ぇ澶у帵','绗�','鍔炰簨娴佺▼','鍥�','淇℃伅鎶�鏈�','鐢熺墿鍖昏嵂','鏈哄櫒浜�','姹借溅',]
+        acceptMsg:['瀹氫綅','濂旈┌','浜笢','灏忕背','鍗氬ぇ澶у帵','鍗氬ぇ','绗�','鍔炰簨娴佺▼','鍥�','淇℃伅鎶�鏈�','鐢熺墿鍖昏嵂','鏈哄櫒浜�','姹借溅',]
     }
 };
 export default mapData;

--
Gitblit v1.9.3