+
装机容量:{currentStation.capacity || '1.00'} MWp
并网时间:{currentStation.gridTime || '2024-01-15'}
电站地址:{currentStation.address || '浙江省杭州市'}
电站类型:{currentStation.type || '地面电站'}
-
-
运行状态
-
●
-
正常运行
+
+ 运行状态:
+ ●
+ 正常运行
diff --git a/src/components/SystemSetting/BasicSettings.tsx b/src/components/SystemSetting/BasicSettings.tsx
index c5b44e1..f3842a1 100644
--- a/src/components/SystemSetting/BasicSettings.tsx
+++ b/src/components/SystemSetting/BasicSettings.tsx
@@ -34,6 +34,7 @@ import {
SafetyCertificateOutlined,
ToolOutlined,
RightOutlined,
+ EyeOutlined,
} from '@ant-design/icons';
import {
Smartphone,
@@ -367,7 +368,16 @@ const BasicSettings = () => {
)
},
- { title: '操作', key: 'action', width: 60, render: () =>
, fixed: 'right' },
+ {
+ title: '操作', key: 'action', width: 60, render: () =>
}
+ style={{ padding: 0, fontSize: 11 }}
+ >
+ 查看
+ , fixed: 'right'
+ },
]}
dataSource={[
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' },
diff --git a/src/components/SystemSetting/Organization.tsx b/src/components/SystemSetting/Organization.tsx
index 719756d..349bd43 100644
--- a/src/components/SystemSetting/Organization.tsx
+++ b/src/components/SystemSetting/Organization.tsx
@@ -121,7 +121,7 @@ export default function Organization() {
const columns = [
{ title: '组织名称', dataIndex: 'orgName' },
- { title: '组织编码', dataIndex: 'orgCode' },
+ //{ title: '组织编码', dataIndex: 'orgCode' },
{ title: '负责人', dataIndex: 'manager' },
{ title: '联系电话', dataIndex: 'phone' },
{ title: '邮箱', dataIndex: 'email' },
@@ -189,9 +189,9 @@ export default function Organization() {
-
+ {/*
-
+ */}
diff --git a/src/components/SystemSetting/SerialNumGenerate.jsx b/src/components/SystemSetting/SerialNumGenerate.jsx
index a1905f3..75306db 100644
--- a/src/components/SystemSetting/SerialNumGenerate.jsx
+++ b/src/components/SystemSetting/SerialNumGenerate.jsx
@@ -7,6 +7,11 @@ import QRCode from 'qrcode';
import DictManager from "../DictManager";
import request from '../../api/request';
import { Country, State } from 'country-state-city';
+import {
+ EyeOutlined,
+ EditOutlined,
+ DeleteOutlined,
+} from '@ant-design/icons';
// 接口导入
import {
@@ -378,12 +383,14 @@ const SerialNumGenerate = () => {
fixed: "right",
render: (_, r) => (
-
+ } onClick={() => handleView(r)}>查看
handleDelete(r.id)}
>
-
+ } >
+ 删除
+
)
diff --git a/src/components/SystemSetting/StationManage.tsx b/src/components/SystemSetting/StationManage.tsx
index 0440506..18445cc 100644
--- a/src/components/SystemSetting/StationManage.tsx
+++ b/src/components/SystemSetting/StationManage.tsx
@@ -225,7 +225,7 @@ export default function StationManage() {
// ====================== 表格列 ======================
const columns = [
{ title: '场站名称', dataIndex: 'siteName' },
- { title: '场站编号', dataIndex: 'siteCode' },
+ //{ title: '场站编号', dataIndex: 'siteCode' },
{
title: '所属组织',
dataIndex: 'orgId',
@@ -316,21 +316,19 @@ export default function StationManage() {
-
-
+
+
-
-
-
+
diff --git a/src/components/alerts/AlarmOverview.tsx b/src/components/alerts/AlarmOverview.tsx
index dafcac3..f53b4e2 100644
--- a/src/components/alerts/AlarmOverview.tsx
+++ b/src/components/alerts/AlarmOverview.tsx
@@ -5,9 +5,10 @@ import {
} from 'antd';
import {
BellOutlined, ClockCircleOutlined, CheckCircleOutlined, ExclamationCircleOutlined,
- SearchOutlined, ReloadOutlined, FileTextOutlined, NotificationOutlined
+ SearchOutlined, ReloadOutlined, FileTextOutlined, NotificationOutlined,
+ EyeOutlined,
+ EditOutlined
} from '@ant-design/icons';
-import { Line, Pie, Bar } from '@ant-design/charts';
import dayjs from 'dayjs';
import { exportTable } from "../../lib/utils.js"
@@ -265,9 +266,21 @@ export default function AlarmCenterPage() {
fixed: 'right',
render: (_, record) => (
-
- {/* 新增修改按钮 */}
-
+ }
+ onClick={() => showDetail(record.id)}
+ >
+ 查看
+
+
+ }
+ onClick={() => openEditModal(record)}
+ >
+ 修改
+
)
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index 547bca5..d1fbc25 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -1,5 +1,5 @@
-import React, { useState, useEffect } from 'react';
-import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table } from 'antd';
+import React, { useState, useEffect, useRef } from 'react';
+import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table, message } from 'antd';
import {
CloudOutlined, ThunderboltOutlined, BarChartOutlined,
RiseOutlined, BellOutlined, WalletOutlined,
@@ -14,18 +14,27 @@ import {
BranchesOutlined,
RobotOutlined
} from '@ant-design/icons';
-import { Line, Bar, Pie, } from '@ant-design/charts';
+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';
-
+// 👇 在这里引入你的工单接口(改成你真实的接口地址)
+import { addWorkOrder } from '../api/workOrder';
+import { useSelector } from 'react-redux';
const { Text } = Typography;
-
export default function StationDashboard() {
+ // 👇 消息提示(修复缺失)
+ const [messageApi, contextHolder] = message.useMessage();
+
+ // 👇 获取当前选中的电站(从redux拿,修复缺失)
+ const { currentStation } = useSelector((state) => state.station);
+ const { userInfo } = useSelector((state) => state.user);
+
+ // 天气数据
const [weatherdata, setWeatherData] = useState({
province: "江苏省",
city: "南通市",
@@ -41,7 +50,7 @@ export default function StationDashboard() {
});
const weatherType = getWeatherType(weatherdata.weather);
- // 请求天气接口
+ // 请求天气
useEffect(() => {
const fetchWeather = async () => {
try {
@@ -90,7 +99,7 @@ export default function StationDashboard() {
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。", desc: "整体发电偏差-2.8%" }
];
- // 图表配置 —— 终极美化版(渐变+紧凑+高级)
+ // 图表数据
const powerTrendData = [
{ time: '00:00', actual: 1800, predict: 1600 },
{ time: '04:00', actual: 1500, predict: 1400 },
@@ -135,25 +144,73 @@ export default function StationDashboard() {
const cardStyle = { borderRadius: 12, border: '1px solid #f0f0f0', boxShadow: '0 2px 8px rgba(0,0,0,0.04)' };
- // 顶部卡片微型图表配置
- const tinyAreaConfig = {
- height: 40,
- autoFit: true,
- data: [264, 417, 438, 887, 309, 397, 550, 575, 563, 430, 525, 592, 492, 467, 513, 546, 983, 340, 539, 243, 226, 192],
- smooth: true,
- areaStyle: { fill: 'l(270) 0:#ffffff 0.5:#165DFF 1:#165DFF', fillOpacity: 0.1 },
- line: { color: '#165DFF' },
+ // ==============================================
+ // 👇 【完整完善】生成清洗工单(核心修复)
+ // ==============================================
+ // ==============================================
+ // 【正确匹配接口字段】生成清洗工单
+ // ==============================================
+ const handleaddOrder = async () => {
+ if (!currentStation) {
+ messageApi.warning('请先选择电站');
+ return;
+ }
+ try {
+ // 严格按照你给的接口字段传参
+ const params = {
+ id: '', // 主键ID(新增为空)
+ orderNo: '', // 工单编号(后端生成)
+ orderTitle: '光伏组件清洗工单', // 工单标题
+ sourceType: 3, // 来源 3=清洗
+ orderType: 3, // 类型 3=清洗
+ priorityLevel: 2, // 优先级 2=中
+ deviceId: currentStation.id || '',
+ deviceName: currentStation.siteName || '电站',
+ deviceType: 1, // 设备类型:电站
+ siteId: currentStation.id || '',
+ siteName: currentStation.siteName || '',
+ orgId: userInfo?.orgId || '',
+ assigneeId: '',
+ assigneeName: '',
+ collaboratorIds: '',
+ collaboratorNames: '',
+ planStartTime: '',
+ planEndTime: '',
+ deadlineTime: '',
+ actualStartTime: '',
+ actualEndTime: '',
+ orderStatus: 1, // 状态 1=待处理
+ alarmId: '',
+ alarmNo: '',
+ taskDescription: '根据电站清洁度建议进行组件清洗,提升发电效率',
+ aiSuggestion: '系统自动生成清洗建议,预计提升发电量2.6%',
+ requiredEquipment: '清洗设备、水枪、抹布',
+ estimatedImpact: '2.6', // 影响发电量(%) 数字
+ handleResult: '',
+ handleRemark: ''
+ };
+
+ const res = await addWorkOrder(params);
+
+ if (res.code === 0 || res.code === 200) {
+ messageApi.success('✅ 清洗工单生成成功');
+ } else {
+ messageApi.error(res.msg || '❌ 工单生成失败');
+ }
+ } catch (error) {
+ messageApi.error('❌ 工单生成接口调用失败');
+ console.error(error);
+ }
};
- const tinyColumnConfig = {
- height: 40,
- autoFit: true,
- data: [274, 337, 81, 497, 666, 219, 269],
- color: '#00B42A',
- };
+
return (
+ {/* 👇 必须加这个,message才能正常显示 */}
+ {contextHolder}
+
+ {/* 顶部统计卡片 */}
{[
{ title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: },
@@ -164,16 +221,12 @@ export default function StationDashboard() {
{ title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: },
].map((item, idx) => (
-
+
{item.title}
@@ -188,16 +241,17 @@ export default function StationDashboard() {
display: 'flex', justifyContent: 'center', alignItems: 'center',
boxShadow: `0 2px 8px ${item.color}1A`
}}>
- {React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 22, color: item.color } })}
+ {React.cloneElement(item.icon, { style: { fontSize: 22, color: item.color } })}
))}
+
{/* 主体布局 */}
- {/* 左侧:图表列 */}
+ {/* 左侧图表 */}
发电趋势} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
@@ -210,20 +264,11 @@ export default function StationDashboard() {
dot
backgroundColor="transparent"
series={[
- {
- key: 'actual',
- name: '实际',
- color: '#165DFF',
- strokeWidth: 3,
- },
- {
- key: 'predict',
- name: '预测',
- color: '#00B42A',
- strokeWidth: 2,
- },
+ { key: 'actual', name: '实际', color: '#165DFF', strokeWidth: 3 },
+ { key: 'predict', name: '预测', color: '#00B42A', strokeWidth: 2 },
]}
- />
+ />
+
辐照度与温度趋势} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
+ />
+
逆变器效率对比} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
+ series={[{ key: 'efficiency', name: '效率', color: '#165DFF' }]}
+ />
+
运维任务进度} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
+ />
+
总任务
12
@@ -283,7 +315,7 @@ export default function StationDashboard() {
- {/* 中间:底图与状态 */}
+ {/* 中间 */}
- {/* 背景图层 */}
- {/*
*/}
- {/* 信息点 */}
- {/*
- 气象站 · 正常
-
-
- 无人机 · 正常
-
-
- 摄像头 12 · 正常
-
-
-
- 逆变器 5 · 正常
-
-
- 汇流箱 20 · 正常
-
-
- 巡检机器人 · 正常
-
*/}
- {/*
*/}
@@ -358,91 +354,48 @@ export default function StationDashboard() {
size="small"
columns={[
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
- { title: '巡检时间', dataIndex: 'time', key: 'time', },
+ { title: '巡检时间', dataIndex: 'time', key: 'time' },
{ title: '巡检人员', dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
-
- { title: '状态', dataIndex: 'status', key: 'status', render: (s) => ● 已完成 },
+ { title: '状态', dataIndex: 'status', key: 'status', render: () => ● 已完成 },
]}
/>
- AI 分析摘要}
- bordered={false}
- style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}
- >
+ AI 分析摘要} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
- {/* 热点检测 */}
-
+
热点检测
-
- 发现 2 处组件存在异常热斑
-
+
发现 2 处组件存在异常热斑
-
- {/* 组串异常 */}
-
+
组串异常
-
- 3 个组串存在发电异常
-
+
3 个组串存在发电异常
-
- {/* 发电偏差分析 */}
-
+
发电偏差分析
-
- 整体发电偏差 -2.8%
-
+
整体发电偏差 -2.8%
@@ -454,94 +407,34 @@ export default function StationDashboard() {
- {/* 右侧:状态与分析 */}
+ {/* 右侧 */}
- 实时告警}
- extra={}
- bordered={false}
- style={cardStyle}
- bodyStyle={{ padding: '12px' }}
- >
- {/* 表头 */}
-
+
实时告警} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
+
告警内容
级别
发生时间
-
{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';
- }
-
+ let dotColor = alert.level === '严重' ? '#ff4d4f' : alert.level === '重要' ? '#fa8c16' : '#1677ff';
+ let tagColor = alert.level === '严重' ? 'error' : alert.level === '重要' ? 'warning' : 'processing';
return (
-
- {/* 告警内容(带圆点) */}
+
-
-
- {alert.type}
-
+
+
{alert.type}
-
- {/* 级别标签 */}
{alert.level}
-
- {/* 发生时间 */}
-
- {alert.time}
-
+
{alert.time}
);
})}
-
设备在线状态}
- extra={}
- bordered={false}
- style={cardStyle}
- bodyStyle={{ padding: '12px' }}
- >
+ 设备在线状态} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
{[
{ name: '组件阵列', count: '320/320', icon: },
@@ -554,30 +447,12 @@ export default function StationDashboard() {
{ name: '巡检机器人', count: '1/1', icon: },
].map((item, idx) => (
- {/* 绿色圆形图标 */}
-
-
- {item.icon}
-
+
- {/* 名称+在线数 */}
-
-
- {item.name}
-
-
- {item.count}
-
+
+
{item.name}
+
{item.count}
))}
@@ -588,15 +463,9 @@ export default function StationDashboard() {
- {/*
*/}
-
-
-
- {weatherdata.temperature}℃
-
-
- {weatherdata.weather}
-
+
+
{weatherdata.temperature}℃
+
{weatherdata.weather}
@@ -607,6 +476,9 @@ export default function StationDashboard() {
+ {/* ====================================== */}
+ {/* 👇 清洗建议 + 生成工单按钮(已完善) */}
+ {/* ====================================== */}
清洗建议} extra={} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
@@ -630,7 +502,14 @@ export default function StationDashboard() {
预计提升电量: 120 kWh/天
-
+
diff --git a/src/pages/ReportCenter.tsx b/src/pages/ReportCenter.tsx
index a0a833c..a6f8ef3 100644
--- a/src/pages/ReportCenter.tsx
+++ b/src/pages/ReportCenter.tsx
@@ -511,8 +511,8 @@ export default function ReportCenterPage() {
title: '操作', width: 120,
render: () => (
}>
-
-
+
} style={{ fontSize: 12, padding: 0 }}>查看
+
} style={{ fontSize: 12, padding: 0 }}>下载
)
}
diff --git a/src/pages/WorkOrder.tsx b/src/pages/WorkOrder.tsx
index d02b1c1..4166822 100644
--- a/src/pages/WorkOrder.tsx
+++ b/src/pages/WorkOrder.tsx
@@ -407,10 +407,12 @@ const WorkOrderPage = () => {
fixed: "right",
render: (_, record) => (
-
-
+ } onClick={() => handleRowSelect(record)}>查看
+ } onClick={() => { handleRowSelect(record); openEditModal(); }}>修改
handleDelete(record)}>
-
+ }>
+ 删除
+
)