自适应
This commit is contained in:
@@ -1,62 +1,46 @@
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Card, Row, Col, Statistic, Table, Select, Input, Tag,
|
||||
Typography, Button
|
||||
Card, Row, Col, Table, Select, Input, Tag,
|
||||
Typography, Button, Space, Avatar, Pagination
|
||||
} from 'antd';
|
||||
import {
|
||||
CloudOutlined, CheckCircleOutlined, WarningOutlined,
|
||||
MinusCircleOutlined, ThunderboltOutlined,
|
||||
RiseOutlined, SunOutlined, BarChartOutlined
|
||||
RiseOutlined, SunOutlined, BarChartOutlined,
|
||||
VideoCameraOutlined, RocketOutlined, AppstoreOutlined,
|
||||
RobotOutlined, BranchesOutlined, ExperimentOutlined,
|
||||
SearchOutlined, MoreOutlined, ArrowRightOutlined,
|
||||
FullscreenOutlined, SyncOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Line, Bar, Pie } from '@ant-design/charts';
|
||||
import bgMain from '../assets/images/bgmain.jpg';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Search } = Input;
|
||||
const { Text, Title } = Typography;
|
||||
|
||||
// 模拟数据
|
||||
// 模拟数据扩展
|
||||
const deviceList = [
|
||||
{ id: 1, name: '摄像头 CAM-01', type: '摄像头', status: '正常', data: '35.2 ℃', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' },
|
||||
{ id: 2, name: '摄像头 CAM-02', type: '摄像头', status: '离线', data: '-', communication: '通讯离线', updateTime: '2026-04-28 12:10:00' },
|
||||
{ id: 3, name: '摄像头 CAM-03', type: '摄像头', status: '正常', data: '33.9 ℃', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' },
|
||||
{ id: 4, name: '汇流箱 CMB-A01', type: '汇流箱', status: '预警', data: '46.3 ℃', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' },
|
||||
{ id: 5, name: '汇流箱 CMB-A02', type: '汇流箱', status: '正常', data: '41.1 ℃', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' },
|
||||
{ id: 6, name: '逆变器 INV-A01', type: '逆变器', status: '正常', data: '66.8 kW', communication: '通讯正常', updateTime: '2026-04-28 12:00:00' },
|
||||
{ id: 7, name: '逆变器 INV-A02', type: '逆变器', status: '预警', data: '54.2 kW', communication: '通讯正常', updateTime: '2026-04-28 12:05:00' },
|
||||
{ id: 8, name: '逆变器 INV-B01', type: '逆变器', status: '正常', data: '22.4 kW', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' },
|
||||
{ id: 9, name: '电表 METER-01', type: '电表', status: '正常', data: '66.8 kW', communication: '通讯正常', updateTime: '2026-04-28 11:32:45' }
|
||||
{ id: 1, name: '逆变器 INV-01', type: '逆变器', status: '正常', data: '164.2 KW', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 2, name: '逆变器 INV-02', type: '逆变器', status: '正常', data: '166.8 KW', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 3, name: '逆变器 INV-03', type: '逆变器', status: '正常', data: '162.1 KW', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 4, name: '逆变器 INV-04', type: '逆变器', status: '正常', data: '159.7 KW', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 5, name: '逆变器 INV-05', type: '逆变器', status: '告警', data: '159.8 KW', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 6, name: '汇流箱 01', type: '汇流箱', status: '正常', data: '32 组 / 32 组', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 7, name: '汇流箱 02', type: '汇流箱', status: '正常', data: '32 组 / 32 组', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
{ id: 8, name: '气象站', type: '气象站', status: '正常', data: '28.0 ℃ / 815W/m²', communication: '通讯正常', updateTime: '2025-05-25 10:24:15' },
|
||||
];
|
||||
|
||||
// 👇 改成两天对比数据
|
||||
const powerTrendData = [
|
||||
{ time: '00:00', value: 13.4, type: '今日' },
|
||||
{ time: '00:00', value: 12.1, type: '昨日' },
|
||||
{ time: '00:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '04:00', value: 15.7, type: '今日' },
|
||||
{ time: '04:00', value: 14.3, type: '昨日' },
|
||||
{ time: '04:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '08:00', value: 220.5, type: '今日' },
|
||||
{ time: '08:00', value: 200.8, type: '昨日' },
|
||||
{ time: '08:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '12:00', value: 350.2, type: '今日' },
|
||||
{ time: '12:00', value: 320.5, type: '昨日' },
|
||||
{ time: '12:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '16:00', value: 280.7, type: '今日' },
|
||||
{ time: '16:00', value: 260.3, type: '昨日' },
|
||||
{ time: '16:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '20:00', value: 13.4, type: '今日' },
|
||||
{ time: '20:00', value: 11.9, type: '昨日' },
|
||||
{ time: '20:00', value: 1000, type: '额定' },
|
||||
|
||||
{ time: '24:00', value: 10.2, type: '今日' },
|
||||
{ time: '24:00', value: 9.8, type: '昨日' },
|
||||
{ time: '24:00', value: 1000, type: '额定' },
|
||||
{ time: '00:00', value: 0, type: '实时功率' },
|
||||
{ time: '04:00', value: 50, type: '实时功率' },
|
||||
{ time: '08:00', value: 350, type: '实时功率' },
|
||||
{ time: '12:00', value: 750, type: '实时功率' },
|
||||
{ time: '16:00', value: 500, type: '实时功率' },
|
||||
{ time: '20:00', value: 50, type: '实时功率' },
|
||||
{ time: '24:00', value: 0, type: '实时功率' },
|
||||
];
|
||||
|
||||
const inverterPowerData = [
|
||||
{ name: 'INV-01', power: 164.2 },
|
||||
{ name: 'INV-02', power: 166.8 },
|
||||
@@ -65,303 +49,271 @@ const inverterPowerData = [
|
||||
{ name: 'INV-05', power: 159.8 }
|
||||
];
|
||||
|
||||
const heatmapData = [
|
||||
['#1677ff', '#52c41a', '#1677ff', '#faad14', '#52c41a', '#1677ff', '#faad14', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#1677ff'],
|
||||
['#52c41a', '#1677ff', '#faad14', '#52c41a', '#1677ff', '#faad14', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#1677ff', '#52c41a'],
|
||||
['#1677ff', '#faad14', '#52c41a', '#1677ff', '#faad14', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#1677ff', '#1677ff', '#52c41a'],
|
||||
['#faad14', '#52c41a', '#1677ff', '#faad14', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#faad14'],
|
||||
['#52c41a', '#1677ff', '#faad14', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#1677ff', '#52c41a', '#1677ff', '#faad14', '#52c41a']
|
||||
];
|
||||
|
||||
const OnlineRateData = [
|
||||
{ type: '在线', value: 12 },
|
||||
{ type: '离线', value: 1 },
|
||||
{ type: '告警', value: 2 },
|
||||
{ type: '总数', value: 13 }
|
||||
];
|
||||
const heatmapColors = ['#52c41a', '#1890ff', '#faad14', '#1890ff', '#52c41a'];
|
||||
|
||||
const RealTimeMonitorPage = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [filterStatus, setFilterStatus] = useState('all');
|
||||
const [filterType, setFilterType] = useState(undefined);
|
||||
const [searchName, setSearchName] = useState('');
|
||||
|
||||
const filteredList = deviceList.filter(item => {
|
||||
if (filterStatus === 'all') return true;
|
||||
if (filterStatus === 'normal') return item.status === '正常';
|
||||
if (filterStatus === 'warning') return item.status === '预警';
|
||||
if (filterStatus === 'offline') return item.status === '离线';
|
||||
return true;
|
||||
}).filter(item => !filterType || item.type === filterType)
|
||||
.filter(item => !searchName || item.name.includes(searchName));
|
||||
const cardStyle = { borderRadius: 12, border: '1px solid #f0f0f0', boxShadow: '0 2px 8px rgba(0,0,0,0.04)' };
|
||||
|
||||
const getStatusTag = (status) => {
|
||||
switch (status) {
|
||||
case '正常': return <Tag color="green" icon={<CheckCircleOutlined />}>正常</Tag>;
|
||||
case '预警': return <Tag color="orange" icon={<WarningOutlined />}>预警</Tag>;
|
||||
case '离线': return <Tag color="gray" icon={<MinusCircleOutlined />}>离线</Tag>;
|
||||
default: return status;
|
||||
}
|
||||
const color = status === '正常' ? '#52c41a' : status === '告警' ? '#faad14' : '#999';
|
||||
return (
|
||||
<Space size={4}>
|
||||
<span style={{ width: 8, height: 8, borderRadius: '50%', background: color, display: 'inline-block' }} />
|
||||
<span style={{ color }}>{status}</span>
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '设备名称', dataIndex: 'name', key: 'name',
|
||||
render: (name, record) => (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<span style={{ color: '#1890ff' }}>
|
||||
{record.type === '摄像头' ? '摄' : record.type === '汇流箱' ? '汇' : record.type === '逆变器' ? '逆' : record.type === '电表' ? '网' : '其'}
|
||||
</span>
|
||||
{name}
|
||||
</div>
|
||||
render: (text, record) => (
|
||||
<Space>
|
||||
<div style={{ width: 24, height: 24, background: '#f5f5f5', borderRadius: 4, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
{record.type === '逆变器' ? <ThunderboltOutlined style={{ fontSize: 14 }} /> : <BranchesOutlined style={{ fontSize: 14 }} />}
|
||||
</div>
|
||||
<span style={{ fontSize: 13 }}>{text}</span>
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
{ title: '类型', dataIndex: 'type' },
|
||||
{ title: '类型', dataIndex: 'type', render: (t) => <span style={{ fontSize: 13, color: '#666' }}>{t}</span> },
|
||||
{ title: '当前状态', dataIndex: 'status', render: getStatusTag },
|
||||
{ title: '实时功率/数据', dataIndex: 'data' },
|
||||
{ title: '通讯状态', dataIndex: 'communication' },
|
||||
{ title: '更新时间', dataIndex: 'updateTime' }
|
||||
{ title: '实时功率/数据', dataIndex: 'data', render: (d) => <span style={{ fontSize: 13, fontWeight: 500 }}>{d}</span> },
|
||||
{
|
||||
title: '通讯状态', dataIndex: 'communication',
|
||||
render: (c) => (
|
||||
<Space size={4}>
|
||||
<span style={{ fontSize: 13 }}>{c}</span>
|
||||
<RiseOutlined style={{ color: '#52c41a' }} />
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
{ title: '更新时间', dataIndex: 'updateTime', render: (t) => <span style={{ fontSize: 12, color: '#999' }}>{t}</span> }
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20, background: '#f0f2f5', minHeight: '100vh' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 20 }}>
|
||||
<div>
|
||||
<Title level={4} style={{ margin: 0 }}>实时监控中心</Title>
|
||||
<Text type="secondary">全方位实时掌握电站设备运行状态与发电表现</Text>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 16 }}>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<Statistic
|
||||
title="在线率"
|
||||
value="92.3"
|
||||
suffix="%"
|
||||
valueStyle={{ color: '#52c41a', fontSize: 20, fontWeight: 700 }}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<Statistic
|
||||
title="设备"
|
||||
value={13}
|
||||
valueStyle={{ fontSize: 20, fontWeight: 700 }}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<Statistic
|
||||
title="离线"
|
||||
value={1}
|
||||
valueStyle={{ color: '#8c8c8c', fontSize: 20, fontWeight: 700 }}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<Statistic
|
||||
title="告警"
|
||||
value={2}
|
||||
valueStyle={{ color: '#faad14', fontSize: 20, fontWeight: 700 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ background: '#f8fafc', padding: '16px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
|
||||
<div>
|
||||
<Title level={4} style={{ margin: 0 }}>实时监控中心</Title>
|
||||
<Text type="secondary">全方位实时掌握电站设备运行状态与发电表现</Text>
|
||||
</div>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={14}>
|
||||
<Card
|
||||
title="电站拓扑图 (实时)"
|
||||
style={{ marginBottom: 16, borderRadius: 8 }}
|
||||
extra={<Text type="secondary">真实正射底图 · 设备状态联动</Text>}
|
||||
>
|
||||
<div style={{ height: 360, background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
<iframe
|
||||
src="https://pvs.satabot.com/?platform=web"
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
position: "absolute",
|
||||
}}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
title="外部系统"
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card title="设备实时监控列表" style={{ borderRadius: 8 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 16 }}>
|
||||
<div style={{ display: 'flex', gap: 8 }}>
|
||||
<Button type={filterStatus === 'all' ? 'primary' : 'default'} onClick={() => setFilterStatus('all')}>全部 13</Button>
|
||||
<Button type={filterStatus === 'normal' ? 'primary' : 'default'} onClick={() => setFilterStatus('normal')}>正常 10</Button>
|
||||
<Button type={filterStatus === 'warning' ? 'primary' : 'default'} onClick={() => setFilterStatus('warning')}>告警 2</Button>
|
||||
<Button type={filterStatus === 'offline' ? 'primary' : 'default'} onClick={() => setFilterStatus('offline')}>离线 1</Button>
|
||||
<Row gutter={[16, 16]}>
|
||||
{/* 左侧大栏 */}
|
||||
<Col xs={24} xl={16}>
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
{/* 电站拓扑图 */}
|
||||
<Card
|
||||
title={<span style={{ fontWeight: 800 }}>电站拓扑图 (实时)</span>}
|
||||
extra={
|
||||
<div style={{ display: 'flex', gap: 16, fontSize: 12 }}>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#52c41a', marginRight: 4 }}></span>正常</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>告警</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#888', marginRight: 4 }}></span>离线</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ color: '#1890ff', marginLeft: 8 }}>•• 通讯中</span></span>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0, position: 'relative', height: 480, overflow: 'hidden' }}
|
||||
>
|
||||
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
<iframe
|
||||
src="https://pvs.satabot.com/?platform=web"
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
position: "absolute",
|
||||
}}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
title="外部系统"
|
||||
/>
|
||||
</div>
|
||||
<Select placeholder="全部类型" style={{ width: 120 }} allowClear onChange={setFilterType}>
|
||||
<Option value="摄像头">摄像头</Option>
|
||||
<Option value="汇流箱">汇流箱</Option>
|
||||
<Option value="逆变器">逆变器</Option>
|
||||
<Option value="电表">电表</Option>
|
||||
</Select>
|
||||
<Search placeholder="搜索设备名称" style={{ width: 200 }} value={searchName} onChange={(e) => setSearchName(e.target.value)} />
|
||||
</div>
|
||||
<Table rowKey="id" columns={columns} dataSource={filteredList} pagination={{ total: 13, pageSize: 10 }} size="small" />
|
||||
</Card>
|
||||
</Card>
|
||||
|
||||
{/* 设备实时监控列表 */}
|
||||
<Card
|
||||
title={<span style={{ fontWeight: 800 }}>设备实时监控列表</span>}
|
||||
bordered={false}
|
||||
style={cardStyle}
|
||||
extra={
|
||||
<Space>
|
||||
<span style={{ fontSize: 12, color: '#999' }}>全部 56</span>
|
||||
<span style={{ fontSize: 12, color: '#52c41a' }}>正常 52</span>
|
||||
<span style={{ fontSize: 12, color: '#faad14' }}>告警 1</span>
|
||||
<span style={{ fontSize: 12, color: '#999' }}>离线 3</span>
|
||||
<Select defaultValue="all" size="small" style={{ width: 100 }}>
|
||||
<Option value="all">全部类型</Option>
|
||||
</Select>
|
||||
<Input size="small" placeholder="搜索设备名称" prefix={<SearchOutlined />} style={{ width: 150 }} />
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={deviceList}
|
||||
pagination={false}
|
||||
size="middle"
|
||||
/>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 16, alignItems: 'center' }}>
|
||||
<span style={{ color: '#999', fontSize: 12 }}>共 56 条</span>
|
||||
<Pagination size="small" total={56} current={1} pageSize={10} showSizeChanger />
|
||||
</div>
|
||||
</Card>
|
||||
</Space>
|
||||
</Col>
|
||||
|
||||
<Col span={10}>
|
||||
<Row
|
||||
gutter={[8, 8]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{
|
||||
title: '当前总功率',
|
||||
value: '812.6',
|
||||
unit: 'kW',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <ThunderboltOutlined />,
|
||||
sub: '额定功率 1,000 kW'
|
||||
},
|
||||
{
|
||||
title: '并网状态',
|
||||
value: '并网正常',
|
||||
unit: '',
|
||||
color: '#00B42A',
|
||||
bg: '#E8FFEA',
|
||||
icon: <CheckCircleOutlined />,
|
||||
sub: '频率 50.02 Hz'
|
||||
},
|
||||
{
|
||||
title: '电网电压',
|
||||
value: '380.2',
|
||||
unit: 'V',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <BarChartOutlined />,
|
||||
sub: 'A相 380.1 V'
|
||||
},
|
||||
{
|
||||
title: '今日累计发电量',
|
||||
value: '4,752',
|
||||
unit: 'kWh',
|
||||
color: '#00B42A',
|
||||
bg: '#E8FFEA',
|
||||
icon: <RiseOutlined />,
|
||||
sub: '昨日 5,000 kWh'
|
||||
},
|
||||
{
|
||||
title: '当前辐照度',
|
||||
value: '815',
|
||||
unit: 'W/m²',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <SunOutlined />,
|
||||
sub: '较昨日 +5.6%'
|
||||
},
|
||||
{
|
||||
title: '环境温度',
|
||||
value: '28.0',
|
||||
unit: '℃',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <CloudOutlined />,
|
||||
sub: '较昨日 +1.2 ℃'
|
||||
},
|
||||
].map((item, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '168px', flex: '0 0 auto' }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
style={{ borderRadius: 8, width: 168, height: 100 }}
|
||||
bodyStyle={{ padding: '16px', height: '100%' }}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'flex-start', gap: 12 }}>
|
||||
{/* 左侧图标 */}
|
||||
<div style={{
|
||||
width: 30,
|
||||
height: 30,
|
||||
borderRadius: '50%',
|
||||
background: item.bg,
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
flexShrink: 0
|
||||
}}>
|
||||
{React.cloneElement(item.icon, { style: { fontSize: 20, color: item.color } })}
|
||||
</div>
|
||||
|
||||
{/* 右侧文字 */}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 12, color: '#333', marginBottom: 4 }}>{item.title}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', marginBottom: 4 }}>
|
||||
<span style={{ color: item.color, fontSize: 20, fontWeight: 600 }}>{item.value}</span>
|
||||
{item.unit && <span style={{ color: item.color, fontSize: 12, marginLeft: 4 }}>{item.unit}</span>}
|
||||
{/* 右侧小栏 */}
|
||||
<Col xs={24} xl={8}>
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
{/* 6个统计卡片 */}
|
||||
<Row gutter={[8, 8]}>
|
||||
{[
|
||||
{ title: '当前总功率', value: '812.6', unit: 'kW', sub: '额定功率 1,000 kW', color: '#165DFF', icon: <ThunderboltOutlined /> },
|
||||
{ title: '并网状态', value: '并网正常', unit: '', sub: '频率 50.02 Hz', color: '#00B42A', icon: <CheckCircleOutlined /> },
|
||||
{ title: '电网电压', value: '380.2', unit: 'V', sub: 'A相 380.1 V', color: '#165DFF', icon: <BarChartOutlined /> },
|
||||
{ title: '今日累计发电量', value: '4,752', unit: 'kWh', sub: '昨日 5,000 kWh', color: '#00B42A', icon: <RiseOutlined /> },
|
||||
{ title: '当前辐照度', value: '815', unit: 'W/m²', sub: '较昨日 +5.6%', color: '#faad14', icon: <SunOutlined /> },
|
||||
{ title: '环境温度', value: '28.0', unit: '℃', sub: '较昨日 +1.2 ℃', color: '#165DFF', icon: <CloudOutlined /> },
|
||||
].map((item, idx) => (
|
||||
<Col span={8} key={idx}>
|
||||
<Card bordered={false} style={{ ...cardStyle, height: '100%' }} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'flex-start', gap: 8 }}>
|
||||
<div style={{ color: item.color, fontSize: 18 }}>{item.icon}</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 'clamp(10px, 0.8vw, 11px)', color: '#666', marginBottom: 4, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.title}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', flexWrap: 'wrap' }}>
|
||||
<span style={{ fontSize: 'clamp(14px, 1.2vw, 18px)', fontWeight: 700 }}>{item.value}</span>
|
||||
<span style={{ fontSize: 10, marginLeft: 2 }}>{item.unit}</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 9, color: '#999', marginTop: 4 }}>{item.sub}</div>
|
||||
</div>
|
||||
<div style={{ fontSize: 10, color: '#999' }}>{item.sub}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 实时功率曲线 */}
|
||||
<Card title={<span style={{ fontWeight: 800 }}>实时功率曲线</span>} extra={<Select defaultValue="today" size="small"><Option value="today">今天</Option></Select>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Line
|
||||
data={powerTrendData}
|
||||
xField="time"
|
||||
yField="value"
|
||||
seriesField="type"
|
||||
height={180}
|
||||
smooth
|
||||
area={{ style: { fill: 'l(270) 0:#ffffff 0.5:#165DFF 1:#165DFF', fillOpacity: 0.1 } }}
|
||||
color={['#165DFF']}
|
||||
xAxis={{ tickCount: 5 }}
|
||||
yAxis={{ title: { text: '功率 (kW)', style: { fontSize: 10 } } }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* 逆变器功率对比 */}
|
||||
<Card title={<span style={{ fontWeight: 800 }}>逆变器功率对比 (实时)</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Bar
|
||||
data={inverterPowerData}
|
||||
xField="name"
|
||||
yField="power"
|
||||
height={180}
|
||||
color="#165DFF"
|
||||
columnStyle={{ radius: [4, 4, 0, 0] }}
|
||||
label={{ position: 'top', style: { fill: '#000', fontSize: 10 } }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* 热力图与在线率 */}
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>组串电流热力图 (单位: A)</span>} extra={<Select defaultValue="a" size="small" style={{ width: 60 }}><Option value="a">电流</Option></Select>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||
{['INV-01', 'INV-02', 'INV-03', 'INV-04', 'INV-05'].map((name, i) => (
|
||||
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<span style={{ fontSize: 10, width: 40 }}>{name}</span>
|
||||
<div style={{ display: 'flex', gap: 2, flex: 1 }}>
|
||||
{Array.from({ length: 12 }).map((_, j) => (
|
||||
<div key={j} style={{ flex: 1, height: 16, background: heatmapColors[Math.floor(Math.random() * 5)], borderRadius: 2 }} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 9, color: '#999', marginTop: 4 }}>
|
||||
<span>1</span><span>5</span><span>10</span><span>15</span><span>20</span><span>25</span><span>30</span><span>32</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ maxHeight: 180, overflow: 'auto' }} className="custom-scrollbar">
|
||||
{[
|
||||
{ name: '逆变器 INV-01', status: '正常', color: '#52c41a' },
|
||||
{ name: '逆变器 INV-02', status: '正常', color: '#52c41a' },
|
||||
{ name: '逆变器 INV-03', status: '正常', color: '#52c41a' },
|
||||
{ name: '逆变器 INV-04', status: '正常', color: '#52c41a' },
|
||||
{ name: '逆变器 INV-05', status: '告警', color: '#faad14' },
|
||||
{ name: '气象站', status: '正常', color: '#52c41a' },
|
||||
{ name: '无人机机场', status: '正常', color: '#52c41a' },
|
||||
{ name: '巡检机器人', status: '正常', color: '#52c41a' },
|
||||
].map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', padding: '6px 4px', borderBottom: '1px solid #f5f5f5' }}>
|
||||
<Space size={4}>
|
||||
{item.name.includes('逆变器') ? <ThunderboltOutlined style={{ fontSize: 10 }} /> : <ExperimentOutlined style={{ fontSize: 10 }} />}
|
||||
<span style={{ fontSize: 11 }}>{item.name}</span>
|
||||
</Space>
|
||||
<span style={{ fontSize: 11, color: item.color }}>{item.status}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
{/* 👇 修改后的实时功率曲线:两天对比 */}
|
||||
<Card title="实时功率曲线" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<Line
|
||||
data={powerTrendData}
|
||||
xField="time"
|
||||
yField="value"
|
||||
seriesField="type"
|
||||
scale={{
|
||||
color: {
|
||||
relations: [
|
||||
['今日', '#1890ff'],
|
||||
['昨日', '#faad14'],
|
||||
['额定', '#52c41a']
|
||||
]
|
||||
}
|
||||
}}
|
||||
tooltip={{
|
||||
formatter: (datum) => ({
|
||||
name: datum.type,
|
||||
value: `${datum.value} kW`
|
||||
})
|
||||
}}
|
||||
lineStyle={{
|
||||
lineDash: (datum) => (datum.type === '额定' ? [4, 4] : undefined)
|
||||
}}
|
||||
point={{
|
||||
size: 3
|
||||
}}
|
||||
height={180}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card title="逆变器功率对比" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<Bar data={inverterPowerData} xField="name" yField="power" color={'#1677ff'} height={180} />
|
||||
</Card>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Card title="组串电流热力图" style={{ borderRadius: 8 }}>
|
||||
{heatmapData.map((row, i) => (
|
||||
<div key={i} style={{ display: 'flex', gap: 4, marginBottom: 4 }}>
|
||||
<div style={{ width: 40 }}>INV-0{i + 1}</div>
|
||||
{row.map((c, j) => <div key={j} style={{ width: 16, height: 24, background: c, borderRadius: 2 }} />)}
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>设备在线率</span>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ position: 'relative', height: 160 }}>
|
||||
<Pie
|
||||
data={[
|
||||
{ type: '在线', value: 52 },
|
||||
{ type: '离线', value: 3 },
|
||||
{ type: '告警', value: 1 }
|
||||
]}
|
||||
angleField="value"
|
||||
colorField="type"
|
||||
color={['#52c41a', '#f5f5f5', '#faad14']}
|
||||
radius={1}
|
||||
innerRadius={0.7}
|
||||
legend={false}
|
||||
height={140}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', textAlign: 'center' }}>
|
||||
<div style={{ fontSize: 16, fontWeight: 800 }}>92.1%</div>
|
||||
<div style={{ fontSize: 10, color: '#999' }}>在线率</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card title="设备在线率" style={{ borderRadius: 8 }}>
|
||||
<Pie data={OnlineRateData} angleField="value" colorField="type" radius={0.7} innerRadius={0.6} height={220} />
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<div style={{ fontSize: 10, display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 8 }}>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 6, height: 6, borderRadius: '50%', background: '#52c41a', marginRight: 4 }}></span>在线 52 (92.1%)</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 6, height: 6, borderRadius: '50%', background: '#f5f5f5', marginRight: 4 }}></span>离线 3 (5.3%)</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 6, height: 6, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>告警 1 (1.8%)</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 6, height: 6, borderRadius: '50%', background: '#999', marginRight: 4 }}></span>总数 56</span>
|
||||
</div>
|
||||
<div style={{ width: '100%', height: '100%', background: `url(${bgMain}) center/cover no-repeat`, position: 'relative' }}>
|
||||
{/* 简易地图点位 */}
|
||||
{/*<div style={{ position: 'absolute', top: '20%', left: '30%', width: 8, height: 8, background: '#52c41a', borderRadius: '50%', border: '1px solid #fff' }} />
|
||||
<div style={{ position: 'absolute', top: '40%', left: '60%', width: 8, height: 8, background: '#faad14', borderRadius: '50%', border: '1px solid #fff' }} />
|
||||
<div style={{ position: 'absolute', bottom: '20%', left: '40%', width: 8, height: 8, background: '#52c41a', borderRadius: '50%', border: '1px solid #fff' }} />*/}
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</Space>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div >
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user