From 05297b22cb78f816fb949329ec1874370daddaa4 Mon Sep 17 00:00:00 2001 From: yangsy Date: Wed, 26 Nov 2025 15:52:42 +0800 Subject: [PATCH] refactor: remove /dashboard, migrate icmp-export --- .../dashboard-page/device-statistic-card.vue | 84 ---------------- src/components/dashboard-page/index.ts | 1 - src/components/index.ts | 1 - .../station-page/device-export-modal.vue | 98 +++++++++++++++++++ src/components/station-page/index.ts | 1 + src/layouts/app-layout.vue | 17 ++-- src/pages/dashboard-page.vue | 63 ------------ src/pages/station-page.vue | 51 +++++++--- src/router/index.ts | 4 +- 9 files changed, 144 insertions(+), 176 deletions(-) delete mode 100644 src/components/dashboard-page/device-statistic-card.vue delete mode 100644 src/components/dashboard-page/index.ts create mode 100644 src/components/station-page/device-export-modal.vue delete mode 100644 src/pages/dashboard-page.vue diff --git a/src/components/dashboard-page/device-statistic-card.vue b/src/components/dashboard-page/device-statistic-card.vue deleted file mode 100644 index eb7b13f..0000000 --- a/src/components/dashboard-page/device-statistic-card.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/src/components/dashboard-page/index.ts b/src/components/dashboard-page/index.ts deleted file mode 100644 index 5922374..0000000 --- a/src/components/dashboard-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as DeviceStatisticCard } from './device-statistic-card.vue'; diff --git a/src/components/index.ts b/src/components/index.ts index b1d25ac..2d78d7b 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,4 +1,3 @@ -export * from './dashboard-page'; export * from './device-page'; export * from './global'; export * from './helper'; diff --git a/src/components/station-page/device-export-modal.vue b/src/components/station-page/device-export-modal.vue new file mode 100644 index 0000000..86c1211 --- /dev/null +++ b/src/components/station-page/device-export-modal.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/components/station-page/index.ts b/src/components/station-page/index.ts index 09b1276..f70f4d7 100644 --- a/src/components/station-page/index.ts +++ b/src/components/station-page/index.ts @@ -1,4 +1,5 @@ export { default as DeviceAlarmDetailModal } from './device-alarm-detail-modal.vue'; +export { default as DeviceExportModal } from './device-export-modal.vue'; export { default as DeviceParamsConfigModal } from './device-params-config-modal.vue'; export { default as OfflineDeviceDetailModal } from './offline-device-detail-modal.vue'; export { default as StationCard } from './station-card.vue'; diff --git a/src/layouts/app-layout.vue b/src/layouts/app-layout.vue index 0171b0b..c04727f 100644 --- a/src/layouts/app-layout.vue +++ b/src/layouts/app-layout.vue @@ -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([ - { - 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 = () => {