页面样式还原

This commit is contained in:
mmc
2026-05-14 15:54:40 +08:00
parent adf4c37b95
commit 468f1a5cf0
5 changed files with 680 additions and 265 deletions

View File

@@ -79,15 +79,15 @@ export default function StationDashboard() {
];
const patrolRecords = [
{ name: "升压站安防巡检任务", device: "UAV-01", status: "草稿", time: "04-29T..." },
{ name: "B区清洗任务", device: "CLEAN-01", status: "待执行", time: "04-29T..." },
{ name: "A区巡检任务", device: "ROBOT-01", status: "已派发", time: "04-29T..." }
{ name: "升压站安防巡检任务", device: "UAV-01", status: "草稿", time: "04-29T...", person: "张运维" },
{ name: "B区清洗任务", device: "CLEAN-01", status: "待执行", time: "04-29T...", person: "张运维" },
{ name: "A区巡检任务", device: "ROBOT-01", status: "已派发", time: "04-29T...", person: "张运维" }
];
const aiAnalysis = [
{ type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。" },
{ type: "严重", content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。" },
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。" }
{ type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。", desc: "发现2处组件存在异常热斑" },
{ type: "严重", content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。", desc: "3个组串存在发电异常" },
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。", desc: "整体发电偏差-2.8%" }
];
// 图表配置 —— 终极美化版(渐变+紧凑+高级)
@@ -342,33 +342,101 @@ export default function StationDashboard() {
<Row gutter={16}>
<Col span={12}>
<Card title={<span style={{ fontWeight: 800 }}>近期巡检记录</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '0 12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>近期巡检记录</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '0 12px' }}>
<Table
dataSource={patrolRecords}
pagination={false}
size="small"
columns={[
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
{ title: '巡检时间', dataIndex: 'time', key: 'time', render: (t) => t.substring(0, 10) },
{ title: '巡检时间', dataIndex: 'time', key: 'time', },
{ title: '巡检人员', dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
{ title: '状态', dataIndex: 'status', key: 'status', render: (s) => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
]}
/>
</Card>
</Col>
<Col span={12}>
<Card title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><ThunderboltOutlined style={{ color: '#722ed1' }} /> <span style={{ fontSize: 13 }}>热点检测</span></Space>
<Button type="link" size="small">查看详情</Button>
<Card
title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>}
bordered={false}
style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}
>
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
{/* 热点检测 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(114, 46, 209, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<ThunderboltOutlined style={{ fontSize: 24, color: '#722ed1' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>热点检测</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
发现 <span style={{ color: '#165DFF', fontWeight: 600 }}>2</span> 处组件存在异常热斑
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><AppstoreOutlined style={{ color: '#52c41a' }} /> <span style={{ fontSize: 13 }}>组串异常</span></Space>
<Button type="link" size="small">查看详情</Button>
{/* 组串异常 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(82, 196, 26, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<AppstoreOutlined style={{ fontSize: 24, color: '#52c41a' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>组串异常</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
<span style={{ color: '#165DFF', fontWeight: 600 }}>3</span> 个组串存在发电异常
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><RiseOutlined style={{ color: '#165DFF' }} /> <span style={{ fontSize: 13 }}>发电偏差分析</span></Space>
<Button type="link" size="small">查看详情</Button>
{/* 发电偏差分析 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(22, 93, 255, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<RiseOutlined style={{ fontSize: 24, color: '#165DFF' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>发电偏差分析</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
整体发电偏差 <span style={{ color: '#165DFF', fontWeight: 600 }}>-2.8%</span>
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
</div>
</Card>
@@ -380,20 +448,92 @@ export default function StationDashboard() {
{/* 右侧:状态与分析 */}
<Col xs={24} xl={6}>
<Space direction="vertical" size={16} style={{ width: '100%' }}>
<Card title={<span style={{ fontWeight: 800 }}>实时告警</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
{realtimeAlerts.map((alert, idx) => (
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12, borderBottom: '1px solid #f5f5f5', paddingBottom: 8 }}>
<div>
<div style={{ fontSize: 13, fontWeight: 500 }}>{alert.type}</div>
<div style={{ fontSize: 11, color: '#999' }}>发生时间: 10:24:15</div>
<Card
title={<span style={{ fontWeight: 800 }}>实时告警</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
{/* 表头 */}
<div style={{
display: 'flex',
justifyContent: 'space-between',
marginBottom: 12,
padding: '0 4px 8px',
borderBottom: '1px solid #f0f0f0',
fontSize: 13,
color: '#666'
}}>
<span style={{ flex: 3 }}>告警内容</span>
<span style={{ flex: 1, textAlign: 'center' }}>级别</span>
<span style={{ flex: 1.5, textAlign: 'right' }}>发生时间</span>
</div>
{realtimeAlerts.map((alert, idx) => {
// 映射级别颜色和圆点颜色
let dotColor, tagColor;
if (alert.level === '严重') {
dotColor = '#ff4d4f';
tagColor = 'error';
} else if (alert.level === '重要') {
dotColor = '#fa8c16';
tagColor = 'warning';
} else {
dotColor = '#1677ff';
tagColor = 'processing';
}
return (
<div
key={idx}
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 12,
padding: '0 4px',
borderBottom: idx < realtimeAlerts.length - 1 ? '1px solid #f5f5f5' : 'none',
paddingBottom: 8
}}
>
{/* 告警内容(带圆点) */}
<div style={{ display: 'flex', alignItems: 'center', flex: 3, minWidth: 0 }}>
<div style={{
width: 12,
height: 12,
borderRadius: '50%',
backgroundColor: dotColor,
marginRight: 8,
flexShrink: 0
}} />
<span style={{ fontSize: 13, fontWeight: 500, whiteSpace: 'normal', wordBreak: 'break-all' }}>
{alert.type}
</span>
</div>
{/* 级别标签 */}
<div style={{ flex: 1, textAlign: 'center' }}>
<Tag color={tagColor} style={{ fontSize: 12 }}>{alert.level}</Tag>
</div>
{/* 发生时间 */}
<div style={{ flex: 1.5, textAlign: 'right', fontSize: 13, color: '#333' }}>
{alert.time}
</div>
</div>
<Tag color={alert.level === '严重' ? 'error' : 'warning'}>{alert.level}</Tag>
</div>
))}
);
})}
</Card>
<Card title={<span style={{ fontWeight: 800 }}>设备在线状态</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Row gutter={[8, 8]}>
<Card
title={<span style={{ fontWeight: 800 }}>设备在线状态</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
<Row gutter={[16, 16]}>
{[
{ name: '组件阵列', count: '320/320', icon: <AppstoreOutlined /> },
{ name: '逆变器', count: '5/5', icon: <ThunderboltOutlined /> },
@@ -404,11 +544,31 @@ export default function StationDashboard() {
{ name: '无人机', count: '1/1', icon: <RocketOutlined /> },
{ name: '巡检机器人', count: '1/1', icon: <RobotOutlined /> },
].map((item, idx) => (
<Col span={6} key={idx} style={{ textAlign: 'center' }}>
<div style={{ background: '#f9f9f9', borderRadius: 8, padding: '8px 4px' }}>
<div style={{ color: '#165DFF', fontSize: 16 }}>{item.icon}</div>
<div style={{ fontSize: 11, color: '#333', fontWeight: 600, marginTop: 4 }}>{item.count}</div>
<div style={{ fontSize: 10, color: '#999' }}>{item.name}</div>
<Col span={6} key={idx} style={{ display: 'flex', alignItems: 'center' }}>
{/* 绿色圆形图标 */}
<div style={{
width: 20,
height: 20,
borderRadius: '50%',
border: '2px solid #52c41a',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
marginRight: 12,
flexShrink: 0
}}>
<div style={{ fontSize: 12, color: '#52c41a' }}>
{item.icon}
</div>
</div>
{/* 名称+在线数 */}
<div style={{ textAlign: 'left' }}>
<div style={{ fontSize: 12, color: '#333', fontWeight: 600 }}>
{item.name}
</div>
<div style={{ fontSize: 10, color: '#52c41a', fontWeight: 700, marginTop: 4 }}>
{item.count}
</div>
</div>
</Col>
))}
@@ -416,18 +576,24 @@ export default function StationDashboard() {
</Card>
<Card title={<span style={{ fontWeight: 800 }}>天气信息</span>} extra={<Button type="link" size="small">详细 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'start', gap: 20 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{ fontSize: 32, color: '#faad14' }}><CloudOutlined /></div>
<div>
<div style={{ fontSize: 24, fontWeight: 800 }}>28℃</div>
<div style={{ fontSize: 14 }}>晴</div>
<WeatherDisplay type={weatherType} />
<div style={{ flex: 1, flexDirection: "row" }}>
<div style={{ fontSize: 28, fontWeight: 800, color: '#1890ff' }}>
{weatherdata.temperature}℃
</div>
<div style={{ fontSize: 14, color: '#333', marginBottom: 6 }}>
{weatherdata.weather}
</div>
</div>
</div>
<div style={{ fontSize: 12, color: '#666', lineHeight: '20px' }}>
<div>辐照度: 815 W/m²</div>
<div>组件温度: 45.6 ℃</div>
<div>湿度: 56%</div>
<div style={{ fontSize: 12, color: '#666', lineHeight: 1.6 }}>
<div>湿度 {weatherdata.humidity}%</div>
<div>{weatherdata.wind_direction} {weatherdata.wind_power}</div>
<div>{weatherdata.city} · {weatherdata.district}</div>
</div>
</div>
</Card>
@@ -435,14 +601,19 @@ export default function StationDashboard() {
<Card title={<span style={{ fontWeight: 800 }}>清洗建议</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 16 }}>
<div style={{ width: 80, height: 80, position: 'relative' }}>
{/*<RingProgress percent={0.85} width={80} height={80} color={['#00B42A', '#E8FFEA']} innerRadius={0.7} radius={1}
statistic={{
content: {
style: { fontSize: '14px', fontWeight: 800, color: '#000' },
formatter: () => '85分',
},
}}
/>*/}
<UniversalPieChart
data={[
{ name: '清洁度', value: 85, color: '#00B42A' },
{ name: '待清洗', value: 15, color: '#E8FFEA' },
]}
width="100%"
height="100%"
innerRadius={20}
outerRadius={26}
showTooltip={false}
showLegend={false}
showLabel={false}
/>
</div>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>建议清洗时间: <span style={{ color: '#165DFF' }}>3天内</span></div>