总损失电量
@@ -349,16 +341,23 @@ export default function CleanOptimizationPage() {
清洗前后对比分析 (近一次)} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
-
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index ae4f4ed..4b01afa 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -18,6 +18,7 @@ import { Line, Bar, Pie, } from '@ant-design/charts';
import { getWeatherData, getWeatherType } from '../lib/utils';
import WeatherDisplay from '../components/Weather';
import bgMain from '../assets/images/bgmain.jpg';
+import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../components/recharts';
@@ -90,180 +91,47 @@ export default function StationDashboard() {
];
// 图表配置 —— 终极美化版(渐变+紧凑+高级)
- const powerTrendConfig = {
- data: [
- { time: "00:00", type: "实际", value: 1800 },
- { time: "00:00", type: "预测", value: 1600 },
- { time: "04:00", type: "实际", value: 1500 },
- { time: "04:00", type: "预测", value: 1400 },
- { time: "06:00", type: "实际", value: 8000 },
- { time: "06:00", type: "预测", value: 7500 },
- { time: "08:00", type: "实际", value: 32000 },
- { time: "08:00", type: "预测", value: 30000 },
- { time: "10:00", type: "实际", value: 58000 },
- { time: "10:00", type: "预测", value: 56000 },
- { time: "12:00", type: "实际", value: 62000 },
- { time: "12:00", type: "预测", value: 60000 },
- { time: "14:00", type: "实际", value: 59000 },
- { time: "14:00", type: "预测", value: 57000 },
- { time: "16:00", type: "实际", value: 42000 },
- { time: "16:00", type: "预测", value: 40000 },
- { time: "18:00", type: "实际", value: 12000 },
- { time: "18:00", type: "预测", value: 10000 },
- { time: "20:00", type: "实际", value: 3000 },
- { time: "20:00", type: "预测", value: 2500 },
- { time: "24:00", type: "实际", value: 1800 },
- { time: "24:00", type: "预测", value: 1600 }
- ],
+ const powerTrendData = [
+ { time: '00:00', actual: 1800, predict: 1600 },
+ { time: '04:00', actual: 1500, predict: 1400 },
+ { time: '06:00', actual: 8000, predict: 7500 },
+ { time: '08:00', actual: 32000, predict: 30000 },
+ { time: '10:00', actual: 58000, predict: 56000 },
+ { time: '12:00', actual: 62000, predict: 60000 },
+ { time: '14:00', actual: 59000, predict: 57000 },
+ { time: '16:00', actual: 42000, predict: 40000 },
+ { time: '18:00', actual: 12000, predict: 10000 },
+ { time: '20:00', actual: 3000, predict: 2500 },
+ { time: '24:00', actual: 1800, predict: 1600 },
+ ];
- xField: 'time',
- yField: 'value',
- seriesField: 'type',
- smooth: true,
- color: ['#165DFF', '#00B42A'], // ✅ 两条线颜色
- lineStyle: { lineWidth: 2 },
- point: { size: 5, shape: 'circle' },
- area: false,
- legend: { position: 'top-left' },
- yAxis: { min: 0, max: 68000 },
- };
+ const irradianceData = [
+ { time: '00:00', irradiance: 40, temperature: 14 },
+ { time: '04:00', irradiance: 30, temperature: 12 },
+ { time: '06:00', irradiance: 180, temperature: 16 },
+ { time: '08:00', irradiance: 460, temperature: 21 },
+ { time: '10:00', irradiance: 780, temperature: 27 },
+ { time: '12:00', irradiance: 860, temperature: 31 },
+ { time: '14:00', irradiance: 820, temperature: 30 },
+ { time: '16:00', irradiance: 620, temperature: 26 },
+ { time: '18:00', irradiance: 220, temperature: 20 },
+ { time: '20:00', irradiance: 60, temperature: 16 },
+ { time: '24:00', irradiance: 40, temperature: 14 },
+ ];
+ const invEfficiencyData = [
+ { device: 'INV-01', efficiency: 98.6 },
+ { device: 'INV-02', efficiency: 97.8 },
+ { device: 'INV-03', efficiency: 97.2 },
+ { device: 'INV-04', efficiency: 96.5 },
+ { device: 'INV-05', efficiency: 95.8 },
+ ];
- const irradianceConfig = {
- // 👇 我已经帮你把数据改成支持多色的格式
- data: [
- { time: "00:00", name: "辐照度", value: 40 },
- { time: "00:00", name: "温度", value: 14 },
- { time: "04:00", name: "辐照度", value: 30 },
- { time: "04:00", name: "温度", value: 12 },
- { time: "06:00", name: "辐照度", value: 180 },
- { time: "06:00", name: "温度", value: 16 },
- { time: "08:00", name: "辐照度", value: 460 },
- { time: "08:00", name: "温度", value: 21 },
- { time: "10:00", name: "辐照度", value: 780 },
- { time: "10:00", name: "温度", value: 27 },
- { time: "12:00", name: "辐照度", value: 860 },
- { time: "12:00", name: "温度", value: 31 },
- { time: "14:00", name: "辐照度", value: 820 },
- { time: "14:00", name: "温度", value: 30 },
- { time: "16:00", name: "辐照度", value: 620 },
- { time: "16:00", name: "温度", value: 26 },
- { time: "18:00", name: "辐照度", value: 220 },
- { time: "18:00", name: "温度", value: 20 },
- { time: "20:00", name: "辐照度", value: 60 },
- { time: "20:00", name: "温度", value: 16 },
- { time: "24:00", name: "辐照度", value: 40 },
- { time: "24:00", name: "温度", value: 14 },
- ],
-
- xField: "time",
- yField: "value", // 现在只用一个 value
- seriesField: "name", // 按 name 区分两条线
- smooth: true,
- color: ["#165DFF", "#00B42A"],
-
- point: {
- size: 5,
- shape: "circle",
- },
-
- area: false,
- animation: {
- appear: {
- animation: "path-in",
- duration: 1500,
- },
- },
-
- grid: {
- line: {
- style: {
- stroke: "#eee",
- lineWidth: 0.5,
- },
- },
- },
-
- legend: {
- position: "top-left",
- },
-
- yAxis: {
- min: 0,
- max: 900,
- tickCount: 6,
- },
- };
- const invEfficiencyConfig = {
- data: [
- { device: 'INV-01', efficiency: 98.6 },
- { device: 'INV-02', efficiency: 97.8 },
- { device: 'INV-03', efficiency: 97.2 },
- { device: 'INV-04', efficiency: 96.5 },
- { device: 'INV-05', efficiency: 95.8 }
- ],
- // 恢复为竖向柱状图:X轴是设备,Y轴是效率
- xField: 'device',
- yField: 'efficiency',
-
- // 每个柱子不同颜色,效率越高越亮
- color: ({ efficiency }) => {
- if (efficiency >= 98) return '#00B42A'; // 亮绿(最高效)
- if (efficiency >= 97) return '#52C41A'; // 草绿
- if (efficiency >= 96) return '#1890FF'; // 天蓝
- if (efficiency >= 95) return '#4080FF'; // 蓝色
- return '#808695'; // 灰色(最低效)
- },
-
- barStyle: {
- radius: [4, 4, 0, 0] // 顶部圆角,和第二张图效果一致
- },
-
- // 标签放在柱子顶部,显示百分比
- label: {
- position: 'top',
- style: {
- fontSize: 11,
- fill: '#333',
- fontWeight: 600
- },
- formatter: (item) => `${item}%`
- },
-
- // Y轴从60开始(和第二张图的刻度一致),让柱子更饱满
- yAxis: {
- min: 60,
- max: 100,
- tickCount: 5, // 控制刻度数量,显示60/70/80/90/100
- label: {
- formatter: (v) => `${v}`
- }
- },
-
- // 隐藏X轴上的线,保持简洁
- xAxis: {
- line: null
- },
-
- grid: {
- line: { style: { stroke: '#eee', lineWidth: 0.5 } }
- },
- animation: { appear: { animation: 'scale-in-y', duration: 1000 } }
- };
-
- 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 taskProgressData = [
+ { name: '已完成', value: 40, color: '#1890ff' },
+ { name: '进行中', value: 35, color: '#52c41a' },
+ { name: '待开始', value: 20, color: '#faad14' },
+ { name: '异常', value: 5, color: '#ff4d4f' },
+ ];
const cardStyle = { borderRadius: 12, border: '1px solid #f0f0f0', boxShadow: '0 2px 8px rgba(0,0,0,0.04)' };
@@ -325,18 +193,77 @@ export default function StationDashboard() {
发电趋势} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
今日发电功率趋势 (kW)
-
-
+
辐照度与温度趋势} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
-
-
+
逆变器效率对比} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
-
-
+
运维任务进度} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
-
-
+
总任务
12
diff --git a/src/pages/RealTimeMonitor.tsx b/src/pages/RealTimeMonitor.tsx
index 098f9f9..6ad3e3d 100644
--- a/src/pages/RealTimeMonitor.tsx
+++ b/src/pages/RealTimeMonitor.tsx
@@ -14,6 +14,7 @@ import {
} from '@ant-design/icons';
import { Line, Bar, Pie } from '@ant-design/charts';
import bgMain from '../assets/images/bgmain.jpg';
+import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../components/recharts';
const { Option } = Select;
const { Search } = Input;
@@ -203,30 +204,41 @@ const RealTimeMonitorPage = () => {
{/* 实时功率曲线 */}
实时功率曲线} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
-
{/* 逆变器功率对比 */}
逆变器功率对比 (实时)} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
-
@@ -274,19 +286,30 @@ const RealTimeMonitorPage = () => {
设备在线率} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
-
92.1%
diff --git a/src/pages/ReportCenter.tsx b/src/pages/ReportCenter.tsx
index 90fd35c..e5d01bc 100644
--- a/src/pages/ReportCenter.tsx
+++ b/src/pages/ReportCenter.tsx
@@ -18,6 +18,7 @@ import {
import { Line, Column, Pie, Area, DualAxes, Bar } from '@ant-design/charts';
import dayjs from 'dayjs';
import { ChevronRight } from 'lucide-react';
+import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../components/recharts';
const { TabPane } = Tabs;
const { RangePicker } = DatePicker;
@@ -73,6 +74,11 @@ const aiAnalysisData = [
{ type: '推荐清洗区块', value: 8, color: '#00B42A', icon:
},
{ type: '视频异常事件', value: 6, color: '#722ED1', icon:
},
];
+const aiPieData = aiAnalysisData.map(item => ({
+ name: item.type,
+ value: item.value,
+ color: item.color,
+}));
const reportFileList = [
{ name: '2025年05月电站月报', status: '已生成' },
@@ -275,47 +281,29 @@ export default function ReportCenterPage() {
预测发电 (MWh)
PR (%)
-
{
- if (datum.type === 'pr') return { lineDash: [4, 4] };
- return {};
- }}
- tooltip={{
- formatter: (datum) => {
- return {
- name: datum.date,
- data: [
- { name: '发电量(MWh)', value: datum.generation },
- { name: '预测发电(MWh)', value: datum.predicted },
- { name: 'PR(%)', value: datum.pr }
- ]
- };
- }
- }}
- legend={{
- items: [
- { name: '发电量(MWh)', marker: { symbol: 'line', style: { stroke: '#52c41a' } } },
- { name: '预测发电(MWh)', marker: { symbol: 'line', style: { stroke: '#1890ff', lineDash: [4, 4] } } },
- { name: 'PR(%)', marker: { symbol: 'line', style: { stroke: '#fa8c16' } } },
- ]
- }}
- yAxis={[
+ xKey="date"
+ height={260}
+ series={[
{
- label: { formatter: (v) => `${v}` },
- name: '发电量',
+ key: 'generation',
+ name: '发电量(MWh)',
+ color: '#52c41a',
},
{
- label: { formatter: (v) => `${v}%` },
- name: 'PR',
- position: 'right',
- }
+ key: 'predicted',
+ name: '预测发电(MWh)',
+ color: '#1890ff',
+ dashed: true,
+ },
+ {
+ key: 'pr',
+ name: 'PR(%)',
+ color: '#fa8c16',
+ strokeWidth: 2,
+ },
]}
- height={200}
/>
@@ -340,9 +328,14 @@ export default function ReportCenterPage() {
{/* 第二排:三个图表 */}
-
+
- 发电与气象统计}>
+ 发电与气象统计}
+ >
@@ -350,18 +343,26 @@ export default function ReportCenterPage() {
-
+
- 工单与告警闭环分析}>
+ 工单与告警闭环分析}
+ >
@@ -369,57 +370,82 @@ export default function ReportCenterPage() {
-
+
- AI 分析成果统计}>
-
-
-
-
d.color)}
- radius={1}
- innerRadius={0.7}
- legend={false}
- height={160}
- autoFit
- />
-
-
本月AI事件
-
总计
-
58
+
AI 分析成果统计}
+ >
+
+
+
+
+ {aiAnalysisData.map((item, idx) => (
+
+
+
+ {item.type}
+
+
+ {item.value} 个
+
-
-
-
-
- {aiAnalysisData.map((item, idx) => (
-
-
-
- {item.type}
-
-
{item.value} 个
-
- ))}
-
-
-
+ ))}
+
+
-
{/* 订阅与分发 */}
订阅与分发}>
diff --git a/src/pages/WorkOrder.tsx b/src/pages/WorkOrder.tsx
index 761dff1..7df537f 100644
--- a/src/pages/WorkOrder.tsx
+++ b/src/pages/WorkOrder.tsx
@@ -30,6 +30,7 @@ import {
} from 'lucide-react';
// 导入工单接口
import { getWorkOrderApi, getWorkOrderDetailApi, updateWorkOrder, dispatchWorkOrder, completeWorkOrder } from '../api/workOrder';
+import { UniversalLineChart } from '../components/recharts';
const { Option } = Select;
const { Search } = Input;
@@ -705,17 +706,24 @@ const WorkOrderPage = () => {
关联告警趋势 (近 7 天)
-