index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="_energy">
  3. <layout>
  4. <template #left>
  5. <div style="height: 100%;display: flex;flex-direction: column;overflow: hidden;">
  6. <consume :resultData="leftData" style="flex:1;" />
  7. <running :resultData="leftData" style="flex: 1;" />
  8. <carbonEmission :resultData="leftData.Access" style="flex:1;" />
  9. </div>
  10. </template>
  11. <template #content>
  12. <!-- <p>物业</p> -->
  13. </template>
  14. <template #right>
  15. <div style="height: 100%;display: flex;flex-direction: column;overflow: hidden;">
  16. <eventList :resultData="leftData.AccessRecords" style="flex: 1;" />
  17. <sameDay :resultData="leftData.GarageCount" style="flex: 1;" />
  18. <tiring :resultData="leftData.GarRecords" style="flex: 1;" />
  19. </div>
  20. </template>
  21. </layout>
  22. </div>
  23. </template>
  24. <script setup name="Role">
  25. import { getProperty } from "@/api/system/tenement"
  26. import layout from "@/components/layout_/index.vue";
  27. import running from './modules/running.vue'
  28. import consume from './modules/consume.vue'
  29. import carbonEmission from "./modules/carbonEmission.vue";
  30. import sameDay from './modules/sameDay.vue'
  31. import eventList from './modules/eventList.vue'
  32. import tiring from './modules/tiring.vue'
  33. const intervalId = ref(null)
  34. const leftData = ref({})
  35. // 生命周期
  36. onMounted(() => {
  37. intervalId.value = setInterval(getPropertyData, 10000);
  38. getPropertyData()
  39. });
  40. onUnmounted(() => {
  41. clearInterval(intervalId.value);
  42. })
  43. function getPropertyData() {
  44. getProperty().then((res) => {
  45. if (res.code == 200) {
  46. leftData.value = res.data
  47. }
  48. })
  49. }
  50. </script>
  51. <style lang="scss">
  52. ._energy {
  53. height: 100%;
  54. }
  55. </style>