index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="scene-box" style="position: relative">
  4. <CustomHeader> 瓦斯抽采综合管控系统 </CustomHeader>
  5. <template v-if="activeKey == 'gasHome'">
  6. <VentModal />
  7. <CustomBadges class="w-1710px ml-100px mt-50px" :badges="headerBadges" />
  8. <GasMonitor v-if="dataSource" :dataSource="dataSource" />
  9. </template>
  10. <BottomMenu :navList="navList" @change="changeActive" type="router" />
  11. </div>
  12. </template>
  13. <script lang="ts" setup>
  14. import { ref, onBeforeMount, onBeforeUnmount, onMounted, computed } from 'vue';
  15. import CustomHeader from '/@/components/vent/customHeader.vue';
  16. import CustomBadges from './components/customHeader.vue';
  17. import GasMonitor from './components/gasMonitor.vue';
  18. import VentModal from '/@/components/vent/micro/ventModal.vue';
  19. import { gasSystem } from './gasHome.api';
  20. import { unmountMicroApps } from '/@/qiankun';
  21. import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
  22. import { navList } from './gasHome.data';
  23. import { useRouter } from 'vue-router';
  24. import { get } from '@/utils/ventutil';
  25. const router = useRouter();
  26. const activeKey = ref('gasHome');
  27. const dataSource = ref<any | null>(null);
  28. function changeActive(activeValue) {
  29. if (activeValue == 'gasPump') {
  30. const newPage = router.resolve({ path: '/gas/gas-pump-monitor/home' });
  31. window.open(newPage.href, '_blank');
  32. }
  33. if (activeValue == 'gasStandard') {
  34. const newPage = router.resolve({ path: '/gasAssessment/home' });
  35. window.open(newPage.href, '_blank');
  36. }
  37. if (activeValue == 'gasPiping') {
  38. const newPage = router.resolve({
  39. path: '/micro-vent-3dModal/gas-pipe-net/home',
  40. query: {
  41. type: 'sysMonitor',
  42. deviceType: 'pipingpage',
  43. },
  44. });
  45. window.open(newPage.href, '_blank');
  46. }
  47. if (activeValue == 'gasAlarm') {
  48. const newPage = router.resolve({ path: '/gas/warn/home?p=0' });
  49. window.open(newPage.href, '_blank');
  50. }
  51. if (activeValue == 'drillDesign') {
  52. const newPage = router.resolve({
  53. path: '/micro-vent-3dModal/modelchannel/model3D/home',
  54. query: {
  55. type: 'model3D',
  56. deviceType: 'model3D',
  57. kind: 'drillset',
  58. },
  59. });
  60. window.open(newPage.href, '_blank');
  61. }
  62. }
  63. const headerBadges = computed(() => [
  64. {
  65. title: get(dataSource.value, 'sysInfo.totalGasVolume'),
  66. desc: '累积瓦斯抽采量(万t/d)',
  67. },
  68. {
  69. title: get(dataSource.value, 'sysInfo.totalAverageRate'),
  70. desc: '平均瓦斯抽采率(%)',
  71. },
  72. {
  73. title: get(dataSource.value, 'sysInfo.totalComplteQuantity'),
  74. desc: '抽采达标工作面数量(个)',
  75. },
  76. {
  77. title: get(dataSource.value, 'sysInfo.useM3Perent'),
  78. desc: '有效风量率(%)', //回采中工作面数量
  79. },
  80. {
  81. title: get(dataSource.value, 'sysInfo.drillinFootage'),
  82. desc: '抽采钻孔总进尺(m)',
  83. },
  84. ]);
  85. onBeforeMount(async () => {
  86. dataSource.value = await gasSystem();
  87. });
  88. onMounted(() => {});
  89. onBeforeUnmount(async () => {
  90. await unmountMicroApps(['/micro-vent-3dModal']);
  91. });
  92. </script>
  93. <style lang="less" scoped>
  94. .gas-container {
  95. width: 100%;
  96. position: absolute;
  97. z-index: 999;
  98. }
  99. .modal-box {
  100. width: 100%;
  101. height: calc(100%);
  102. position: absolute;
  103. top: 0;
  104. left: 0;
  105. }
  106. :deep(.vent-home-header) {
  107. background-color: var(--vent-base-color) !important;
  108. }
  109. </style>