forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
  <div class="home-left">
    <!--时间 天气-->
    <common-weather></common-weather>
    <template v-if="machineNestListRef">
      <!--机巢列表-->
      <MachineNestList></MachineNestList>
    </template>
    <template v-else>
      <!--机巢概况-->
      <overview-next></overview-next>
      <!--巡检任务情况-->
      <inspection-rask-details></inspection-rask-details>
    </template>
  </div>
</template>
 
<script setup>
import OverviewNext from './OverviewNext.vue';
import InspectionRaskDetails from './InspectionRaskDetails/InspectionRaskDetails.vue';
import CommonWeather from '@/components/CommonWeather.vue';
import MachineNestList from './MachineNestList.vue';
import { useStore } from 'vuex';
 
const store = useStore();
const machineNestListRef = ref(false);
 
// 监听机巢详情变化
watch(
  () => store.state.home.machineNestDetail,
  (newVal) => {
    machineNestListRef.value = newVal;
  },
  { immediate: true } // 添加立即执行选项
);
</script>
 
<style scoped lang="scss">
.home-left {
  position: absolute;
  top: 88px;
  color: #e7f5ff;
}
</style>