dustControl.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="company-home" ref="dustControlContainer">
  4. <!-- 顶部标题样式块 -->
  5. <div class="top-bg">
  6. <div class="main-title">{{ mainTitle }}</div>
  7. </div>
  8. <div id="dedust3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  9. <div
  10. v-show="!loading"
  11. id="dedustCss"
  12. style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 2; top: 0px; left: 0px"
  13. >
  14. <div id="dedustEnvA"> </div>
  15. <div id="dedustEnvB"> </div>
  16. </div>
  17. <!-- 渲染所有模块 -->
  18. <ModuleCommon
  19. v-for="cfg in cfgs"
  20. :key="cfg.deviceType + cfg.moduleName"
  21. :show-style="cfg.showStyle"
  22. :module-data="cfg.moduleData"
  23. :module-name="cfg.moduleName"
  24. :device-type="cfg.deviceType"
  25. :data="data"
  26. :visible="true"
  27. />
  28. </div>
  29. </template>
  30. <script lang="ts" setup>
  31. import { computed, onMounted, onUnmounted, ref, provide } from 'vue';
  32. import { useInitConfigs, useInitPage } from './hooks/useInit';
  33. import { testConfigDustControl } from './configurable.data.dustControl';
  34. import ModuleCommon from './components/ModuleCommon.vue';
  35. import { mountedThree, destroy, setModelType } from '/@/views/vent/monitorManager/dedustMonitor/dedust.threejs';
  36. const cfgs = computed(() => configs.value);
  37. const loading = ref(false);
  38. const { configs, fetchConfigs } = useInitConfigs();
  39. const { mainTitle, data } = useInitPage('除尘装置控制系统');
  40. let interval: ReturnType<typeof setInterval> | undefined;
  41. // 新增:获取容器DOM元素
  42. const dustControlContainer = ref<HTMLDivElement>();
  43. onMounted(() => {
  44. loading.value = true;
  45. mountedThree('#dedust3D', ['#dedustCss', '#dedustEnvA', '#dedustEnvB']).then(() => {
  46. setModelType('dedust').finally(() => {
  47. loading.value = false;
  48. });
  49. });
  50. fetchConfigs('mine_fire').then(() => {
  51. configs.value = testConfigDustControl;
  52. // getDisHome({
  53. // dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
  54. // }).then(updateData);
  55. });
  56. interval = setInterval(() => {
  57. // getDisHome({
  58. // dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
  59. // }).then(updateData);
  60. }, 2000);
  61. });
  62. // 提供处理函数(关键:跨层级传递给buttonList)
  63. provide('handleButtonConfirm', (button) => {
  64. console.log('祖父组件收到数据:', button);
  65. // 对按钮事件进行处理
  66. });
  67. provide('handleRadioChange', (value) => {
  68. console.log('祖父组件收到数据:', value);
  69. // 对切换事件进行处理
  70. });
  71. onUnmounted(() => {
  72. destroy();
  73. clearInterval(interval);
  74. });
  75. </script>
  76. <style lang="less" scoped>
  77. @import '/@/design/theme.less';
  78. @font-face {
  79. font-family: 'douyuFont';
  80. src: url('../../../../assets/font/douyuFont.otf');
  81. }
  82. .company-home {
  83. --image-fire-title: url(/@/assets/images/vent/vent-header1.png);
  84. --image-common-border1: url('/@/assets/images/home-container/configurable/minehome/common-border1.png');
  85. --image-common-border3: url('/@/assets/images/home-container/configurable/minehome/common-border3.png');
  86. width: 100%;
  87. height: 100%;
  88. color: @white;
  89. position: relative;
  90. background: #09172c;
  91. .top-bg {
  92. width: 100%;
  93. height: 73px;
  94. background: var(--image-fire-title) no-repeat top;
  95. position: absolute;
  96. z-index: 1;
  97. .main-title {
  98. height: 80px;
  99. font-family: 'douyuFont';
  100. font-size: 26px;
  101. letter-spacing: 2px;
  102. display: flex;
  103. justify-content: center;
  104. align-items: center;
  105. padding: 0 0 10px 0;
  106. }
  107. }
  108. // 顶部中间样式块
  109. .center-info-bar {
  110. position: relative;
  111. top: 75px;
  112. left: 50%;
  113. transform: translateX(-50%);
  114. width: 900px;
  115. height: 160px;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. background: url('@/assets/images/home-container/configurable/tashanhome/center-bar-bg.png') no-repeat center;
  120. .center-info-content {
  121. position: relative;
  122. top: 15px;
  123. background: url('@/assets/images/home-container/configurable/tashanhome/center-bar-circle.png') no-repeat center;
  124. width: 160px;
  125. height: 160px;
  126. text-align: center;
  127. .info-value {
  128. position: absolute;
  129. top: 34%;
  130. left: 50%;
  131. transform: translateX(-50%);
  132. font-family: 'douyuFont';
  133. font-size: 25px;
  134. color: #2cffdd;
  135. }
  136. .info-label {
  137. width: 100%;
  138. position: absolute;
  139. bottom: 25px;
  140. font-size: 17px;
  141. left: 50%;
  142. transform: translateX(-50%);
  143. }
  144. }
  145. .left-info-content {
  146. position: relative;
  147. text-align: right;
  148. .left-block {
  149. position: absolute;
  150. width: 190px;
  151. height: 55px;
  152. background: url('@/assets/images/home-container/configurable/tashanhome/leftbar-bg1.png') no-repeat right;
  153. padding-right: 52px;
  154. .info-value {
  155. height: 28px;
  156. line-height: 28px;
  157. font-family: 'douyuFont';
  158. font-size: 12px;
  159. color: var(--vent-gas-primary-text);
  160. }
  161. .info-label {
  162. height: 28px;
  163. line-height: 28px;
  164. }
  165. }
  166. .block1 {
  167. top: -70px;
  168. right: -5px;
  169. }
  170. .block2 {
  171. top: -15px;
  172. left: -280px;
  173. background: url('@/assets/images/home-container/configurable/tashanhome/leftbar-bg2.png') no-repeat right;
  174. .info-value {
  175. color: #2cffdd;
  176. }
  177. }
  178. .block3 {
  179. top: 40px;
  180. right: -5px;
  181. }
  182. }
  183. .right-info-content {
  184. position: relative;
  185. .right-block {
  186. position: absolute;
  187. width: 190px;
  188. height: 55px;
  189. background: url('@/assets/images/home-container/configurable/tashanhome/rightbar-bg1.png') no-repeat left;
  190. padding-left: 52px;
  191. .info-value {
  192. height: 28px;
  193. line-height: 28px;
  194. font-family: 'douyuFont';
  195. font-size: 12px;
  196. color: var(--vent-gas-primary-text);
  197. }
  198. .info-label {
  199. height: 28px;
  200. line-height: 28px;
  201. }
  202. }
  203. .block1 {
  204. top: -70px;
  205. left: -5px;
  206. }
  207. .block2 {
  208. top: -15px;
  209. right: -280px;
  210. background: url('@/assets/images/home-container/configurable/tashanhome/rightbar-bg2.png') no-repeat left;
  211. .info-value {
  212. color: #2cffdd;
  213. }
  214. }
  215. .block3 {
  216. top: 40px;
  217. left: -5px;
  218. }
  219. }
  220. }
  221. ::v-deep .dane-bd {
  222. background-repeat: no-repeat;
  223. background-position: center;
  224. background-size: 100% 100%;
  225. &.dane-w {
  226. background-image: var(--image-common-border3);
  227. }
  228. .dane-title {
  229. justify-content: space-around;
  230. padding: 0 50px 0 0;
  231. .common-navL {
  232. font-size: 14px;
  233. font-weight: bold;
  234. font-family: 'douyuFont';
  235. }
  236. }
  237. .dane-content {
  238. border: none;
  239. background: none;
  240. padding: 10px 35px;
  241. }
  242. }
  243. ::v-deep .table__content .table__content_list {
  244. width: 95%;
  245. }
  246. ::v-deep .table__content .table__content_label {
  247. width: 95%;
  248. }
  249. }
  250. </style>