warnMonitor.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="fusion-home">
  3. <div class="top-bg">
  4. <NewNav Title="预警监测管控系统" />
  5. </div>
  6. <template v-if="!route.query.deviceType">
  7. <div class="main-container">
  8. <ModuleOriginal
  9. v-for="(cfg, index) in configs"
  10. :key="cfg.deviceType + index"
  11. :show-style="cfg.showStyle"
  12. :module-data="cfg.moduleData"
  13. :module-name="cfg.moduleName"
  14. :device-type="cfg.deviceType"
  15. :data="data"
  16. :visible="true"
  17. />
  18. </div>
  19. </template>
  20. <div class="center-area">
  21. <CenterAreaWarn></CenterAreaWarn>
  22. </div>
  23. </div>
  24. </template>
  25. <script lang="ts" setup>
  26. import { onMounted, onUnmounted } from 'vue';
  27. import { useInitConfigs, useInitPage } from './hooks/useInit';
  28. import ModuleOriginal from './components/ModuleWarnMonitor.vue';
  29. import CenterAreaWarn from './components/center-area-warn.vue';
  30. import { useRoute } from 'vue-router';
  31. import { useGlobSetting } from '/@/hooks/setting';
  32. import { testConfigWarnMonitor } from './configurable.data';
  33. import NewNav from './components/originalNew/NewNavFire.vue';
  34. import { getTotal } from './configurable.api';
  35. const { title = '智能通风管控系统' } = useGlobSetting();
  36. const { configs, fetchConfigs } = useInitConfigs();
  37. const { data, updateData } = useInitPage(title);
  38. const route = useRoute();
  39. // https获取监测数据
  40. let timer: null | NodeJS.Timeout = null;
  41. function getMonitor(flag = false) {
  42. timer = setTimeout(
  43. async () => {
  44. getTotal({}).then(updateData);
  45. if (timer) {
  46. timer = null;
  47. }
  48. getMonitor();
  49. },
  50. flag ? 0 : 20000
  51. );
  52. }
  53. onMounted(() => {
  54. fetchConfigs('fusion-warn-green').then(() => {
  55. configs.value = testConfigWarnMonitor;
  56. // updateEnhancedConfigs(configs.value);
  57. // Promise.resolve(BDFireMock).then(updateData);
  58. getMonitor(true);
  59. });
  60. });
  61. onUnmounted(() => {
  62. clearTimeout(timer);
  63. timer = undefined;
  64. });
  65. </script>
  66. <style lang="less" scoped>
  67. @import '/@/design/theme.less';
  68. @font-face {
  69. font-family: 'douyuFont';
  70. src: url('/@/assets/font/douyuFont.otf');
  71. }
  72. .fusion-home {
  73. width: 100%;
  74. height: 100%;
  75. position: relative;
  76. .top-bg {
  77. width: 100%;
  78. height: 56px;
  79. background: url('../../../../assets/images/home-warn/1-1.png') no-repeat center;
  80. position: absolute;
  81. z-index: 1;
  82. .main-title {
  83. height: 56px;
  84. color: #fff;
  85. font-family: 'douyuFont';
  86. font-size: 20px;
  87. letter-spacing: 2px;
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. }
  92. .top-nav {
  93. position: absolute;
  94. top: 0;
  95. width: 880px;
  96. height: 100%;
  97. display: flex;
  98. justify-content: flex-start;
  99. }
  100. }
  101. .main-container {
  102. width: 100%;
  103. height: 100%;
  104. background: url('../../../../assets/images/home-warn/bg.png') no-repeat;
  105. background-size: 100% 100%;
  106. .left-area {
  107. position: absolute;
  108. left: 0;
  109. top: 0;
  110. width: 420px;
  111. height: 100%;
  112. padding: 15px;
  113. box-sizing: border-box;
  114. overflow-y: auto;
  115. }
  116. .bottom-area {
  117. position: absolute;
  118. left: 435px;
  119. bottom: 0;
  120. width: calc(100% - 435px);
  121. height: 290px;
  122. padding: 15px;
  123. box-sizing: border-box;
  124. }
  125. .right-area {
  126. position: absolute;
  127. right: 0px;
  128. top: 0px;
  129. width: 420px;
  130. height: calc(100% - 305px);
  131. padding: 15px 15px 0px 15px;
  132. box-sizing: border-box;
  133. overflow-y: auto;
  134. }
  135. }
  136. .center-area {
  137. position: absolute;
  138. left: 450px;
  139. top: 0;
  140. width: calc(100% - 900px);
  141. height: calc(100% - 270px);
  142. }
  143. }
  144. :deep(.loading-box) {
  145. position: unset;
  146. }
  147. </style>