<template>
  <div class="sys-lay-out receive-worktable-sys">
    <!-- 侧边栏 -->
    <LeftNav></LeftNav>
    <!-- 右侧主体 -->
    <div class="main">
      <!-- 头部 -->
      <Header></Header>
      <!-- tag页签 -->
      <div class="tags-wrapper">
        <Button
          class="left carousel-arrow"
          type="default"
          size="small"
          icon="ios-arrow-back"
          @click.native="tagsPageSlide(0)"
        ></Button>
        <!-- 页签组件 -->
        <TagList
          ref="tagListRef"
          class="tags-box"
        ></TagList>
        <Button
          class="right carousel-arrow"
          type="default"
          size="small"
          icon="ios-arrow-forward"
          @click.native="tagsPageSlide(1)"
        ></Button>
      </div>

      <!-- 主视图路由 -->
      <div class="mian-content">
        <keep-alive :include="cachedViewList">
          <router-view
            :key="$route.fullPath"
            class="single-wrappers"
          ></router-view>
        </keep-alive>
      </div>
    </div>
  </div>
</template>

<script>
import LeftNav from './LeftNav';
import Header from './Header';
import TagList from './TagList';
export default {
  components: {
    LeftNav,
    Header,
    TagList
  },
  props: {
  },
  data() {
    return {
    };
  },
  computed: {
    cachedViewList() {
      return this.$store.state.paymentWorktable.cachedViewList;
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    tagsPageSlide(type) {
      this.$refs.tagListRef.tagsPageSlide(type == 0 ? 120 : -120);
    }
  }
};
</script>

<style lang="less" scoped>
.sys-lay-out {
  display: flex;
  width: 100%;
  .main {
    .tags-wrapper {
      position: relative;
      top: 60px;
      height: 25px;
      margin: 0 15px;
      box-sizing: border-box;
      button.left {
        position: absolute;
        left: 0;
      }
      button.right {
        position: absolute;
        right: 0;
        top: 0;
      }

      .tags-box {

        position: relative;
        box-sizing: border-box;
        height: 100%;
        margin: 0 30px;
        overflow: hidden;
      }
    }
    .mian-content {
      margin-top: 55px;
      padding: 15px;
    }
  }
}

</style>
