ventSDG.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. </div> -->
  7. <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; z-index: 0">
  8. <a-spin :spinning="loading" />
  9. <div id="balancePress3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  10. <!-- <div id="damper3DCSS" v-show="!loading" style="width: 100%; height: 100%; top:0; left: 0; position: absolute; overflow: hidden;">
  11. <div>
  12. <div ref="elementContent" class="elementContent">
  13. <p><span class="data-title">压力(Pa):</span>{{selectData.frontRearDP}}</p>
  14. <p><span class="data-title">动力源压力(MPa):</span>{{selectData.sourcePressure}}</p>
  15. <p><span class="data-title">故障诊断:</span>
  16. <i
  17. :class="{'state-icon': true, 'open': selectData.messageBoxStatus, 'close': !selectData.messageBoxStatus}"
  18. ></i>{{selectData.fault}}</p>
  19. </div>
  20. </div>
  21. </div> -->
  22. </div>
  23. <!-- 如果是有 deviceType、type 等 query,认为是详情页,不需要展示普通模块,只需要模型 -->
  24. <CustomHeader v-if="!route.query.embed">{{ mainTitle }}</CustomHeader>
  25. <!-- <a class="ant-dropdown-link module-dropdown" @click.prevent="showBar = !showBar">
  26. 全矿井通风检测
  27. <CaretDownOutlined />
  28. </a> -->
  29. <!-- <MonitorBar v-if="showBar" class="module-monitor-bar" :is-data-real-time="isDataRealTime" :data="data" /> -->
  30. <!-- <a-dropdown class="module-dropdown" :class="{ 'module-dropdown-original': isOriginal }" :trigger="['click']" placement="bottomRight">
  31. <template #overlay>
  32. </template>
  33. </a-dropdown> -->
  34. <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
  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. :data="data"
  44. :visible="showModules"
  45. />
  46. <div v-if="showModules" class="switch-button icon-goto right-475px bottom-300px" @click="showModules = false"></div>
  47. <div v-else class="switch-button icon-goto right-20px bottom-20px" @click="showModules = true"></div>
  48. </template>
  49. <template v-else-if="isCommon">
  50. <ModuleCommon
  51. v-for="cfg in configs"
  52. :key="cfg.deviceType"
  53. :show-style="cfg.showStyle"
  54. :module-data="cfg.moduleData"
  55. :module-name="cfg.moduleName"
  56. :device-type="cfg.deviceType"
  57. :data="data"
  58. :visible="true"
  59. />
  60. </template>
  61. <template v-else>
  62. <!-- 下面是正常展示的各新版模块 -->
  63. <ModuleEnhanced
  64. v-for="cfg in enhancedConfigs"
  65. :key="cfg.deviceType"
  66. :visible="cfg.visible"
  67. :show-style="cfg.showStyle"
  68. :module-data="cfg.moduleData"
  69. :module-name="cfg.moduleName"
  70. :device-type="cfg.deviceType"
  71. :data="data"
  72. @close="cfg.visible = false"
  73. />
  74. <!-- 下面是用于呼出已隐藏的模块的按钮 -->
  75. <div class="flex pos-absolute bottom-10px left-60px z-3">
  76. <div v-for="(item, i) in hiddenList" :key="`vvhchg${i}`">
  77. <AButton class="module-trigger-button" @click="item.visible = true">{{ item.moduleName }}</AButton>
  78. </div>
  79. </div>
  80. </template>
  81. <!-- <div
  82. v-if="sysDataType === 'all'"
  83. :class="{ 'realtime-mode': isDataRealTime }"
  84. alt="切换数据模式"
  85. class="switch-button report-mode right-525px"
  86. @click="switchDataMode"
  87. ></div> -->
  88. </div>
  89. </template>
  90. <script lang="ts" setup>
  91. import CustomHeader from '/@/components/vent/customHeader.vue';
  92. import { onMounted, onUnmounted, ref, watch } from 'vue';
  93. // import { CaretDownOutlined } from '@ant-design/icons-vue';
  94. // import MonitorBar from './components/MonitorBar.vue';
  95. import { useInitConfigs, useInitPage } from './hooks/useInit';
  96. import ModuleEnhanced from './components/ModuleEnhanced.vue';
  97. import ModuleOriginal from './components/ModuleOriginal.vue';
  98. import ModuleCommon from './components/ModuleCommon.vue';
  99. // import { useRoute } from 'vue-router';
  100. // import VentModal from '/@/components/vent/micro/ventModal.vue';
  101. import { mountedThree, destroy, setModelType, play } from '/@/views/vent/monitorManager/balancePressMonitor/balancePress.threejs';
  102. import { list } from './configurable.api';
  103. import { useRoute } from 'vue-router';
  104. import { useGlobSetting } from '/@/hooks/setting';
  105. import { testConfigSDG } from './configurable.data.wz';
  106. const { sysDataType = 'monitor', title = '三道沟煤矿均压综采面智能监测与动态调控', sysOrgCode } = useGlobSetting();
  107. const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
  108. const { enhancedConfigs, hiddenList, data, updateData, updateEnhancedConfigs, mainTitle } = useInitPage(title);
  109. const route = useRoute();
  110. // const router = useRouter();
  111. const isDataRealTime = ref(sysDataType === 'monitor');
  112. // const showBar = ref(true);
  113. const loading = ref(false);
  114. const showModules = ref(true);
  115. let interval: number | undefined;
  116. // function switchDataMode() {
  117. // isDataRealTime.value = !isDataRealTime.value;
  118. // refresh();
  119. // }
  120. function refresh() {
  121. fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
  122. configs.value = testConfigSDG;
  123. updateEnhancedConfigs(configs.value);
  124. // 测风装置 windrect
  125. // 自动风窗 window
  126. // 自动风门 gate
  127. // 传感器 modelsensor
  128. // 局部通风机 fanlocal
  129. // 主通风机 fanmain
  130. // 密闭 obfurage
  131. // 安全监控 safetymonitor
  132. // 光纤测温 fiber
  133. // 束管监测 bundletube
  134. // 制氮 nitrogen
  135. // 制浆 pulping
  136. // 喷淋 spray
  137. // 喷粉 dustdev
  138. // 喷雾设备 atomizing
  139. // 除尘风机 dedustefan
  140. // 粉尘传感器 dustsensor
  141. // 转载点 transferpoint
  142. // 瓦斯抽采泵 pump
  143. // 粉尘 dusting
  144. // 瓦斯监测 gasmonitor
  145. // 球阀 ballvalve
  146. // 压风机 forcFan
  147. // 瓦斯巡检 gaspatrol
  148. // 防火门 firedoor
  149. // 隔爆设施 explosionProof
  150. // 瓦斯管道阀门 gasvalve
  151. list({
  152. types: configs.value
  153. .filter((e) => e.deviceType)
  154. .map((e) => e.deviceType)
  155. .join(','),
  156. }).then(updateData);
  157. });
  158. }
  159. function initInterval() {
  160. setInterval(() => {
  161. list({
  162. types: configs.value
  163. .filter((e) => e.deviceType)
  164. .map((e) => e.deviceType)
  165. .join(','),
  166. }).then(updateData);
  167. }, 60000);
  168. }
  169. // function goMicroApp() {
  170. // router.push({
  171. // path: route.path,
  172. // query: {
  173. // ...route.query,
  174. // type: 'model3D',
  175. // deviceType: 'model3D',
  176. // },
  177. // });
  178. // }
  179. watch(
  180. () => route.query,
  181. () => {
  182. if (route.query.deviceType) {
  183. // 仅需要展示子应用,模拟 unmounted
  184. clearInterval(interval);
  185. } else {
  186. // 模拟 mounted
  187. refresh();
  188. initInterval();
  189. }
  190. }
  191. );
  192. onMounted(() => {
  193. refresh();
  194. initInterval();
  195. mountedThree().then(async () => {
  196. if (sysOrgCode === 'jsnyspmy') {
  197. await setModelType('balancePressSp'); //balancePressBase
  198. } else {
  199. await setModelType('balancePressTun'); //balancePressBase
  200. }
  201. loading.value = false;
  202. play('startSmoke', 'top', 30, 'open', 0);
  203. });
  204. });
  205. onUnmounted(() => {
  206. destroy();
  207. clearInterval(interval);
  208. });
  209. </script>
  210. <style lang="less" scoped>
  211. @import '/@/design/theme.less';
  212. @font-face {
  213. font-family: 'douyuFont';
  214. src: url('/@/assets/font/douyuFont.otf');
  215. }
  216. @{theme-deepblue} {
  217. .company-home {
  218. --image-modal-top: url('/@/assets/images/themify/deepblue/vent/home/modal-top.png');
  219. }
  220. }
  221. .company-home {
  222. --image-modal-top: url('/@/assets/images/vent/home/modal-top.png');
  223. --image-monitor-realtime: url('/@/assets/images/company/monitor-realtime.png');
  224. --image-monitor-doc: url('/@/assets/images/company/monitor-doc.png');
  225. --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
  226. width: 100%;
  227. height: 100%;
  228. color: @white;
  229. position: relative;
  230. // background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  231. .top-bg {
  232. width: 100%;
  233. height: 56px;
  234. background: var(--image-modal-top) no-repeat center;
  235. position: absolute;
  236. z-index: 1;
  237. .main-title {
  238. height: 56px;
  239. font-family: 'douyuFont';
  240. font-size: 20px;
  241. letter-spacing: 2px;
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. }
  246. }
  247. // .module-left {
  248. // position: absolute;
  249. // width: 450px;
  250. // height: 280px;
  251. // left: 0;
  252. // }
  253. // .module-right {
  254. // position: absolute;
  255. // width: 450px;
  256. // height: 280px;
  257. // right: 0;
  258. // }
  259. // .module-bottom {
  260. // position: absolute;
  261. // width: 1000px;
  262. // height: 280px;
  263. // }
  264. .module-dropdown {
  265. padding: 5px;
  266. background-image: @vent-configurable-dropdown;
  267. border-bottom: 2px solid @vent-configurable-home-light-border;
  268. color: @vent-font-color;
  269. position: absolute;
  270. top: 60px;
  271. right: 480px;
  272. }
  273. .module-dropdown-original {
  274. padding: 10px;
  275. background-image: @vent-configurable-dropdown;
  276. border-bottom: 2px solid @vent-configurable-home-light-border;
  277. color: @vent-font-color;
  278. position: absolute;
  279. top: 70px;
  280. right: 460px;
  281. }
  282. .module-trigger-button {
  283. color: @vent-font-color;
  284. background-image: @vent-configurable-dropdown;
  285. border: none;
  286. border-bottom: 2px solid @vent-configurable-home-light-border;
  287. }
  288. .switch-button {
  289. width: 34px;
  290. height: 34px;
  291. position: absolute;
  292. // right: 5px;
  293. // bottom: 300px;
  294. z-index: 5;
  295. background-repeat: no-repeat;
  296. background-size: 100% 100%;
  297. }
  298. .report-mode {
  299. background-image: var(--image-monitor-doc);
  300. }
  301. .realtime-mode {
  302. background-image: var(--image-monitor-realtime);
  303. }
  304. .icon-goto {
  305. background-image: var(--image-monitor-goto);
  306. }
  307. .module-monitor-bar {
  308. position: absolute;
  309. top: 100px;
  310. width: 1000px;
  311. height: 200px;
  312. left: calc(50% - 500px);
  313. }
  314. }
  315. :deep(.loading-box) {
  316. position: unset;
  317. }
  318. </style>