ventSDG.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. fetchConfigs('vent').then(() => {
  123. // configs.value = testConfigSDG;
  124. updateEnhancedConfigs(configs.value);
  125. // 测风装置 windrect
  126. // 自动风窗 window
  127. // 自动风门 gate
  128. // 传感器 modelsensor
  129. // 局部通风机 fanlocal
  130. // 主通风机 fanmain
  131. // 密闭 obfurage
  132. // 安全监控 safetymonitor
  133. // 光纤测温 fiber
  134. // 束管监测 bundletube
  135. // 制氮 nitrogen
  136. // 制浆 pulping
  137. // 喷淋 spray
  138. // 喷粉 dustdev
  139. // 喷雾设备 atomizing
  140. // 除尘风机 dedustefan
  141. // 粉尘传感器 dustsensor
  142. // 转载点 transferpoint
  143. // 瓦斯抽采泵 pump
  144. // 粉尘 dusting
  145. // 瓦斯监测 gasmonitor
  146. // 球阀 ballvalve
  147. // 压风机 forcFan
  148. // 瓦斯巡检 gaspatrol
  149. // 防火门 firedoor
  150. // 隔爆设施 explosionProof
  151. // 瓦斯管道阀门 gasvalve
  152. list({
  153. types: configs.value
  154. .filter((e) => e.deviceType)
  155. .map((e) => e.deviceType)
  156. .join(','),
  157. }).then(updateData);
  158. });
  159. }
  160. function initInterval() {
  161. setInterval(() => {
  162. list({
  163. types: configs.value
  164. .filter((e) => e.deviceType)
  165. .map((e) => e.deviceType)
  166. .join(','),
  167. }).then(updateData);
  168. }, 60000);
  169. }
  170. // function goMicroApp() {
  171. // router.push({
  172. // path: route.path,
  173. // query: {
  174. // ...route.query,
  175. // type: 'model3D',
  176. // deviceType: 'model3D',
  177. // },
  178. // });
  179. // }
  180. watch(
  181. () => route.query,
  182. () => {
  183. if (route.query.deviceType) {
  184. // 仅需要展示子应用,模拟 unmounted
  185. clearInterval(interval);
  186. } else {
  187. // 模拟 mounted
  188. refresh();
  189. initInterval();
  190. }
  191. }
  192. );
  193. onMounted(() => {
  194. refresh();
  195. initInterval();
  196. mountedThree().then(async () => {
  197. if (sysOrgCode === 'jsnyspmy') {
  198. await setModelType('balancePressSp'); //balancePressBase
  199. } else {
  200. await setModelType('balancePressTun'); //balancePressBase
  201. }
  202. loading.value = false;
  203. play('startSmoke', 'top', 30, 'open', 0);
  204. });
  205. });
  206. onUnmounted(() => {
  207. destroy();
  208. clearInterval(interval);
  209. });
  210. </script>
  211. <style lang="less" scoped>
  212. @import '/@/design/theme.less';
  213. @font-face {
  214. font-family: 'douyuFont';
  215. src: url('/@/assets/font/douyuFont.otf');
  216. }
  217. @{theme-deepblue} {
  218. .company-home {
  219. --image-modal-top: url('/@/assets/images/themify/deepblue/vent/home/modal-top.png');
  220. }
  221. }
  222. .company-home {
  223. --image-modal-top: url('/@/assets/images/vent/home/modal-top.png');
  224. --image-monitor-realtime: url('/@/assets/images/company/monitor-realtime.png');
  225. --image-monitor-doc: url('/@/assets/images/company/monitor-doc.png');
  226. --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
  227. width: 100%;
  228. height: 100%;
  229. color: @white;
  230. position: relative;
  231. // background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
  232. .top-bg {
  233. width: 100%;
  234. height: 56px;
  235. background: var(--image-modal-top) no-repeat center;
  236. position: absolute;
  237. z-index: 1;
  238. .main-title {
  239. height: 56px;
  240. font-family: 'douyuFont';
  241. font-size: 20px;
  242. letter-spacing: 2px;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. }
  247. }
  248. // .module-left {
  249. // position: absolute;
  250. // width: 450px;
  251. // height: 280px;
  252. // left: 0;
  253. // }
  254. // .module-right {
  255. // position: absolute;
  256. // width: 450px;
  257. // height: 280px;
  258. // right: 0;
  259. // }
  260. // .module-bottom {
  261. // position: absolute;
  262. // width: 1000px;
  263. // height: 280px;
  264. // }
  265. .module-dropdown {
  266. padding: 5px;
  267. background-image: @vent-configurable-dropdown;
  268. border-bottom: 2px solid @vent-configurable-home-light-border;
  269. color: @vent-font-color;
  270. position: absolute;
  271. top: 60px;
  272. right: 480px;
  273. }
  274. .module-dropdown-original {
  275. padding: 10px;
  276. background-image: @vent-configurable-dropdown;
  277. border-bottom: 2px solid @vent-configurable-home-light-border;
  278. color: @vent-font-color;
  279. position: absolute;
  280. top: 70px;
  281. right: 460px;
  282. }
  283. .module-trigger-button {
  284. color: @vent-font-color;
  285. background-image: @vent-configurable-dropdown;
  286. border: none;
  287. border-bottom: 2px solid @vent-configurable-home-light-border;
  288. }
  289. .switch-button {
  290. width: 34px;
  291. height: 34px;
  292. position: absolute;
  293. // right: 5px;
  294. // bottom: 300px;
  295. z-index: 5;
  296. background-repeat: no-repeat;
  297. background-size: 100% 100%;
  298. }
  299. .report-mode {
  300. background-image: var(--image-monitor-doc);
  301. }
  302. .realtime-mode {
  303. background-image: var(--image-monitor-realtime);
  304. }
  305. .icon-goto {
  306. background-image: var(--image-monitor-goto);
  307. }
  308. .module-monitor-bar {
  309. position: absolute;
  310. top: 100px;
  311. width: 1000px;
  312. height: 200px;
  313. left: calc(50% - 500px);
  314. }
  315. }
  316. :deep(.loading-box) {
  317. position: unset;
  318. }
  319. </style>