<template>
  <div class="homeWrap" v-loading="loading">
    <!-- 华电 -->
    <el-container v-if="menuShow === 'HD'">
      <el-main>
        <el-header>
          <div class="headerHDBox">
            <div class="headerLeft"></div>
            <!-- <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom> -->
            <MenuHD class="menuBox"></MenuHD>
            <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom>
          </div>
        </el-header>

        <!-- <MenuTag></MenuTag> -->
        <!-- 主体内容-->
        <transition name="slide-fade">
          <div class="main-content">
            <router-view />
          </div>
        </transition>
      </el-main>
    </el-container>
    <!-- 默认 -->
    <el-container v-else="menuShow === 'default'">
      <Menu></Menu>
      <el-main>
        <HeaderCom class="headerBox" @setLoding="setLoding"></HeaderCom>
        <!-- <MenuTag></MenuTag> -->
        <!-- 主体内容-->
        <transition name="slide-fade">
          <div class="main-content">
            <router-view />
          </div>
        </transition>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import HeaderCom from "@/components/HeaderCom.vue";
import MenuHD from "./components/MenuHD.vue";
import Menu from "./components/Menu.vue";
import MenuTag from "@/components/MenuTag.vue";

export default {
  components: {
    Menu,
    MenuHD,
    HeaderCom,
    MenuTag,
  },
  data() {
    return {
      menuShow: process.env.VUE_APP_ISSHOWHD,
      loading: false,
    };
  },
  methods: {
    setLoding(state) {
      this.loading = state;
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep.el-main::-webkit-scrollbar {
  width: 0px !important; /* 滚动条宽度 */
}
.homeWrap {
  height: 100vh;
  .el-container {
    // height: 100%;
    min-height: 89vh;
  }
  .el-main {
    min-width: 800px;
    // min-height: 88vh;
    height: 100%;
    background-color: #f7f7f8;
    padding: 0;
    overflow: hidden;
    .main-content {
      height: 100%;
    }
  }
}
::v-deep.el-header {
  padding: 0 !important;
  background: #1b3b7f;
  color: #fff !important;
  height: 100px !important;
  .headerHDBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: url("../../assets/headerBorder.png");
    background-size: 6%, 100%;
    background-repeat: repeat-x; /* 水平方向重复 */
  }
  .menuBox {
    flex: 1;
    overflow-x: scroll;
    align-items: center;
    justify-content: center;
    display: flex;
  }
  .headerRight {
  }
}
.headerBox {
  background: #fff;
}
.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.5s cubic-bezier(1, 0.5, 0.6, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(50px);
  opacity: 0;
}

.headerLeft {
  // width: 170px;
  width: 52px;
}

@media screen and (max-width: 1650px) {
  ::v-deep .el-header {
    height: 60px !important;
  }
}
</style>
