<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2018-10-10 14:44:45
 * @LastEditors: 无尘
 * @LastEditTime: 2020-05-11 15:16:06
 -->
<template>
  <div class="daily-set-wrap">
    <div class="daily-set-content border-box">
      <el-tabs v-model="activeTab" @tab-click="handleClick">
        <el-tab-pane :label="item.tabName" :name="item.tabId" v-for="item in tabListData" :key="item.tabId">
          <div class="border-box">
            <transition name="fade" mode="out-in">
              <router-view></router-view>
            </transition>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script>
export default {
  name: 'reviewed',
  data() {
    return {
      activeTab: '1',
      tabListData: [
        {
          tabId: '1',
          tabName: '待审核',
          icon: 'icondaishenhe_orange'
        },
        {
          tabId: '2',
          tabName: '已审核',
          icon: 'iconrenwu1'
        },
        {
          tabId: '3',
          tabName: '审核设置',
          icon: 'iconshenhe'
        }
      ]
    };
  },
  computed: {},
  methods: {
    handleClick(tab, event) {
      switch (tab.name) {
        case '1':
          this.$router.push(`unreview`);
          break;
        case '2':
          this.$router.push(`reviewed`);
          break;
        case '3':
          this.$router.push(`reviewSet`);
          break;
      }
      console.log(tab, event);
    }
  },
  watch: {
    $route: {
      handler: function(val, oldVal) {
        // this.$refs.asideMenu.refreshRoute();
      },
      // 深度观察监听
      deep: true
    }
  },
  mounted() {
    this.$emit('showTab', 5);
    document.documentElement.style.backgroundColor = '#f0f2f5';
  },
  destroyed() {
    document.documentElement.style.backgroundColor = '#fff';
  }
};
</script>
<style type="text/scss" lang="scss" scoped>
.daily-set-wrap {
  height: 100%;
  .daily-set-content {
    padding: 20px;
  }
}
</style>
