北京经济技术开发区经开区虚拟城市项目-【前端】--政府服务中心-2号屏Web
surprise
2023-10-12 18d47efa0853d4435477b6d60842c715d89bccb9
代码更新
已修改4个文件
59 ■■■■■ 文件已修改
src/assets/js/mapMsg.js 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/rpc.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/map/viewer.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/mapData.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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{
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);
            }
        }
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%;
static/mapData.js
@@ -96,7 +96,7 @@
        lineRoam: ['漫游', '导航'],
        closeRoam: ['停止漫游', '停止导航'],
        localPage: ['一', '二', '三', '四', '五', '六'],
        acceptMsg:['定位','奔驰','京东','小米','博大大厦','第','办事流程','园','信息技术','生物医药','机器人','汽车',]
        acceptMsg:['定位','奔驰','京东','小米','博大大厦','博大','第','办事流程','园','信息技术','生物医药','机器人','汽车',]
    }
};
export default mapData;