<template>
  <div class="dashboard-container">
    <el-row type="flex" justify="center">
      <el-col :span="12">
        <echarts-lesson id="lesson" ref="lesson" :width="width + 'px'" :height="height+ 'px'" />
      </el-col>
      <el-col :span="12">
        <echarts-lesson id="exam" ref="exam" :width="width + 'px'" :height="height+ 'px'" />
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <echarts-lesson id="deomon" ref="deomon" :width="width + 'px'" :height="height+ 'px'" />
      </el-col>
      <el-col :span="12">
        <echarts-lesson id="test" ref="test" :width="width + 'px'" :height="height+ 'px'" />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import EchartsLesson from './echarts/lesson';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';

export default {
	name: 'Dashboard',
	components: {
		EchartsLesson
	},
	mixins: [WindowResizeHandler],
	data() {
		return {
			width: 0,
			height: 0
		};
	},
	computed: {
		...mapGetters([
			'name'
		])
	},
	methods: {
		resizeHandler() {
			this.width = this._clientWidth / 2;
			this.height = this._clientHeight - 80;
		}
	}
};
</script>

<style lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }

    &-text {
      font-size: 30px;
      line-height: 46px;
    }
  }
</style>
