| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | }, |
| | | //消息匹配 |
| | | setMsgMatching(result) { |
| | | console.log("message", result) |
| | | var param = result.message; |
| | | var rest = mapData.msgMach.rest; |
| | | var rom = mapData.msgMach.lineRoam; |
| | |
| | | |
| | | // 地图复位 |
| | | if (valRest.length > 0) { |
| | | |
| | | vueEvents.$emit("queryData", false); |
| | | rpc.setClearAllMsg(); |
| | | rpc.setMapRest(); |
| | | return |
| | |
| | | } |
| | | }) |
| | | if (valRom.length > 0) { |
| | | |
| | | vueEvents.$emit("queryData", false); |
| | | rpc.setClearAllMsg(); |
| | | rpc.setLineRoaming() |
| | | return |