Index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="homeWrap" v-loading="loading">
  3. <!-- 华电 -->
  4. <el-container v-if="menuShow === 'HD'">
  5. <el-main>
  6. <el-header>
  7. <div class="headerHDBox">
  8. <div class="headerLeft"></div>
  9. <!-- <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom> -->
  10. <MenuHD class="menuBox"></MenuHD>
  11. <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom>
  12. </div>
  13. </el-header>
  14. <!-- <MenuTag></MenuTag> -->
  15. <!-- 主体内容-->
  16. <div class="main-content">
  17. <transition name="slide-fade">
  18. <router-view />
  19. </transition>
  20. </div>
  21. </el-main>
  22. </el-container>
  23. <!-- 默认 -->
  24. <el-container v-else="menuShow === 'default'">
  25. <MenuDt></MenuDt>
  26. <el-main>
  27. <HeaderCom class="headerBox" @setLoding="setLoding"></HeaderCom>
  28. <!-- <MenuTag></MenuTag> -->
  29. <!-- 主体内容-->
  30. <div class="main-content">
  31. <transition name="slide-fade">
  32. <router-view />
  33. </transition>
  34. </div>
  35. </el-main>
  36. </el-container>
  37. </div>
  38. </template>
  39. <script>
  40. import HeaderCom from "@/components/HeaderCom.vue";
  41. import MenuHD from "./components/MenuHD.vue";
  42. import Menu from "./components/Menu.vue";
  43. import MenuDt from "./components/MenuDt.vue";
  44. import MenuTag from "@/components/MenuTag.vue";
  45. export default {
  46. components: {
  47. Menu,
  48. MenuHD,
  49. HeaderCom,
  50. MenuTag,
  51. MenuDt,
  52. },
  53. data() {
  54. return {
  55. menuShow: process.env.VUE_APP_ISSHOWHD,
  56. loading: false,
  57. };
  58. },
  59. methods: {
  60. setLoding(state) {
  61. this.loading = state;
  62. },
  63. },
  64. };
  65. </script>
  66. <style lang="scss" scoped>
  67. .homeWrap {
  68. height: 100vh;
  69. overflow: hidden;
  70. .el-container {
  71. height: 100%;
  72. min-height: 0;
  73. }
  74. .el-main {
  75. min-width: 800px;
  76. height: 100%;
  77. display: flex;
  78. flex-direction: column;
  79. padding: 0;
  80. overflow: hidden;
  81. background-color: var(--content-bg, #f5f7fa);
  82. .main-content {
  83. flex: 1 1 auto;
  84. min-height: 0;
  85. overflow-y: auto;
  86. overflow-x: hidden;
  87. }
  88. }
  89. }
  90. ::v-deep.el-header {
  91. flex-shrink: 0;
  92. padding: 0 !important;
  93. background: #1b3b7f;
  94. color: #fff !important;
  95. height: 100px !important;
  96. .headerHDBox {
  97. display: flex;
  98. justify-content: space-between;
  99. align-items: center;
  100. background: url("../../assets/headerBorder.png");
  101. background-size: 6%, 100%;
  102. background-repeat: repeat-x; /* 水平方向重复 */
  103. }
  104. .menuBox {
  105. flex: 1;
  106. overflow-x: scroll;
  107. align-items: center;
  108. justify-content: center;
  109. display: flex;
  110. }
  111. .headerRight {
  112. }
  113. }
  114. .headerBox {
  115. flex-shrink: 0;
  116. background: var(--header-bg, #001529) !important;
  117. // border-bottom: 1px solid var(--panel-border, rgba(0, 170, 255, 0.35));
  118. color: var(--text-color, #ffffff);
  119. }
  120. .slide-fade-enter-active {
  121. transition: all 0.3s ease-out;
  122. }
  123. .slide-fade-leave-active {
  124. transition: all 0.5s cubic-bezier(1, 0.5, 0.6, 1);
  125. }
  126. .slide-fade-enter-from,
  127. .slide-fade-leave-to {
  128. transform: translateX(50px);
  129. opacity: 0;
  130. }
  131. .headerLeft {
  132. // width: 170px;
  133. width: 52px;
  134. }
  135. @media screen and (max-width: 1650px) {
  136. ::v-deep .el-header {
  137. height: 60px !important;
  138. }
  139. }
  140. </style>