Newer
Older
CloudBrainNew / src / views / layout / layout1.vue
StephanieGitHub on 4 Feb 2021 3 KB first commit
<!--
 * @Description: 四屏布局:地图,左,右
 * @Author: 王晓颖
 * @Date: 2020-09-01 10:34:35
 -->
<template>
  <div ref="container" class="container">
    <!--头-->
    <header1 ref="header"/>
    <!--内容-->
    <div ref="body" class="body">
      <!--地图图层-->
      <div class="map-body">
        <div class="middle">
          <!--<map2-d/>-->
          <JyMap2D/>
        </div>
      </div>
      <!--图表图层-->
      <!--<city-manage-left/>-->
      <transition mode="out-in">
        <component :is="statusLeft"/>
      </transition>
      <transition mode="out-in">
        <component :is="statusRight"/>
      </transition>
    </div>
  </div>
</template>

<script>
import Header1 from '../header/header1'
import JyMap2D from '../mapViews/JyMap2D'
import CityManageLeft from '@/views/cityManage/cityManageLeft2'
import CityManageRight from '../cityManage/cityManageRight2'
import SocialLivelihoodLeft from '../socialLive/socialLivelihoodLeft'
import SocialLivelihoodRight from '../socialLive/socialLivelihoodRight'
import CityConstructionLeft from '../cityConstruction/cityConstructionLeft'
import CityConstructionRight from '../cityConstruction/cityConstructionRight'
import WaitBoardLeft from '../waitBoard/waitBoardLeft'
import WaitBoardRight from '../waitBoard/waitBoardRight'
export default {
  name: 'layout1',
  components: {
    WaitBoardRight,
    WaitBoardLeft,
    JyMap2D,
    CityManageRight,
    CityManageLeft,
    SocialLivelihoodRight,
    SocialLivelihoodLeft,
    CityConstructionLeft,
    CityConstructionRight,
    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%'
      }
    }
  },
  computed: {
    statusLeft () {
      return this.$store.state.statusLeft
    },
    statusRight () {
      return this.$store.state.statusRight
    }
  },
  mounted () {
    const that = this
    window.onload = () => {
      that.calSize()
    }
    window.onresize = () => {
      that.calSize()
    }
  },
  methods: {
    calSize () {
      const height = document.body.clientHeight
      const headerHeight = this.$refs.header.$el.clientHeight
      const bodyHeight = height - headerHeight
      this.$refs.body.height = bodyHeight
      console.log('calSize:' + bodyHeight)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  /*.container{*/
    /*height: 1080px;*/
    /*width:7680px;*/
  /*}*/
@media screen and (max-width: 5000px) {
  .container{
    height: 1080px;
    width:7680px;
  }
}
@media screen and (min-width: 5000px) {
  .container{
    height: 100%;
    width:100%;
  }
}
.container{
  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.6rem);
  width:100%;
}
.map-body{
  width: 100%;
  height:100%;
  position: absolute;
  z-index: 1;
  display: flex;
  justify-content: center;
  top: 0;
  .middle{
    width:30%;
    height:96%;
    display: flex;
    justify-content: center;
    padding-left: 0.4rem;
    padding-right: 0.2rem;
    div{
      flex: 1;
    }
  }
}
</style>