<template>
  <div class="app-wrapper" :class="{hideSidebar:!sidebar.opened}">
    <div class="topTitle">
      <div class="com-logo">
        <img src="../../assets/images/logo.png" alt="logo">
      </div>
      <h1 class="com-title">{{title}}</h1>
      <UserBox></UserBox>
    </div>
    <div>
      <sidebar class="sidebar-container"></sidebar>
      <div class="main-container">
        <navbar></navbar>
        <tags-view></tags-view>
        <app-main></app-main>
      </div>
    </div>
    <div class="copyright">
      Copyright©成都多彩任意门科技有限公司2015-2017 蜀ICP备14012163号-1
    </div>
  </div>
</template>

<style lang="scss">
@import 'src/assets/styles/mixin.scss';
.app-wrapper {
  @include clearfix;
  position: relative;
  height: 100%;
  width: 100%;
  min-width: 1280px;
  .topTitle {
    display: flex;
    align-items: center;
    height: 70px;
    background-color: #182b3e;
  }
  .com-logo {
    width: 138px;
    height: 44px;
    margin-left: 42px;
  }
  .com-title {
    flex: 1;
    height: 24px;
    line-height: 24px;
    font-size: 14px;
    font-weight: normal;
    color: #fff;
    border-left: 1px solid #fff;
    margin-left: 67px;
    text-indent: 20px;
  }
  .copyright {
    box-sizing: border-box;
    width: 100%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    position: absolute;
    top: calc(100vh - 30px);
    padding-left: 250px;
    font-size: 14px;
    color: #666;
  }
}
</style>

<script>
import {
  Navbar,
  Sidebar,
  AppMain,
  TagsView,
  UserBox,
} from '@/containers/layout/components';
import { PAGE_TITLE } from '@/config';

export default {
  name: 'layout',
  components: {
    Navbar,
    Sidebar,
    AppMain,
    TagsView,
    UserBox,
  },
  data() {
    return {
      title: PAGE_TITLE,
    };
  },
  computed: {
    sidebar() {
      return this.$store.state.app.sidebar;
    },
  },
};
</script>
