shuishen
2023-04-27 577beb1a767da2c4a77409a019da85ac0aa473bb
eventbus处理
7 files modified
76 ■■■■ changed files
src/components/map/components/yToolTip.vue 9 ●●●● patch | view | raw | blame | history
src/components/map/index.vue 39 ●●●● patch | view | raw | blame | history
src/views/activity/index.vue 4 ●●●● patch | view | raw | blame | history
src/views/home/index.vue 5 ●●●● patch | view | raw | blame | history
src/views/house/index.vue 7 ●●●● patch | view | raw | blame | history
src/views/policeInfor/index.vue 4 ●●● patch | view | raw | blame | history
src/views/video/list.vue 8 ●●●● patch | view | raw | blame | history
src/components/map/components/yToolTip.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-09 10:36:05
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-03-09 11:31:03
 * @LastEditTime: 2023-04-27 19:54:44
 * @FilePath: \srs-police-affairs\src\components\map\components\yToolTip.vue
 * @Description: 
 * 
@@ -62,7 +62,12 @@
                transform:translate3d(${Math.round(x)}px,${Math.round(y)}px, 0);
            `
        }
    }
    },
    destroyed () {
        this.$EventBus.$off('showTooltip')
        this.$EventBus.$off('closeTooltip')
    },
}
</script>
src/components/map/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 17:00:30
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-25 16:39:34
 * @LastEditTime: 2023-04-27 20:00:20
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -297,8 +297,7 @@
            // 地形数据添加
            that.addTerrain()
            // 外网
            // global.viewer.imageryLayers.addImageryProvider(
            // 外网 // global.viewer.imageryLayers.addImageryProvider(
            //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
            //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=d083e4cf30bfc438ef93436c10c2c20a',
            //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
@@ -307,6 +306,7 @@
            //         maximumLevel: 18
            //     })
            // )
            // 设置地图初始位置,角度等
            global.viewer.camera.setView({
@@ -872,7 +872,11 @@
                layersObjcect[layerName].addTo(global.viewer)
            } else if (type == 'ClusterLayer') {
                if (!layersObjcect[layerName]) layersObjcect[layerName] = null
                if (!layersObjcect[layerName]) {
                    this.mapRemoveLayer(layerName, type)
                    layersObjcect[layerName] = null
                }
                layersObjcect[layerName] = new global.DC.ClusterLayer(layerName, {
                    pixelRange: 40, style: ClusterLayerType
                })
@@ -1314,6 +1318,33 @@
                }
            })
        }
    },
    destroyed () {
        this.$EventBus.$off('mapAddLayer')
        this.$EventBus.$off('mapRemoveLayer')
        this.$EventBus.$off('mapRemovePolygonLayer')
        this.$EventBus.$off('mapRemovePolygon')
        this.$EventBus.$off('mapClearLayer')
        this.$EventBus.$off('layerPointAdd')
        this.$EventBus.$off('layerPolygonAdd')
        this.$EventBus.$off('layerPolylineAdd')
        this.$EventBus.$off('layerWallAdd')
        this.$EventBus.$off('rowLayerWallAdd')
        this.$EventBus.$off('getOverLayerID')
        this.$EventBus.$off('layerShow')
        this.$EventBus.$off('toPosition')
        this.$EventBus.$off('highOrLightChange')
        this.$EventBus.$off('addMxTileset')
        this.$EventBus.$off('closeMxTileset')
        this.$EventBus.$off('tilesetLayerFlag')
        this.$EventBus.$off('removeMxTileset')
        this.$EventBus.$off('flytoLayer')
        this.$EventBus.$off('showThreeDimensions')
        this.$EventBus.$off('switchThreeDimensions')
        this.$EventBus.$off('clearHouse3D')
        this.$EventBus.$off('registerMxClick')
        this.$EventBus.$off('unbindMxClick')
    }
}
</script>
src/views/activity/index.vue
@@ -1008,6 +1008,7 @@
    },
    beforeDestroy () {
        // 清除定时器
        this.cleartAllTimer()
    },
@@ -1058,6 +1059,9 @@
        this.$store.commit('SET_ACTIVITYPOLICEPOPUP', false)
        this.$parent.$parent.resize('0px')
        this.$EventBus.$off('activeDeletePolygon')
        this.$EventBus.$off('activeDeleteLineOrPoint')
    }
}
</script>
src/views/home/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-27 13:09:59
 * @LastEditTime: 2023-04-27 20:02:50
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 *
@@ -2064,6 +2064,9 @@
        document.querySelector('.over-look-btn').classList.remove('homebottom')
        document.querySelector('.image-switch-icon-btn').classList.remove('iconbottom')
        window.removeEventListener('resize', this.setDomStyle)
        this.$EventBus.$off('policeSituationSiteClick')
        this.$EventBus.$off('closeLoading')
    },
}
</script>
src/views/house/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-27 14:03:22
 * @LastEditTime: 2023-04-27 19:57:29
 * @FilePath: \srs-police-affairs\src\views\house\index.vue
 * @Description: 小区-栋-层-房屋
 * 
@@ -1816,6 +1816,11 @@
        },
    },
    beforeDestroy () {
        this.$EventBus.$off("housingPoliceSiteClick")
        this.$EventBus.$off("showHouseingTileset")
    },
    destroyed () {
        this.$EventBus.$emit('unbindMxClick', this.getAoiByPtStd)
src/views/policeInfor/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-17 14:39:26
 * @LastEditTime: 2023-04-27 20:03:16
 * @FilePath: \srs-police-affairs\src\views\policeInfor\index.vue
 * @Description: 辖区管理
 * 
@@ -823,6 +823,8 @@
        }
        this.$parent.$parent.resize('0px')
        this.$EventBus.$off('PoliceInforSiteClick')
    }
}
</script>
src/views/video/list.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-04-04 11:02:46
 * @LastEditTime: 2023-04-27 19:29:57
 * @FilePath: \srs-police-affairs\src\views\video\list.vue
 * @Description: 辖区管理
 * 
@@ -444,6 +444,7 @@
        },
        getRegionListAll ({ customType, positions }) {
            alert(1)
            let positionStr = ''
            const color = this.chooseRangeColor + ',' + this.choosePlotColorAlpha
@@ -526,8 +527,6 @@
                parentId = node.data.id
                sourceId = node.data.sourceId
            }
            console.log(node, 56)
            const status = node.label == "在线" ? { status: 1 } : node.label == "离线" ? { status: 0 } : {}
@@ -640,6 +639,7 @@
        // 获取设备列表
        getEquipmentAll (params, layerName) {
            alert(1)
            this.loading()
            this.$EventBus.$emit('mapClearLayer', {
@@ -651,7 +651,7 @@
            getEquipmentAll({ ...params, deptId: this.userInfo.dept_id }).then(res => {
                if (params.type == 1 && res.data.data) {
                    res.data.data.forEach(item => {
                    res.data.data.forEach((item, index) => {
                        if (item.longitude && item.latitude) {
                            this.$EventBus.$emit('layerPointAdd', {
                                layerName: 'treeValAllLayer',