<template>
  <div class="main">
    <el-container>
      <el-header>
        <div class="title">垃圾分类后台检视管理平台</div>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
        >
          <el-menu-item index="1">概述</el-menu-item>
          <el-menu-item index="2">视频管理</el-menu-item>
          <el-menu-item index="3">积分管理</el-menu-item>
        </el-menu>
      </el-header>
      <el-main :style="{ height: tableheight }">
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import summary from "@/components/summary.vue";
import video from "@/components/video.vue";
import integral from "@/components/integral.vue";

@Component({
  components: { summary, video, integral }
})
export default class Main extends Vue {
  //
  activeIndex = "1";
  tableheight = window.innerHeight - 60 + "px";
  handleSelect(key) {
    console.log(key);
    switch (key) {
      case "1":
        this.$router.push("summary");
        break;
      case "2":
        this.$router.push("video");
        break;
      case "3":
        this.$router.push("integral");
        break;
    }
  }
}
</script>
<style scoped>
.el-header,
.el-footer {
  /* background-color: #b3c0d1; */
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  line-height: 60px;
  padding: auto 0;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  height: 700px;
}
.title {
  font-size: 22px;
  font-weight: 550;
}
</style>
