布局
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user