<template>
  <el-container :class="'el-container-style-' + curTheme">
    <NewTop />
    <el-aside :width="isCollapse ? '60px' : '240px'" :class="[{ collapse: isCollapse }]">
      <el-scrollbar style="height: calc(100% + 17px)">
        <Left :is-collapse="isCollapse" />
      </el-scrollbar>
    </el-aside>
    <el-main class="right-container">
      <!-- <Top /> -->
      <div class="pageTitle">{{ $route.matched[this.$route.matched.length - 1].meta.name }}</div>
      <div class="main-box">
        <keep-alive>
          <router-view v-if="$route.meta.keepAlive" :key="key" />
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive" />
      </div>
    </el-main>
  </el-container>
</template>

<script>
import Left from '@views/layout/left';
// import Top from '@views/layout/top';
import NewTop from '@views/layout/new-top';
// import Footer from '@views/layout/footer';
import { mapGetters } from 'vuex';

export default {
  name: 'Index',
  components: {
    Left,
    NewTop
  },
  data() {
    return {
      anticon: 'icon-setting'
    };
  },
  computed: {
    ...mapGetters(['isCollapse', 'curTheme']),
    key() {
      return this.$route.path;
    }
  }
};
</script>

<style scoped lang="less">
.el-aside {
  margin-top: 90px;
  margin-right: 20px;
  height: calc(100vh - 90px);
  background: #fff;
  border-top-right-radius: 20px;
  overflow: hidden !important;
}
.right-container {
  margin-top: 90px;
  margin-right: 20px;
  background-color: #fff;
  border-radius: 20px 20px 0 0;
  height: calc(100vh - 90px);
  // overflow: auto;
}
.el-header,
.top-nav {
  z-index: 1;
  background-color: #fff;
  border-radius: 20px 20px 0 0;
}

.el-main {
  background-color: #fff;
  overflow-y: auto;
}

.pageTitle {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  padding: @mainPadding;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  background: #fff;

  &::before {
    content: '';
    display: block;
    width: 6px;
    height: 14px;
    background: @theme-color;
    margin-right: 8px;
    border-radius: 88px;
  }
}
</style>
