页面样式还原

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

@@ -144,19 +144,30 @@ export default function AIDiagnosisPage() {
overflow: 'hidden'
};
// 状态标签渲染
const renderStatusTag = (status: string) => {
const colorMap: Record<string, string> = {
'异常': '#F53F3F',
'正常': '#00B42A',
'轻微': '#F7BA1E',
};
return <span style={{ color: colorMap[status], fontWeight: 600 }}>{status}</span>;
let color = '';
if (status === '异常') color = '#ff4d4f';
else if (status === '轻微') color = '#1677ff';
else if (status === '正常') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{status}</Tag>;
};
// 影响程度标签渲染
const renderImpactTag = (impact: string) => {
const colorMap: Record<string, string> = { '高': '#F53F3F', '中': '#FF7D00', '低': '#00B42A' };
return <span style={{ color: colorMap[impact], fontWeight: 600 }}>{impact}</span>;
let color = '';
if (impact === '高') color = '#ff4d4f';
else if (impact === '中') color = '#fa8c16';
else if (impact === '低') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{impact}</Tag>;
};
// 优先级标签渲染(建议措施用)
const renderPriorityTag = (priority: string) => {
let color = '';
if (priority === '高') color = '#ff4d4f';
else if (priority === '中') color = '#fa8c16';
else if (priority === '低') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{priority}</Tag>;
};
return (
@@ -488,49 +499,122 @@ export default function AIDiagnosisPage() {
bodyStyle={{ padding: 0 }}
style={{ ...cardStyle, height: '100%' }}
>
{/* AI诊断总结 */}
<div style={{ padding: '16px 20px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>AI 智能诊断总结</span>
<Tag color="blue" style={{ margin: 0 }}>实时更新</Tag>
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>AI 诊断总结</span>
<span style={{ fontSize: 13, color: '#86909C' }}>更新时间: 2025-05-20 09:45</span>
</div>
<Table
columns={[
{ title: '诊断项', dataIndex: 'diagnosis', key: 'diagnosis', width: 85 },
{ title: '状态', dataIndex: 'status', key: 'status', render: renderStatusTag, width: 60 },
{ title: '置信度', dataIndex: 'confidence', key: 'confidence', width: 70 },
{ title: '影响', dataIndex: 'impact', key: 'impact', render: renderImpactTag, width: 60 },
{
title: '诊断项',
dataIndex: 'diagnosis',
key: 'diagnosis',
width: 90
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: renderStatusTag,
width: 60
},
{
title: '置信度',
dataIndex: 'confidence',
key: 'confidence',
width: 70
},
{
title: '影响程度',
dataIndex: 'impact',
key: 'impact',
render: renderImpactTag,
width: 70
},
{
title: '详情',
dataIndex: 'detail',
key: 'detail',
ellipsis: true
},
]}
dataSource={[
{ key: '1', diagnosis: '热斑检测', status: '异常', confidence: '92%', impact: '高', detail: '检测到 36 处热斑疑似点' },
{ key: '2', diagnosis: '组串失配', status: '异常', confidence: '90%', impact: '高', detail: '8 串组串存在异常' },
{ key: '3', diagnosis: '遮挡风险', status: '轻微', confidence: '78%', impact: '中', detail: '局部遮挡影响 2% 发电量' },
{ key: '4', diagnosis: '组件衰减', status: '异常', confidence: '86%', impact: '中', detail: '平均衰减率 -5.32%' },
{ key: '5', diagnosis: '逆变器效率异常', status: '正常', confidence: '93%', impact: '低', detail: '所有逆变器运行正常' },
]}
dataSource={aiSummaryData.slice(0, 4)}
pagination={false}
size="small"
className="compact-table"
rowKey="key"
/>
</div>
<Divider style={{ margin: 0 }} />
{/* AI建议与处置 */}
<div style={{ padding: '16px 20px' }}>
<div style={{ fontSize: 15, fontWeight: 700, color: '#1D2129', marginBottom: 16, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
AI 建议与智能处置
<Button type="link" size="small" style={{ fontSize: 12, padding: 0 }}>批量处理</Button>
<div style={{ fontSize: 15, fontWeight: 700, color: '#1D2129', marginBottom: 16 }}>
AI 建议与处置
</div>
<Table
columns={[
{ title: '建议措施', dataIndex: 'measure', key: 'measure', ellipsis: true },
{ title: '收益', dataIndex: 'expectedGain', key: 'expectedGain', render: (g) => <span style={{ color: '#00B42A', fontWeight: 600 }}>{g}</span>, width: 70 },
{
title: '建议措施',
dataIndex: 'measure',
key: 'measure',
ellipsis: true
},
{
title: '优先级',
dataIndex: 'priority',
key: 'priority',
render: renderPriorityTag,
width: 70
},
{
title: '预计收益',
dataIndex: 'gain',
key: 'gain',
render: (g) => <span style={{ color: '#00B42A', fontWeight: 600 }}>{g}</span>,
width: 80
},
{
title: '置信度',
dataIndex: 'confidence',
key: 'confidence',
width: 70
},
{
title: '操作',
key: 'action',
width: 80,
render: (text, record) => (
<Button type="primary" size="small" style={{ fontSize: 11, borderRadius: 6, height: 24 }}>
{record.key === '5' ? '详情' : '派单'}
width: 90,
render: (_, record) => (
<Button
type="primary"
size="small"
style={{ fontSize: 12, borderRadius: 6, height: 28 }}
>
{record.isView ? '查看详情' : '创建工单'}
</Button>
)
},
]}
dataSource={aiRecommendations.slice(0, 4)}
dataSource={[
{ key: '1', measure: '处理热斑组件', priority: '高', gain: '+2.15%', confidence: '92%', isView: false },
{ key: '2', measure: '排查异常组串', priority: '高', gain: '+1.85%', confidence: '90%', isView: false },
{ key: '3', measure: '清洗受遮挡区域', priority: '中', gain: '+0.45%', confidence: '78%', isView: false },
{ key: '4', measure: '跟踪衰减较大组件', priority: '中', gain: '+0.35%', confidence: '86%', isView: false },
{ key: '5', measure: '持续监控逆变器效率', priority: '低', gain: '+0.10%', confidence: '93%', isView: true },
]}
pagination={false}
size="small"
className="compact-table"
rowKey="key"
/>
</div>
</Card>

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>