ventNew.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="company-home">
  4. <div style="width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 0">
  5. <VentModal />
  6. </div>
  7. <div class="top-bg">
  8. <!-- <img style="width: 300px; height: 40px; position: fixed; left: 5px; top: 5px" src="./meeee.png" /> -->
  9. <div class="main-title">{{ mainTitle }}</div>
  10. </div>
  11. <div class="left-t"> </div>
  12. <div class="right-t"> </div>
  13. <template v-if="isNew">
  14. <ModuleNew
  15. v-for="cfg in configs"
  16. :key="cfg.deviceType"
  17. :show-style="cfg.showStyle"
  18. :module-data="cfg.moduleData"
  19. :module-name="cfg.moduleName"
  20. :device-type="cfg.deviceType"
  21. :data="data"
  22. :visible="true"
  23. />
  24. </template>
  25. </div>
  26. </template>
  27. <script lang="ts" setup>
  28. import { onMounted, onUnmounted } from 'vue';
  29. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  30. // import MonitorCenter from './components/MonitorCenter.vue';
  31. import { useInitConfigs, useInitPage } from './hooks/useInit';
  32. import ModuleNew from './components/ModuleNew.vue';
  33. // import { useRoute } from 'vue-router';
  34. import VentModal from '/@/components/vent/micro/ventModal.vue';
  35. import { getHomeData } from './configurable.api';
  36. import { useRoute } from 'vue-router';
  37. import { testConfigVentNew } from './configurable.data';
  38. const { configs, isNew, fetchConfigs } = useInitConfigs();
  39. const { mainTitle, data, updateData, updateEnhancedConfigs } = useInitPage('一通三防智能管控平台');
  40. const route = useRoute();
  41. let interval: number | undefined;
  42. onMounted(() => {
  43. fetchConfigs('vent').then(() => {
  44. configs.value = testConfigVentNew;
  45. console.log('configs', configs.value);
  46. updateEnhancedConfigs(configs.value);
  47. getHomeData({}).then(updateData);
  48. });
  49. setInterval(() => {
  50. getHomeData({}).then(updateData);
  51. }, 60000);
  52. });
  53. onUnmounted(() => {
  54. clearInterval(interval);
  55. });
  56. </script>
  57. <style lang="less" scoped>
  58. @import '/@/design/theme.less';
  59. @font-face {
  60. font-family: 'douyuFont';
  61. src: url('../../../../assets/font/douyuFont.otf');
  62. }
  63. @{theme-deepblue} {
  64. .company-home {
  65. --image-modal-top: url('@/assets/images/themify/deepblue/vent/home/modaltop.png');
  66. }
  67. }
  68. .company-home {
  69. --image-modal-top: url('@/assets/images/vent/homeNew/modaltop.png');
  70. width: 100%;
  71. height: 100%;
  72. color: @white;
  73. position: relative;
  74. background: url('@/assets/images//vent/homeNew/bg.png') no-repeat center;
  75. .top-bg {
  76. width: 100%;
  77. height: 56px;
  78. background: var(--image-modal-top) no-repeat center;
  79. position: absolute;
  80. z-index: 1;
  81. .main-title {
  82. height: 56px;
  83. font-family: 'douyuFont';
  84. font-size: 20px;
  85. letter-spacing: 2px;
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. }
  90. }
  91. .left-t {
  92. position: absolute;
  93. width: 28%;
  94. height: 100%;
  95. background: url('@/assets/images/vent/homeNew/leftContent.png') no-repeat center;
  96. z-index: 0;
  97. }
  98. .right-t {
  99. position: absolute;
  100. width: 172%;
  101. height: 100%;
  102. background: url('@/assets/images/vent/homeNew/rightContent.png') no-repeat center;
  103. z-index: 0;
  104. }
  105. // .module-left {
  106. // position: absolute;
  107. // width: 450px;
  108. // height: 280px;
  109. // left: 0;
  110. // }
  111. // .module-right {
  112. // position: absolute;
  113. // width: 450px;
  114. // height: 280px;
  115. // right: 0;
  116. // }
  117. // .module-bottom {
  118. // position: absolute;
  119. // width: 1000px;
  120. // height: 280px;
  121. // }
  122. .module-dropdown {
  123. padding: 10px;
  124. background-image: @vent-configurable-dropdown;
  125. border-bottom: 2px solid @vent-configurable-home-light-border;
  126. color: @vent-font-color;
  127. position: absolute;
  128. top: 70px;
  129. right: 460px;
  130. }
  131. .module-dropdown-original {
  132. padding: 10px;
  133. background-image: @vent-configurable-dropdown;
  134. border-bottom: 2px solid @vent-configurable-home-light-border;
  135. color: @vent-font-color;
  136. position: absolute;
  137. top: 70px;
  138. right: 460px;
  139. }
  140. .module-trigger-button {
  141. color: @vent-font-color;
  142. background-image: @vent-configurable-dropdown;
  143. border: none;
  144. border-bottom: 2px solid @vent-configurable-home-light-border;
  145. }
  146. }
  147. :deep(.loading-box) {
  148. position: unset;
  149. }
  150. </style>