From ee1e10d84e839da6337691d8faf743367f4c92bf Mon Sep 17 00:00:00 2001 From: zhang1106 <849185023@qq.com> Date: Wed, 21 Jan 2026 16:31:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor(Dashboard):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将卡片顶部边框改为左侧边框以提升视觉效果 - 调整网格布局的响应式断点 - 重新组织欢迎横幅和系统信息布局 - 移除未使用的样式定义 --- frontend/src/pages/Dashboard.jsx | 152 +++++++++++++++---------------- 1 file changed, 72 insertions(+), 80 deletions(-) diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 1a042a9..cc633ae 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -103,7 +103,7 @@ const responsiveConfig = { const containerStyle = { minHeight: '100vh', background: 'linear-gradient(180deg, #f5f7fa 0%, #e8ecf1 100%)', - padding: '24px' + padding: '20px' }; const headerStyle = { @@ -202,7 +202,8 @@ const STAT_CARD_BASE_STYLE = { overflow: 'hidden', cursor: 'pointer', height: '100%', - animation: 'fadeInUp 0.6s ease-out backwards' + animation: 'fadeInUp 0.6s ease-out backwards', + borderLeft: '4px solid transparent' }; const STAT_ICON_CONTAINER_BASE = { @@ -219,15 +220,6 @@ const STAT_ICON_CONTAINER_BASE = { transition: `all ${designTokens.transitions.normal}` }; -const TOP_BORDER_BASE = { - position: 'absolute', - top: 0, - left: 0, - right: 0, - height: '4px', - borderRadius: `${designTokens.borderRadius.large} ${designTokens.borderRadius.large} 0 0` -}; - const NAV_BUTTON_BASE = { height: 'auto', padding: '24px 20px', @@ -256,7 +248,7 @@ const NAV_ICON_CONTAINER_BASE = { const createStatCardStyle = (color) => ({ ...STAT_CARD_BASE_STYLE, - borderTop: `4px solid ${color}` + borderLeftColor: color }); const createStatIconContainer = (color) => ({ @@ -264,11 +256,6 @@ const createStatIconContainer = (color) => ({ background: `linear-gradient(135deg, ${color}20 0%, ${color}10 100%)` }); -const createTopBorderStyle = (color) => ({ - ...TOP_BORDER_BASE, - background: `linear-gradient(90deg, ${color}, ${color}80)` -}); - const createNavButtonStyle = (color) => ({ ...NAV_BUTTON_BASE, borderColor: color @@ -664,7 +651,7 @@ function Dashboard() { const statCards = useMemo(() => [ { key: 'devices', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: CloudServerOutlined, color: designTokens.colors.primary.main, statKey: 'totalDevices', @@ -675,7 +662,7 @@ function Dashboard() { }, { key: 'racks', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: DatabaseOutlined, color: designTokens.colors.purple.main, statKey: 'totalRacks', @@ -687,7 +674,7 @@ function Dashboard() { }, { key: 'rooms', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: HomeOutlined, color: designTokens.colors.success.main, statKey: 'totalRooms', @@ -699,7 +686,7 @@ function Dashboard() { }, { key: 'faults', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: WarningOutlined, color: designTokens.colors.error.main, statKey: 'faultDevices', @@ -710,7 +697,7 @@ function Dashboard() { }, { key: 'users', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: TeamOutlined, color: designTokens.colors.cyan.main, statKey: 'totalUsers', @@ -721,7 +708,7 @@ function Dashboard() { }, { key: 'tickets', - xs: 24, sm: 12, lg: 6, xl: 4, + xs: 24, sm: 12, md: 8, lg: 6, xl: 4, icon: BarChartOutlined, color: '#fa8c16', statKey: 'activeTickets', @@ -749,7 +736,6 @@ function Dashboard() { onMouseLeave={() => setHoveredCard(null)} >
- 专业的机房设备管理解决方案,提供全方位的设备监控和管理能力 -
-+ 专业的机房设备管理解决方案,提供全方位的设备监控和管理能力 +