fireBD.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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">低风险</div>
  25. <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div>
  26. </div>
  27. <div class="tcontent-r">
  28. <div>火灾</div>
  29. <div>风险</div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="right-t">
  34. <div class="tcontent-l" @click="redirectTo('https://bing.cn')">
  35. <div>智能</div>
  36. <div>灌浆系统</div>
  37. </div>
  38. <div class="tcontent-r" @click="redirectTo('https://bing.cn')">
  39. <div>智能</div>
  40. <div>注氟系统</div>
  41. </div>
  42. </div>
  43. <template v-if="isOriginal">
  44. <ModuleOriginal
  45. v-for="cfg in configs"
  46. :key="cfg.deviceType"
  47. :show-style="cfg.showStyle"
  48. :module-data="cfg.moduleData"
  49. :module-name="cfg.moduleName"
  50. :device-type="cfg.deviceType"
  51. :visible="true"
  52. />
  53. </template>
  54. <template v-else-if="isCommon">
  55. <ModuleCommon
  56. v-for="cfg in configs"
  57. :key="cfg.deviceType"
  58. :show-style="cfg.showStyle"
  59. :module-data="cfg.moduleData"
  60. :module-name="cfg.moduleName"
  61. :device-type="cfg.deviceType"
  62. :visible="true"
  63. />
  64. </template>
  65. <template v-else-if="isBD">
  66. <ModuleBD
  67. v-for="cfg in configs"
  68. :key="cfg.deviceType"
  69. :show-style="cfg.showStyle"
  70. :module-data="cfg.moduleData"
  71. :module-name="cfg.moduleName"
  72. :device-type="cfg.deviceType"
  73. :visible="true"
  74. />
  75. </template>
  76. <template v-else>
  77. <!-- 下面是正常展示的各新版模块 -->
  78. <ModuleEnhanced
  79. v-for="cfg in enhancedConfigs"
  80. :key="cfg.deviceType"
  81. :visible="cfg.visible"
  82. :show-style="cfg.showStyle"
  83. :module-data="cfg.moduleData"
  84. :module-name="cfg.moduleName"
  85. :device-type="cfg.deviceType"
  86. @close="cfg.visible = false"
  87. />
  88. <!-- 下面是用于呼出已隐藏的模块的按钮 -->
  89. <div class="pos-absolute top-70px left-460px">
  90. <div v-for="(item, i) in hiddenList" :key="`vvhchg${i}`">
  91. <AButton class="module-trigger-button" @click="item.visible = true">{{ item.moduleName }}</AButton>
  92. </div>
  93. </div>
  94. </template>
  95. <VentModal style="width: 100%; height: 100%; position: absolute" />
  96. </div>
  97. </template>
  98. <script lang="ts" setup>
  99. import { computed, onMounted, ref } from 'vue';
  100. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  101. // import MonitorCenter from './components/MonitorCenter.vue';
  102. import { useInitConfigs } from './hooks/useInit';
  103. import { Config } from '../../deviceManager/configurationTable/types';
  104. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  105. import ModuleOriginal from './components/ModuleOriginal.vue';
  106. import ModuleCommon from './components/ModuleCommon.vue';
  107. import ModuleBD from './components/ModuleBD.vue';
  108. import { testConfigBDFire } from './configurable.data';
  109. import VentModal from '/@/components/vent/micro/ventModal.vue';
  110. interface EnhancedConfig extends Config {
  111. visible: boolean;
  112. }
  113. const mainTitle = ref('保德煤矿火灾预警系统');
  114. // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
  115. const enhancedConfigs = ref<EnhancedConfig[]>([]);
  116. const hiddenList = computed(() => {
  117. return enhancedConfigs.value.filter((e) => e.visible === false);
  118. });
  119. const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
  120. onMounted(() => {
  121. // configs.value = testConfigB;
  122. fetchConfigs().then(() => {
  123. configs.value = testConfigBDFire;
  124. // configs.value.push(...testConfigBDFire);
  125. enhancedConfigs.value = configs.value.map((c) => {
  126. return {
  127. visible: true,
  128. ...c,
  129. };
  130. });
  131. });
  132. });
  133. function redirectTo(url) {
  134. window.open(url);
  135. }
  136. </script>
  137. <style lang="less" scoped>
  138. @font-face {
  139. font-family: 'douyuFont';
  140. src: url('../../../../assets/font/douyuFont.otf');
  141. }
  142. .company-home {
  143. width: 100%;
  144. height: 100%;
  145. color: @white;
  146. position: relative;
  147. background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  148. .top-bg {
  149. width: 100%;
  150. height: 56px;
  151. background: url(/@/assets/images/home-container/configurable/firehome/fire-title.png) no-repeat center;
  152. position: absolute;
  153. z-index: 1;
  154. .main-title {
  155. height: 56px;
  156. font-family: 'douyuFont';
  157. font-size: 20px;
  158. letter-spacing: 2px;
  159. display: flex;
  160. justify-content: center;
  161. align-items: center;
  162. }
  163. }
  164. // .module-left {
  165. // position: absolute;
  166. // width: 450px;
  167. // height: 280px;
  168. // left: 0;
  169. // }
  170. // .module-right {
  171. // position: absolute;
  172. // width: 450px;
  173. // height: 280px;
  174. // right: 0;
  175. // }
  176. // .module-bottom {
  177. // position: absolute;
  178. // width: 1000px;
  179. // height: 280px;
  180. // }
  181. .module-dropdown {
  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-dropdown-original {
  191. padding: 10px;
  192. background-image: linear-gradient(to bottom, #036886, #072a40);
  193. border-bottom: 2px solid #3df6ff;
  194. color: #fff;
  195. position: absolute;
  196. top: 70px;
  197. right: 460px;
  198. }
  199. .module-trigger-button {
  200. color: #fff;
  201. background-image: linear-gradient(to bottom, #036886, #072a40);
  202. border: none;
  203. border-bottom: 2px solid #3df6ff;
  204. }
  205. }
  206. .left-t {
  207. position: absolute;
  208. height: 115px;
  209. top: 30px;
  210. width: 450px;
  211. background-image: url('/@/assets/images/home-container/configurable/firehome/qkjaq.png');
  212. background-color: #000723;
  213. background-repeat: no-repeat;
  214. background-position: center;
  215. background-size: 100% 100%;
  216. .tcontent-area {
  217. display: flex;
  218. position: absolute;
  219. top: 50%;
  220. left: 0;
  221. box-sizing: border-box;
  222. align-items: center;
  223. justify-content: space-around;
  224. width: 100%;
  225. height: 70px;
  226. padding: 0 15px;
  227. transform: translate(0, -40%);
  228. .tcontent-l {
  229. display: flex;
  230. flex: 1;
  231. flex-direction: column;
  232. align-items: center;
  233. justify-content: center;
  234. height: 100%;
  235. color: #9da5aa;
  236. font-size: 14px;
  237. font-weight: bold;
  238. letter-spacing: 2px;
  239. }
  240. .tcontent-c {
  241. display: flex;
  242. flex: 3;
  243. flex-direction: column;
  244. align-items: center;
  245. justify-content: center;
  246. height: 100%;
  247. }
  248. .tcontent-r {
  249. display: flex;
  250. flex: 1;
  251. flex-direction: column;
  252. align-items: center;
  253. justify-content: center;
  254. height: 100%;
  255. color: #9da5aa;
  256. font-size: 14px;
  257. font-weight: bold;
  258. letter-spacing: 2px;
  259. }
  260. }
  261. }
  262. .right-t {
  263. position: absolute;
  264. height: 160px;
  265. right: 0;
  266. top: 40px;
  267. width: 450px;
  268. background-image: url('/@/assets/images/home-container/configurable/firehome/common-border2.png');
  269. background-color: #000723;
  270. background-repeat: no-repeat;
  271. background-position: center;
  272. background-size: 100% 100%;
  273. display: flex;
  274. align-items: center;
  275. justify-content: space-around;
  276. .tcontent-l {
  277. flex: 1;
  278. height: 70%;
  279. font-size: 20px;
  280. font-weight: bold;
  281. background-image: url(/@/assets/images/home-container/configurable/firehome/img-5.png),
  282. url(/@/assets/images/home-container/configurable/firehome/ggxt.png);
  283. background-size:
  284. auto 100%,
  285. auto auto;
  286. background-repeat: no-repeat;
  287. background-position:
  288. center,
  289. center top;
  290. text-align: center;
  291. padding-top: 40px;
  292. line-height: 50px;
  293. }
  294. .tcontent-r {
  295. flex: 1;
  296. height: 70%;
  297. font-size: 20px;
  298. font-weight: bold;
  299. background-image: url(/@/assets/images/home-container/configurable/firehome/img-5.png),
  300. url(/@/assets/images/home-container/configurable/firehome/zjxt.png);
  301. background-size:
  302. auto 100%,
  303. auto auto;
  304. background-repeat: no-repeat;
  305. background-position:
  306. center,
  307. center top;
  308. text-align: center;
  309. padding-top: 40px;
  310. line-height: 50px;
  311. }
  312. }
  313. </style>