refactor: remove /dashboard, migrate icmp-export

This commit is contained in:
yangsy
2025-11-26 15:52:42 +08:00
parent 41c9b4c5ed
commit 05297b22cb
9 changed files with 144 additions and 176 deletions

View File

@@ -11,7 +11,7 @@ import { useLineStationsQuery } from '@/composables';
import { LINE_STATIONS_QUERY_KEY, LINE_DEVICES_QUERY_KEY, LINE_ALARMS_QUERY_KEY } from '@/constants';
import { useAlarmStore, useUserStore } from '@/stores';
import { useIsFetching } from '@tanstack/vue-query';
import { AlertFilled, BugFilled, CaretDownFilled, EnvironmentFilled, /* AreaChartOutlined, */ FileTextFilled, FundFilled, HddFilled, LogoutOutlined, SettingOutlined } from '@vicons/antd';
import { AlertFilled, BugFilled, CaretDownFilled, EnvironmentFilled, /* AreaChartOutlined, */ FileTextFilled, HddFilled, LogoutOutlined, SettingOutlined } from '@vicons/antd';
import type { AxiosError } from 'axios';
import { NBadge, NButton, NDropdown, NFlex, NIcon, NLayout, NLayoutContent, NLayoutFooter, NLayoutHeader, NLayoutSider, NMenu, NScrollbar, type DropdownOption, type MenuOption } from 'naive-ui';
import { storeToRefs } from 'pinia';
@@ -49,11 +49,6 @@ const route = useRoute();
const router = useRouter();
const menuOptions = ref<MenuOption[]>([
{
label: () => h(RouterLink, { to: '/dashboard' }, { default: () => '全线总概览' }),
key: '/dashboard',
icon: renderIcon(FundFilled),
},
{
label: () => h(RouterLink, { to: '/station' }, { default: () => '车站状态' }),
key: '/station',
@@ -119,8 +114,8 @@ const selectDropdownOption = (key: string, option: DropdownOption) => {
}
};
const routeToDashboardPage = () => {
router.push('/dashboard');
const routeToRoot = () => {
router.push('/');
};
const routeToAlarmPage = () => {
@@ -139,14 +134,14 @@ const openSettingsDrawer = () => {
<template>
<NScrollbar x-scrollable style="width: 100vw; height: 100vh">
<NLayout has-sider :content-style="{ 'min-width': '1400px' }">
<NLayoutSider bordered collapsed :collapse-mode="'width'" :collapsed-width="60">
<NMenu collapsed :collapsed-width="60" :collapsed-icon-size="18" :value="route.path" :options="menuOptions" />
<NLayoutSider bordered collapsed collapse-mode="width" :collapsed-width="64">
<NMenu collapsed :collapsed-width="64" :collapsed-icon-size="20" :value="route.path" :options="menuOptions" />
</NLayoutSider>
<NLayout :native-scrollbar="false">
<NLayoutHeader bordered class="app-layout-header">
<NFlex justify="space-between" align="center" :size="8" style="width: 100%; height: 100%">
<NFlex>
<div style="font-size: 16px; font-weight: 500; margin-left: 16px; cursor: pointer" @click="routeToDashboardPage">网络设备管理平台</div>
<div style="font-size: 16px; font-weight: 500; margin-left: 16px; cursor: pointer" @click="routeToRoot">网络设备管理平台</div>
<NButton text size="tiny" :loading="fetchingCount > 0" />
</NFlex>
<NFlex align="center" :size="0" style="height: 100%">