forked from drone/command-center-dashboard

罗广辉
2025-04-07 da2a4e58ecc7c5da0a3ec726708a16c21e7f60e3
src/views/Home/HomeLeft/HomeLeft.vue
@@ -2,10 +2,16 @@
  <div class="home-left">
    <!--时间 天气-->
    <common-weather></common-weather>
    <!--机巢概况-->
    <overview-next></overview-next>
    <!--巡检任务情况-->
    <inspection-rask-details></inspection-rask-details>
    <template v-if="machineNestListRef">
      <!--机巢列表-->
      <MachineNestList></MachineNestList>
    </template>
    <template v-else>
      <!--机巢概况-->
      <overview-next></overview-next>
      <!--巡检任务情况-->
      <inspection-rask-details></inspection-rask-details>
    </template>
  </div>
</template>
@@ -13,7 +19,20 @@
import OverviewNext from './OverviewNext.vue';
import InspectionRaskDetails from './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">