vent-Green.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="company-home">
  3. <!-- 如果是有 deviceType、type 等 query,认为是详情页,不需要展示普通模块,只需要模型 -->
  4. <template v-if="!route.query.deviceType">
  5. <div v-if="!route.query.embed" class="top-bg">
  6. <greenNav :Title="mainTitle" :activeIndex="activeIndex" @menuToggle="menuToggle" />
  7. </div>
  8. <div class="main-container">
  9. <component :is="currentComponent" />
  10. </div>
  11. </template>
  12. </div>
  13. </template>
  14. <script lang="ts" setup>
  15. import { onMounted, onUnmounted, ref } from 'vue';
  16. import { useInitPage } from './hooks/useInit';
  17. import fireGreen from './fire-green.vue';
  18. import dustGreen from './dust-green.vue';
  19. import commonGreen from './common-green.vue';
  20. import greenNav from './components/green-nav.vue';
  21. import { useRoute } from 'vue-router';
  22. import { useGlobSetting } from '/@/hooks/setting';
  23. //当前激活menu索引
  24. let activeIndex = ref(0);
  25. //当前加载menu组件
  26. let currentComponent = ref<any>(commonGreen);
  27. const { title = '智能通风管控系统' } = useGlobSetting();
  28. const route = useRoute();
  29. const { mainTitle } = useInitPage(title);
  30. //menu切换,界面跳转
  31. function menuToggle(item, index) {
  32. activeIndex.value = index;
  33. switch (item.name) {
  34. case '灾害预警':
  35. currentComponent.value = commonGreen;
  36. break;
  37. case '火灾监控':
  38. currentComponent.value = fireGreen;
  39. break;
  40. case '粉尘监控':
  41. currentComponent.value = dustGreen;
  42. break;
  43. }
  44. }
  45. onMounted(() => {});
  46. onUnmounted(() => {});
  47. </script>
  48. <style lang="less" scoped>
  49. @import '/@/design/theme.less';
  50. @font-face {
  51. font-family: 'douyuFont';
  52. src: url('/@/assets/font/douyuFont.otf');
  53. }
  54. @{theme-deepblue} {
  55. .company-home {
  56. --image-modal-top: url('/@/assets/images/themify/deepblue/vent/home/modal-top.png');
  57. }
  58. }
  59. .company-home {
  60. --image-modal-top: url('/@/assets/images/vent/home/modal-top.png');
  61. --image-monitor-realtime: url('/@/assets/images/company/monitor-realtime.png');
  62. --image-monitor-doc: url('/@/assets/images/company/monitor-doc.png');
  63. --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
  64. width: 100%;
  65. height: 100%;
  66. color: @white;
  67. position: relative;
  68. background: #181b24;
  69. .top-bg {
  70. width: 100%;
  71. height: 96px;
  72. // background: var(--image-modal-top) no-repeat center;
  73. position: absolute;
  74. z-index: 1;
  75. }
  76. .main-container {
  77. position: absolute;
  78. top: 96px;
  79. width: calc(100% - 30px);
  80. height: calc(100% - 96px);
  81. margin: 0px 15px;
  82. box-sizing: border-box;
  83. }
  84. .module-dropdown {
  85. padding: 5px;
  86. background-image: @vent-configurable-dropdown;
  87. border-bottom: 2px solid @vent-configurable-home-light-border;
  88. color: @vent-font-color;
  89. position: absolute;
  90. top: 60px;
  91. right: 480px;
  92. }
  93. .module-dropdown-original {
  94. padding: 10px;
  95. background-image: @vent-configurable-dropdown;
  96. border-bottom: 2px solid @vent-configurable-home-light-border;
  97. color: @vent-font-color;
  98. position: absolute;
  99. top: 70px;
  100. right: 460px;
  101. }
  102. .module-trigger-button {
  103. color: @vent-font-color;
  104. background-image: @vent-configurable-dropdown;
  105. border: none;
  106. border-bottom: 2px solid @vent-configurable-home-light-border;
  107. }
  108. .realtime-mode {
  109. background-image: var(--image-monitor-realtime);
  110. }
  111. .module-monitor-bar {
  112. position: absolute;
  113. top: 100px;
  114. width: 1000px;
  115. height: 200px;
  116. left: calc(50% - 500px);
  117. }
  118. }
  119. :deep(.loading-box) {
  120. position: unset;
  121. }
  122. </style>