fireBD.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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. <div class="left-t">
  18. <div class="tcontent-area">
  19. <div class="tcontent-l">
  20. <div>监测</div>
  21. <div>区域</div>
  22. </div>
  23. <div class="tcontent-c">
  24. <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
  25. {{ data.fireAllMineWarn }}
  26. </div>
  27. <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 自燃</div>
  28. </div>
  29. <div class="tcontent-r">
  30. <div>火灾</div>
  31. <div>风险</div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="right-t">
  36. <div class="tcontent-l" @click="redirectTo('/grout-home')">
  37. <div>智能注浆系统</div>
  38. </div>
  39. <div class="tcontent-r" @click="redirectTo('/nitrogen-home')">
  40. <div>智能注氮系统</div>
  41. </div>
  42. </div>
  43. <ModuleBD
  44. v-for="cfg in cfgs"
  45. :key="cfg.deviceType"
  46. :show-style="cfg.showStyle"
  47. :module-data="cfg.moduleData"
  48. :module-name="cfg.moduleName"
  49. :device-type="cfg.deviceType"
  50. :data="data"
  51. :visible="true"
  52. />
  53. <ModuleBDDual
  54. v-if="cfgA && cfgB"
  55. :show-style="cfgA.showStyle"
  56. :module-data-a="cfgA.moduleData"
  57. :module-name-a="cfgA.moduleName"
  58. :device-type-a="cfgA.deviceType"
  59. :module-data-b="cfgB.moduleData"
  60. :module-name-b="cfgB.moduleName"
  61. :device-type-b="cfgB.deviceType"
  62. :data="data"
  63. :visible="true"
  64. />
  65. <div style="width: 1000px; height: 550px; position: absolute; left: calc(50% - 500px); top: 60px">
  66. <VentModal />
  67. </div>
  68. </div>
  69. </template>
  70. <script lang="ts" setup>
  71. import { computed, onMounted, onUnmounted } from 'vue';
  72. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  73. // import MonitorCenter from './components/MonitorCenter.vue';
  74. import { useInitConfigs, useInitPage } from './hooks/useInit';
  75. import ModuleBD from './components/ModuleBD.vue';
  76. import ModuleBDDual from './components/ModuleBDDual.vue';
  77. import VentModal from '/@/components/vent/micro/ventModal.vue';
  78. import { getDisHome } from './configurable.api';
  79. // import { testConfigBDFire } from './configurable.data.bd';
  80. // import { getToken } from '/@/utils/auth';
  81. const cfgs = computed(() =>
  82. configs.value.filter((_, index) => {
  83. return index !== 4 && index !== 3;
  84. })
  85. );
  86. const cfgA = computed<any>(() =>
  87. configs.value.find((_, index) => {
  88. return index === 3;
  89. })
  90. );
  91. const cfgB = computed<any>(() =>
  92. configs.value.find((_, index) => {
  93. return index === 4;
  94. })
  95. );
  96. const { configs, fetchConfigs } = useInitConfigs();
  97. const { mainTitle, data, updateData } = useInitPage('保德煤矿火灾预警系统');
  98. let interval: number | undefined;
  99. // function hideLoading() {
  100. // loading.value = false;
  101. // }
  102. onMounted(() => {
  103. fetchConfigs('BD_fire').then(() => {
  104. // configs.value = testConfigBDFire;
  105. getDisHome({
  106. dataList: configs.value
  107. .map((e) => e.deviceType)
  108. .concat('fireAllMineWarn')
  109. .join(','),
  110. }).then(updateData);
  111. });
  112. setInterval(() => {
  113. getDisHome({
  114. dataList: configs.value
  115. .map((e) => e.deviceType)
  116. .concat('fireAllMineWarn')
  117. .join(','),
  118. }).then(updateData);
  119. }, 60000);
  120. });
  121. onUnmounted(() => {
  122. clearInterval(interval);
  123. });
  124. function redirectTo(url) {
  125. window.open(url);
  126. }
  127. </script>
  128. <style lang="less" scoped>
  129. @font-face {
  130. font-family: 'douyuFont';
  131. src: url('../../../../assets/font/douyuFont.otf');
  132. }
  133. .company-home {
  134. width: 100%;
  135. height: 100%;
  136. color: @white;
  137. position: relative;
  138. background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  139. .top-bg {
  140. width: 100%;
  141. height: 86px;
  142. background: url(/@/assets/images/home-container/configurable/firehome/fire-title.png) no-repeat center;
  143. position: absolute;
  144. z-index: 1;
  145. .main-title {
  146. height: 86px;
  147. font-family: 'douyuFont';
  148. font-size: 26px;
  149. letter-spacing: 2px;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. }
  154. }
  155. // .module-left {
  156. // position: absolute;
  157. // width: 440px;
  158. // height: 280px;
  159. // left: 0;
  160. // }
  161. // .module-right {
  162. // position: absolute;
  163. // width: 440px;
  164. // height: 280px;
  165. // right: 0;
  166. // }
  167. // .module-bottom {
  168. // position: absolute;
  169. // width: 1000px;
  170. // height: 280px;
  171. // }
  172. .module-dropdown {
  173. padding: 10px;
  174. background-image: linear-gradient(to bottom, #036886, #072a40);
  175. border-bottom: 2px solid #3df6ff;
  176. color: #fff;
  177. position: absolute;
  178. top: 70px;
  179. right: 460px;
  180. }
  181. .module-dropdown-original {
  182. padding: 10px;
  183. background-image: linear-gradient(to bottom, #036886, #072a40);
  184. border-bottom: 2px solid #3df6ff;
  185. color: #fff;
  186. position: absolute;
  187. top: 70px;
  188. right: 460px;
  189. }
  190. .module-trigger-button {
  191. color: #fff;
  192. background-image: linear-gradient(to bottom, #036886, #072a40);
  193. border: none;
  194. border-bottom: 2px solid #3df6ff;
  195. }
  196. }
  197. .left-t {
  198. position: absolute;
  199. height: 115px;
  200. top: 40px;
  201. left: 10px;
  202. width: 440px;
  203. background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
  204. background-color: #000723;
  205. background-repeat: no-repeat;
  206. background-position: center;
  207. background-size: 100% 100%;
  208. .tcontent-area {
  209. display: flex;
  210. position: absolute;
  211. top: 50%;
  212. left: 0;
  213. box-sizing: border-box;
  214. align-items: center;
  215. justify-content: space-around;
  216. width: 100%;
  217. height: 70px;
  218. padding: 0 15px;
  219. transform: translate(0, -40%);
  220. .tcontent-l {
  221. display: flex;
  222. flex: 1;
  223. flex-direction: column;
  224. align-items: center;
  225. justify-content: center;
  226. height: 100%;
  227. color: #9da5aa;
  228. font-size: 14px;
  229. font-weight: bold;
  230. letter-spacing: 2px;
  231. }
  232. .tcontent-c {
  233. display: flex;
  234. flex: 3;
  235. flex-direction: column;
  236. align-items: center;
  237. justify-content: center;
  238. height: 100%;
  239. }
  240. .tcontent-r {
  241. display: flex;
  242. flex: 1;
  243. flex-direction: column;
  244. align-items: center;
  245. justify-content: center;
  246. height: 100%;
  247. color: #9da5aa;
  248. font-size: 14px;
  249. font-weight: bold;
  250. letter-spacing: 2px;
  251. }
  252. }
  253. }
  254. .right-t {
  255. position: absolute;
  256. // height: 160px;
  257. height: 115px;
  258. right: 10px;
  259. top: 50px;
  260. width: 440px;
  261. background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
  262. background-color: #000723;
  263. background-repeat: no-repeat;
  264. background-position: center;
  265. background-size: 100% 100%;
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-around;
  269. z-index: 1;
  270. .tcontent-l {
  271. flex: 1;
  272. height: 100%;
  273. font-size: 16px;
  274. font-weight: bold;
  275. background-image: url(/@/assets/images/home-container/configurable/firehome/znzjxt.png);
  276. background-size: auto 100%;
  277. background-repeat: no-repeat;
  278. background-position: center;
  279. text-align: center;
  280. padding-top: 85px;
  281. }
  282. .tcontent-r {
  283. flex: 1;
  284. height: 100%;
  285. font-size: 16px;
  286. font-weight: bold;
  287. background-image: url(/@/assets/images/home-container/configurable/firehome/znzdxt.png);
  288. background-size: auto 100%;
  289. background-repeat: no-repeat;
  290. background-position: center;
  291. text-align: center;
  292. padding-top: 85px;
  293. }
  294. }
  295. :deep(.loading-box) {
  296. position: unset;
  297. }
  298. </style>