suerprisePlus
2024-08-14 d4a3ca549f8755c2f87442c27217c3be39cab5cc
src/views/visual/mapView/index.vue
@@ -45,6 +45,7 @@
            <dataStatistics ref="dataStatistics"></dataStatistics>
            <!-- 属性信息 -->
            <attributeInfo ref="attributeInfo"></attributeInfo>
            <map-info :childObj="childObj" ref="mapInfo"></map-info>
        </div>
    </div>
</template>
@@ -65,31 +66,58 @@
import dataAnalysis from './dataAnalysis.vue';
import dataStatistics from './dataStatistics.vue'
import attributeInfo from './attributeInfo.vue';
import mapInfo from './mapInfo.vue';
export default {
    name: 'mapView',
    components: { layerManager, location, knowledge, lineRoaming, undergroundMode, dataAnalysis, dataStatistics, attributeInfo },
    components: { layerManager, location, knowledge, lineRoaming, undergroundMode, dataAnalysis, dataStatistics, attributeInfo, mapInfo },
    data() {
        return {
            menuIsShow: false,
            menuOption: [],
            childMenuIsShow: true,
            childMenuOption: [],
            childObj: [],
        };
    },
    mounted() {
        this.mapViewStart();
        this.$busEvent.$on('CHANGE_MAPINFO', res => {
            this.setMapInfo(res)
        });
    },
    beforeDestroy() {
        this.$store.dispatch('mapLayers/changeLayerTree', [])
        this.$store.dispatch('mapLayers/changeDefaultLayer', [])
    },
    methods: {
        setMapInfo(res) {
            // console.log(res);
            if (res.length > 0) {
                this.childObj = res;
                setTimeout(() => {
                    this.$refs && this.$refs.mapInfo && this.$refs.mapInfo.open();
                }, 200);
            }
        },
        mapViewStart() {
            this.menuOption = mapData.menuData;
            this.$nextTick(() => {
                mapInit.Init();
                setTimeout(() => {
                  if(config.baseModel.url){
                    mapServer.addLayer(config.baseModel);
                  }
                this.getSelectLayers();
                }, 500);
            });
        },
        getSelectLayers() {
@@ -196,7 +224,7 @@
        .rightMenu {
            width: 30px;
            height: 40px;
            background: rgba(245, 245, 245, 1);
            background: rgba(255, 255, 255, 1);
            border: 1px solid rgb(245, 245, 245);
            color: #4ab1fc;
            display: flex;