index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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">火灾风险</div>
  28. </div>
  29. </div>
  30. <div class="right-t">
  31. <DanelBd :moduleName="''" :contentStyle="{ contentH: '121px' }" :bgSize="'small'">
  32. <systemJc />
  33. </DanelBd>
  34. </div> -->
  35. <template v-if="isOriginal">
  36. <ModuleOriginal
  37. v-for="cfg in configs"
  38. :key="cfg.deviceType"
  39. :show-style="cfg.showStyle"
  40. :module-data="cfg.moduleData"
  41. :module-name="cfg.moduleName"
  42. :device-type="cfg.deviceType"
  43. :visible="true"
  44. />
  45. </template>
  46. <template v-else-if="isCommon">
  47. <ModuleCommon
  48. v-for="cfg in configs"
  49. :key="cfg.deviceType"
  50. :show-style="cfg.showStyle"
  51. :module-data="cfg.moduleData"
  52. :module-name="cfg.moduleName"
  53. :device-type="cfg.deviceType"
  54. :visible="true"
  55. />
  56. </template>
  57. <template v-else-if="isBD">
  58. <ModuleBD
  59. v-for="cfg in configs"
  60. :key="cfg.deviceType"
  61. :show-style="cfg.showStyle"
  62. :module-data="cfg.moduleData"
  63. :module-name="cfg.moduleName"
  64. :device-type="cfg.deviceType"
  65. :visible="true"
  66. />
  67. </template>
  68. <template v-else>
  69. <!-- 下面是正常展示的各新版模块 -->
  70. <ModuleEnhanced
  71. v-for="cfg in enhancedConfigs"
  72. :key="cfg.deviceType"
  73. :visible="cfg.visible"
  74. :show-style="cfg.showStyle"
  75. :module-data="cfg.moduleData"
  76. :module-name="cfg.moduleName"
  77. :device-type="cfg.deviceType"
  78. @close="cfg.visible = false"
  79. />
  80. <!-- 下面是用于呼出已隐藏的模块的按钮 -->
  81. <div class="pos-absolute top-70px left-460px">
  82. <div v-for="(item, i) in hiddenList" :key="`vvhchg${i}`">
  83. <AButton class="module-trigger-button" @click="item.visible = true">{{ item.moduleName }}</AButton>
  84. </div>
  85. </div>
  86. </template>
  87. </div>
  88. </template>
  89. <script lang="ts" setup>
  90. import { computed, onMounted, ref } from 'vue';
  91. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  92. // import MonitorCenter from './components/MonitorCenter.vue';
  93. import { useInitConfigs } from './hooks/useInit';
  94. import { Config } from '../../deviceManager/configurationTable/types';
  95. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  96. import ModuleOriginal from './components/ModuleOriginal.vue';
  97. import ModuleCommon from './components/ModuleCommon.vue';
  98. import ModuleBD from './components/ModuleBD.vue';
  99. import { testConfigA } from './configurable.data';
  100. import { useRoute } from 'vue-router';
  101. interface EnhancedConfig extends Config {
  102. visible: boolean;
  103. }
  104. const mainTitle = ref('智能通风管控系统');
  105. // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
  106. const enhancedConfigs = ref<EnhancedConfig[]>([]);
  107. const hiddenList = computed(() => {
  108. return enhancedConfigs.value.filter((e) => e.visible === false);
  109. });
  110. const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
  111. onMounted(() => {
  112. const query = useRoute().query;
  113. if (query.fire) {
  114. mainTitle.value = '智能火灾管控系统';
  115. }
  116. if (query.gas) {
  117. mainTitle.value = '智能瓦斯管控系统';
  118. }
  119. // configs.value = testConfigB;
  120. fetchConfigs().then(() => {
  121. configs.value = testConfigA;
  122. // configs.value.push(...testConfigA);
  123. enhancedConfigs.value = configs.value.map((c) => {
  124. return {
  125. visible: true,
  126. ...c,
  127. };
  128. });
  129. });
  130. });
  131. </script>
  132. <style lang="less" scoped>
  133. @font-face {
  134. font-family: 'douyuFont';
  135. src: url('../../../../assets/font/douyuFont.otf');
  136. }
  137. .company-home {
  138. width: 100%;
  139. height: 100%;
  140. color: @white;
  141. position: relative;
  142. background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  143. .top-bg {
  144. width: 100%;
  145. height: 56px;
  146. background: url('@/assets/images/home-container/configurable/main_title_bg.png') no-repeat center;
  147. position: absolute;
  148. z-index: 1;
  149. .main-title {
  150. height: 56px;
  151. font-family: 'douyuFont';
  152. font-size: 20px;
  153. letter-spacing: 2px;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. }
  158. }
  159. // .module-left {
  160. // position: absolute;
  161. // width: 450px;
  162. // height: 280px;
  163. // left: 0;
  164. // }
  165. // .module-right {
  166. // position: absolute;
  167. // width: 450px;
  168. // height: 280px;
  169. // right: 0;
  170. // }
  171. // .module-bottom {
  172. // position: absolute;
  173. // width: 1000px;
  174. // height: 280px;
  175. // }
  176. .module-dropdown {
  177. padding: 10px;
  178. background-image: linear-gradient(to bottom, #036886, #072a40);
  179. border-bottom: 2px solid #3df6ff;
  180. color: #fff;
  181. position: absolute;
  182. top: 70px;
  183. right: 460px;
  184. }
  185. .module-dropdown-original {
  186. padding: 10px;
  187. background-image: linear-gradient(to bottom, #036886, #072a40);
  188. border-bottom: 2px solid #3df6ff;
  189. color: #fff;
  190. position: absolute;
  191. top: 70px;
  192. right: 460px;
  193. }
  194. .module-trigger-button {
  195. color: #fff;
  196. background-image: linear-gradient(to bottom, #036886, #072a40);
  197. border: none;
  198. border-bottom: 2px solid #3df6ff;
  199. }
  200. }
  201. .left-t {
  202. position: absolute;
  203. height: 115px;
  204. margin-bottom: 25px;
  205. width: 450px;
  206. background: url('../../../../assets/images/fire/firehome/qkjaq.png') no-repeat 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. width: 450px;
  257. }
  258. </style>