2026-05-07 17:09:19 +08:00
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
|
import {
|
|
|
|
|
|
Card, Row, Col, Select, DatePicker, Input, Button, Space, Table, Tag,
|
2026-05-11 14:59:36 +08:00
|
|
|
|
Statistic, Typography, Modal, Form, Checkbox, message, Switch, Divider, Pagination
|
2026-05-07 17:09:19 +08:00
|
|
|
|
} from 'antd';
|
|
|
|
|
|
import {
|
2026-05-11 14:59:36 +08:00
|
|
|
|
BellOutlined, ClockCircleOutlined, CheckCircleOutlined, ExclamationCircleOutlined,
|
|
|
|
|
|
SearchOutlined, ReloadOutlined, CloseOutlined, InfoCircleOutlined,
|
|
|
|
|
|
SendOutlined, MailOutlined, MessageOutlined, DesktopOutlined,
|
|
|
|
|
|
FileTextOutlined, LineChartOutlined, PieChartOutlined, BarChartOutlined,
|
|
|
|
|
|
RiseOutlined
|
2026-05-07 17:09:19 +08:00
|
|
|
|
} from '@ant-design/icons';
|
2026-05-07 20:25:14 +08:00
|
|
|
|
import { Line, Pie, Bar } from '@ant-design/charts';
|
2026-05-07 14:13:26 +08:00
|
|
|
|
|
2026-05-07 17:09:19 +08:00
|
|
|
|
const { RangePicker } = DatePicker;
|
2026-05-11 14:59:36 +08:00
|
|
|
|
const { Text, Title } = Typography;
|
2026-05-07 17:09:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 级别 + 状态颜色
|
|
|
|
|
|
const levelColor = {
|
2026-05-11 14:59:36 +08:00
|
|
|
|
严重: '#F53F3F',
|
|
|
|
|
|
重要: '#FF7D00',
|
|
|
|
|
|
一般: '#F7BA1E',
|
|
|
|
|
|
提示: '#165DFF'
|
2026-05-07 17:09:19 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const statusColor = {
|
2026-05-11 14:59:36 +08:00
|
|
|
|
处理中: '#165DFF',
|
|
|
|
|
|
待处理: '#F7BA1E',
|
|
|
|
|
|
已关闭: '#00B42A'
|
2026-05-07 17:09:19 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 模拟数据
|
|
|
|
|
|
const mockAlerts = [
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{ id: 'AL20250525001', content: '逆变器停机', device: '逆变器 12 (组串式)', level: '严重', time: '2025-05-25 09:18:32', duration: '2小时18分', status: '处理中', handler: '张运维' },
|
|
|
|
|
|
{ id: 'AL20250525002', content: '发电量下降 > 15%', device: '汇流箱 05', level: '重要', time: '2025-05-25 08:46:11', duration: '3小时50分', status: '处理中', handler: '李工程师' },
|
|
|
|
|
|
{ id: 'AL20250525003', content: '逆变器温度过高', device: '逆变器 07 (组串式)', level: '重要', time: '2025-05-25 07:32:45', duration: '4小时24分', status: '待处理', handler: '-' },
|
|
|
|
|
|
{ id: 'AL20250525004', content: '通信中断', device: '气象站 01', level: '一般', time: '2025-05-25 06:51:20', duration: '5小时05分', status: '待处理', handler: '王运维' },
|
|
|
|
|
|
{ id: 'AL20250525005', content: '数据异常', device: '电表 01 (并网点)', level: '提示', time: '2025-05-25 06:20:18', duration: '3小时36分', status: '已关闭', handler: '赵工程师' },
|
|
|
|
|
|
{ id: 'AL20250525006', content: '发电量下降 > 15%', device: '组串 3-15', level: '重要', time: '2025-05-25 05:45:02', duration: '6小时10分', status: '处理中', handler: '李工程师' },
|
|
|
|
|
|
{ id: 'AL20250525007', content: '逆变器停机', device: '逆变器 03 (组串式)', level: '严重', time: '2025-05-25 04:28:33', duration: '7小时28分', status: '处理中', handler: '张运维' },
|
|
|
|
|
|
{ id: 'AL20250525008', content: '通信中断', device: '智能汇流箱 08', level: '一般', time: '2025-05-25 03:15:47', duration: '2小时18分', status: '已关闭', handler: '王运维' },
|
2026-05-07 17:09:19 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
2026-05-09 16:44:39 +08:00
|
|
|
|
// 通知渠道
|
|
|
|
|
|
const channelOptions = [
|
|
|
|
|
|
{ label: '企业微信', value: 'wecom' },
|
|
|
|
|
|
{ label: '钉钉', value: 'dingtalk' },
|
|
|
|
|
|
{ label: '邮件', value: 'email' },
|
|
|
|
|
|
{ label: '短信', value: 'sms' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
2026-05-07 17:09:19 +08:00
|
|
|
|
export default function AlarmCenterPage() {
|
2026-05-11 14:59:36 +08:00
|
|
|
|
const [selectedAlert, setSelectedAlert] = useState<any>(null);
|
|
|
|
|
|
const [detailVisible, setDetailVisible] = useState(false);
|
2026-05-09 16:44:39 +08:00
|
|
|
|
const [confirmModalVisible, setConfirmModalVisible] = useState(false);
|
|
|
|
|
|
const [notifyChannels, setNotifyChannels] = useState<string[]>(['wecom', 'dingtalk', 'email']);
|
|
|
|
|
|
const [form] = Form.useForm();
|
2026-05-07 17:09:19 +08:00
|
|
|
|
|
|
|
|
|
|
const columns = [
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '告警编号',
|
|
|
|
|
|
dataIndex: 'id',
|
|
|
|
|
|
width: 140,
|
|
|
|
|
|
render: (text) => <Text style={{ color: '#165DFF' }}>{text}</Text>
|
|
|
|
|
|
},
|
2026-05-07 17:09:19 +08:00
|
|
|
|
{ title: '告警内容', dataIndex: 'content', ellipsis: true },
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{ title: '来源设备', dataIndex: 'device', width: 160 },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '告警级别',
|
|
|
|
|
|
dataIndex: 'level',
|
|
|
|
|
|
width: 100,
|
|
|
|
|
|
render: (l) => (
|
|
|
|
|
|
<Tag color={levelColor[l]} style={{ borderRadius: 2, border: 'none', color: '#fff' }}>
|
|
|
|
|
|
{l}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
)
|
|
|
|
|
|
},
|
2026-05-07 17:09:19 +08:00
|
|
|
|
{ title: '发生时间', dataIndex: 'time', width: 160 },
|
|
|
|
|
|
{ title: '持续时长', dataIndex: 'duration', width: 100 },
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{
|
|
|
|
|
|
title: '处理状态',
|
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
|
width: 100,
|
|
|
|
|
|
render: (s) => (
|
|
|
|
|
|
<span style={{ color: statusColor[s], display: 'flex', alignItems: 'center' }}>
|
|
|
|
|
|
<span style={{ width: 6, height: 6, borderRadius: '50%', background: statusColor[s], marginRight: 8 }}></span>
|
|
|
|
|
|
{s}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
},
|
2026-05-07 17:09:19 +08:00
|
|
|
|
{ title: '负责人', dataIndex: 'handler', width: 100 },
|
|
|
|
|
|
{
|
2026-05-11 14:59:36 +08:00
|
|
|
|
title: '操作',
|
|
|
|
|
|
width: 80,
|
2026-05-07 17:09:19 +08:00
|
|
|
|
render: (_, record) => (
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Button type="link" onClick={() => { setSelectedAlert(record); setDetailVisible(true); }}>查看</Button>
|
2026-05-07 17:09:19 +08:00
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
];
|
2026-05-07 14:13:26 +08:00
|
|
|
|
|
2026-05-07 20:25:14 +08:00
|
|
|
|
// 告警趋势图配置
|
|
|
|
|
|
const trendConfig = {
|
|
|
|
|
|
data: [
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{ date: '05-19', type: '严重', value: 12 },
|
|
|
|
|
|
{ date: '05-19', type: '重要', value: 5 },
|
|
|
|
|
|
{ date: '05-19', type: '一般', value: 3 },
|
|
|
|
|
|
{ date: '05-19', type: '提示', value: 2 },
|
|
|
|
|
|
{ date: '05-20', type: '严重', value: 30 },
|
|
|
|
|
|
{ date: '05-20', type: '重要', value: 16 },
|
|
|
|
|
|
{ date: '05-20', type: '一般', value: 9 },
|
|
|
|
|
|
{ date: '05-20', type: '提示', value: 6 },
|
|
|
|
|
|
{ date: '05-21', type: '严重', value: 23 },
|
|
|
|
|
|
{ date: '05-21', type: '重要', value: 11 },
|
|
|
|
|
|
{ date: '05-21', type: '一般', value: 7 },
|
|
|
|
|
|
{ date: '05-21', type: '提示', value: 5 },
|
|
|
|
|
|
{ date: '05-22', type: '严重', value: 25 },
|
|
|
|
|
|
{ date: '05-22', type: '重要', value: 17 },
|
|
|
|
|
|
{ date: '05-22', type: '一般', value: 10 },
|
|
|
|
|
|
{ date: '05-22', type: '提示', value: 4 },
|
|
|
|
|
|
{ date: '05-23', type: '严重', value: 19 },
|
|
|
|
|
|
{ date: '05-23', type: '重要', value: 9 },
|
|
|
|
|
|
{ date: '05-23', type: '一般', value: 13 },
|
|
|
|
|
|
{ date: '05-23', type: '提示', value: 7 },
|
|
|
|
|
|
{ date: '05-24', type: '严重', value: 24 },
|
|
|
|
|
|
{ date: '05-24', type: '重要', value: 18 },
|
|
|
|
|
|
{ date: '05-24', type: '一般', value: 16 },
|
|
|
|
|
|
{ date: '05-24', type: '提示', value: 8 },
|
|
|
|
|
|
{ date: '05-25', type: '严重', value: 36 },
|
|
|
|
|
|
{ date: '05-25', type: '重要', value: 29 },
|
|
|
|
|
|
{ date: '05-25', type: '一般', value: 22 },
|
|
|
|
|
|
{ date: '05-25', type: '提示', value: 13 },
|
2026-05-07 20:25:14 +08:00
|
|
|
|
],
|
|
|
|
|
|
xField: 'date',
|
2026-05-11 14:59:36 +08:00
|
|
|
|
yField: 'value',
|
|
|
|
|
|
seriesField: 'type',
|
|
|
|
|
|
color: ['#F53F3F', '#FF7D00', '#F7BA1E', '#165DFF'],
|
2026-05-07 20:25:14 +08:00
|
|
|
|
smooth: true,
|
|
|
|
|
|
legend: { position: 'top-left' },
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 告警分类占比配置
|
|
|
|
|
|
const pieConfig = {
|
|
|
|
|
|
data: [
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{ type: '严重', value: 8 },
|
|
|
|
|
|
{ type: '重要', value: 12 },
|
|
|
|
|
|
{ type: '一般', value: 11 },
|
|
|
|
|
|
{ type: '提示', value: 5 }
|
2026-05-07 20:25:14 +08:00
|
|
|
|
],
|
|
|
|
|
|
angleField: 'value',
|
|
|
|
|
|
colorField: 'type',
|
2026-05-11 14:59:36 +08:00
|
|
|
|
color: ['#F53F3F', '#FF7D00', '#F7BA1E', '#165DFF'],
|
2026-05-07 20:25:14 +08:00
|
|
|
|
radius: 0.8,
|
|
|
|
|
|
innerRadius: 0.6,
|
2026-05-11 14:59:36 +08:00
|
|
|
|
label: false,
|
|
|
|
|
|
legend: {
|
|
|
|
|
|
position: 'right',
|
|
|
|
|
|
layout: 'vertical',
|
|
|
|
|
|
formatter: (text, item) => {
|
|
|
|
|
|
const d = pieConfig.data.find(d => d.type === text);
|
|
|
|
|
|
const total = pieConfig.data.reduce((a, b) => a + b.value, 0);
|
|
|
|
|
|
return `${text} ${((d!.value / total) * 100).toFixed(1)}% (${d!.value})`;
|
|
|
|
|
|
}
|
2026-05-07 20:25:14 +08:00
|
|
|
|
},
|
2026-05-11 14:59:36 +08:00
|
|
|
|
statistic: {
|
|
|
|
|
|
title: {
|
|
|
|
|
|
offsetY: -12,
|
|
|
|
|
|
style: { fontSize: '14px', color: '#86909C' },
|
|
|
|
|
|
content: '总告警'
|
|
|
|
|
|
},
|
|
|
|
|
|
content: {
|
|
|
|
|
|
offsetY: 12,
|
|
|
|
|
|
style: { fontSize: '24px', fontWeight: '700', color: '#1D2129' },
|
|
|
|
|
|
content: '36'
|
2026-05-07 20:25:14 +08:00
|
|
|
|
}
|
2026-05-11 14:59:36 +08:00
|
|
|
|
}
|
2026-05-07 20:25:14 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 告警来源设备分布
|
|
|
|
|
|
const barConfig = {
|
|
|
|
|
|
data: [
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{ device: '逆变器', count: 14 },
|
|
|
|
|
|
{ device: '汇流箱', count: 8 },
|
|
|
|
|
|
{ device: '组串', count: 6 },
|
|
|
|
|
|
{ device: '气象站', count: 3 },
|
|
|
|
|
|
{ device: '电表', count: 3 },
|
|
|
|
|
|
{ device: '其他', count: 2 }
|
2026-05-07 20:25:14 +08:00
|
|
|
|
],
|
|
|
|
|
|
xField: 'count',
|
|
|
|
|
|
yField: 'device',
|
2026-05-11 14:59:36 +08:00
|
|
|
|
seriesField: 'device',
|
|
|
|
|
|
color: '#165DFF',
|
|
|
|
|
|
barWidthRatio: 0.4,
|
2026-05-07 20:25:14 +08:00
|
|
|
|
label: {
|
|
|
|
|
|
position: 'right',
|
2026-05-11 14:59:36 +08:00
|
|
|
|
//formatter: (text) => {
|
|
|
|
|
|
// const total = barConfig.data.reduce((a, b) => a + b.count, 0);
|
|
|
|
|
|
// const d = barConfig.data.find(d => d.count === Number(text.count));
|
|
|
|
|
|
// return `${text.count} (${((Number(text.count) / total) * 100).toFixed(1)}%)`;
|
|
|
|
|
|
//}
|
|
|
|
|
|
},
|
|
|
|
|
|
legend: false
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 详情页趋势图配置
|
|
|
|
|
|
const detailTrendConfig = {
|
|
|
|
|
|
data: [
|
|
|
|
|
|
{ time: '05-25 04:00', type: '功率 (kW)', value: 100 },
|
|
|
|
|
|
{ time: '05-25 05:00', type: '功率 (kW)', value: 120 },
|
|
|
|
|
|
{ time: '05-25 06:00', type: '功率 (kW)', value: 150 },
|
|
|
|
|
|
{ time: '05-25 07:00', type: '功率 (kW)', value: 130 },
|
|
|
|
|
|
{ time: '05-25 08:00', type: '功率 (kW)', value: 140 },
|
|
|
|
|
|
{ time: '05-25 09:00', type: '功率 (kW)', value: 20 },
|
|
|
|
|
|
{ time: '05-25 10:00', type: '功率 (kW)', value: 10 },
|
|
|
|
|
|
{ time: '05-25 04:00', type: '直流电压 (V)', value: 600 },
|
|
|
|
|
|
{ time: '05-25 05:00', type: '直流电压 (V)', value: 610 },
|
|
|
|
|
|
{ time: '05-25 06:00', type: '直流电压 (V)', value: 620 },
|
|
|
|
|
|
{ time: '05-25 07:00', type: '直流电压 (V)', value: 600 },
|
|
|
|
|
|
{ time: '05-25 08:00', type: '直流电压 (V)', value: 610 },
|
|
|
|
|
|
{ time: '05-25 09:00', type: '直流电压 (V)', value: 580 },
|
|
|
|
|
|
{ time: '05-25 10:00', type: '直流电压 (V)', value: 570 },
|
|
|
|
|
|
{ time: '05-25 04:00', type: '温度 (℃)', value: 35 },
|
|
|
|
|
|
{ time: '05-25 05:00', type: '温度 (℃)', value: 38 },
|
|
|
|
|
|
{ time: '05-25 06:00', type: '温度 (℃)', value: 42 },
|
|
|
|
|
|
{ time: '05-25 07:00', type: '温度 (℃)', value: 45 },
|
|
|
|
|
|
{ time: '05-25 08:00', type: '温度 (℃)', value: 48 },
|
|
|
|
|
|
{ time: '05-25 09:00', type: '温度 (℃)', value: 52 },
|
|
|
|
|
|
{ time: '05-25 10:00', type: '温度 (℃)', value: 55 },
|
|
|
|
|
|
],
|
|
|
|
|
|
xField: 'time',
|
|
|
|
|
|
yField: 'value',
|
|
|
|
|
|
seriesField: 'type',
|
|
|
|
|
|
color: ['#165DFF', '#00B42A', '#FF7D00'],
|
|
|
|
|
|
smooth: true,
|
|
|
|
|
|
legend: { position: 'top' },
|
|
|
|
|
|
yAxis: { grid: { line: { style: { lineDash: [4, 4] } } } }
|
2026-05-07 20:25:14 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-09 16:44:39 +08:00
|
|
|
|
const handleConfirmAlarm = () => {
|
|
|
|
|
|
form.validateFields().then(values => {
|
2026-05-11 14:59:36 +08:00
|
|
|
|
message.success('告警已确认');
|
2026-05-09 16:44:39 +08:00
|
|
|
|
setConfirmModalVisible(false);
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-07 14:13:26 +08:00
|
|
|
|
return (
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}>
|
|
|
|
|
|
{/* 🔥 核心布局:左侧内容 + 右侧详情 永远一行显示 */}
|
|
|
|
|
|
<div style={{ display: 'flex', width: '100%', gap: 16, flexWrap: 'nowrap' }}>
|
2026-05-07 17:09:19 +08:00
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
|
{/* 左侧主内容区 */}
|
|
|
|
|
|
<div style={{ flex: 1, minWidth: 0 }}>
|
|
|
|
|
|
<Row gutter={16} style={{ marginBottom: 16 }}>
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: '16px 24px' }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row gutter={[24, 16]} align="middle">
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>告警级别</div>
|
|
|
|
|
|
<Select defaultValue="全部" style={{ width: 120 }} options={[{ value: '全部', label: '全部' }]} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>告警类型</div>
|
|
|
|
|
|
<Select defaultValue="全部" style={{ width: 120 }} options={[{ value: '全部', label: '全部' }]} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>设备类型</div>
|
|
|
|
|
|
<Select defaultValue="全部" style={{ width: 120 }} options={[{ value: '全部', label: '全部' }]} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>时间范围</div>
|
|
|
|
|
|
<RangePicker showTime style={{ width: 320 }} defaultValue={[null, null]} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>处理状态</div>
|
|
|
|
|
|
<Select defaultValue="全部" style={{ width: 120 }} options={[{ value: '全部', label: '全部' }]} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col flex="auto">
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>搜索关键词</div>
|
|
|
|
|
|
<Input placeholder="请输入告警编号/内容" style={{ width: '100%' }} />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ height: 22 }}></div>
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<Button style={{ borderRadius: 8 }}>重置</Button>
|
|
|
|
|
|
<Button type="primary" style={{ borderRadius: 8, background: '#165DFF' }}>查询</Button>
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</Card>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
2026-05-07 17:09:19 +08:00
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Row gutter={16} style={{ marginBottom: 16 }}>
|
|
|
|
|
|
<Col flex="1">
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: 16 }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row align="middle" gutter={16}>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
|
<BellOutlined style={{ fontSize: 24, color: '#F53F3F' }} />
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</div>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 14, color: '#4E5969' }}>今日告警总数</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
|
|
|
|
|
<span style={{ fontSize: 28, fontWeight: 700, color: '#F53F3F', marginRight: 8 }}>36</span>
|
|
|
|
|
|
<span style={{ fontSize: 12, color: '#F53F3F' }}>较昨日 +28.6% ↑</span>
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</div>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>昨日 28</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col flex="1">
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: 16 }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row align="middle" gutter={16}>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
|
<ExclamationCircleOutlined style={{ fontSize: 24, color: '#F53F3F' }} />
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</div>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 14, color: '#4E5969' }}>严重告警</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
|
|
|
|
|
<span style={{ fontSize: 28, fontWeight: 700, color: '#F53F3F', marginRight: 8 }}>8</span>
|
|
|
|
|
|
<span style={{ fontSize: 12, color: '#F53F3F' }}>较昨日 +33.3% ↑</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>昨日 6</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col flex="1">
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: 16 }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row align="middle" gutter={16}>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ width: 48, height: 48, background: '#FFF7E8', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
|
<ClockCircleOutlined style={{ fontSize: 24, color: '#FF7D00' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 14, color: '#4E5969' }}>处理中</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
|
|
|
|
|
<span style={{ fontSize: 28, fontWeight: 700, color: '#FF7D00', marginRight: 8 }}>12</span>
|
|
|
|
|
|
<span style={{ fontSize: 12, color: '#FF7D00' }}>较昨日 +20.0% ↑</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>昨日 10</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col flex="1">
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: 16 }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row align="middle" gutter={16}>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ width: 48, height: 48, background: '#E8FFEA', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
|
<CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 14, color: '#4E5969' }}>已关闭</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
|
|
|
|
|
<span style={{ fontSize: 28, fontWeight: 700, color: '#00B42A', marginRight: 8 }}>16</span>
|
|
|
|
|
|
<span style={{ fontSize: 12, color: '#00B42A' }}>较昨日 +45.5% ↑</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>昨日 11</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col flex="1">
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: 16 }} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Row align="middle" gutter={16}>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ width: 48, height: 48, background: '#E8F3FF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
|
<ReloadOutlined style={{ fontSize: 24, color: '#165DFF' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col>
|
|
|
|
|
|
<div style={{ fontSize: 14, color: '#4E5969' }}>平均响应时长</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
|
|
|
|
|
<span style={{ fontSize: 28, fontWeight: 700, color: '#165DFF', marginRight: 8 }}>18<span style={{ fontSize: 14 }}>分</span>32<span style={{ fontSize: 14 }}>秒</span></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>昨日 21分12秒</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
2026-05-07 20:25:14 +08:00
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Row gutter={16} style={{ marginBottom: 16 }}>
|
|
|
|
|
|
<Col flex="auto" style={{ minWidth: 0 }}>
|
|
|
|
|
|
<Card bordered={false} bodyStyle={{ padding: '16px 24px' }} style={{ height: '100%', borderRadius: 8 }}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
|
|
|
|
|
|
<Title level={5} style={{ margin: 0, fontSize: 14, color: '#4E5969' }}>告警列表(共 36 条)</Title>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<Table
|
|
|
|
|
|
rowSelection={{ type: 'checkbox' }}
|
|
|
|
|
|
columns={columns}
|
|
|
|
|
|
dataSource={mockAlerts}
|
|
|
|
|
|
pagination={false}
|
|
|
|
|
|
size="middle"
|
|
|
|
|
|
scroll={{ x: 'max-content' }}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', marginTop: 16 }}>
|
|
|
|
|
|
<Pagination total={36} showSizeChanger showQuickJumper defaultCurrent={1} size="small" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
2026-05-07 20:25:14 +08:00
|
|
|
|
|
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
|
<Col span={8}>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Card bordered={false} title={<span style={{ fontSize: 14, fontWeight: 700 }}>告警趋势</span>} extra={<Button type="link" size="small">更多 <RiseOutlined /></Button>} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Line {...trendConfig} height={220} />
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={8}>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Card bordered={false} title={<span style={{ fontSize: 14, fontWeight: 700 }}>告警分类占比</span>} extra={<Button type="link" size="small">更多 <PieChartOutlined /></Button>} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Pie {...pieConfig} height={220} />
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={8}>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
<Card bordered={false} title={<span style={{ fontSize: 14, fontWeight: 700 }}>告警来源设备分布</span>} extra={<Button type="link" size="small">更多 <BarChartOutlined /></Button>} style={{ borderRadius: 8 }}>
|
|
|
|
|
|
<Bar {...barConfig} height={220} />
|
2026-05-07 20:25:14 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</div>
|
2026-05-11 14:59:36 +08:00
|
|
|
|
|
|
|
|
|
|
{/* 🔥 右侧详情:丝滑滑入动画 */}
|
|
|
|
|
|
{detailVisible && selectedAlert && (
|
|
|
|
|
|
<div
|
|
|
|
|
|
style={{
|
|
|
|
|
|
width: 380,
|
|
|
|
|
|
flexShrink: 0,
|
|
|
|
|
|
animation: detailVisible ? 'slideIn 0.3s ease-out forwards' : 'none',
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
{`
|
|
|
|
|
|
@keyframes slideIn {
|
|
|
|
|
|
from { transform: translateX(40px); opacity: 0; }
|
|
|
|
|
|
to { transform: translateX(0); opacity: 1; }
|
|
|
|
|
|
}
|
|
|
|
|
|
`}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<Card
|
|
|
|
|
|
bordered={false}
|
|
|
|
|
|
title={<span style={{ fontSize: 14, fontWeight: 700 }}>告警详情</span>}
|
|
|
|
|
|
extra={<CloseOutlined style={{ cursor: 'pointer' }} onClick={() => setDetailVisible(false)} />}
|
|
|
|
|
|
bodyStyle={{ padding: 16 }}
|
|
|
|
|
|
style={{ height: '100%', borderRadius: 8 }}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 20 }}>
|
|
|
|
|
|
<div style={{ width: 40, height: 40, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', marginRight: 12 }}>
|
|
|
|
|
|
<ExclamationCircleOutlined style={{ fontSize: 20, color: '#F53F3F' }} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ flex: 1 }}>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
|
|
|
|
<span style={{ fontSize: 16, fontWeight: 700 }}>{selectedAlert.content}</span>
|
|
|
|
|
|
<Tag color={levelColor[selectedAlert.level]} style={{ borderRadius: 2, border: 'none', color: '#fff' }}>{selectedAlert.level}</Tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>告警编号:{selectedAlert.id}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={[16, 12]} style={{ marginBottom: 24 }}>
|
|
|
|
|
|
<Col span={12}><div style={{ fontSize: 12, color: '#86909C' }}>来源设备</div><div style={{ fontSize: 13 }}>{selectedAlert.device}</div></Col>
|
|
|
|
|
|
<Col span={12}><div style={{ fontSize: 12, color: '#86909C' }}>设备类型</div><div style={{ fontSize: 13 }}>逆变器</div></Col>
|
|
|
|
|
|
<Col span={12}><div style={{ fontSize: 12, color: '#86909C' }}>发生时间</div><div style={{ fontSize: 13 }}>{selectedAlert.time}</div></Col>
|
|
|
|
|
|
<Col span={12}><div style={{ fontSize: 12, color: '#86909C' }}>持续时长</div><div style={{ fontSize: 13 }}>{selectedAlert.duration}</div></Col>
|
|
|
|
|
|
<Col span={12}><div style={{ fontSize: 12, color: '#86909C' }}>处理状态</div><Tag color="blue" style={{ border: 'none' }}>{selectedAlert.status}</Tag></Col>
|
|
|
|
|
|
<Col span={12}>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#86909C' }}>负责人</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
|
|
|
<span style={{ fontSize: 13, marginRight: 8 }}>{selectedAlert.handler}</span>
|
|
|
|
|
|
<Button type="link" size="small" style={{ padding: 0 }}>转派</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span={24}><div style={{ fontSize: 12, color: '#86909C' }}>当前处理人</div><div style={{ fontSize: 13 }}>张运维 (2025-05-25 09:22 接收)</div></Col>
|
|
|
|
|
|
<Col span={24}><div style={{ fontSize: 12, color: '#86909C' }}>告警描述</div><div style={{ fontSize: 13 }}>逆变器因内部故障自动停机,当前无功率输出。</div></Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
<Divider style={{ margin: '16px 0' }} />
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 20 }}>
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12 }}>
|
|
|
|
|
|
<span style={{ fontSize: 14, fontWeight: 700 }}>根因分析建议</span>
|
|
|
|
|
|
<Button size="small" type="primary" ghost icon={<InfoCircleOutlined />} style={{ fontSize: 12 }}>AI 诊断分析</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<ol style={{ paddingLeft: 16, fontSize: 12, color: '#4E5969', lineHeight: '20px' }}>
|
|
|
|
|
|
<li>逆变器内部保护触发 (IGBT/继电器故障)</li>
|
|
|
|
|
|
<li>交流侧电压异常或并网不稳定</li>
|
|
|
|
|
|
<li>散热风扇故障导致过温保护</li>
|
|
|
|
|
|
</ol>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 20 }}>
|
|
|
|
|
|
<div style={{ fontSize: 14, fontWeight: 700, marginBottom: 12 }}>相关趋势</div>
|
|
|
|
|
|
<Line {...detailTrendConfig} height={160} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 24 }}>
|
|
|
|
|
|
<div style={{ fontSize: 14, fontWeight: 700, marginBottom: 12 }}>推荐处理措施</div>
|
|
|
|
|
|
<ul style={{ paddingLeft: 16, fontSize: 12, color: '#4E5969', lineHeight: '20px', listStyleType: 'decimal' }}>
|
|
|
|
|
|
<li>现场检查逆变器告警记录及指示灯状态;</li>
|
|
|
|
|
|
<li>检查散热风扇运行及通风条件;</li>
|
|
|
|
|
|
<li>检查交流侧电压及并网条件;</li>
|
|
|
|
|
|
<li>如无法恢复,建议联系厂家或更换模块。</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<div style={{ textAlign: 'right', marginTop: 8 }}>
|
|
|
|
|
|
<Button type="primary" size="small">生成工单</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ marginBottom: 24 }}>
|
|
|
|
|
|
<div style={{ fontSize: 14, fontWeight: 700, marginBottom: 12 }}>通知与订阅</div>
|
|
|
|
|
|
<Row align="middle" gutter={16} style={{ fontSize: 12 }}>
|
|
|
|
|
|
<Col><Space><MessageOutlined style={{ color: '#00B42A' }} />短信</Space> <Switch size="small" defaultChecked /></Col>
|
|
|
|
|
|
<Col><Space><DesktopOutlined style={{ color: '#165DFF' }} />Telegram</Space> <Switch size="small" defaultChecked /></Col>
|
|
|
|
|
|
<Col><Space><MailOutlined style={{ color: '#FF7D00' }} />邮件</Space> <Switch size="small" defaultChecked /></Col>
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Button type="primary" block style={{ height: 40, background: '#165DFF', borderRadius: 4 }}>标记为已解决</Button>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
2026-05-07 17:09:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-05-09 16:44:39 +08:00
|
|
|
|
<Modal
|
|
|
|
|
|
title="确认告警"
|
|
|
|
|
|
open={confirmModalVisible}
|
|
|
|
|
|
onCancel={() => setConfirmModalVisible(false)}
|
|
|
|
|
|
onOk={handleConfirmAlarm}
|
|
|
|
|
|
destroyOnClose
|
|
|
|
|
|
>
|
|
|
|
|
|
<Form form={form} initialValues={{ notifyChannels }}>
|
|
|
|
|
|
<Form.Item label="发送通知至" name="notifyChannels">
|
|
|
|
|
|
<Checkbox.Group options={channelOptions} />
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
<div style={{ fontSize: 12, color: '#999' }}>
|
|
|
|
|
|
确认后将向选中渠道发送通知
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
</div>
|
2026-05-07 14:13:26 +08:00
|
|
|
|
);
|
2026-05-07 17:09:19 +08:00
|
|
|
|
}
|