feat: apply new stores to UI and hope it works

This commit is contained in:
yangsy
2025-08-26 03:28:20 +08:00
parent c2ebe34a05
commit 9a050f08f6
3 changed files with 33 additions and 25 deletions

View File

@@ -3,15 +3,21 @@ import StationCard from '@/components/station-card.vue';
import { NGrid, NGi } from 'naive-ui';
import { useStationStore } from '@/stores/station';
import { storeToRefs } from 'pinia';
import { useLineDevicesStore } from '@/stores/line-devices';
import { useLineAlarmsStore } from '@/stores/line-alarms';
const stationStore = useStationStore();
const { stationList } = storeToRefs(stationStore);
const lineDevicesStore = useLineDevicesStore();
const { lineDevices } = storeToRefs(lineDevicesStore);
const lineAlarmsStore = useLineAlarmsStore();
const { lineAlarms } = storeToRefs(lineAlarmsStore);
</script>
<template>
<NGrid :cols="8" :x-gap="6" :y-gap="6" style="padding: 8px">
<NGi v-for="station in stationList" :key="station.name">
<StationCard :station="station" />
<StationCard :station="station" :station-devices="lineDevices[station.code]" :station-alarms="lineAlarms[station.code]" />
</NGi>
</NGrid>
</template>