This commit is contained in:
mmc
2026-05-14 10:03:51 +08:00
parent 2ae097eed0
commit 4ac279139b
4 changed files with 90 additions and 44 deletions

View File

@@ -110,17 +110,20 @@ export default function AppLayout() {
}
}}
>
<Layout style={{ maxHeight: '100vh' }}>
<Layout style={{ height: '100vh', display: 'flex', flexDirection: 'column' }}>
<Header style={{
background: '#0837a8',
color: '#fff',
height: "50px",
minHeight: "50px",
height: "auto",
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '0 16px'
padding: '4px 16px',
flexWrap: 'wrap',
gap: '8px'
}}>
<Space size="large" style={{ display: 'flex', alignItems: 'center' }}>
<Space size="large" style={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap' }}>
{/* ====================== 收起/展开按钮 ====================== */}
<Button
@@ -138,7 +141,7 @@ export default function AppLayout() {
<Space size="small">
<img src={logo} alt="Logo" style={{ width: 24, height: 24 }} />
{!collapsed && (
<span style={{ fontWeight: 'bold', fontSize: 16, color: '#fff' }}>
<span style={{ fontWeight: 'bold', fontSize: 'clamp(14px, 1.2vw, 16px)', color: '#fff', whiteSpace: 'nowrap' }}>
光伏电站智能监控与运维系统
</span>
)}
@@ -150,7 +153,7 @@ export default function AppLayout() {
onChange={handleStationChange}
options={stationList.map(s => ({ label: s.siteName, value: s.id }))}
style={{
width: 180,
width: 'clamp(140px, 15vw, 180px)',
backgroundColor: '#0837a8',
color: '#fff',
border: 'none',
@@ -158,8 +161,8 @@ export default function AppLayout() {
/>
</Space>
<Space size="middle">
<span style={{ fontSize: 13 }}>{time}</span>
<Space size="middle" style={{ flexWrap: 'wrap' }}>
<span style={{ fontSize: 'clamp(12px, 1vw, 13px)' }}>{time}</span>
<Space
style={{ cursor: 'pointer', padding: '0 4px' }}
onClick={() => navigate('/profile')}
@@ -171,15 +174,15 @@ export default function AppLayout() {
src={userInfo.avatar.startsWith('http') ? userInfo.avatar : `${envConfig.baseURL}${userInfo.avatar}`}
/>
)}
<span style={{ fontSize: 14 }}>{userInfo?.nickName || userInfo?.username}</span>
<span style={{ fontSize: 'clamp(12px, 1vw, 14px)' }}>{userInfo?.nickName || userInfo?.username}</span>
</Space>
<Button type="text" danger icon={<LogoutOutlined />} onClick={handleLogout}>
<Button type="text" danger icon={<LogoutOutlined />} onClick={handleLogout} style={{ fontSize: 'clamp(12px, 1vw, 14px)' }}>
退出登录
</Button>
</Space>
</Header>
<Layout style={{ height: 'calc(100vh - 50px)', overflow: 'hidden', background: '#fff' }}>
<Layout style={{ flex: 1, overflow: 'hidden', background: '#fff' }}>
<Sider
collapsible
collapsed={collapsed}

View File

@@ -195,7 +195,7 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 20,
fontSize: 'clamp(16px, 1.5vw, 20px)',
flexShrink: 0,
}}
>
@@ -204,12 +204,12 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
{/* 右侧文字 */}
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 13, color: '#666' }}>{card.title}</div>
<div style={{ fontSize: 24, fontWeight: 700, color: '#222', lineHeight: '30px' }}>
<div style={{ fontSize: 'clamp(11px, 0.9vw, 13px)', color: '#666' }}>{card.title}</div>
<div style={{ fontSize: 'clamp(18px, 1.6vw, 24px)', fontWeight: 700, color: '#222', lineHeight: '30px' }}>
{card.value}
</div>
{card.sub && (
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
<div style={{ fontSize: 'clamp(10px, 0.8vw, 12px)', color: '#999', marginTop: 2 }}>
{card.sub}
</div>
)}

View File

@@ -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

View File

@@ -271,16 +271,16 @@ export default function StationDashboard() {
{ title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: <BellOutlined /> },
{ title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> },
].map((item, idx) => (
<Col key={idx} style={{ flex: "0 0 auto", minWidth: "200px" }}>
<Col key={idx} style={{ flex: "1 0 auto", minWidth: "200px" }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%", minWidth: "200px" }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
<div style={{ color: '#000', fontSize: 'clamp(12px, 1vw, 14px)', fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: item.color, fontSize: 24, fontWeight: 800 }}>{item.value}</span>
{item.unit && <span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>{item.unit}</span>}
<span style={{ color: item.color, fontSize: 'clamp(20px, 1.8vw, 24px)', fontWeight: 800 }}>{item.value}</span>
{item.unit && <span style={{ color: '#666', fontSize: 'clamp(12px, 0.9vw, 14px)', marginLeft: 4 }}>{item.unit}</span>}
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>{item.sub}</div>
<div style={{ fontSize: 'clamp(10px, 0.8vw, 12px)', color: '#999', marginTop: 8 }}>{item.sub}</div>
</div>
<div style={{
width: 50, height: 50, background: item.bg, borderRadius: '50%',
@@ -372,6 +372,7 @@ export default function StationDashboard() {
}
bordered={false}
style={{ ...cardStyle, height: '100%', padding: '12px' }}
bodyStyle={{ height: "86%" }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12 }}>
@@ -381,17 +382,17 @@ export default function StationDashboard() {
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#888', marginRight: 4 }}></span>离线</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>维护中</span>
</div>
<Space size="small">
{/*<Space size="small">
<Button size="small">适应</Button>
<Button size="small" icon={<MinusOutlined />} />
<Button size="small" icon={<PlusOutlined />} />
<Button size="small" icon={<SyncOutlined />}>重置</Button>
<span style={{ fontSize: 12 }}>65%</span>
</Space>
</Space>*/}
</div>
<div style={{ height: 360, background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
<iframe
src="https://pvs.satabot.com/?platform=web"
style={{
@@ -415,7 +416,7 @@ export default function StationDashboard() {
xs={24}
lg={6}
style={{
flex: '0 0 25%',
flex: '1 0 25%',
height: "100%",
overflow: 'auto',
scrollbarWidth: 'thin',
@@ -437,7 +438,8 @@ export default function StationDashboard() {
style={{
borderRadius: 8,
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
padding: '4px 8px'
padding: '4px 8px',
flex: 1,
}}
bodyStyle={{ padding: 4 }}
>
@@ -482,7 +484,8 @@ export default function StationDashboard() {
style={{
borderRadius: 8,
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
padding: '4px 8px'
padding: '4px 8px',
flex: 1,
}}
bodyStyle={{ padding: 4 }}
>
@@ -515,6 +518,7 @@ export default function StationDashboard() {
borderRadius: 8,
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
padding: '8px',
flex: 1,
}}
bodyStyle={{ padding: 8 }}
>
@@ -570,7 +574,8 @@ export default function StationDashboard() {
style={{
borderRadius: 8,
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
padding: '4px 8px'
padding: '4px 8px',
flex: 1,
}}
bodyStyle={{ padding: 4 }}
>