From f99c96adfe3ec59712cdadf88d54416c7742cc21 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期日, 08 十月 2023 11:15:11 +0800 Subject: [PATCH] 代码更新 --- src/assets/js/mapMsg.js | 51 ++++++++++++++++++++++++++------------------------- 1 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/assets/js/mapMsg.js b/src/assets/js/mapMsg.js index 98eb4eb..8430e25 100644 --- a/src/assets/js/mapMsg.js +++ b/src/assets/js/mapMsg.js @@ -1,15 +1,17 @@ import mapData from "../../../static/mapData"; import rpc from "./rpc"; -import vueEvents from '@/utils/vueEvent.js' +import vueEvents from "@/utils/vueEvent.js"; window.mapMsg = { setTimeInterval: null, testMsg(res) { this.setMsgMatching({ message: res, baidu_keys: { - results: [{ - word: res - }] + results: [ + { + word: res + } + ] } }); }, @@ -19,67 +21,66 @@ if (this.setTimeInterval) { clearInterval(this.setTimeInterval); this.setTimeInterval = null; - } if (res.data.status === "ok") { that.setMsgMatching(res.data.params); } - this.setTimeInterval = setTimeout((res) => { + this.setTimeInterval = setTimeout(res => { vueEvents.$emit("queryData", false); rpc.setClearAllMsg(); - rpc.setLineRoaming() + rpc.setLineRoaming(); clearInterval(this.setTimeInterval); this.setTimeInterval = null; - }, 70000) - + }, 70000); }); + + }, + //娑堟伅鍖归厤 setMsgMatching(result) { var param = result.message; var rest = mapData.msgMach.rest; var rom = mapData.msgMach.lineRoam; var closeRomData = mapData.msgMach.closeRoam; - var valRest = rest.filter((rs) => { + var valRest = rest.filter(rs => { if (param.indexOf(rs) > -1) { return rs; } - }) + }); // 鍦板浘澶嶄綅 if (valRest.length > 0) { - vueEvents.$emit("queryData", false); rpc.setClearAllMsg(); rpc.setMapRest(); - return + return; } //婕父 - var valRom = rom.filter((rs) => { + var valRom = rom.filter(rs => { if (param.indexOf(rs) > -1) { return rs; } - }) + }); if (valRom.length > 0) { - vueEvents.$emit("queryData", false); rpc.setClearAllMsg(); - rpc.setLineRoaming() - return + rpc.setLineRoaming(); + return; } // 鍋滄婕父 - var closeRom = closeRomData.filter((rs) => { + var closeRom = closeRomData.filter(rs => { if (param.indexOf(rs) > -1) { - return rs + return rs; } }); if (closeRom.length > 0) { rpc.setCloseLineRomaing(); - return + return; } - rpc.getFuzzyQuery(result) - - }, + rpc.getFuzzyQuery(result); + } }; -export default mapMsg \ No newline at end of file +export default mapMsg; + -- Gitblit v1.9.3