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 (