index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="air-door">
  3. <customHeader>风门集中同控</customHeader>
  4. <div class="main-container">
  5. <div class="container-left">
  6. <doorMenuL :menuData="menuData"></doorMenuL>
  7. </div>
  8. <div class="container-right">
  9. <doorContentR :infoData="menuData" :visibleTs30="visibleTs30"></doorContentR>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script setup lang="ts">
  15. import { ref, onMounted } from 'vue'
  16. import customHeader from '/@/components/vent/customHeader.vue';
  17. import doorMenuL from './components/door-menu-l.vue'
  18. import doorContentR from './components/door-content-r.vue'
  19. import { getDevice, upcoming } from './airdoor.api'
  20. let menuData = ref<any[]>([])
  21. //控制定时设置提示弹窗显示/隐藏
  22. let visibleTs30 = ref(false)
  23. // https获取监测数据
  24. let timer: null | NodeJS.Timeout = null;
  25. function getMonitor(flag?) {
  26. timer = setTimeout(
  27. async () => {
  28. //获取左侧菜单数据
  29. await getMenuList()
  30. await upcomingList()
  31. getMonitor(false);
  32. },
  33. flag ? 0 : 5000
  34. );
  35. }
  36. //左侧数据
  37. async function getMenuList() {
  38. let res = await getDevice({ devicetype: "gate", pagetype: "normal" })
  39. console.log(res, 'menuList')
  40. menuData.value = res.msgTxt[0].datalist || []
  41. }
  42. async function upcomingList() {
  43. visibleTs30.value = true
  44. // let res = await upcoming({})
  45. // console.log(res, '定时30秒')
  46. // if (res.length) {
  47. // visibleTs30.value = true
  48. // } else {
  49. // visibleTs30.value = false
  50. // }
  51. }
  52. onMounted(() => {
  53. getMenuList()
  54. getMonitor()
  55. })
  56. </script>
  57. <style lang="less" scoped>
  58. .air-door {
  59. position: relative;
  60. width: 100%;
  61. height: 100%;
  62. .main-container {
  63. display: flex;
  64. width: 100%;
  65. margin-top: 70px;
  66. height: calc(100% - 70px);
  67. padding: 10px;
  68. box-sizing: border-box;
  69. }
  70. .container-left {
  71. width: 260px;
  72. height: 100%;
  73. padding: 10px 15px;
  74. margin-right: 10px;
  75. border: 1px solid #99e8ff66;
  76. background: #27546e1a;
  77. overflow-y: auto;
  78. box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  79. -moz-box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  80. -webkit-box-shadow: 0px 0px 50px 1px rgb(149 235 255 / 5%) inset;
  81. }
  82. .container-right {
  83. width: calc(100% - 275px);
  84. height: 100%;
  85. // padding: 10px;
  86. // box-sizing: border-box;
  87. }
  88. }
  89. </style>