Newer
Older
sanitationFront / src / views / dashboard / components / chart.vue
dutingting on 7 Dec 3 KB 首页三个图bug修复
<!--
 * @Description: 总览大屏布局
 * @Author: 王晓颖
 * @Date: 2020-09-01 10:34:35
 -->
<template>
  <div ref="container" class="container">
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="人员管理">
            <staff-statistic />
          </chart-layout>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="环卫设施管理">
            <device-statistic/>
          </chart-layout>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="作业情况">
            <job-statistic/>
          </chart-layout>
        </el-card>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 10px;">
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="垃圾转运作业管理">
            <waste-transfer type="waste"/>
          </chart-layout>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="路面清扫作业管理">
            <waste-transfer type="clean"/>
          </chart-layout>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="box-card">
          <chart-layout title="公厕保洁作业管理">
            <waste-transfer type="toilet"/>
          </chart-layout>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import ChartLayout from './layout.vue'
import StaffStatistic from '@/views/overview/components/staffStatistic'
import WasteTransfer from '@/views/overview/components/wasteTransfer'
import DeviceStatistic from '@/views/overview/components/deviceStatistic'
import JobStatistic from '@/views/overview/components/jobStatistic'
export default {
  name: 'Overview',
  components: { JobStatistic, DeviceStatistic, WasteTransfer, StaffStatistic, ChartLayout },
  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>
.box-card {
  height: 300px;
  padding: 0px;
}
  .container{
    height: 600px;
    width:100%;
    /*background: url("../../assets/overview/background2.jpg") no-repeat;*/
    -webkit-background-size: 100% 100%;
    background-size: 100% 100%;
    // background-color: #fff;
    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>