import React from 'react'; import { Card, Row, Col, Statistic, Table, Tag, Progress, List, Button, Typography, Space, } from 'antd'; import { ThunderboltOutlined, DashboardOutlined, DotChartOutlined, RocketOutlined, BellOutlined, CloudUploadOutlined, } from '@ant-design/icons'; import { DEVICES, ALERTS } from '../constants'; import { useNavigate } from 'react-router-dom'; import { Line, Column } from '@ant-design/charts'; const { Text, Title } = Typography; const AntdCard = Card as any; export default function Home() { const navigate = useNavigate(); // 顶部统计卡片数据(和参考图完全一致) const topStats = [ { title: '今日发电量', value: 4752, suffix: 'kWh', extra: 日目标 5,000 kWh, percent: 95, color: '#52c41a' }, { title: '当前功率', value: 812.6, suffix: 'kW', extra: 装机容量 1,000 kWp, color: '#1890ff' }, { title: 'Performance Ratio(PR)', value: 82.6, suffix: '%', extra: 昨日 81.3% 环比 ↑1.3%, color: '#13c2c2' }, { title: '系统可用率', value: 99.35, suffix: '%', extra: 昨日 99.12% 环比 ↑0.23%, color: '#52c41a' }, { title: '告警数量', value: 8, extra: 未处理 5 / 已处理 3, color: '#ff4d4f' }, { title: '节省运维成本', value: 36540, prefix: '¥', extra: 本月累计节省, color: '#faad14' }, ]; // 发电趋势图数据 const powerTrendData = [ { time: '00:00', actual: 0, forecast: 0 }, { time: '06:00', actual: 200, forecast: 180 }, { time: '09:00', actual: 800, forecast: 750 }, { time: '12:00', actual: 1100, forecast: 1050 }, { time: '15:00', actual: 900, forecast: 920 }, { time: '18:00', actual: 300, forecast: 280 }, { time: '24:00', actual: 0, forecast: 0 }, ]; // 辐照度与温度趋势数据 const irradianceData = [ { time: '00:00', irradiance: 0, temp: 20 }, { time: '06:00', irradiance: 200, temp: 22 }, { time: '09:00', irradiance: 800, temp: 28 }, { time: '12:00', irradiance: 1050, temp: 35 }, { time: '15:00', irradiance: 750, temp: 32 }, { time: '18:00', irradiance: 200, temp: 26 }, { time: '24:00', irradiance: 0, temp: 21 }, ]; // 逆变器效率数据 const inverterData = [ { name: 'INV-01', value: 98.2 }, { name: 'INV-02', value: 97.6 }, { name: 'INV-03', value: 98.9 }, { name: 'INV-04', value: 97.1 }, { name: 'INV-05', value: 98.0 }, ]; // 告警列表数据 const alertList = [ { key: 1, content: 'INV-03 逆变直流电压异常', level: '严重', time: '10:24:15' }, { key: 2, content: '组串 String-07 绝缘电阻低', level: '重要', time: '10:18:42' }, { key: 3, content: '汇流箱 Combiner-12 过温', level: '重要', time: '10:12:33' }, { key: 4, content: '气象站辐照度传感器离线', level: '次要', time: '09:58:11' }, { key: 5, content: '组件温度异常偏高', level: '次要', time: '09:41:28' }, ]; // 巡检记录数据 const patrolData = [ { key: 1, type: '日常巡检', time: '2025-05-23 09:30', person: '张运维', status: '已完成' }, { key: 2, type: '无人机巡检', time: '2025-05-22 14:15', person: '无人机01号', status: '已完成' }, { key: 3, type: '夜间巡检', time: '2025-05-21 20:45', person: '李班长', status: '已完成' }, { key: 4, type: '专项巡检', time: '2025-05-20 10:20', person: '王技术员', status: '已完成' }, { key: 5, type: '日常巡检', time: '2025-05-19 09:25', person: '张运维', status: '已完成' }, ]; return (
{/* 顶部统计卡片 */} {topStats.map((stat, idx) => ( {stat.title}} value={stat.value} precision={stat.value % 1 !== 0 ? 1 : 0} valueStyle={{ color: '#1f2329', fontWeight: 600, fontSize: 20 }} prefix={stat.prefix} suffix={stat.suffix} />
{stat.extra} {stat.percent && }
))}
{/* 左侧图表区域 */} {/* 发电趋势 */} 今日发电功率趋势} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', marginBottom: 16 }} extra={■ 实际功率■ 预测功率} > {/* 辐照度与温度趋势 */} 辐照度与温度趋势} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', marginBottom: 16 }} extra={■ 辐照度(W/m²)■ 环境温度(℃)} > {/* 逆变器效率对比 */} 逆变器效率对比} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }} > {/* 中间:电站概览 */} 电站概览} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', height: '100%' }} extra={● 正常● 告警● 离线● 维护中} > {/* 这里替换成你的电站3D图 */}
电站3D概览图(可替换为你的图片/地图组件)
{/* 右侧信息面板 */} {/* 实时告警 */} 实时告警} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', marginBottom: 16 }} extra={} > (
{item.content}
{item.level} {item.time}
)} />
{/* 设备在线状态 */} 设备在线状态} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', marginBottom: 16 }} extra={} >
组件阵列
320/320
逆变器
5/5
汇流箱
20/20
气象站
1/1
摄像头
12/12
环境传感器
8/8
无人机
1/1
巡检机器人
1/1
{/* 天气信息 */} 天气信息} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', marginBottom: 16 }} extra={} >
☀️
28℃
晴
辐照度: 815 W/m²
组件温度: 45.6℃
环境温度: 28.3℃
风速: 2.6 m/s
风向: 东南风
湿度: 56%
{/* 清洗建议 */} 清洗建议} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }} extra={} >
建议清洗时间: 3 天内
预计提升发电量: 2.6%
预计提升电量: 120 kWh/天
{/* 底部:运维任务/巡检记录/AI分析 */} 运维任务进度} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }} extra={} >
● 已完成 7 (58%)
● 进行中 3 (25%)
● 待开始 2 (17%)
● 已延期 0 (0%)
近期巡检记录} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }} extra={} > {status} }, ]} /> AI分析摘要} variant={false} style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }} > (
{item.title}
{item.desc}
)} />
); }