<!-- * @Description: 布局 * @Author: 王晓颖 * @Date: 2020-09-01 10:34:35 --> <template> <div class="outer" > <!--<vue-scroll :ops="ops" ref="vsMain">--> <div ref="container" class="container"> <!--头--> <header1 ref="header"/> <!--内容--> <div class="body"> <!--地图图层--> <div class="map-body"> <div class="middle"> <map2-d/> </div> </div> <!--图表图层--> <city-manage-left/> <city-manage-right/> </div> </div> <!--</vue-scroll>--> </div> </template> <script> import Header1 from '../header/header1' import GLMap from '@/views/mapViews/GlMap' import Map2D from '@/views/mapViews/Map2D' import CityManageLeft from '@/views/cityManage/cityManageLeft' import CityManageRight from '../cityManage/cityManageRight' export default { name: 'layout2', components: {CityManageRight, CityManageLeft, Map2D, GLMap, Header1}, data () { return { ops: { bar: { showDelay: 1000, // 当不做任何操作时滚动条自动消失的时间 keepShow: false, // 是否保持显示 background: '#cecece', // 滚动条颜色 opacity: 0.5, // 滚动条透明度 size: '.06rem', 'z-index': 21, onlyShowBarOnScroll: false /** 是否只在滚动的时候现实滚动条 */ } }, size: { width: '100%', height: '100%' } } }, mounted () { const that = this window.onload = () => { that.calSize() } window.onresize = () => { that.calSize() } }, methods: { calSize () { const height = document.body.clientHeight const width = Math.ceil(height * 7.111111111111111) this.size.height = height + 'px' this.size.width = width + 'px' console.log('calSize:' + this.height + ',' + this.width) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .outer{ /*height:100%;*/ /*width:100%;*/ /*width:711.11111vh;*/ /*width:355.55555vh;*/ height: 1080px; width:7680px; /*width:533.3333vh;*/ /*height:100vh;*/ top:0px !important; background-color: black; .container{ height: 1080px; width:7680px; /*width:711.11111vh;*/ /*width:355.55555vh;*/ /*width:533.3333vh;*/ /*height:100vh;*/ top:0px !important; background: url("../../assets/images/background.jpg") no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; background-color: black; } .body{ position:relative; height:calc(100% - 0.46rem); width:100%; } .map-body{ width: 100%; height:100%; position: absolute; z-index: 1; display: flex; justify-content: center; top: 0; .middle{ width:40%; height:98%; display: flex; justify-content: center; margin-left: 0.2rem; margin-right: 0.2rem; div{ flex: 1; } } } /*.chart-body{*/ /*width: 100%;*/ /*height:100%;*/ /*position: absolute;*/ /*}*/ } </style>