shuishen
2023-03-17 fa1c9a1bce019374ddd444341c6cca4b7cd9135f
地图显示更改--楼栋
2 files modified
40 ■■■■ changed files
src/components/map/index.vue 22 ●●●● patch | view | raw | blame | history
src/views/house/index.vue 18 ●●●● patch | view | raw | blame | history
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-03-16 16:54:09
 * @LastEditTime: 2023-03-17 08:55:29
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -75,6 +75,8 @@
<script>
let tile3DUrl = ''
let floorEntitysLayers = null
let flootEntitysEntites = null
if (process.env.NODE_ENV == 'development') {
    // 开发
@@ -156,7 +158,6 @@
    sdTilesetLayer: null
}
let flootEntitysEntites = null
const ysLabels = [
    'EPSG:4490_test:0',
@@ -347,9 +348,7 @@
            })
            // 原生Cesium加载多边体
            let floorEntitysLayers = new global.DC.Namespace.Cesium.CustomDataSource("floorEntitysLayers")
            global.viewer.dataSources.add(floorEntitysLayers)
            flootEntitysEntites = floorEntitysLayers.entities
            // let floorPositions = positions.reduce((prev, curr, index, arr) => {
            //     curr.forEach(item => {
@@ -504,8 +503,8 @@
            that.flytoLayer(params.polygonName, params.duration)
        })
        this.$EventBus.$on('showHouse3D', (params) => {
            that.showHouse3D(params.positions, params.minHeight, params.maxHeight)
        this.$EventBus.$on('showThreeDimensions', (params) => {
            that.showThreeDimensions(params.positions, params.minHeight, params.maxHeight)
        })
        this.$EventBus.$on('clearHouse3D', () => {
@@ -1002,9 +1001,12 @@
        * @param {*} positions 建筑范围坐标
        * @param {*} 
        */
        showHouse3D (positions, minHeight, maxHeight) {
            console.log('showHouse3D被调用!',positions,111);
            if(flootEntitysEntites!=null){
        showThreeDimensions (positions, minHeight, maxHeight) {
            if (flootEntitysEntites == null) {
                floorEntitysLayers = new global.DC.Namespace.Cesium.CustomDataSource("floorEntitysLayers")
                global.viewer.dataSources.add(floorEntitysLayers)
                flootEntitysEntites = floorEntitysLayers.entities
            } else {
                flootEntitysEntites.removeAll()
            }
            let housePositions = JSON.parse(positions).coordinates[0]
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-03-09 17:24:03
 * @LastEditTime: 2023-03-17 10:07:45
 * @FilePath: \srs-police-affairs\src\views\house\index.vue
 * @Description: 小区-栋-层-房屋
 * 
@@ -827,16 +827,16 @@
        // 楼栋单元楼层户室查询
        getHouses (build_id, adcode, aoiArr) {
            getHouses(build_id, adcode).then(res => {
                console.log('getHouses',res);
                let maxHeight = 3 * (res.data.data.properties.cjgga.features.length + 1)
                let maxHeight = res.data.data.properties.hwtxa.features[0].properties.mbfdr - res.data.data.properties.hwtxa.features[0].properties.yjpca
                let houseData = res.data.data.properties
                curHousingName = res.data.data.properties.ckgkt
                this.floorChoosed = []
                this.$nextTick(() => {
                    this.$EventBus.$emit('showHouse3D', { positions: houseData.kmj3a, minHeight: 0, maxHeight: maxHeight })
                })
                this.$EventBus.$emit('showThreeDimensions', { positions: houseData.kmj3a, minHeight: 0, maxHeight: maxHeight })
                if (res.data != null && houseData.nwwqd.features != []) {
                    let unitData = houseData.nwwqd.features
@@ -919,7 +919,7 @@
            this.getVillagePersonInfo(params.properties.snxmi)
            this.residentDetailsTitle = `${curHousingName}${this.unitOptions.filter(item => item.value == this.unitValue)[0].label}${params.properties.fojcu}住户信息`
            this.residentDetailsShow = true
            console.log('residentDetailsClick-params',params);
            console.log('residentDetailsClick-params', params)
            this.$EventBus.$emit('showHouse3D', { positions: params.properties.kmj3a, minHeight: params.properties.szhfr, maxHeight: params.properties.szhfr + params.properties.hnagn })
        },
@@ -928,7 +928,7 @@
        },
        buildingClick (item, aoiArr) {
            console.log('buildingClick-start',111);
            console.log('buildingClick-start', 111)
            this.unitHouseChoosed = []
            this.pictLoading = true
            if (!aoiArr) {
@@ -948,7 +948,7 @@
            this.choosedBuildId = item.build_id
            this.getVillagePersonStatisticInfoByBuildId(item.build_id)
            this.getHouses(item.build_id, '361102', aoiArr)
            console.log('buildingClick-end');
            console.log('buildingClick-end')
            this.floorsType = 1
            document.querySelector(".floor-num").style.left = '0px'
            this.lastFloorShow = false