ventDHZ.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="company-home">
  4. <div v-if="!route.query.embed" 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="flex pos-absolute bottom-10px left-60px 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. <!-- 下面按钮原来跳转到 @click="redirectTo('/micro-vent-3dModal/subSysmodal/data/timesolution?type=sysMonitor&deviceType=model3D')" -->
  64. <a-button
  65. type="primary"
  66. shape="circle"
  67. style="width: 34px; height: 34px; position: absolute; right: 5px; bottom: 5px; z-index: 5"
  68. @click="redirectTo('/micro-vent-3dModal/dashboard/analysis?type=model3D&deviceType=model3D')"
  69. >
  70. <EyeFilled />
  71. </a-button>
  72. </div>
  73. </div>
  74. </template>
  75. <script lang="ts" setup>
  76. import { onMounted, onUnmounted } from 'vue';
  77. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  78. // import MonitorCenter from './components/MonitorCenter.vue';
  79. import { useInitConfigs, useInitPage } from './hooks/useInit';
  80. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  81. import ModuleOriginal from './components/ModuleOriginal.vue';
  82. import ModuleCommon from './components/ModuleCommon.vue';
  83. // import { useRoute } from 'vue-router';
  84. import VentModal from '/@/components/vent/micro/ventModal.vue';
  85. import { getHomeData } from './configurable.api';
  86. import { useRoute } from 'vue-router';
  87. // import { testConfigVent } from './configurable.data';
  88. import { EyeFilled } from '@ant-design/icons-vue';
  89. const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
  90. const { mainTitle, enhancedConfigs, hiddenList, data, updateData, updateEnhancedConfigs } = useInitPage('智能通风管控系统');
  91. const route = useRoute();
  92. let interval: number | undefined;
  93. function redirectTo(url) {
  94. window.open(url);
  95. }
  96. onMounted(() => {
  97. fetchConfigs('vent').then(() => {
  98. // configs.value = testConfigVent;
  99. updateEnhancedConfigs(configs.value);
  100. getHomeData({}).then(updateData);
  101. });
  102. setInterval(() => {
  103. getHomeData({}).then(updateData);
  104. }, 60000);
  105. });
  106. onUnmounted(() => {
  107. clearInterval(interval);
  108. });
  109. </script>
  110. <style lang="less" scoped>
  111. @import '/@/design/theme.less';
  112. @font-face {
  113. font-family: 'douyuFont';
  114. src: url('../../../../assets/font/douyuFont.otf');
  115. }
  116. @{theme-deepblue} {
  117. .company-home {
  118. --image-modal-top: url('@/assets/images/themify/deepblue/vent/home/modal-top.png');
  119. }
  120. }
  121. .company-home {
  122. --image-modal-top: url('@/assets/images/vent/home/modal-top.png');
  123. width: 100%;
  124. height: 100%;
  125. color: @white;
  126. position: relative;
  127. // background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  128. .top-bg {
  129. width: 100%;
  130. height: 56px;
  131. background: var(--image-modal-top) no-repeat center;
  132. position: absolute;
  133. z-index: 1;
  134. .main-title {
  135. height: 56px;
  136. font-family: 'douyuFont';
  137. font-size: 20px;
  138. letter-spacing: 2px;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. }
  143. }
  144. // .module-left {
  145. // position: absolute;
  146. // width: 450px;
  147. // height: 280px;
  148. // left: 0;
  149. // }
  150. // .module-right {
  151. // position: absolute;
  152. // width: 450px;
  153. // height: 280px;
  154. // right: 0;
  155. // }
  156. // .module-bottom {
  157. // position: absolute;
  158. // width: 1000px;
  159. // height: 280px;
  160. // }
  161. .module-dropdown {
  162. padding: 10px;
  163. background-image: @vent-configurable-dropdown;
  164. border-bottom: 2px solid @vent-configurable-home-light-border;
  165. color: @vent-font-color;
  166. position: absolute;
  167. top: 70px;
  168. right: 460px;
  169. }
  170. .module-dropdown-original {
  171. padding: 10px;
  172. background-image: @vent-configurable-dropdown;
  173. border-bottom: 2px solid @vent-configurable-home-light-border;
  174. color: @vent-font-color;
  175. position: absolute;
  176. top: 70px;
  177. right: 460px;
  178. }
  179. .module-trigger-button {
  180. color: @vent-font-color;
  181. background-image: @vent-configurable-dropdown;
  182. border: none;
  183. border-bottom: 2px solid @vent-configurable-home-light-border;
  184. }
  185. }
  186. :deep(.loading-box) {
  187. position: unset;
  188. }
  189. </style>