import React from 'react'; import { Card, Row, Col, Statistic, Button, Space, Tag, Typography } from 'antd'; import { CloudOutlined, ThunderboltOutlined, BarChartOutlined, RiseOutlined, BellOutlined, WalletOutlined, MinusOutlined, PlusOutlined, SyncOutlined } from '@ant-design/icons'; import { Line, Bar, Pie } from '@ant-design/charts'; const { Text } = Typography; export default function StationDashboard() { // 模拟数据 const stationOverview = { todayEnergy: 45.9, currentPower: 66811.3, systemEfficiency: 66.8, yesterdayEfficiency: 81.3, systemAvailability: 92.31, onlineDevices: "12/13", alarmCount: 5, costSaved: 8278 }; const realtimeAlerts = [ { level: "INFO", type: "设备离线", time: "04-28 18:44" }, { level: "严重", type: "逆变器温度过高", time: "04-28 18:44" } ]; const deviceStatus = [ { name: "汇流箱", count: "2/2", status: "异常 1" }, { name: "逆变器", count: "3/3", status: "异常 1" }, { name: "电表", count: "1/1", status: "正常" }, { name: "巡检机器人", count: "1/1", status: "正常" } ]; 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..." } ]; const aiAnalysis = [ { type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。" }, { type: "严重", content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。" }, { type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。" } ]; // 图表配置 const powerTrendConfig = { data: [ { time: "00:00", actual: 2000, predict: 1800 }, { time: "08:00", actual: 35000, predict: 33000 }, { time: "16:00", actual: 55000, predict: 53000 }, { time: "24:00", actual: 2000, predict: 1800 } ], xField: 'time', yField: ['actual', 'predict'], color: ['#1890ff', '#52c41a'], areaStyle: { fillOpacity: 0.15 }, legend: { position: 'top-left' } }; const irradianceConfig = { data: [ { time: "00:00", irradiance: 50, temperature: 15 }, { time: "08:00", irradiance: 400, temperature: 20 }, { time: "16:00", irradiance: 800, temperature: 30 }, { time: "24:00", irradiance: 50, temperature: 15 } ], xField: 'time', yField: ['irradiance', 'temperature'], color: ['#1890ff', '#52c41a'], areaStyle: { fillOpacity: 0.15 }, legend: { position: 'top-left' } }; const invEfficiencyConfig = { data: [ { device: 'INV-01', efficiency: 98 }, { device: 'INV-03', efficiency: 97 }, { device: 'INV-05', efficiency: 96 }, { device: 'INV-07', efficiency: 95 }, { device: 'INV-09', efficiency: 94 } ], xField: 'device', yField: 'efficiency', color: '#1890ff', label: { position: 'top' } }; const taskProgressConfig = { data: [ { type: '已完成', value: 40 }, { type: '进行中', value: 35 }, { type: '待开始', value: 20 }, { type: '异常', value: 5 } ], angleField: 'value', colorField: 'type', color: ['#1890ff', '#52c41a', '#faad14', '#ff4d4f'], radius: 0.8, innerRadius: 0.6, legend: { position: 'right' } }; const cardStyle = { borderRadius: 8, }; return (
{/* 顶部一排6个卡片 —— 等宽、不换行、自适应 */} 今日发电量} value={stationOverview.todayEnergy} precision={1} valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 800 }} prefix={} suffix="kWh" />
日发电实时累计
当前功率} value={stationOverview.currentPower} precision={1} valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 800 }} prefix={} suffix="kW" />
装机容量 100.0 MWp
系统效率 PR} value={stationOverview.systemEfficiency} precision={1} valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 800 }} prefix={} suffix="%" />
昨日 {stationOverview.yesterdayEfficiency}% +1.3%
系统可用率} value={stationOverview.systemAvailability} precision={2} valueStyle={{ color: '#faad14', fontSize: 24, fontWeight: 800 }} prefix={} suffix="%" />
在线设备 {stationOverview.onlineDevices}
告警数量} value={stationOverview.alarmCount} valueStyle={{ color: '#ff4d4f', fontSize: 24, fontWeight: 800 }} prefix={} suffix="条" />
今日新增 0 条
节省运维成本} value={stationOverview.costSaved} valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 800 }} prefix="¥" />
清洗收益 + 工单闭环估算
{/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */} {/* 左侧图表列 - 最终完美版:不溢出 + 一定可见 */} 发电趋势} bordered={false} style={{ ...cardStyle, flex: 1, padding: '8px 12px', display: 'flex', flexDirection: 'column', boxSizing: 'border-box' }} bodyStyle={{ padding: 8 }} > 辐照度与温度} bordered={false} style={{ ...cardStyle, flex: 1, padding: '8px 12px', display: 'flex', flexDirection: 'column', boxSizing: 'border-box' }} bodyStyle={{ padding: 8 }} > 逆变器效率} bordered={false} style={{ ...cardStyle, flex: 1, padding: '8px 12px', display: 'flex', flexDirection: 'column', boxSizing: 'border-box' }} bodyStyle={{ padding: 8 }} > 运维任务进度} bordered={false} style={{ ...cardStyle, flex: 1, padding: '8px 12px', display: 'flex', flexDirection: 'column', boxSizing: 'border-box' }} bodyStyle={{ padding: 8 }} >
电站概览
GeoTIFF 正射底图 · 设备点位叠加
} bordered={false} style={{ ...cardStyle, height: '100%', padding: '12px' }} >
正常 告警 离线 维护中
65%
{/* 右侧:实时告警 */} {/* 实时告警 */} 实时告警
} bordered={false} style={{ borderRadius: 8, boxShadow: '0 1px 2px rgba(0,0,0,0.05)', padding: '4px 8px' }} bodyStyle={{ padding: 4 }} > {realtimeAlerts.map((alert, idx) => (
{alert.level} {alert.type}
{alert.time}
))} {/* 设备在线状态 */} 设备在线状态} bordered={false} style={{ borderRadius: 8, boxShadow: '0 1px 2px rgba(0,0,0,0.05)', padding: '4px 8px' }} bodyStyle={{ padding: 4 }} > {deviceStatus.map((item, idx) => (
{item.count}
{item.name}
{item.status}
))}
{/* 天气信息 */} 天气信息} bordered={false} style={{ borderRadius: 8, boxShadow: '0 1px 2px rgba(0,0,0,0.05)', padding: '4px 8px' }} bodyStyle={{ padding: 4 }} >
22℃
阴天
辐照度 89 W/m²
风速 4.1 m/s
中卫市
{/* 清洗建议 */} 清洗建议 } bordered={false} style={{ borderRadius: 8, boxShadow: '0 1px 2px rgba(0,0,0,0.05)', padding: '4px 8px' }} bodyStyle={{ padding: 4 }} >
46
分
污染指数中等,建议3天内安排B区清洗。
预计收益 ¥ 8,278
近期巡检记录} bordered={false} style={{ ...cardStyle, height: '100%' }} bodyStyle={{ padding: 12, height: '66%', overflow: 'auto', scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }} > {patrolRecords.map((item, idx) => (
{item.name}
{item.device}
{item.status}
))}
AI分析摘要} bordered={false} style={{ ...cardStyle, height: '100%' }} bodyStyle={{ padding: 12, height: '66%', overflow: 'auto', scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }} > {aiAnalysis.map((item, idx) => (
{item.type} {item.content}
))}
); }