机器人的 路由ok了

This commit is contained in:
mmc
2026-08-03 13:29:16 +08:00
parent e2663b912c
commit a1e5cd1c6a
2 changed files with 45 additions and 17 deletions

View File

@@ -296,25 +296,35 @@ export default function AppLayout() {
theme="light"
style={{ borderRight: '1px solid #e5e7eb' }}
>
{/* 关键:用Layout实现上下分布 */}
<Layout style={{ height: '100%', flexDirection: 'column', background: '#fff' }}>
<Menu
mode="inline"
theme="light"
items={menuList}
selectedKeys={[location.pathname]}
onClick={({ key }) => navigate(key)}
/>
{/* 场站信息卡片:仅在侧边栏展开时显示 */}
<Layout
style={{
height: '100%',
flexDirection: 'column',
background: '#fff',
overflow: 'hidden'
}}
>
{/* 菜单滚动区域:弹性占满剩余空间,超出滚动 */}
<div style={{ flex: 1, overflowY: 'auto', overflowX: 'hidden' }}>
<Menu
mode="inline"
theme="light"
items={menuList}
selectedKeys={[location.pathname]}
onClick={({ key }) => navigate(key)}
style={{ borderRight: 0 }}
/>
</div>
{/* 底部场站卡片,固定在底部,不被菜单挤压 */}
{!collapsed && currentStation && (
<Card
size="small"
style={{
border: '1px solid #e5e7eb',
borderRadius: 8,
margin: 4,
marginBottom: 50
marginBottom: 8
}}
styles={{ body: { padding: '12px 4px' } }}
>
@@ -322,12 +332,11 @@ export default function AppLayout() {
<div style={{ fontSize: 14, fontWeight: 600, marginBottom: 8 }}>
{currentStation.siteName || '1MW 光伏电站'}
</div>
<img style={{ width: '100%', borderRadius: "8px", marginBottom: 8 }} src="https://images.unsplash.com/photo-1509391366360-2e959784a276?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80" />
{/* <img src="电站图片地址" style={{ width: '100%', borderRadius: 4, marginBottom: 8 }} alt="电站" /> */}
<img
style={{ width: '100%', borderRadius: "8px", marginBottom: 8 }}
src="https://images.unsplash.com/photo-1509391366360-2e959784a276?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80"
/>
<div style={{ fontSize: 11, color: '#666', lineHeight: 1.8 }}>
{/*<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>*/}
<div>电站地址:{currentStation.address || '河南省林州'}</div>
<div>电站类型:{currentStation.type || '地面电站'}</div>
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center', color: '#41ad0a' }}>
@@ -342,6 +351,7 @@ export default function AppLayout() {
</Layout>
</Sider>
<Content style={{ background: '#f4f7f9', overflowY: 'auto', padding: '4px 8px' }}>
<Outlet />
</Content>