This commit is contained in:
yangsy
2025-08-14 13:06:22 +08:00
parent a1a73180b4
commit dd317df58a
9 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<script setup lang="ts">
import { ref } from 'vue';
import StationCard from '@/components/station-card.vue';
import { NGrid, NGi } from 'naive-ui';
import { useQuery } from '@tanstack/vue-query';
// 模拟数据
const stations = ref(
Array.from({ length: 32 }).map((_, i) => ({
name: `车站 ${i + 1}`,
online: Math.random() > 0.5,
offlineDeviceCount: Math.floor(Math.random() * 20),
alarmCount: Math.floor(Math.random() * 10),
})),
);
// const query = useQuery({
// queryKey: ['line-devices'],
// queryFn: async () => {},
// });
</script>
<template>
<NGrid :cols="8" :x-gap="12" :y-gap="12">
<NGi v-for="station in stations" :key="station.name">
<StationCard :name="station.name" :online="station.online" :offline-device-count="station.offlineDeviceCount" :alarm-count="station.alarmCount" />
</NGi>
</NGrid>
</template>
<style scoped></style>