fireNew.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. <a-button
  7. type="primary"
  8. shape="circle"
  9. style="width: 34px; height: 34px; position: absolute; right: 5px; bottom: 5px; z-index: 5"
  10. @click="redirectTo('/micro-vent-3dModal/dashboard/analysis?type=model3D&deviceType=model3D')"
  11. >
  12. <!-- <EyeFilled /> -->
  13. </a-button>
  14. </div>
  15. <div class="top-bg">
  16. <!-- <img style="width: 300px; height: 40px; position: fixed; left: 5px; top: 5px" src="./meeee.png" /> -->
  17. <!-- <div class="main-title">{{ mainTitle }}</div> -->
  18. <NewNav :Title="mainTitle" />
  19. </div>
  20. <ModuleFireNew
  21. v-for="cfg in cfgs"
  22. :key="cfg.deviceType"
  23. :show-style="cfg.showStyle"
  24. :module-data="cfg.moduleData"
  25. :module-name="cfg.moduleName"
  26. :device-type="cfg.deviceType"
  27. :data="data"
  28. :visible="true"
  29. />
  30. <ModuleNew
  31. v-if="cfgTop"
  32. :show-style="cfgTop.showStyle"
  33. :module-data="cfgTop.moduleData"
  34. :module-name="cfgTop.moduleName"
  35. :device-type="cfgTop.deviceType"
  36. :data="data"
  37. :visible="true"
  38. />
  39. <ModuleFireNewDual
  40. v-if="cfgA && cfgB"
  41. :show-style="cfgA.showStyle"
  42. :module-data-a="cfgA.moduleData"
  43. :module-name-a="cfgA.moduleName"
  44. :device-type-a="cfgA.deviceType"
  45. :module-data-b="cfgB.moduleData"
  46. :module-name-b="cfgB.moduleName"
  47. :device-type-b="cfgB.deviceType"
  48. :data="data"
  49. :visible="true"
  50. />
  51. </div>
  52. </template>
  53. <script lang="ts" setup>
  54. import { computed, onMounted, onUnmounted } from 'vue';
  55. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  56. import NewNav from './components/originalNew/NewNavFire.vue';
  57. import { useInitConfigs, useInitPage } from './hooks/useInit';
  58. import ModuleNew from './components/ModuleNew.vue';
  59. import ModuleFireNew from './components/ModuleFireNew.vue';
  60. import ModuleFireNewDual from './components/ModuleFireNewDual.vue';
  61. import VentModal from '/@/components/vent/micro/ventModal.vue';
  62. import { BDFireMock } from './mock';
  63. import { getDisHome } from './configurable.api';
  64. import { EyeFilled } from '@ant-design/icons-vue';
  65. import { testConfigNewFire } from './configurable.data.New';
  66. const cfgs = computed(() =>
  67. configs.value.filter((_, index) => {
  68. return index !== 4 && index !== 3 && index !== 5;
  69. })
  70. );
  71. const cfgA = computed<any>(() =>
  72. configs.value.find((_, index) => {
  73. return index === 3;
  74. })
  75. );
  76. const cfgB = computed<any>(() =>
  77. configs.value.find((_, index) => {
  78. return index === 4;
  79. })
  80. );
  81. const cfgTop = computed<any>(() =>
  82. configs.value.find((_, index) => {
  83. return index === 5;
  84. })
  85. );
  86. const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
  87. const { mainTitle, data, updateData, updateEnhancedConfigs } = useInitPage('火灾预警系统');
  88. let interval: number | undefined;
  89. onMounted(() => {
  90. // fetchConfigs('New_fire').then(() => {
  91. // configs.value = testConfigNewFire;
  92. // Promise.resolve(BDFireMock).then(updateData);
  93. // });
  94. // setInterval(() => {
  95. // Promise.resolve(BDFireMock).then(updateData);
  96. // }, 2000);
  97. fetchConfigs('New_fire').then(() => {
  98. configs.value = testConfigNewFire;
  99. getDisHome({
  100. dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
  101. }).then(updateData);
  102. });
  103. setInterval(() => {
  104. getDisHome({
  105. dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
  106. }).then(updateData);
  107. }, 2000);
  108. });
  109. onUnmounted(() => {
  110. clearInterval(interval);
  111. });
  112. function redirectTo(url) {
  113. window.open(url);
  114. }
  115. </script>
  116. <style lang="less" scoped>
  117. @import '/@/design/theme.less';
  118. @font-face {
  119. font-family: 'douyuFont';
  120. src: url('../../../../assets/font/douyuFont.otf');
  121. }
  122. @{theme-deepblue} {
  123. .company-home {
  124. --image-modal-top: url('@/assets/images/fireNew/1.png');
  125. }
  126. }
  127. .company-home {
  128. --image-modal-top: url('@/assets/images/fireNew/1.png');
  129. width: 100%;
  130. height: 100%;
  131. color: @white;
  132. position: relative;
  133. background: url('@/assets/images/fireNew/FireBj.png') no-repeat center;
  134. .top-bg {
  135. width: 100%;
  136. height: 56px;
  137. background: var(--image-modal-top) no-repeat center;
  138. position: absolute;
  139. z-index: 1;
  140. .main-title {
  141. height: 56px;
  142. font-family: 'douyuFont';
  143. font-size: 20px;
  144. letter-spacing: 2px;
  145. display: flex;
  146. justify-content: center;
  147. align-items: center;
  148. }
  149. .top-nav {
  150. position: absolute;
  151. top: 0;
  152. width: 880px;
  153. height: 100%;
  154. display: flex;
  155. justify-content: flex-start;
  156. }
  157. }
  158. .left-t {
  159. position: absolute;
  160. width: 28%;
  161. height: 100%;
  162. background: url('@/assets/images/vent/homeNew/leftContent.png') no-repeat center;
  163. z-index: 0;
  164. }
  165. .right-t {
  166. position: absolute;
  167. width: 172%;
  168. height: 100%;
  169. background: url('@/assets/images/vent/homeNew/rightContent.png') no-repeat center;
  170. z-index: 0;
  171. }
  172. // .module-left {
  173. // position: absolute;
  174. // width: 450px;
  175. // height: 280px;
  176. // left: 0;
  177. // }
  178. // .module-right {
  179. // position: absolute;
  180. // width: 450px;
  181. // height: 280px;
  182. // right: 0;
  183. // }
  184. // .module-bottom {
  185. // position: absolute;
  186. // width: 1000px;
  187. // height: 280px;
  188. // }
  189. .module-dropdown {
  190. padding: 10px;
  191. background-image: @vent-configurable-dropdown;
  192. border-bottom: 2px solid @vent-configurable-home-light-border;
  193. color: @vent-font-color;
  194. position: absolute;
  195. top: 70px;
  196. right: 460px;
  197. }
  198. .module-dropdown-original {
  199. padding: 10px;
  200. background-image: @vent-configurable-dropdown;
  201. border-bottom: 2px solid @vent-configurable-home-light-border;
  202. color: @vent-font-color;
  203. position: absolute;
  204. top: 70px;
  205. right: 460px;
  206. }
  207. .module-trigger-button {
  208. color: @vent-font-color;
  209. background-image: @vent-configurable-dropdown;
  210. border: none;
  211. border-bottom: 2px solid @vent-configurable-home-light-border;
  212. }
  213. }
  214. :deep(.loading-box) {
  215. position: unset;
  216. }
  217. </style>