fire.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="company-home">
  4. <div class="top-bg">
  5. <div class="main-title">{{ mainTitle }}</div>
  6. </div>
  7. <!-- <a-dropdown class="module-dropdown" :class="{ 'module-dropdown-original': isOriginal }" :trigger="['click']" placement="bottomRight">
  8. <a class="ant-dropdown-link" @click.prevent>
  9. 全矿井通风检测
  10. <CaretDownOutlined />
  11. </a>
  12. <template #overlay>
  13. <MonitorCenter />
  14. </template>
  15. </a-dropdown> -->
  16. <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
  17. <template v-if="isOriginal">
  18. <ModuleOriginal
  19. v-for="cfg in configs"
  20. :key="cfg.deviceType"
  21. :show-style="cfg.showStyle"
  22. :module-data="cfg.moduleData"
  23. :module-name="cfg.moduleName"
  24. :device-type="cfg.deviceType"
  25. :data="data"
  26. :visible="true"
  27. />
  28. </template>
  29. <template v-else-if="isCommon">
  30. <ModuleCommon
  31. v-for="cfg in configs"
  32. :key="cfg.deviceType"
  33. :show-style="cfg.showStyle"
  34. :module-data="cfg.moduleData"
  35. :module-name="cfg.moduleName"
  36. :device-type="cfg.deviceType"
  37. :data="data"
  38. :visible="true"
  39. />
  40. </template>
  41. <template v-else>
  42. <!-- 下面是正常展示的各新版模块 -->
  43. <ModuleEnhanced
  44. v-for="cfg in enhancedConfigs"
  45. :key="cfg.deviceType"
  46. :visible="cfg.visible"
  47. :show-style="cfg.showStyle"
  48. :module-data="cfg.moduleData"
  49. :module-name="cfg.moduleName"
  50. :device-type="cfg.deviceType"
  51. :data="data"
  52. @close="cfg.visible = false"
  53. />
  54. <!-- 下面是用于呼出已隐藏的模块的按钮 -->
  55. <div class="pos-absolute top-70px left-460px z-3">
  56. <div v-for="(item, i) in hiddenList" :key="`vvhchg${i}`">
  57. <AButton class="module-trigger-button" @click="item.visible = true">{{ item.moduleName }}</AButton>
  58. </div>
  59. </div>
  60. </template>
  61. <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
  62. <VentModal />
  63. </div>
  64. </div>
  65. </template>
  66. <script lang="ts" setup>
  67. import { onMounted, onUnmounted } from 'vue';
  68. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  69. // import MonitorCenter from './components/MonitorCenter.vue';
  70. import { useInitConfigs, useInitPage } from './hooks/useInit';
  71. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  72. import ModuleOriginal from './components/ModuleOriginal.vue';
  73. import ModuleCommon from './components/ModuleCommon.vue';
  74. // import { useRoute } from 'vue-router';
  75. import VentModal from '/@/components/vent/micro/ventModal.vue';
  76. import { getHomeData } from './configurable.api';
  77. // import { testConfigFire } from './configurable.data';
  78. const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
  79. const { mainTitle, enhancedConfigs, hiddenList, data, updateData, updateEnhancedConfigs } = useInitPage('智能防灭火管控系统');
  80. let interval: number | undefined;
  81. onMounted(() => {
  82. fetchConfigs('fire').then(() => {
  83. // configs.value = testConfigFire;
  84. updateEnhancedConfigs(configs.value);
  85. getHomeData({}).then(updateData);
  86. });
  87. setInterval(() => {
  88. getHomeData({}).then(updateData);
  89. }, 60000);
  90. });
  91. onUnmounted(() => {
  92. clearInterval(interval);
  93. });
  94. </script>
  95. <style lang="less" scoped>
  96. @font-face {
  97. font-family: 'douyuFont';
  98. src: url('../../../../assets/font/douyuFont.otf');
  99. }
  100. .company-home {
  101. width: 100%;
  102. height: 100%;
  103. color: @white;
  104. position: relative;
  105. // background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  106. .top-bg {
  107. width: 100%;
  108. height: 56px;
  109. background: url('@/assets/images/vent/home/modal-top.png') no-repeat center;
  110. position: absolute;
  111. z-index: 1;
  112. .main-title {
  113. height: 56px;
  114. font-family: 'douyuFont';
  115. font-size: 20px;
  116. letter-spacing: 2px;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. }
  121. }
  122. // .module-left {
  123. // position: absolute;
  124. // width: 450px;
  125. // height: 280px;
  126. // left: 0;
  127. // }
  128. // .module-right {
  129. // position: absolute;
  130. // width: 450px;
  131. // height: 280px;
  132. // right: 0;
  133. // }
  134. // .module-bottom {
  135. // position: absolute;
  136. // width: 1000px;
  137. // height: 280px;
  138. // }
  139. .module-dropdown {
  140. padding: 10px;
  141. background-image: linear-gradient(to bottom, #036886, #072a40);
  142. border-bottom: 2px solid #3df6ff;
  143. color: #fff;
  144. position: absolute;
  145. top: 70px;
  146. right: 460px;
  147. }
  148. .module-dropdown-original {
  149. padding: 10px;
  150. background-image: linear-gradient(to bottom, #036886, #072a40);
  151. border-bottom: 2px solid #3df6ff;
  152. color: #fff;
  153. position: absolute;
  154. top: 70px;
  155. right: 460px;
  156. }
  157. .module-trigger-button {
  158. color: #fff;
  159. background-image: linear-gradient(to bottom, #036886, #072a40);
  160. border: none;
  161. border-bottom: 2px solid #3df6ff;
  162. }
  163. }
  164. :deep(.loading-box) {
  165. position: unset;
  166. }
  167. </style>