diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 3149814..2c3d504 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -110,17 +110,20 @@ export default function AppLayout() { } }} > - +
- + {/* ====================== 收起/展开按钮 ====================== */}
- + @@ -204,12 +204,12 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, {/* 右侧文字 */}
-
{card.title}
-
+
{card.title}
+
{card.value}
{card.sub && ( -
+
{card.sub}
)} diff --git a/src/index.css b/src/index.css index dc7dc81..ae46b86 100644 --- a/src/index.css +++ b/src/index.css @@ -19,34 +19,72 @@ } @layer base { + html { + font-size: 16px; /* 基础字号 */ + } body { @apply bg-bg text-text-main font-sans; - width:100vw; - height: 100vh; + width: 100vw; + height: 100vh; + overflow-x: hidden; /* 防止横向滚动 */ + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; } - #root{ - width:100%; - height:100%; - overflow: hidden; + #root { + width: 100%; + height: 100%; + overflow: hidden; } } +/* 响应式字体优化 */ +h1, .ant-typography h1 { font-size: clamp(1.5rem, 2.5vw, 2rem) !important; } +h2, .ant-typography h2 { font-size: clamp(1.25rem, 2vw, 1.75rem) !important; } +h3, .ant-typography h3 { font-size: clamp(1.1rem, 1.8vw, 1.5rem) !important; } +h4, .ant-typography h4 { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; } + +/* 统计卡片字体自适应 */ +.ant-statistic-content { + font-size: clamp(1.2rem, 2vw, 1.8rem) !important; +} +.ant-statistic-title { + color: #000 !important; + opacity: 1; + font-weight: 800; + font-size: clamp(0.8rem, 1.2vw, 1rem) !important; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.ant-statistic-content-suffix { + font-size: clamp(0.7rem, 1vw, 0.9rem) !important; +} + +/* 全局滚动条优化 */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track { + background: transparent; +} +::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.1); + border-radius: 10px; +} +::-webkit-scrollbar-thumb:hover { + background: rgba(0, 0, 0, 0.2); +} + .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); } -.ant-card-head-title{ - color:#0837A8; - font-weight: 800 !important; -} -.ant-statistic-content-suffix{ - font-size: 14px; -} -.ant-statistic-title{ - color:#000 !important; - opacity: 1; - font-weight: 800; +.ant-card-head-title { + color: #0837A8; + font-weight: 800 !important; + font-size: clamp(0.9rem, 1.3vw, 1.1rem) !important; } .ant-card-head{ min-height:44px !important diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 30c5010..caac13b 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -271,16 +271,16 @@ export default function StationDashboard() { { title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: }, { title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: }, ].map((item, idx) => ( - +
-
{item.title}
+
{item.title}
- {item.value} - {item.unit && {item.unit}} + {item.value} + {item.unit && {item.unit}}
-
{item.sub}
+
{item.sub}
@@ -381,17 +382,17 @@ export default function StationDashboard() { 离线 维护中
- + {/* 65% - + */}
-
+