北京经济技术开发区经开区虚拟城市项目-【前端】--政府服务中心-2号屏Web
surprise
2023-10-12 18d47efa0853d4435477b6d60842c715d89bccb9
src/assets/js/mapMsg.js
@@ -16,13 +16,22 @@
    init() {
        var that = this;
        window.addEventListener("message", res => {
            if (res.data.status === "ok") {
                that.setMsgMatching(res.data.params);
            }
        });
    },
    clearTime(){
            if (this.setTimeInterval) {
                 clearInterval(this.setTimeInterval);
                this.setTimeInterval = null;
            }
            if (res.data.status === "ok") {
                that.setMsgMatching(res.data.params);
       this.setTime();
    },
    setTime(){
        if(this.setTimeInterval){
            clearInterval(this.setTimeInterval);
            this.setTimeInterval = null;
            }
            this.setTimeInterval = setTimeout((res) => {
                vueEvents.$emit("queryData", false);
@@ -31,8 +40,6 @@
                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,6 +93,7 @@
            }
        })
        if (accept.length > 0) {
            this.clearTime();
            rpc.getFuzzyQuery(result)
        }