From 7b429d1ffd2ae778cb730e819b15e39fdd22197d Mon Sep 17 00:00:00 2001 From: lzh Date: Thu, 23 Apr 2026 19:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE:=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=88=87=E6=8D=A2=E5=88=B0=20/iot/home?= =?UTF-8?q?=EF=BC=8C=E4=B8=8B=E7=BA=BF=E6=97=A7=20Dashboard=20=E4=B8=8E?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=86=E5=B8=83=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - preferences.ts: 覆盖框架默认的 defaultHomePath: '/analytics' 为 '/iot/home', 登录后直接进入 IoT 概览页。 - router/routes/modules/dashboard.ts: 删除 Dashboard/Workspace/Analytics 路由 (不再作为菜单项暴露),仅保留 Profile。 - views/iot/home/index.vue: 移除 DeviceMapCard(依赖的后端 /admin-api/iot/device/location-list 接口尚未就绪,避免无效请求)。 Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/web-antd/src/preferences.ts | 2 ++ .../src/router/routes/modules/dashboard.ts | 31 +------------------ apps/web-antd/src/views/iot/home/index.vue | 8 ----- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index 73eb135cb..aeb8ad960 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -12,6 +12,8 @@ export const overridesPreferences = defineOverridesPreferences({ accessMode: 'backend', name: import.meta.env.VITE_APP_TITLE, enableRefreshToken: true, + /** 首页路径:默认跳转到 IoT 首页(覆盖框架默认的 /analytics) */ + defaultHomePath: '/iot/home', }, footer: { /** 默认关闭 footer 页脚,因为有一定遮挡 */ diff --git a/apps/web-antd/src/router/routes/modules/dashboard.ts b/apps/web-antd/src/router/routes/modules/dashboard.ts index 2cccc8115..90dd4e6d5 100644 --- a/apps/web-antd/src/router/routes/modules/dashboard.ts +++ b/apps/web-antd/src/router/routes/modules/dashboard.ts @@ -2,37 +2,8 @@ import type { RouteRecordRaw } from 'vue-router'; import { $t } from '#/locales'; +// 首页已改为 /iot/home(见 preferences.ts),原 Dashboard/Workspace/Analytics 路由已下线 const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'lucide:layout-dashboard', - order: -1, - title: $t('page.dashboard.title'), - }, - name: 'Dashboard', - path: '/dashboard', - children: [ - { - name: 'Workspace', - path: '/workspace', - component: () => import('#/views/dashboard/workspace/index.vue'), - meta: { - icon: 'carbon:workspace', - title: $t('page.dashboard.workspace'), - }, - }, - { - name: 'Analytics', - path: '/analytics', - component: () => import('#/views/dashboard/analytics/index.vue'), - meta: { - affixTab: true, - icon: 'lucide:area-chart', - title: $t('page.dashboard.analytics'), - }, - }, - ], - }, { name: 'Profile', path: '/profile', diff --git a/apps/web-antd/src/views/iot/home/index.vue b/apps/web-antd/src/views/iot/home/index.vue index e05863fe9..182a96ab5 100644 --- a/apps/web-antd/src/views/iot/home/index.vue +++ b/apps/web-antd/src/views/iot/home/index.vue @@ -11,7 +11,6 @@ import { getStatisticsSummary } from '#/api/iot/statistics'; import { defaultStatsData } from './data'; import DeviceCountCard from './modules/device-count-card.vue'; -import DeviceMapCard from './modules/device-map-card.vue'; import DeviceStateCountCard from './modules/device-state-count-card.vue'; import MessageTrendCard from './modules/message-trend-card.vue'; @@ -103,12 +102,5 @@ onMounted(() => { - - - - - - -