gasVideo.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <CustomBadges class="w-1710px ml-100px mt-50px" :badges="headerBadges" />
  3. <div class="monitor-container">
  4. <transition enter-active-class="animate__animated animate__fadeInLeft" leave-active-class="animate__animated animate__fadeOutLeft">
  5. <div class="lr left-box" v-if="loading">
  6. <template v-for="unitIndex in unitNum" :key="unitIndex">
  7. <ventBox1 v-if="unitIndex < 4" class="vent-margin-t-10">
  8. <template #title>
  9. <div>视频{{ unitIndex }}</div>
  10. </template>
  11. <template #container>
  12. <div class="video-box"></div>
  13. </template>
  14. </ventBox1>
  15. </template>
  16. </div>
  17. </transition>
  18. <transition enter-active-class="animate__animated animate__fadeInRight" leave-active-class="animate__animated animate__fadeInRight">
  19. <div class="lr right-box" v-if="loading">
  20. <template v-for="unitIndex in unitNum" :key="unitIndex">
  21. <ventBox1 v-if="unitIndex >= 4" class="vent-margin-t-10">
  22. <template #title>
  23. <div>视频{{ unitIndex }}</div>
  24. </template>
  25. <template #container>
  26. <div class="video-box"></div>
  27. </template>
  28. </ventBox1>
  29. </template>
  30. </div>
  31. </transition>
  32. </div>
  33. </template>
  34. <script setup lang="ts">
  35. import { ref, onMounted } from 'vue';
  36. import ventBox1 from '/@/components/vent/ventBox1.vue';
  37. import CustomBadges from './customHeader.vue';
  38. import { gasUnitOption, headerBadges, mockGasUnitData, gasUnitBarOption, mockData, gasUnitPieOption, mockPieData } from '../gasAssessment.data';
  39. const loading = ref(false);
  40. const dataSource = ref({});
  41. const unitNum = ref(5);
  42. // // https获取监测数据
  43. let timer: null | NodeJS.Timeout = null;
  44. function getMonitor(flag?) {
  45. if (Object.prototype.toString.call(timer) === '[object Null]') {
  46. timer = setTimeout(
  47. async () => {
  48. if (timer) {
  49. timer = null;
  50. }
  51. await getMonitor();
  52. // loading.value = false;
  53. },
  54. flag ? 0 : 1000
  55. );
  56. }
  57. }
  58. onMounted(async () => {
  59. timer = null;
  60. await getMonitor(true);
  61. loading.value = true;
  62. });
  63. </script>
  64. <style lang="less" scoped>
  65. @ventSpace: zxm;
  66. @import '/@/design/vent/modal.less';
  67. @import '@/views/vent/monitorManager/comment/less/workFace.less';
  68. .monitor-container {
  69. height: 850px;
  70. pointer-events: none;
  71. }
  72. .left-box,
  73. .right-box {
  74. width: 380px !important;
  75. }
  76. .video-box {
  77. height: 200px;
  78. }
  79. </style>