<template>
    <div class="warpper" style="background-color: #f8f8f8">
        <div v-if="bIniFrame">
          <!-- <transition style="z-index: 100">
            <div>
              <v-header class="warpper-right"></v-header>
            </div>
          </transition> -->
        </div>
        <div :class="bIniFrame?('router-style'+(toggleMenu? '':' toggle-left')):''">
            <keep-alive :include="keepInclude">
                <router-view style="padding: 10px;"></router-view>
            </keep-alive>
        </div>
    </div>
</template>
<script>
  import vHeader from '@/components/layout/header'
  // import sidebar from '@/components/layout/sidebar'
  // import sideMinibar from '@/components/layout/sideminibar'
  // import tabs from '@/components/layout/tabs'
  import { mapGetters } from 'vuex'
  export default {
    name: 'index',
    components: {
      vHeader
      // sidebar,
    },
    data() {
      return {
        sideBarColor: 'red',
        miniSideBar: false,
        sideBarBg: true,
        sideBarImg: 1,
        bIniFrame: false
      }
    },
    computed: {
      // activeTabIndex () {
      //   return this.$store.state.activeTabIndex
      // },
      // headerTabs () {
      //   return this.$store.state.headerTabs
      // },
      // toggleMenu () {
      //   return this.$store.state.toggleMenu
      // }
      ...mapGetters([
        'activeTabIndex',
        'headerTabs',
        'toggleMenu',
        'keepInclude'
      ])
    },
    mounted() {
      this.bIniFrame = self === top
    },
    methods: {
      // changeTab (index, link) {
      //   this.$router.push(link)
      //   this.$store.commit('changeActiveTabIndex', index)
      // },
      // closeTab (index) {
      //   this.$store.commit('deleteHeaderTab', index)
      //   if (index === this.headerTabs.length && this.$store.state.activeTabIndex === this.headerTabs.length) {
      //     // 关闭最后一个tab页
      //     this.$store.commit('changeActiveTabIndex', index - 1)
      //     this.$router.push(this.headerTabs[index - 1].link)
      //   } else if (index < this.$store.state.activeTabIndex) {
      //     // 关闭非活动tab页
      //     this.$store.commit('changeActiveTabIndex', this.$store.state.activeTabIndex - 1)
      //     this.$router.push(this.headerTabs[this.$store.state.activeTabIndex].link)
      //   } else if (index < this.headerTabs.length && index === this.$store.state.activeTabIndex) {
      //     // 关闭非最后一个活动状态下的tab页
      //     this.$router.push(this.headerTabs[this.$store.state.activeTabIndex].link)
      //   }
      // }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss">
.warpper {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  .router-style {
    // position: absolute;
    left: 270px;
    top: 70px;
    right: 0;
    bottom: 0;
    padding: 0px;
    margin: 0 0 10px 0;
    box-sizing: border-box;
    overflow-y: auto;
  }
  .tab-style {
    overflow: hidden;
    display: flex;
    flex-direction: row;
    // background-color:#EEEFF6;
    // position: absolute;
    left: 230px;
    top: 70px;
    right: 0;
    margin: 0 10px 10px 0;
    box-sizing: border-box;
    .tab-style-nav {
      display: inline-block;
      white-space: nowrap;
      position: relative;
      transition: transform 0.3s;
      // border: 1px solid #DBDBDB;
      border-bottom: none;
      border-radius: 4px 4px 0 0;
      .tab-style-item {
        position: relative;
        padding: 0 20px;
        height: 40px;
        box-sizing: border-box;
        line-height: 40px;
        display: inline-block;
        list-style: none;
        font-size: 14px;
        font-weight: 500;
        border-bottom: 1px solid #eb4f52;
        // border-left: 1px solid #DBDBDB;
        transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
          padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        // .item-active-span{
        //   color: #409eff;
        // }
        .el-icon-close {
          position: relative;
          font-size: 12px;
          width: 0;
          height: 8px;
          vertical-align: middle;
          line-height: 9px;
          border-radius: 50%;
          overflow: hidden;
          top: -1px;
          right: -8px;
          transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        }
        .el-icon-close-active {
          transform-origin: 100% 50%;
          text-align: center;
          width: 12px;
          transform: scale(0.9);
        }
        .el-icon-close:hover {
          height: 12px;
          line-height: 12px;
          border: 3px solid #e5e5ea;
          display: inline-block;
          background-color: #e5e5ea;
          content: "\E60F";
        }
      }
      /**/
      .item-active {
        border-bottom: 4px solid red;
        // background-color: #eee;
        color: #eb4f52;
      }
    }
    .tab-style-nonav {
      display: inline-block;
      border-bottom: 1px solid #eb4f52;
      width: 100%;
    }
  }
}
.table-style-left {
  left: 110px !important;
}
.toggle-left {
  left: 110px !important;
}
</style>
