卡片的自适应修改

This commit is contained in:
mmc
2026-05-14 09:37:15 +08:00
parent c0e8a1cd3e
commit 2ae097eed0
10 changed files with 874 additions and 790 deletions

View File

@@ -135,30 +135,50 @@ export default function AIDiagnosisPage() {
return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}>
{/* 顶部指标卡片 */}
<Row gutter={12} style={{ marginBottom: 16 }}>
{/* 优化版:宽高统一 + 最小168px + 自动换行 + 样式统一 */}
<Row
gutter={[12, 12]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{[
{ title: 'PR值', value: '82.6%', trend: '较昨日 -1.3%', icon: <RiseOutlined />, color: '#00B42A', bg: '#E8FFEA' },
{ title: '发电偏差', value: '-4.35%', trend: '较昨日 -1.02%', icon: <FallOutlined />, color: '#F53F3F', bg: '#FFF1F0' },
{ title: 'PR值', value: '82.6%', trend: '较昨日 -1.3%', icon: <RiseOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F' },
{ title: '发电偏差', value: '-4.35%', trend: '较昨日 -1.02%', icon: <FallOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '异常组串数量', value: '8', trend: '较昨日 +2 ↑', icon: <AppstoreOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '热斑疑似数量', value: '36', trend: '较昨日 +5 ↑', icon: <BellOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '健康度评分', value: '86.3分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA' },
{ title: '预测发电量', value: '4,821kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' },
{ title: '健康度评分', value: '86.3', unit: '分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F' },
{ title: '预测发电量', value: '4,821', unit: 'kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' },
].map((item, index) => (
<Col span={4} key={index}>
<Card bordered={false} bodyStyle={{ padding: 16 }} style={cardStyle}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto', }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ borderRadius: 8, height: 120 }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', height: '100%' }}>
<div>
<div style={{ fontSize: 14, color: '#4E5969', marginBottom: 8 }}>{item.title}</div>
<div style={{ fontSize: 24, fontWeight: 700, color: item.color }}>
{item.value.includes('分') ? <>{item.value.replace('分', '')}<span style={{ fontSize: 14 }}>分</span></> :
item.value.includes('kWh') ? <>{item.value.replace('kWh', '')}<span style={{ fontSize: 14 }}>kWh</span></> : item.value}
<div style={{ fontSize: 24, fontWeight: 700, color: item.color, display: 'flex', alignItems: 'baseline', gap: 4 }}>
{item.value}
{item.unit && <span style={{ fontSize: 14, fontWeight: 400 }}>{item.unit}</span>}
</div>
<div style={{ fontSize: 12, color: item.trendColor || '#86909C', marginTop: 8 }}>
{item.trend} {item.trend.includes('-') && <FallOutlined />}
{item.trend}
</div>
</div>
<div style={{ width: 48, height: 48, background: item.bg, borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
{React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 24, color: item.color } })}
<div style={{
width: 48,
height: 48,
background: item.bg,
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}>
{React.cloneElement(item.icon, { style: { fontSize: 24, color: item.color } })}
</div>
</div>
</Card>

View File

@@ -113,120 +113,127 @@ export default function CleanOptimizationPage() {
return (
<div style={{ background: '#f0f2f5', minHeight: '100vh', padding: '16px 24px' }}>
{/* 顶部指标卡片 */}
<Row gutter={12} style={{ marginBottom: 16 }}>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>污染指数</Text>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>68.5</Text>
<Tag color="#52c41a" style={{ borderRadius: 10, margin: 0 }}>中等</Tag>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">较昨日</Text>
<Text style={{ color: '#ff4d4f', marginLeft: 4, fontWeight: 'bold' }}>▼ 5.3</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<SunOutlined style={{ color: '#faad14', fontSize: 20 }} />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>建议清洗区块数</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>8 / 20</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">占比 40%</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#e6f7ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<LayoutGrid size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>预计发电提升</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#1890ff' }}>12,850</Text>
<Text style={{ fontSize: 14, marginLeft: 4 }}>kWh</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">占当前日发电量 14.2%</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#f0f5ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<TrendingUp size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>预计收益提升</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#faad14' }}>¥ 7,286</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">按电价 0.568 元/kWh 计算</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<DollarSign size={20} color="#faad14" />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>上次清洗时间</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>2025-05-12</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">距今 12 天</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#f0f5ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Calendar size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>清洗成本预估</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#faad14' }}>¥ 3,200</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">预计单次清洗总成本</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#e6f7ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Droplets size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
</Row>
{/* 清洗建议卡片组 —— 宽高统一 + 最小168px + 自动换行 + 风格统一 */}
<Row
gutter={[12, 12]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{[
{
title: '污染指数',
value: '68.5',
unit: '',
tag: '中等',
tagColor: '#52c41a',
trend: '较昨日 ▼ 5.3',
trendColor: '#ff4d4f',
icon: <SunOutlined />,
color: '#faad14',
bg: '#fff7e6'
},
{
title: '建议清洗区块数',
value: '8 / 20',
unit: '',
trend: '占比 40%',
icon: <LayoutGrid />,
color: '#1890ff',
bg: '#e6f7ff'
},
{
title: '预计发电提升',
value: '12,850',
unit: 'kWh',
trend: '占当前日发电量 14.2%',
icon: <TrendingUp />,
color: '#1890ff',
bg: '#f0f5ff'
},
{
title: '预计收益提升',
value: '¥ 7,286',
unit: '',
trend: '按电价 0.568 元/kWh 计算',
icon: <DollarSign />,
color: '#faad14',
bg: '#fff7e6'
},
{
title: '上次清洗时间',
value: '2025-05-12',
unit: '',
trend: '距今 12 天',
icon: <Calendar />,
color: '#1890ff',
bg: '#f0f5ff'
},
{
title: '清洗成本预估',
value: '¥ 3,200',
unit: '',
trend: '预计单次清洗总成本',
icon: <Droplets />,
color: '#1890ff',
bg: '#e6f7ff'
},
].map((item, index) => (
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ borderRadius: 8, height: 120 }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
<div style={{ fontSize: 13, color: '#86909C', marginBottom: 4 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 }}>
<div style={{ fontSize: 24, fontWeight: 700, color: item.color }}>
{item.value}
</div>
{item.unit && (
<span style={{ fontSize: 14, color: '#4E5969' }}>{item.unit}</span>
)}
{item.tag && (
<Tag
color={item.tagColor}
style={{
borderRadius: 10,
margin: 0,
padding: '0 8px',
fontSize: 12
}}
>
{item.tag}
</Tag>
)}
</div>
<div style={{ fontSize: 12, color: item.trendColor || '#86909C' }}>
{item.trend}
</div>
</div>
<div style={{
width: 40,
height: 40,
borderRadius: '50%',
background: item.bg,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
{React.cloneElement(item.icon, { style: { fontSize: 20, color: item.color } })}
</div>
</div>
</Card>
</Col>
))}
</Row>
{/* 标题栏 */}
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Card, Row, Col, Statistic, Button, Space, Tag, Typography } from 'antd';
import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table } from 'antd';
import {
CloudOutlined, ThunderboltOutlined, BarChartOutlined,
RiseOutlined, BellOutlined, WalletOutlined,
@@ -193,10 +193,11 @@ export default function StationDashboard() {
{ 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'; // 草绿
@@ -204,9 +205,12 @@ export default function StationDashboard() {
if (efficiency >= 95) return '#4080FF'; // 蓝色
return '#808695'; // 灰色(最低效)
},
barStyle: {
radius: [4, 4, 0, 0] // 顶部圆角,更美观
radius: [4, 4, 0, 0] // 顶部圆角,和第二张图效果一致
},
// 标签放在柱子顶部,显示百分比
label: {
position: 'top',
style: {
@@ -216,22 +220,28 @@ export default function StationDashboard() {
},
formatter: (item) => `${item}%`
},
// 关键:Y轴从90开始,让柱子更饱满
// Y轴从60开始(和第二张图的刻度一致),让柱子更饱满
yAxis: {
min: 90,
min: 60,
max: 100,
tickCount: 6,
tickCount: 5, // 控制刻度数量,显示60/70/80/90/100
label: {
formatter: (v) => `${v}%`
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 },
@@ -250,187 +260,39 @@ export default function StationDashboard() {
const cardStyle = { borderRadius: 8, };
return (
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "hidden" }}>
{/* 顶部一排6个卡片 —— 等宽、不换行、自适应 */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 16,
width: '100%',
margin: '0 0 16px 0',
flexWrap: 'wrap',
}}
>
{/* 今日发电量 */}
<Col flex="1 1 16.666%" style={{ height: '140px' }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>今日发电量</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#00B42A', fontSize: 24, fontWeight: 800 }}>4,752</span>
<span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>kWh</span>
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "auto" }}>
{/* 顶部统计卡片 */}
<Row gutter={[16, 16]} style={{ margin: '0 16px 16px 16px' }}>
{[
{ title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: <ThunderboltOutlined /> },
{ title: '当前功率', value: '812.6', unit: 'kW', sub: '装机容量 1,000 kWp', color: '#165DFF', bg: '#E8F3FF', icon: <DashboardOutlined /> },
{ title: 'Performance Ratio', value: '82.6%', unit: '', sub: '昨日 81.3% ↑1.3%', color: '#00B42A', bg: '#E8FFEA', icon: <BarChartOutlined /> },
{ title: '系统可用率', value: '99.35%', unit: '', sub: '昨日 99.12% ↑0.23%', color: '#165DFF', bg: '#E8F3FF', icon: <RiseOutlined /> },
{ title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: <BellOutlined /> },
{ title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> },
].map((item, idx) => (
<Col key={idx} style={{ flex: "0 0 auto", minWidth: "200px" }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%", minWidth: "200px" }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: item.color, fontSize: 24, fontWeight: 800 }}>{item.value}</span>
{item.unit && <span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>{item.unit}</span>}
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>{item.sub}</div>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>日目标 5,000 kWh</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8FFEA',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(0, 180, 42, 0.1)'
}}>
<ThunderboltOutlined style={{ fontSize: 28, color: '#00B42A' }} />
</div>
</div>
</Card>
</Col>
{/* 当前功率 */}
<Col flex="1 1 16.666%" style={{ height: '140px' }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>当前功率</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#165DFF', fontSize: 24, fontWeight: 800 }}>812.6</span>
<span style={{ color: '#165DFF', fontSize: 14, marginLeft: 4 }}>kW</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>装机容量 1,000 kWp</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8F3FF',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(22, 93, 255, 0.1)'
}}>
<DashboardOutlined style={{ fontSize: 28, color: '#165DFF' }} />
</div>
</div>
</Card>
</Col>
{/* Performance Ratio(PR) */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>Performance Ratio</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#00B42A', fontSize: 24, fontWeight: 800 }}>82.6%</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
昨日 81.3% &nbsp; 环比 <span style={{ color: '#00B42A' }}>↑1.3%</span>
<div style={{
width: 50, height: 50, background: item.bg, borderRadius: '50%',
display: 'flex', justifyContent: 'center', alignItems: 'center',
boxShadow: `0 2px 8px ${item.color}1A`
}}>
{React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 28, color: item.color } })}
</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8FFEA',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(0, 180, 42, 0.1)'
}}>
<BarChartOutlined style={{ fontSize: 28, color: '#00B42A' }} />
</div>
</div>
</Card>
</Col>
{/* 系统可用率 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>系统可用率</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#165DFF', fontSize: 24, fontWeight: 800 }}>99.35%</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
昨日 99.12% &nbsp; 环比 <span style={{ color: '#00B42A' }}>↑0.23%</span>
</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8F3FF',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(22, 93, 255, 0.1)'
}}>
<RiseOutlined style={{ fontSize: 28, color: '#165DFF' }} />
</div>
</div>
</Card>
</Col>
{/* 告警数量 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>告警数量</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#F53F3F', fontSize: 24, fontWeight: 800 }}>8</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
未处理 <span style={{ color: '#F53F3F' }}>5</span> &nbsp; 已处理 <span style={{ color: '#666' }}>3</span>
</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#FFF1F0',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(245, 63, 63, 0.1)'
}}>
<BellOutlined style={{ fontSize: 28, color: '#F53F3F' }} />
</div>
</div>
</Card>
</Col>
{/* 节省运维成本 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>节省运维成本</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#FF7D00', fontSize: 24, fontWeight: 800 }}>¥ 36,540</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>本月累计节省</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#FFF7E8',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(255, 125, 0, 0.1)'
}}>
<MoneyCollectOutlined style={{ fontSize: 28, color: '#FF7D00' }} />
</div>
</div>
</Card>
</Col>
</Card>
</Col>
))}
</Row>
{/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */}

View File

@@ -208,76 +208,104 @@ const RealTimeMonitorPage = () => {
</Col>
<Col span={10}>
<Row gutter={16} style={{ marginBottom: 16 }}>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="当前总功率"
value={66.8}
suffix="kW"
prefix={<ThunderboltOutlined />}
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="并网状态"
value="并网正常"
prefix={<CheckCircleOutlined />}
valueStyle={{ color: '#52c41a', fontSize: 20, fontWeight: 700 }}
/>
</Card>
</Col>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="电网电压"
value={380.2}
suffix="v"
prefix={<BarChartOutlined />}
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
</Row>
<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>
<Row gutter={16} style={{ marginBottom: 16 }}>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="今日发电量"
value={4752}
suffix="kWh"
prefix={<RiseOutlined />}
valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="辐照度"
value={815}
suffix="W/m²"
prefix={<SunOutlined />}
valueStyle={{ color: '#faad14', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="环境温度"
value={28.4}
suffix="℃"
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
{/* 右侧文字 */}
<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>}
</div>
<div style={{ fontSize: 10, color: '#999' }}>{item.sub}</div>
</div>
</div>
</Card>
</Col>
))}
</Row>
{/* 👇 修改后的实时功率曲线:两天对比 */}
<Card title="实时功率曲线" style={{ marginBottom: 16, borderRadius: 8 }}>
<Line

View File

@@ -94,26 +94,67 @@ export default function ReportCenterPage() {
</Tabs>
{/* 顶部统计卡片 */}
<Row gutter={16} style={{ marginBottom: 20 }}>
{/* 概览统计卡片 —— 统一风格 + 自动换行 + 宽高一致 */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 20,
flexWrap: 'wrap',
}}
>
{overviewCards.map((card, idx) => (
<Col span={4} key={idx}>
<Card bordered={false} style={{ borderRadius: 8, height: 120 }}>
<Col key={idx} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{
borderRadius: 8,
height: 120,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center'
}}
>
<Statistic
title={card.title}
title={
<span style={{ fontSize: 14, color: '#666', fontWeight: 500 }}>
{card.title}
</span>
}
value={card.value}
precision={card.title === 'PR均值' ? 1 : 1}
suffix={card.unit}
valueStyle={{ color: card.color, fontSize: 28, fontWeight: 700 }}
suffix={
card.unit && (
<span style={{ fontSize: 16, marginLeft: 4 }}>{card.unit}</span>
)
}
valueStyle={{
color: card.color,
fontSize: 28,
fontWeight: 700,
marginBottom: 4
}}
/>
{card.rate && (
<Text type="secondary" style={{ fontSize: 12 }}>
环比 <span style={{ color: card.rateUp ? '#52c41a' : '#ff4d4f' }}>{card.rate}</span>
</Text>
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
环比
<span
style={{
marginLeft: 4,
color: card.rateUp ? '#52c41a' : '#ff4d4f',
fontWeight: 600
}}
>
{card.rate}
</span>
</div>
)}
{card.desc && (
<Text type="secondary" style={{ fontSize: 12, display: 'block' }}>
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
{card.desc}
</Text>
</div>
)}
</Card>
</Col>

View File

@@ -1,4 +1,4 @@
import { useState } from 'react';
import React, { useState } from 'react';
import {
Card, Row, Col, Button, Space, Input, Select, Table, Tag, Typography, Dropdown, Menu,
Timeline
@@ -54,71 +54,100 @@ export default function VideoMonitorPage() {
<p style={{ color: '#666', margin: '4px 0 0' }}>实时视频监控、云台控制、录像回放与智能告警一体化管理</p>
</div>
{/* ========== 顶部统计卡片:统一高度 ========== */}
<Row gutter={[16, 16]} style={{ marginBottom: 16, display: 'flex', alignItems: 'stretch' }}>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>32 台</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>在线摄像头</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>在线率 <span style={{ color: '#52c41a' }}>↑ 4.1%</span></div>
</div>
<VideoCameraOutlined style={{ fontSize: 28, color: '#1890ff' }} />
</div>
</Card>
</Col>
{/* 视频监控统计卡片 —— 宽高统一 + 最小宽度168px + 自动换行 */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{[
{
title: '在线摄像头',
value: '32',
unit: '台',
sub: '在线率 ↑ 4.1%',
subColor: '#52c41a',
icon: <VideoCameraOutlined />,
color: '#1890ff',
bg: '#E8F3FF'
},
{
title: '离线摄像头',
value: '2',
unit: '台',
sub: '离线率 ↑ 5.9%',
subColor: '#ff4d4f',
icon: <VideoCameraOutlined />,
color: '#999',
bg: '#F5F7FA'
},
{
title: '今日告警事件',
value: '6',
unit: '起',
sub: '较昨日 ↑ 50%',
subColor: '#ff4d4f',
icon: <BellOutlined />,
color: '#faad14',
bg: '#FFF7E8'
},
{
title: '周界告警',
value: '2',
unit: '起',
sub: '较昨日 ↑ 100%',
subColor: '#ff4d4f',
icon: <BorderOutlined />,
color: '#ff4d4f',
bg: '#FFF1F0'
},
{
title: '存储使用率',
value: '78.6',
unit: 'TB',
sub: '使用率 65.5%',
subColor: '#52c41a',
icon: <DatabaseOutlined />,
color: '#1890ff',
bg: '#E8F3FF'
},
].map((item, index) => (
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ borderRadius: 8, height: 120 }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', height: '100%' }}>
<div>
<div style={{ fontSize: 14, color: '#0837A8', marginBottom: 4 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline', marginBottom: 4 }}>
<span style={{ fontSize: 24, fontWeight: 700, color: '#333' }}>{item.value}</span>
<span style={{ fontSize: 14, marginLeft: 4, color: '#333' }}>{item.unit}</span>
</div>
<div style={{ fontSize: 12, color: '#999' }}>
在线率 <span style={{ color: item.subColor }}>{item.sub.replace('在线率 ', '')}</span>
</div>
</div>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>2 台</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>离线摄像头</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>离线率 <span style={{ color: '#ff4d4f' }}>↑ 5.9%</span></div>
<div style={{
width: 48,
height: 48,
borderRadius: '50%',
background: item.bg,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
{React.cloneElement(item.icon, { style: { fontSize: 24, color: item.color } })}
</div>
</div>
<VideoCameraOutlined style={{ fontSize: 28, color: '#999' }} />
</div>
</Card>
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>6 起</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>今日告警事件</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>较昨日 <span style={{ color: '#ff4d4f' }}>↑ 50%</span></div>
</div>
<BellOutlined style={{ fontSize: 28, color: '#faad14' }} />
</div>
</Card>
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>2 起</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>周界告警</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>较昨日 <span style={{ color: '#ff4d4f' }}>↑ 100%</span></div>
</div>
<BorderOutlined style={{ fontSize: 28, color: '#ff4d4f' }} />
</div>
</Card>
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>78.6TB</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>存储使用率</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>使用率 <span style={{ color: '#52c41a' }}>65.5%</span></div>
</div>
<DatabaseOutlined style={{ fontSize: 28, color: '#1890ff' }} />
</div>
</Card>
</Col>
</Card>
</Col>
))}
</Row>
{/* ========== 视频区域 + AI:高度对齐 ========== */}

View File

@@ -279,25 +279,62 @@ const WorkOrderPage = () => {
</div>
{/* 统计卡片 */}
<Row gutter={16} style={{ marginBottom: 16 }}>
{/* 统一风格统计卡片 —— 宽高一致 + 自动换行 + 最小宽度168px */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{stats.map((item, index) => (
<Col span={4} key={index}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>{item.title}</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>{item.value}</Text>
{item.unit && <Text style={{ fontSize: 14, marginLeft: 4 }}>{item.unit}</Text>}
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ borderRadius: 8, height: 120 }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
{/* 左侧文字 */}
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
<div style={{ fontSize: 13, color: '#86909C' }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4, margin: '4px 0' }}>
<span style={{ fontSize: 24, fontWeight: 700, color: '#333' }}>{item.value}</span>
{item.unit && <span style={{ fontSize: 14, color: '#666' }}>{item.unit}</span>}
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">{item.subText}</Text>
<Text style={{ marginLeft: 4, color: item.subValue.startsWith('+') ? '#52c41a' : item.subValue.startsWith('-') ? '#ff4d4f' : '#1890ff', fontWeight: 'bold' }}>
<span style={{ color: '#86909C' }}>{item.subText}</span>
<span
style={{
marginLeft: 4,
fontWeight: 'bold',
color: item.subValue.startsWith('+')
? '#52c41a'
: item.subValue.startsWith('-')
? '#ff4d4f'
: '#1890ff',
}}
>
{item.subValue}
</Text>
</span>
</div>
</div>
<div style={{ width: 48, height: 48, borderRadius: '50%', background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
{/* 右侧图标 */}
<div
style={{
width: 48,
height: 48,
borderRadius: '50%',
background: item.bg,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
}}
>
{item.icon}
</div>
</div>
@@ -305,7 +342,6 @@ const WorkOrderPage = () => {
</Col>
))}
</Row>
{/* 筛选栏 */}
<Card bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 8, marginBottom: 16 }}>
<Row gutter={16} align="middle">