index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <CustomHeader
  3. :fieldNames="{ label: 'systemname', value: 'id', options: 'children' }"
  4. :options="options"
  5. @change="getSelectRow"
  6. :optionValue="optionValue"
  7. >瓦斯抽采达标评判</CustomHeader
  8. >
  9. <div class="bg" style="">
  10. <div id="workFace3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden; z-index: 1; top: 0; pointer-events: auto"> </div>
  11. <div
  12. id="workFace3DCSS"
  13. v-show="pageType == 'workFace'"
  14. class="threejs-Object-CSS"
  15. style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 1; top: 0"
  16. >
  17. </div>
  18. </div>
  19. <div class="modal-monitor vent-flex-row" style="display: none">
  20. <div v-for="groupNum in monitorDataGroupNum" :id="'gasUnitBox' + groupNum" :key="groupNum" style="margin: 0 5px">
  21. <FourBorderBg class="four-border-bg">
  22. <div class="title">抽采单元{{ groupNum }}</div>
  23. <div class="monitor-item" v-for="(gasUnit, index) in gasUnitDetail" :key="index">
  24. <span class="monitor-title">{{ gasUnit.title }}:</span>
  25. <span class="monitor-val">
  26. <span class="val">
  27. {{ selectData[groupNum - 1] && selectData[groupNum - 1][gasUnit.code] ? selectData[groupNum - 1][gasUnit.code] : '-' }}
  28. </span>
  29. </span>
  30. </div>
  31. </FourBorderBg>
  32. </div>
  33. </div>
  34. <template v-if="activeKey == 'gasAssessment'">
  35. <WorkFace class="point-event" v-if="pageType == 'workFace'" />
  36. <gasUnit class="point-event" v-if="pageType == 'gasUnit'" />
  37. </template>
  38. <template v-if="activeKey == 'gasEcharts'">
  39. <GasEcharts class="point-event" />
  40. </template>
  41. <template v-if="activeKey == 'gasControl'">
  42. <GasControl class="point-event" />
  43. </template>
  44. <template v-if="activeKey == 'gasPiping'">
  45. <GasPiping class="point-event" />
  46. </template>
  47. <template v-if="activeKey == 'gasVideo'">
  48. <GasVideo class="point-event" />
  49. </template>
  50. <BottomMenu :navList="monitorNav" @change="changeActive" />
  51. </template>
  52. <script setup lang="ts">
  53. import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
  54. import { onBeforeMount, ref, onMounted, onUnmounted, nextTick, watch } from 'vue';
  55. import CustomHeader from '/@/components/vent/customHeader.vue';
  56. import { gasUnitDetail, monitorNav } from './gasAssessment.data';
  57. import { mountedThree, destroy, setModelType, setCss3D } from './threejs/gasAssessmen.threejs';
  58. import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
  59. import gasUnit from './components/gasUnit.vue';
  60. import GasEcharts from './components/gasEcharts.vue';
  61. import GasControl from './components/gasControl.vue';
  62. import GasPiping from './components/gasPipingEcharts.vue';
  63. import WorkFace from './components/workFace.vue';
  64. import GasVideo from './components/gasVideo.vue';
  65. import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
  66. const activeKey = ref('gasAssessment');
  67. const loading = ref(false);
  68. const dataSource = ref({});
  69. const pageType = ref('workFace');
  70. const activeUnitId = ref('');
  71. function changeActive(activeValue) {
  72. activeKey.value = activeValue;
  73. }
  74. // 获取模型类型
  75. const changeModalType = (currentData) => {
  76. gasUnitNum.value = 4;
  77. setModelType(modalType, gasUnitNum.value);
  78. };
  79. const { options, optionValue, deviceActive, getSelectRow, getSysDataSource, getDeviceList } = useSystemSelect(
  80. 'sys_surface_caimei',
  81. changeModalType
  82. );
  83. const gasUnitNum = ref(5);
  84. let modalType = 'workFace1';
  85. // // 监测数据
  86. const selectData = ref([]);
  87. const monitorDataGroupNum = ref(5);
  88. // // https获取监测数据
  89. let timer: null | NodeJS.Timeout = null;
  90. function getMonitor(flag?) {
  91. if (Object.prototype.toString.call(timer) === '[object Null]') {
  92. timer = setTimeout(
  93. async () => {
  94. if (deviceActive.value) {
  95. await getDeviceList();
  96. }
  97. if (timer) {
  98. timer = null;
  99. }
  100. await getMonitor();
  101. loading.value = false;
  102. },
  103. flag ? 0 : 1000
  104. );
  105. }
  106. }
  107. watch(
  108. pageType,
  109. (newVal, oldVal) => {
  110. console.log('页面类型', newVal);
  111. if (newVal == 'gasUnit') {
  112. } else if (newVal == 'workFace') {
  113. }
  114. },
  115. {}
  116. );
  117. onBeforeMount(() => {});
  118. onMounted(async () => {
  119. loading.value = true;
  120. timer = null;
  121. mountedThree(pageType, activeUnitId).then(async () => {
  122. // gasUnitNum.value = Math.ceil(Math.random() * 10)
  123. gasUnitNum.value = 4;
  124. loading.value = false;
  125. await getSysDataSource();
  126. nextTick(async () => {
  127. await getMonitor(true);
  128. setCss3D();
  129. });
  130. });
  131. });
  132. onUnmounted(() => {
  133. if (timer) {
  134. clearTimeout(timer);
  135. timer = undefined;
  136. }
  137. destroy();
  138. });
  139. </script>
  140. <style lang="less">
  141. @import '/@/design/vent/modal.less';
  142. .@{ventSpace}-select-dropdown {
  143. background: #ffffff !important;
  144. border-bottom: 1px solid rgba(236, 236, 236, 0.4);
  145. backdrop-filter: blur(10px);
  146. .@{ventSpace}-select-item-option-selected,
  147. .@{ventSpace}-select-item-option-active {
  148. background-color: #ffffff33 !important;
  149. }
  150. .@{ventSpace}-select-item:hover {
  151. background-color: #ffffff33 !important;
  152. }
  153. }
  154. </style>
  155. <style lang="less" scoped>
  156. @ventSpace: zxm;
  157. @import '/@/design/vent/modal.less';
  158. @import '@/views/vent/monitorManager/comment/less/workFace.less';
  159. .bg {
  160. width: 100%;
  161. height: 100%;
  162. display: flex;
  163. justify-content: center;
  164. align-items: center;
  165. overflow: hidden;
  166. position: absolute;
  167. pointer-events: auto;
  168. z-index: 0;
  169. }
  170. .point-event {
  171. pointer-events: none !important;
  172. }
  173. </style>