index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="vent-home">
  3. <customHeader>智能管控系统</customHeader>
  4. <div class="home-container">
  5. <workerFace v-if="isBtnActive == 'workFace'" />
  6. <netWork v-if="isBtnActive == 'netWork'" />
  7. </div>
  8. <div class="bottom-btn-group">
  9. <div
  10. v-for="item in bottomBtnList"
  11. :key="item.value"
  12. class="vent-row-center btn-item"
  13. @click="setBtn('click', item)"
  14. @mouseenter="setBtn('over', item)"
  15. @mouseleave="setBtn('leave', item)"
  16. >
  17. <Decoration11
  18. :color="isBtnActive === item.value ? activeColors : item.isHover ? activeColors : noActiveColors"
  19. style="width: 200px; height: 60px"
  20. >
  21. {{ item.text }}
  22. </Decoration11>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script lang="ts" setup>
  28. import { onMounted, onUnmounted, ref } from 'vue';
  29. import { Decoration11 } from '@kjgl77/datav-vue3';
  30. import { bottomBtnList } from './home.data';
  31. import workerFace from './homePage/workerFace.vue';
  32. import netWork from './homePage/network.vue';
  33. import customHeader from '/@/views/vent/comment/components/customHeader.vue';
  34. const activeColors = [];
  35. const noActiveColors = ['#aaa', '#aaa'];
  36. const isBtnActive = ref('workFace');
  37. function setBtn(type, activeObj) {
  38. if (type === 'over') {
  39. activeObj.isHover = true;
  40. } else if (type === 'leave') {
  41. activeObj.isHover = false;
  42. } else if (type === 'click') {
  43. isBtnActive.value = activeObj.value;
  44. }
  45. }
  46. onMounted(() => {});
  47. onUnmounted(() => {});
  48. </script>
  49. <style lang="less" scoped>
  50. @ventSpace: zxm;
  51. .vent-home {
  52. width: 100%;
  53. // height: calc(100%);
  54. position: fixed;
  55. z-index: 99;
  56. display: flex;
  57. flex-direction: column;
  58. justify-content: center;
  59. align-items: center;
  60. pointer-events: none;
  61. top: 0;
  62. .home-container {
  63. width: 100%;
  64. height: calc(100% - 200px);
  65. display: flex;
  66. justify-content: space-between;
  67. margin-bottom: 100px;
  68. margin-top: 20px;
  69. }
  70. .bottom-btn-group {
  71. display: flex;
  72. position: fixed;
  73. width: calc(100% - 400px);
  74. height: 100px;
  75. bottom: 20px;
  76. align-items: center;
  77. justify-content: center;
  78. .btn-item {
  79. width: 200px;
  80. height: 60px;
  81. margin: 10px;
  82. color: #fff;
  83. cursor: pointer;
  84. pointer-events: auto;
  85. }
  86. }
  87. }
  88. </style>