fireBD.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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, devicesTypes, 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: devicesTypes.value.concat('fireAllMineWarn').join(','),
  107. }).then(updateData);
  108. });
  109. setInterval(() => {
  110. getDisHome({
  111. dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
  112. }).then(updateData);
  113. }, 60000);
  114. });
  115. onUnmounted(() => {
  116. clearInterval(interval);
  117. });
  118. function redirectTo(url) {
  119. window.open(url);
  120. }
  121. </script>
  122. <style lang="less" scoped>
  123. @font-face {
  124. font-family: 'douyuFont';
  125. src: url('../../../../assets/font/douyuFont.otf');
  126. }
  127. .company-home {
  128. width: 100%;
  129. height: 100%;
  130. color: @white;
  131. position: relative;
  132. background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  133. .top-bg {
  134. width: 100%;
  135. height: 86px;
  136. background: url(/@/assets/images/home-container/configurable/firehome/fire-title.png) no-repeat center;
  137. position: absolute;
  138. z-index: 1;
  139. .main-title {
  140. height: 86px;
  141. font-family: 'douyuFont';
  142. font-size: 26px;
  143. letter-spacing: 2px;
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. }
  148. }
  149. // .module-left {
  150. // position: absolute;
  151. // width: 440px;
  152. // height: 280px;
  153. // left: 0;
  154. // }
  155. // .module-right {
  156. // position: absolute;
  157. // width: 440px;
  158. // height: 280px;
  159. // right: 0;
  160. // }
  161. // .module-bottom {
  162. // position: absolute;
  163. // width: 1000px;
  164. // height: 280px;
  165. // }
  166. .module-dropdown {
  167. padding: 10px;
  168. background-image: linear-gradient(to bottom, #036886, #072a40);
  169. border-bottom: 2px solid #3df6ff;
  170. color: #fff;
  171. position: absolute;
  172. top: 70px;
  173. right: 460px;
  174. }
  175. .module-dropdown-original {
  176. padding: 10px;
  177. background-image: linear-gradient(to bottom, #036886, #072a40);
  178. border-bottom: 2px solid #3df6ff;
  179. color: #fff;
  180. position: absolute;
  181. top: 70px;
  182. right: 460px;
  183. }
  184. .module-trigger-button {
  185. color: #fff;
  186. background-image: linear-gradient(to bottom, #036886, #072a40);
  187. border: none;
  188. border-bottom: 2px solid #3df6ff;
  189. }
  190. }
  191. .left-t {
  192. position: absolute;
  193. height: 115px;
  194. top: 40px;
  195. left: 10px;
  196. width: 440px;
  197. background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
  198. background-color: #000723;
  199. background-repeat: no-repeat;
  200. background-position: center;
  201. background-size: 100% 100%;
  202. .tcontent-area {
  203. display: flex;
  204. position: absolute;
  205. top: 50%;
  206. left: 0;
  207. box-sizing: border-box;
  208. align-items: center;
  209. justify-content: space-around;
  210. width: 100%;
  211. height: 70px;
  212. padding: 0 15px;
  213. transform: translate(0, -40%);
  214. .tcontent-l {
  215. display: flex;
  216. flex: 1;
  217. flex-direction: column;
  218. align-items: center;
  219. justify-content: center;
  220. height: 100%;
  221. color: #9da5aa;
  222. font-size: 14px;
  223. font-weight: bold;
  224. letter-spacing: 2px;
  225. }
  226. .tcontent-c {
  227. display: flex;
  228. flex: 3;
  229. flex-direction: column;
  230. align-items: center;
  231. justify-content: center;
  232. height: 100%;
  233. }
  234. .tcontent-r {
  235. display: flex;
  236. flex: 1;
  237. flex-direction: column;
  238. align-items: center;
  239. justify-content: center;
  240. height: 100%;
  241. color: #9da5aa;
  242. font-size: 14px;
  243. font-weight: bold;
  244. letter-spacing: 2px;
  245. }
  246. }
  247. }
  248. .right-t {
  249. position: absolute;
  250. // height: 160px;
  251. height: 115px;
  252. right: 10px;
  253. top: 50px;
  254. width: 440px;
  255. background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
  256. background-color: #000723;
  257. background-repeat: no-repeat;
  258. background-position: center;
  259. background-size: 100% 100%;
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-around;
  263. z-index: 1;
  264. .tcontent-l {
  265. flex: 1;
  266. height: 100%;
  267. font-size: 16px;
  268. font-weight: bold;
  269. background-image: url(/@/assets/images/home-container/configurable/firehome/znzjxt.png);
  270. background-size: auto 100%;
  271. background-repeat: no-repeat;
  272. background-position: center;
  273. text-align: center;
  274. padding-top: 85px;
  275. }
  276. .tcontent-r {
  277. flex: 1;
  278. height: 100%;
  279. font-size: 16px;
  280. font-weight: bold;
  281. background-image: url(/@/assets/images/home-container/configurable/firehome/znzdxt.png);
  282. background-size: auto 100%;
  283. background-repeat: no-repeat;
  284. background-position: center;
  285. text-align: center;
  286. padding-top: 85px;
  287. }
  288. }
  289. :deep(.loading-box) {
  290. position: unset;
  291. }
  292. </style>