<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2018-10-10 14:44:45
 * @LastEditors: 无尘
 * @LastEditTime: 2020-12-04 14:08:59
 -->
<template>
  <div class="review-wrap">
    <!-- 公共头部菜单插件 -->
    <vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"> </vue-office-header>
    <div class="setting-wrap__body">
      <div id="content" class="content">
        <div class="content-body">
          <div class="content-body-inner flex border-box">
            <div class="apps-content-left w-157" style="min-height: calc(100vh - 86px);">
              <common-detail-left :tabListData="tabListData" :activeSelTab="activeSelTab" @setSelectTab="setSelectTab"></common-detail-left>
            </div>
            <div class="apps-content-right border-box">
              <transition name="fade" mode="out-in">
                <router-view :brandId="activeBrand" :activeGroupId="activeGroup" :tabType="activeTab" @showTab="showTab"></router-view>
              </transition>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import vueOfficeHeader from '@/components/vue-office-header';
import commonDetailLeft from '@/components/app/app-detail-left.vue';
export default {
  name: 'reviewed',
  components: {
    vueOfficeHeader,
    commonDetailLeft
  },
  data() {
    return {
      projectName: 'haoban-manage-web', // 当前项目名
      collapseFlag: false, // 折叠参数
      contentHeight: '0px', //页面内容高度
      activeSelTab: '1',
      activeTab: '1',

      tabListData: [
        {
          tabId: '1',
          tabName: '模块',
          icon: 'icondaishenhe_orange'
        }
      ]
    };
  },
  computed: {},
  methods: {
    /**
     * 路由跳转
     */
    changeRoute(path) {
      this.$router.push(path);
    },
    /**
     * 选择后返回tabId，做各路由判断
     */
    setSelectTab(item) {
      let that = this;
      that.activeTab = item.tabId;
      switch (item.tabId) {
        case '1':
          that.changeRoute(`index`);
          break;
      }
    },

    /**
     * 各路由返回 tabId
     */
    showTab(id) {
      let that = this;
      that.activeTab = id;
      that.activeSelTab = id;
      that.tabListData.forEach(ele => {
        if (ele.tabId == id) {
          ele.onlyIconActive = false;
        }
        if (!!ele.children) {
          ele.children.forEach(el => {
            if (el.tabId == id) {
              ele.onlyIconActive = true;
            }
            if (!!el.children) {
              el.children.forEach(item => {
                if (item.tabId == id) {
                  ele.onlyIconActive = true;
                }
              });
            }
          });
        }
      });
    },
    // 处理路由跳转
    toRouterView(val) {
      const that = this;
      // 模拟检查数据,有两个参数
      /*{
       name:,
       path:
      }*/
      that.$router.push({
        path: val.path
      });
    },

    // 折叠事件
    collapseTag(val) {
      const that = this;
      that.collapseFlag = val;
    }
  },
  watch: {
    $route: {
      handler: function(val, oldVal) {
        // this.$refs.asideMenu.refreshRoute();
      },
      // 深度观察监听
      deep: true
    }
  },
  mounted() {
    const that = this;
    that.contentHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 64 + 'px';
  }
};
</script>
<style lang="scss">
.review-wrap {
  background-color: #f0f2f5;
}
.setting-wrap__body {
  .content {
    padding-top: 46px;
    /* height: calc(100% - 64px);
    overflow-y: auto;*/
    min-width: 1400px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;

    .content-body {
      .content-body-inner {
        padding: 20px;
        min-height: calc(100% - 86px);
      }
      .apps-content-left {
        min-width: 157px;
        // height: 100%;
        background: #fff;
        overflow-x: hidden;
        overflow-y: auto;
      }
      .apps-content-right {
        width: calc(100% - 157px);
        padding-left: 10px;
        background: #f0f2f5;
      }

      .common-set-wrap {
        position: relative;
        width: 100%;
        height: 100%;
        overflow-y: auto;

        .right-content {
          /*width: 100%;*/
          min-height: calc(100% - 86px);

          .right-box {
            background: #fff;
            padding: 20px;
          }
        }
      }
    }
  }
}

.el-table__body-wrapper .el-table__empty-block {
  height: 256px;
}

.el-table__empty-text {
  width: auto;
  margin-bottom: 80px;
  &::before {
    content: ' ';
    display: block;
    width: 60px;
    height: 60px;
    background: url(../../assets/no-data_icon.png) no-repeat center;
    margin: 0px auto 22px auto;
  }
}

.el-table__empty-text {
  margin-bottom: 0;
}
</style>
