<!--
 * @Description: 总览大屏布局
 * @Author: 王晓颖
 * @Date: 2020-09-01 10:34:35
 -->
<template>
  <div ref="container" class="container">
    <!--头-->
    <head2/>
    <!--内容-->
    <div ref="body" class="body">
      <div class="body-left">
        <!--左边显示-->
        <div class="left-chart-container" style="flex:1;margin-bottom: 8px;">
          <chart-layout title="人员管理">
            <staff-statistic/>
          </chart-layout>
        </div>
        <div class="left-chart-container" style="flex:1;margin-bottom: 8px;">
          <chart-layout title="环卫设施管理">
            <device-statistic/>
          </chart-layout>
        </div>
        <div class="left-chart-container" style="flex:1">
          <chart-layout title="今日作业情况">
            <job-statistic/>
          </chart-layout>
        </div>
      </div>
      <!--地图图层-->
      <div class="map-body">
        <map-overview/>
      </div>
      <div class="body-right">
        <!--右边显示-->
        <div class="left-chart-container" style="flex:1;margin-bottom: 8px;">
          <chart-layout title="垃圾转运作业管理">
            <waste-transfer type="waste"/>
          </chart-layout>
        </div>
        <div class="left-chart-container" style="flex:1;margin-bottom: 8px;">
          <chart-layout title="路面清扫作业管理">
            <waste-transfer type="clean"/>
          </chart-layout>
        </div>
        <div class="left-chart-container" style="flex:1">
          <chart-layout title="公厕保洁作业管理">
            <waste-transfer type="toilet"/>
          </chart-layout>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Head2 from './components/head2'
import ChartLayout from '../../components/BigData/Layout/chartLayout'
import StaffStatistic from './components/staffStatistic'
import WasteTransfer from './components/wasteTransfer'
import DeviceStatistic from './components/deviceStatistic'
import JobStatistic from './components/jobStatistic'
import MapOverview from './components/mapOverview'
export default {
  name: 'Overview',
  components: { MapOverview, JobStatistic, DeviceStatistic, WasteTransfer, StaffStatistic, ChartLayout, Head2 },
  data() {
    return {
    }
  },
  mounted() {
    // const that = this
    // window.onload = () => {
    //   that.calSize()
    // }
    // window.onresize = () => {
    //   that.calSize()
    // }
  },
  methods: {
    calSize() {
      const height = document.body.clientHeight
      const headerHeight = this.$refs.head.$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: 100%;
    width:100%;
    /*background: url("../../assets/overview/background2.jpg") no-repeat;*/
    -webkit-background-size: 100% 100%;
    background-size: 100% 100%;
    background-color: #66b2ff;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
  }
  .body{
    position:relative;
    margin-top:3rem;
    flex:1;
    width:100%;
    display: flex;
    justify-content: space-between;
  }
  .body-left, .body-right{
    width:280px;
    height:95%;
    flex:1;
    display:flex;
    flex-direction: column;
    justify-content: space-between;
    .left-chart-container{
      flex:1;
      padding:0px 10px;
    }
  }
  .map-body{
    /*width: 70%;*/
    height:95%;
    display: flex;
    justify-content: center;
    flex:3;
    .middle{
      width:100%;
      height:100%;
      display: flex;
      justify-content: center;
      div{
        flex: 1;
      }
    }
  }
</style>
