feat(pages): separate station-page from dashboard-page

This commit is contained in:
yangsy
2025-11-19 11:55:13 +08:00
parent 0c3e9c24f9
commit 91a665695e
5 changed files with 100 additions and 67 deletions

View File

@@ -15,8 +15,7 @@ import { useCurrentAlarmsStore } from '@/stores/current-alarms';
import { useUserStore } from '@/stores/user';
import { Client as StompClient } from '@stomp/stompjs';
import { useIsFetching } from '@tanstack/vue-query';
import { AlertFilled, /* AreaChartOutlined, */ FileTextFilled, HomeFilled, LogoutOutlined, SettingOutlined, VideoCameraFilled } from '@vicons/antd';
import { ChevronDown, Debug } from '@vicons/carbon';
import { AlertFilled, BugFilled, CaretDownFilled, EnvironmentFilled, /* AreaChartOutlined, */ FileTextFilled, FundFilled, HddFilled, LogoutOutlined, SettingOutlined } from '@vicons/antd';
import type { AxiosError } from 'axios';
import { destr } from 'destr';
import { NBadge, NButton, NDropdown, NFlex, NIcon, NLayout, NLayoutContent, NLayoutFooter, NLayoutHeader, NLayoutSider, NMenu, NScrollbar, type DropdownOption, type MenuOption } from 'naive-ui';
@@ -98,17 +97,22 @@ const router = useRouter();
const menuOptions = ref<MenuOption[]>([
{
label: () => h(RouterLink, { to: '/dashboard' }, { default: () => '今日数据看板' }),
label: () => h(RouterLink, { to: '/dashboard' }, { default: () => '全线总概览' }),
key: '/dashboard',
icon: renderIcon(HomeFilled),
icon: renderIcon(FundFilled),
},
{
label: () => h(RouterLink, { to: '/device' }, { default: () => '设备诊断数据' }),
label: () => h(RouterLink, { to: '/station' }, { default: () => '车站状态' }),
key: '/station',
icon: renderIcon(EnvironmentFilled),
},
{
label: () => h(RouterLink, { to: '/device' }, { default: () => '设备诊断' }),
key: '/device',
icon: renderIcon(VideoCameraFilled),
icon: renderIcon(HddFilled),
},
{
label: () => h(RouterLink, { to: '/alarm' }, { default: () => '设备告警记录' }),
label: () => h(RouterLink, { to: '/alarm' }, { default: () => '设备告警' }),
key: '/alarm',
icon: renderIcon(AlertFilled),
},
@@ -135,7 +139,7 @@ const menuOptions = ref<MenuOption[]>([
{
label: () => h(RouterLink, { to: '/debug' }, { default: () => '调试' }),
key: '/debug',
icon: renderIcon(Debug),
icon: renderIcon(BugFilled),
show: import.meta.env.DEV,
},
]);
@@ -199,15 +203,13 @@ const openSettingsDrawer = () => {
<span>{{ userInfo?.nickName ?? '' }}</span>
</template>
<template #icon>
<NIcon :component="ChevronDown" />
<NIcon :component="CaretDownFilled" />
</template>
</NButton>
</NDropdown>
<NButton :focusable="false" quaternary @click="openSettingsDrawer" style="height: 100%">
<template #icon>
<NIcon>
<SettingOutlined />
</NIcon>
<NIcon :component="SettingOutlined" />
</template>
</NButton>
</NFlex>
@@ -221,9 +223,7 @@ const openSettingsDrawer = () => {
<NBadge :value="currentAlarmCount">
<NButton secondary strong @click="toAlarmPage">
<template #icon>
<NIcon>
<AlertFilled />
</NIcon>
<NIcon :component="AlertFilled" />
</template>
</NButton>
</NBadge>