<template>
  <div id="app" class="layout" >
    <Row type="flex" class="layout-container" v-if="!isDashboard">
      <i-col :span="3" class="layout-menu-left">
        <Menu :active-name="activeName" theme="dark" width="auto" :open-names="['1']" accordion @on-select="select">
          <div class="layout-logo-left">低代码平台</div>
          <Menu-item name="list">作品列表</Menu-item>
          <Menu-item name="my">我的草稿</Menu-item>
          <Menu-item name="template">创意模板</Menu-item>
        </Menu>
      </i-col>
      <i-col :span="21" class="layout-menu-right">
        <div class="layout-header">
          <div class="avator">
            <span>{{ username }}</span>
            <span @click="logOut" style="cursor: pointer;">退出</span>
          </div>
        </div>
        <div class="layout-content">
          <slot></slot>
        </div>
        <div class="layout-copy">
          2014-2021 &copy; QuantGroup
        </div>
      </i-col>
    </Row>
    <slot v-if="isDashboard"></slot>
  </div>
</template>
<style lang="less" scoped>
  #app {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .ivu-spin-fix {
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.8);
  }

  .layout {
    border: 1px solid #d7dde4;
    background: #f5f7f9;
    position: relative;
    border-radius: 4px;
    overflow: auto;
    height: 100%;
  }

  .layout-container {
    height: 100%;
  }

  .layout-breadcrumb {
    padding: 10px 15px 0;
  }

  .layout-content {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 4px;
  }

  .layout-content-main {
    padding: 10px;
  }

  .layout-copy {
    height: 45px;
    text-align: center;
    padding: 10px 0 20px;
    color: #9ea7b4;
  }

  .layout-menu-left {
    background: #464c5b;
  }

  .layout-menu-right {
    display: flex;
    flex-direction: column;
  }

  .layout-header {
    height: 45px;
    line-height: 45px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  }

  .layout-ceiling-main {
    float: right;
    margin-right: 15px;
  }

  .layout-logo-left {
    width: 90%;
    height: 30px;
    line-height: 30px;
    color: #fff;
    font-size: 18px;
    text-align: center;
    background: #5b6270;
    border-radius: 3px;
    margin: 15px auto;
  }

  .layout-ceiling-main a {
    color: #9ba7b5;
  }

  .ivu-col {
    transition: width 0.2s ease-in-out;
  }

  .router-fade-enter-active,
  .router-fade-leave-active {
    transition: opacity 0.3s;
  }

  .router-fade-enter,
  .router-fade-leave-active {
    opacity: 0;
  }

  .avator {
    float: right;
    width: 120px;
    height: 45px;
    line-height: 45px;
    font-size: 14px;
  }

  body {
    /deep/ .cr-popup {
      z-index: 1111;
    }
  }

</style>
<script lang="ts" src="./index.ts"></script>