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