页面样式还原

This commit is contained in:
mmc
2026-05-14 15:54:40 +08:00
parent adf4c37b95
commit 468f1a5cf0
5 changed files with 680 additions and 265 deletions

View File

@@ -16,6 +16,10 @@
left: 60px;
animation: floatCloud 4s ease-in-out infinite;
}
.weather-box{
width: 80px;
height: 80px;
}
@keyframes floatCloud {
0%, 100% { transform: translateX(0); }

View File

@@ -1,6 +1,8 @@
.weather-sunny {
text-align: center;
font-size: 18px;
width: 80px;
height: 80px;
}
.sun {

View File

@@ -8,46 +8,127 @@ import {
SaveOutlined, FullscreenOutlined, EnvironmentOutlined, RobotOutlined,
BranchesOutlined, CloudOutlined, ThunderboltOutlined, CheckCircleOutlined,
InfoCircleOutlined, ClockCircleOutlined, RiseOutlined, FallOutlined,
SettingOutlined, WarningOutlined, ArrowRightOutlined, CloudSyncOutlined
SettingOutlined, WarningOutlined, ArrowRightOutlined, CloudSyncOutlined,
SearchOutlined, MoreOutlined, AimOutlined
} from '@ant-design/icons';
import {
Plane,
Navigation,
Wind,
Thermometer,
Droplets,
Satellite,
LayoutGrid,
Clock,
CheckCircle2,
AlertCircle,
Zap,
Waves,
Calendar,
User,
TrendingUp,
GripVertical,
Maximize2,
Target
} from 'lucide-react';
const { Text, Title } = Typography;
export default function WayLinePage() {
const [activeMainTab, setActiveTab] = useState('wayline');
// 响应式字体大小
const fontSmall = 'clamp(10px, 0.7vw, 11px)';
const fontNormal = 'clamp(12px, 0.75vw, 13px)';
const fontTitle = 'clamp(14px, 0.85vw, 16px)';
const fontLarge = 'clamp(18px, 1.1vw, 24px)';
const cardStyle = { borderRadius: 8, border: 'none', boxShadow: '0 2px 8px rgba(0,0,0,0.05)' };
const cardStyle = { borderRadius: 12, border: 'none', boxShadow: '0 2px 12px rgba(0,0,0,0.04)' };
// 模拟数据
// 顶部统计卡片数据
const topCards = [
{ title: '今日航线计划', value: '18', unit: '条', trend: '较昨日 +2', color: '#165DFF', icon: <NodeIndexOutlined /> },
{ title: '执行中任务', value: '6', unit: '个', desc: '进行中', color: '#165DFF', icon: <NodeIndexOutlined /> },
{ title: '待审批任务', value: '4', unit: '个', trend: '较昨日 -1', color: '#FF7D00', icon: <SafetyCertificateOutlined /> },
{ title: '任务完成率', value: '92', unit: '%', trend: '较昨日 +6%', color: '#00B42A', icon: <CheckCircleOutlined /> },
{ title: 'AI 优化收益', value: '+7.8', unit: '%', trend: '较昨日 +1.2%', color: '#722ED1', icon: <RiseOutlined /> },
{ title: '覆盖装备', value: '4类 / 9台', unit: '', desc: '全部在线', color: '#165DFF', icon: <RobotOutlined /> },
{
title: '今日航线计划',
value: '18',
unit: '条',
trend: '较昨日 +2',
trendColor: '#00B42A',
icon: <LayoutGrid size={22} />,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
{
title: '执行中任务',
value: '6',
unit: '个',
desc: '进行中',
icon: <Plane size={22} />,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
{
title: '待审批任务',
value: '4',
unit: '个',
trend: '较昨日 -1',
trendColor: '#F53F3F',
icon: <Calendar size={22} />,
color: '#FF7D00',
bg: 'linear-gradient(135deg, #FFF7E6 0%, #FFE4BA 100%)'
},
{
title: '任务完成率',
value: '92',
unit: '%',
trend: '较昨日 +6%',
trendColor: '#00B42A',
icon: <CheckCircle2 size={22} />,
color: '#00B42A',
bg: 'linear-gradient(135deg, #E8FFEA 0%, #AFF0B5 100%)'
},
{
title: 'AI 优化收益',
value: '+7.8',
unit: '%',
trend: '较昨日 +1.2%',
trendColor: '#00B42A',
icon: <TrendingUp size={22} />,
color: '#722ED1',
bg: 'linear-gradient(135deg, #F9F0FF 0%, #EFDBFF 100%)'
},
{
title: '覆盖装备',
value: '4 类 / 9 台',
unit: '',
desc: '全部在线',
icon: <Satellite size={22} />,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
];
return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '0px 24px' }}>
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}>
{/* 顶部统计卡片 */}
<Row gutter={12} style={{ marginBottom: 16 }}>
<Row gutter={[12, 12]} style={{ marginBottom: 16 }}>
{topCards.map((item, index) => (
<Col span={4} key={index}>
<Card bordered={false} bodyStyle={{ padding: 16 }} style={cardStyle}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{ width: 40, height: 40, background: `${item.color}15`, borderRadius: 8, display: 'flex', justifyContent: 'center', alignItems: 'center', color: item.color, fontSize: 20 }}>
<Col xs={12} sm={8} md={4} key={index}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={cardStyle}>
<div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
<div style={{
width: 44, height: 44,
background: item.bg,
borderRadius: 12,
display: 'flex', justifyContent: 'center', alignItems: 'center',
color: item.color
}}>
{item.icon}
</div>
<div>
<div style={{ fontSize: 12, color: '#86909C' }}>{item.title}</div>
<div style={{ flex: 1 }}>
<div style={{ fontSize: fontSmall, color: '#86909C', marginBottom: 2 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>
<span style={{ fontSize: 20, fontWeight: 700, color: '#1D2129' }}>{item.value}</span>
<span style={{ fontSize: 12, color: '#4E5969' }}>{item.unit}</span>
<span style={{ fontSize: fontLarge, fontWeight: 700, color: '#1D2129' }}>{item.value}</span>
<span style={{ fontSize: fontSmall, color: '#4E5969' }}>{item.unit}</span>
</div>
<div style={{ fontSize: 11, color: item.trend?.includes('+') ? '#00B42A' : '#F53F3F' }}>
<div style={{ fontSize: 10, color: item.trendColor || '#86909C', fontWeight: 500 }}>
{item.trend || item.desc}
</div>
</div>
@@ -58,58 +139,96 @@ export default function WayLinePage() {
</Row>
{/* 中间主要内容区 */}
<Row gutter={12} style={{ marginBottom: 16 }}>
<Row gutter={16} style={{ marginBottom: 16 }}>
{/* 左侧:航线编辑与路径规划 */}
<Col span={14}>
<Col xs={24} xl={14}>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>航线编辑与路径规划</span>}
title={<span style={{ fontSize: fontTitle, fontWeight: 700, color: '#1D2129' }}>航线编辑与路径规划</span>}
extra={
<Space>
<Button size="small" icon={<PlusOutlined />}>新增航线</Button>
<Button size="small" icon={<ImportOutlined />}>导入模板</Button>
<Button size="small" icon={<NodeIndexOutlined />}>路径优化</Button>
<Button size="small" icon={<SafetyCertificateOutlined />}>风险检查</Button>
<Button size="small" icon={<SaveOutlined />}>保存草稿</Button>
<Button size="small" icon={<FullscreenOutlined />} />
<Space size={8}>
<Button size="small" icon={<PlusOutlined />} style={{ borderRadius: 6 }}>新增航线</Button>
<Button size="small" icon={<ImportOutlined />} style={{ borderRadius: 6 }}>导入模板</Button>
<Button size="small" icon={<NodeIndexOutlined />} style={{ borderRadius: 6 }}>路径优化</Button>
<Button size="small" icon={<SafetyCertificateOutlined />} style={{ borderRadius: 6 }}>风险检查</Button>
<Button size="small" icon={<SaveOutlined />} style={{ borderRadius: 6 }}>保存草稿</Button>
<Button size="small" icon={<Maximize2 size={14} />} style={{ borderRadius: 6 }} />
</Space>
}
bordered={false}
bodyStyle={{ padding: 0, position: 'relative' }}
style={{ ...cardStyle, marginBottom: "16px" }}
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden' }}
style={{ ...cardStyle, marginBottom: 16 }}
>
{/* 模拟地图区域 */}
<div style={{ width: '100%', height: 500, background: '#e8f3ff url(https://picsum.photos/seed/solarfarm_map/1200/800) center/cover', position: 'relative' }}>
{/* 左侧图例 */}
<div style={{ position: 'absolute', top: 16, left: 16, background: 'rgba(255,255,255,0.9)', padding: 12, borderRadius: 4, width: 140 }}>
<div style={{ fontSize: 12, display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 12, height: 2, background: '#165DFF' }}></span> 无人机航线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 12, height: 2, background: '#FF7D00' }}></span> 巡检机器人路线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 12, height: 2, background: '#00B42A' }}></span> 除草路线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 12, height: 2, background: '#13C2C2' }}></span> 清洗航线</div>
<Divider style={{ margin: '4px 0' }} />
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><div style={{ width: 16, height: 16, background: '#165DFF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff', fontSize: 10 }}>H</div> 无人机机场</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>< ThunderboltOutlined style={{ color: '#00B42A' }} /> 充电点</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><CloudSyncOutlined style={{ color: '#165DFF' }} /> 补水点</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><WarningOutlined style={{ color: '#F53F3F' }} /> 禁飞区</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><div style={{ width: 12, height: 12, border: '1px dashed #F53F3F' }} /> 高优先级巡检区</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><div style={{ width: 12, height: 12, background: 'rgba(255,125,0,0.3)' }} /> 障碍物区域</div>
{/* 地图区域 */}
<div style={{ width: '100%', height: 500, background: '#e8f3ff url(https://picsum.photos/seed/solar_map_v2/1600/1000) center/cover', position: 'relative' }}>
{/* SVG 航线与区域覆盖 */}
<svg style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', pointerEvents: 'none' }}>
{/* 航线 1 (蓝色) */}
<path d="M100,120 L200,80 L350,150 L500,100 L650,180" fill="none" stroke="#165DFF" strokeWidth="3" strokeDasharray="8,4" />
{/* 航线 2 (橙色) */}
<path d="M220,300 Q350,220 480,350 T700,280" fill="none" stroke="#FF7D00" strokeWidth="3" />
{/* 航线 3 (绿色) */}
<path d="M400,80 L550,140 L700,100" fill="none" stroke="#00B42A" strokeWidth="3" strokeDasharray="4,2" />
{/* 航点标记 */}
<circle cx="100" cy="120" r="6" fill="#165DFF" stroke="#fff" strokeWidth="2" />
<circle cx="200" cy="80" r="6" fill="#165DFF" stroke="#fff" strokeWidth="2" />
<circle cx="350" cy="150" r="6" fill="#165DFF" stroke="#fff" strokeWidth="2" />
{/* 区域覆盖 */}
<rect x="550" y="50" width="120" height="80" fill="rgba(245,63,63,0.2)" stroke="#F53F3F" strokeWidth="1" strokeDasharray="4,2" />
<rect x="300" y="280" width="150" height="100" fill="rgba(22,93,255,0.1)" stroke="#165DFF" strokeWidth="1" strokeDasharray="4,4" />
<path d="M100,350 L250,350 L250,450 L100,450 Z" fill="rgba(255,125,0,0.15)" stroke="#FF7D00" strokeWidth="1" />
</svg>
{/* 左侧图例 - 拟真样式 */}
<div style={{ position: 'absolute', top: 16, left: 16, background: 'rgba(255,255,255,0.92)', backdropFilter: 'blur(8px)', padding: '14px 16px', borderRadius: 10, width: 150, boxShadow: '0 4px 12px rgba(0,0,0,0.1)' }}>
<div style={{ fontSize: fontSmall, display: 'flex', flexDirection: 'column', gap: 10 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 14, height: 2, background: '#165DFF', borderRadius: 1 }}></span> 无人机航线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 14, height: 2, background: '#FF7D00', borderRadius: 1 }}></span> 巡检机器人路线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 14, height: 2, background: '#00B42A', borderRadius: 1 }}></span> 除草路线</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 14, height: 2, background: '#13C2C2', borderRadius: 1 }}></span> 清洗航线</div>
<Divider style={{ margin: '6px 0' }} />
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<div style={{ width: 18, height: 18, background: '#165DFF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff', fontSize: 10, fontWeight: 700 }}>H</div>
<span>无人机机场</span>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}><Zap size={14} color="#00B42A" fill="#00B42A" /> <span>充电点</span></div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}><Waves size={14} color="#165DFF" /> <span>补水点</span></div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}><AlertCircle size={14} color="#F53F3F" /> <span>禁飞区</span></div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}><div style={{ width: 14, height: 14, border: '1px dashed #F53F3F', background: 'rgba(245,63,63,0.1)' }} /> <span>高优先巡检区</span></div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}><div style={{ width: 14, height: 14, background: 'rgba(255,125,0,0.2)', border: '1px solid #FF7D00' }} /> <span>障碍物区域</span></div>
</div>
</div>
{/* 地图上的模拟标注 */}
<div style={{ position: 'absolute', top: '20%', left: '20%', color: '#fff', textAlign: 'center' }}>
<div style={{ background: '#165DFF', borderRadius: '50%', width: 24, height: 24, display: 'inline-flex', justifyContent: 'center', alignItems: 'center' }}>H</div>
<div style={{ fontSize: 10, background: 'rgba(0,0,0,0.5)', padding: '0 4px' }}>无人机机场 A01</div>
{/* 地图交互层 */}
<div style={{ position: 'absolute', top: '22%', left: '16%', color: '#fff', textAlign: 'center' }}>
<div style={{ background: '#165DFF', borderRadius: '50%', width: 28, height: 28, display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: 12, fontWeight: 700, boxShadow: '0 0 10px rgba(22,93,255,0.6)', border: '2px solid #fff' }}>H</div>
<div style={{ fontSize: 10, background: 'rgba(29,33,41,0.8)', padding: '2px 8px', borderRadius: 4, marginTop: 4 }}>无人机机场 A01</div>
</div>
<div style={{ position: 'absolute', top: '40%', left: '50%', border: '2px dashed #F53F3F', width: 120, height: 80, display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff' }}>
<div style={{ fontSize: 10, background: 'rgba(0,0,0,0.5)', padding: '0 4px' }}>高优先级巡检区 B-12</div>
<div style={{ position: 'absolute', top: '42%', left: '46%', textAlign: 'center' }}>
<div style={{ border: '2px dashed #F53F3F', background: 'rgba(245,63,63,0.2)', width: 140, height: 90, borderRadius: 8, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<span style={{ fontSize: 11, fontWeight: 700, color: '#fff', textShadow: '0 1px 2px rgba(0,0,0,0.8)' }}>高优先级巡检区 B-12</span>
</div>
</div>
{/* 右下角地图缩放控制 */}
<div style={{ position: 'absolute', bottom: 20, right: 20, display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ background: '#fff', borderRadius: 8, padding: 8, display: 'flex', flexDirection: 'column', gap: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.1)' }}>
<AimOutlined style={{ fontSize: 18, color: '#4E5969', cursor: 'pointer' }} />
<Divider style={{ margin: 0 }} />
<PlusOutlined style={{ fontSize: 18, color: '#4E5969', cursor: 'pointer' }} />
<Divider style={{ margin: 0 }} />
<div style={{ width: 18, height: 2, background: '#C9CDD4' }}></div>
</div>
</div>
</div>
</Card>
{/* 航点列表 */}
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>航点列表 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>航线:FL-03 (无人机热斑巡检)</Text></span>}
extra={<PlusOutlined style={{ cursor: 'pointer' }} />}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>航点列表 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400, marginLeft: 12 }}>航线:FL-03 (无人机热斑巡检)</Text></span>}
extra={<PlusOutlined style={{ cursor: 'pointer', color: '#165DFF' }} />}
bordered={false}
bodyStyle={{ padding: 0 }}
style={cardStyle}
@@ -117,7 +236,7 @@ export default function WayLinePage() {
<Table
size="small"
pagination={false}
scroll={{ y: 240 }}
scroll={{ y: 220 }}
dataSource={[
{ key: '1', point: 'WP-01', coord: '30.32921, 120.12345', action: '起飞', height: 35, speed: 6.0, stay: 0, remark: '从机场起飞' },
{ key: '2', point: 'WP-02', coord: '区块 B-01', action: '拍摄', height: 35, speed: 6.0, stay: 2, remark: '组件可见光' },
@@ -125,16 +244,14 @@ export default function WayLinePage() {
{ key: '4', point: 'WP-04', coord: '区块 B-09', action: '悬停', height: 35, speed: 0.0, stay: 10, remark: '重点检查' },
{ key: '5', point: 'WP-05', coord: '区块 B-12', action: '热成像', height: 35, speed: 6.0, stay: 3, remark: '高优先区' },
{ key: '6', point: 'WP-06', coord: '区块 B-16', action: '拍摄', height: 35, speed: 6.0, stay: 2, remark: '组件可见光' },
{ key: '7', point: 'WP-07', coord: '区块 B-20', action: '悬停', height: 35, speed: 0.0, stay: 10, remark: '末端确认' },
{ key: '8', point: 'WP-08', coord: '30.32910, 120.12380', action: '返航', height: 35, speed: 6.0, stay: 0, remark: '返回机场' },
]}
columns={[
{ title: '航点', dataIndex: 'point', width: 60 },
{ title: '坐标/区域', dataIndex: 'coord', width: 100, ellipsis: true },
{ title: '动作', dataIndex: 'action', width: 60 },
{ title: '高度(m)', dataIndex: 'height', width: 60 },
{ title: '速度(m/s)', dataIndex: 'speed', width: 80 },
{ title: '停留(s)', dataIndex: 'stay', width: 60 },
{ title: '航点', dataIndex: 'point', width: 80, render: (t) => <Text strong>{t}</Text> },
{ title: '坐标/区域', dataIndex: 'coord', width: 120, ellipsis: true },
{ title: '动作', dataIndex: 'action', width: 80, render: (a) => <Tag color={a === '起飞' ? 'blue' : a === '悬停' ? 'orange' : 'cyan'} bordered={false} style={{ margin: 0 }}>{a}</Tag> },
{ title: '高度(m)', dataIndex: 'height', width: 70 },
{ title: '速度(m/s)', dataIndex: 'speed', width: 90 },
{ title: '停留(s)', dataIndex: 'stay', width: 70 },
{ title: '备注', dataIndex: 'remark', ellipsis: true },
]}
/>
@@ -142,12 +259,12 @@ export default function WayLinePage() {
</Col>
{/* 右侧:任务编排、参数与天气 */}
<Col span={10}>
<Col xs={24} xl={10}>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>任务编排与 AI 建议</span>}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>任务编排与 AI 建议</span>}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, marginBottom: 12 }}
bodyStyle={{ padding: '12px 16px' }}
style={{ ...cardStyle, marginBottom: 16 }}
>
<Table
size="small"
@@ -160,38 +277,39 @@ export default function WayLinePage() {
{ key: '5', id: 'FL-07', device: 'UAV-A01', type: 'AI 复检航线', level: '低', time: '16:30 - 17:10', duration: '0h40m', status: '待审批' },
]}
columns={[
{ title: '任务编号', dataIndex: 'id', width: 80, render: (t) => <Text style={{ color: '#165DFF' }}>{t}</Text> },
{ title: '装备', dataIndex: 'device' },
{ title: '编号', dataIndex: 'id', width: 70, render: (t) => <Text style={{ color: '#165DFF', fontWeight: 600 }}>{t}</Text> },
{ title: '装备', dataIndex: 'device', width: 80 },
{ title: '类型', dataIndex: 'type', ellipsis: true },
{ title: '优先级', dataIndex: 'level', render: (l) => <span style={{ color: l === '高' ? '#F53F3F' : l === '中' ? '#FF7D00' : '#86909C' }}>▲ {l}</span> },
{ title: '建议时间', dataIndex: 'time' },
{ title: '预计时长', dataIndex: 'duration' },
{ title: '状态', dataIndex: 'status', render: (s) => <Text style={{ color: s.includes('建议') ? '#165DFF' : '#86909C' }}>{s}</Text> },
{ title: '优先级', dataIndex: 'level', width: 80, render: (l) => <span style={{ color: l === '高' ? '#F53F3F' : l === '中' ? '#FF7D00' : '#86909C', fontSize: 11, fontWeight: 600 }}>▲ {l}</span> },
{ title: '建议时间', dataIndex: 'time', width: 110 },
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => <Text style={{ color: s.includes('建议') ? '#165DFF' : '#86909C', fontSize: 11, fontWeight: 500 }}>{s}</Text> },
]}
/>
<div style={{ background: '#F2F3F5', padding: '8px 12px', borderRadius: 4, marginTop: 12, display: 'flex', gap: 12, fontSize: 12 }}>
<span style={{ fontWeight: 700 }}>AI 建议:</span>
<Space split={<Divider type="vertical" />}>
<span><CheckCircleOutlined style={{ color: '#165DFF' }} /> 推荐优先执行 FL-03 航线</span>
<span><ClockCircleOutlined style={{ color: '#165DFF' }} /> 14:00-16:00 风速最佳</span>
<span><WarningOutlined style={{ color: '#FF7D00' }} /> 区块 B-12 存在高温风险</span>
</Space>
<div style={{ background: '#F8F9FB', padding: '10px 14px', borderRadius: 8, marginTop: 14, border: '1px solid #F1F2F5' }}>
<div style={{ display: 'flex', gap: 12, fontSize: fontSmall, alignItems: 'center' }}>
<span style={{ fontWeight: 700, color: '#1D2129' }}>AI 建议:</span>
<Space split={<Divider type="vertical" style={{ margin: 0 }} />}>
<Space size={4}><CheckCircle2 size={13} color="#165DFF" /> <span>推荐优先执行 FL-03 航线</span></Space>
<Space size={4}><Clock size={13} color="#165DFF" /> <span>14:00-16:00 风速最佳</span></Space>
<Space size={4}><AlertCircle size={13} color="#FF7D00" /> <span>区块 B-12 存在高温风险</span></Space>
</Space>
</div>
</div>
<Row gutter={12} style={{ marginTop: 12 }}>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF' }}>一键排程</Button></Col>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF' }}>智能分配</Button></Col>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF' }}>生成工单</Button></Col>
<Row gutter={12} style={{ marginTop: 16 }}>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF', height: 36, borderRadius: 18, fontWeight: 600 }}>一键排程</Button></Col>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF', height: 36, borderRadius: 18, fontWeight: 600 }}>智能分配</Button></Col>
<Col span={8}><Button type="primary" block style={{ background: '#165DFF', height: 36, borderRadius: 18, fontWeight: 600 }}>生成工单</Button></Col>
</Row>
</Card>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>航线参数 / 作业参数</span>}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>航线参数 / 作业参数</span>}
extra={<Text type="secondary" style={{ fontSize: 12 }}>当前航线:FL-03</Text>}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, marginBottom: 12 }}
bodyStyle={{ padding: '16px' }}
style={{ ...cardStyle, marginBottom: 16 }}
>
<Row gutter={[24, 12]}>
<Row gutter={[24, 16]}>
{[
{ label: '飞行高度', value: '35', unit: 'm' },
{ label: '速度', value: '6', unit: 'm/s' },
@@ -203,150 +321,186 @@ export default function WayLinePage() {
{ label: '巡检采样频率', value: '2', unit: 'Hz' },
].map((item, idx) => (
<Col span={6} key={idx}>
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 4 }}>{item.label}</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<Input size="small" defaultValue={item.value} style={{ width: 40, height: 22, padding: '0 4px', fontSize: 12 }} />
<span style={{ fontSize: 11 }}>{item.unit}</span>
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 6 }}>{item.label}</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
<Input size="small" defaultValue={item.value} style={{ width: '100%', height: 26, borderRadius: 4, textAlign: 'center', fontWeight: 600 }} />
<span style={{ fontSize: 11, color: '#4E5969' }}>{item.unit}</span>
</div>
</Col>
))}
</Row>
<Divider style={{ margin: '12px 0' }} />
<Space size="large">
<Space>
<span style={{ fontSize: 12 }}>避障开关</span>
<Divider style={{ margin: '16px 0' }} />
<div style={{ display: 'flex', gap: 32 }}>
<Space size={8}>
<span style={{ fontSize: fontNormal, color: '#4E5969' }}>避障开关</span>
<Switch size="small" defaultChecked />
</Space>
<Space>
<span style={{ fontSize: 12 }}>夜航限制</span>
<Space size={8}>
<span style={{ fontSize: fontNormal, color: '#4E5969' }}>夜航限制</span>
<Switch size="small" />
</Space>
</Space>
</div>
</Card>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>天气窗口与执行约束</span>}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>天气窗口与执行约束</span>}
bordered={false}
bodyStyle={{ padding: 12 }}
bodyStyle={{ padding: '16px' }}
style={cardStyle}
>
<Row gutter={12} align="middle">
<Col span={5}>
<div style={{ textAlign: 'center', background: '#F6FFED', padding: '8px 4px', borderRadius: 4, border: '1px solid #B7EB8F' }}>
<div style={{ fontSize: 11, color: '#52C41A', fontWeight: 700 }}>适宜执行</div>
<div style={{ width: 16, height: 16, background: '#52C41A', borderRadius: '50%', margin: '4px auto', display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff', fontSize: 10 }}><CheckCircleOutlined /></div>
<div style={{ fontSize: 10, color: '#86909C' }}>适宜执行</div>
<Row gutter={16} align="middle">
<Col span={6}>
<div style={{ textAlign: 'center', background: '#F6FFED', padding: '12px 8px', borderRadius: 10, border: '1px solid #B7EB8F' }}>
<div style={{ fontSize: 11, color: '#52C41A', fontWeight: 700, marginBottom: 8 }}>适宜执行</div>
<CheckCircle2 size={24} color="#52C41A" style={{ margin: '0 auto 8px' }} />
<div style={{ fontSize: 10, color: '#86909C' }}>适宜航行</div>
</div>
</Col>
{[
{ label: '风速', value: '2.8 m/s', desc: '适宜', icon: <CloudSyncOutlined />, color: '#165DFF' },
{ label: '温度', value: '28℃', desc: '适宜', icon: < ThunderboltOutlined />, color: '#FF7D00' },
{ label: '降水概率', value: '10%', desc: '极低', icon: <CloudOutlined />, color: '#165DFF' },
{ label: 'GNSS质量', value: '良好', desc: '适宜', icon: <EnvironmentOutlined />, color: '#00B42A' },
].map((item, idx) => (
<Col span={4.5} key={idx} style={{ flex: 1 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<div style={{ color: item.color, fontSize: 16 }}>{item.icon}</div>
<div>
<div style={{ fontSize: 10, color: '#86909C' }}>{item.label}</div>
<div style={{ fontSize: 12, fontWeight: 700 }}>{item.value}</div>
<div style={{ fontSize: 10, color: '#86909C' }}>{item.desc}</div>
</div>
</div>
</Col>
))}
<Col span={18}>
<Row gutter={[16, 16]}>
{[
{ label: '风速', value: '2.8 m/s', desc: '适宜', icon: <Wind size={16} />, color: '#165DFF' },
{ label: '温度', value: '28℃', desc: '适宜', icon: <Thermometer size={16} />, color: '#FF7D00' },
{ label: '降水概率', value: '10%', desc: '极低', icon: <Droplets size={16} />, color: '#165DFF' },
{ label: 'GNSS 质量', value: '良好', desc: '适宜', icon: <Satellite size={16} />, color: '#00B42A' },
].map((item, idx) => (
<Col span={12} key={idx}>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<div style={{ width: 32, height: 32, borderRadius: 8, background: '#F7F8FA', display: 'flex', justifyContent: 'center', alignItems: 'center', color: item.color }}>
{item.icon}
</div>
<div>
<div style={{ fontSize: 10, color: '#86909C' }}>{item.label}</div>
<div style={{ fontSize: fontNormal, fontWeight: 700, color: '#1D2129' }}>{item.value}</div>
<div style={{ fontSize: 10, color: '#52C41A', fontWeight: 500 }}>{item.desc}</div>
</div>
</div>
</Col>
))}
</Row>
</Col>
</Row>
<div style={{ marginTop: 12, display: 'flex', justifyContent: 'space-between', fontSize: 11, color: '#86909C' }}>
<span><InfoCircleOutlined style={{ color: '#FF7D00' }} /> 16:30 后风速升高,建议提前完成任务</span>
<span><ClockCircleOutlined style={{ color: '#165DFF' }} /> 预计 14:00-16:00 为最佳执行窗口</span>
<div style={{ marginTop: 16, display: 'flex', flexDirection: 'column', gap: 6, fontSize: 11, color: '#86909C', borderTop: '1px solid #F1F2F5', paddingTop: 12 }}>
<Space size={6}><AlertCircle size={14} color="#FF7D00" /> <span>16:30 后风速升高,建议提前完成任务</span></Space>
<Space size={6}><Clock size={14} color="#165DFF" /> <span>预计 14:00-16:00 为最佳执行窗口</span></Space>
</div>
</Card>
</Col>
</Row>
{/* 底部内容区 */}
<Row gutter={12}>
<Row gutter={16}>
{/* 甘特图/排班视图 */}
<Col span={14}>
<Col xs={24} xl={14}>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>任务甘特视图 / 排班视图 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>今日 (2025-05-24)</Text></span>}
extra={<SettingOutlined style={{ cursor: 'pointer' }} />}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>任务甘特视图 / 排班视图 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400, marginLeft: 12 }}>今日 (2025-05-24)</Text></span>}
extra={<MoreOutlined style={{ cursor: 'pointer', fontSize: 18 }} />}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, height: '100%' }} // 👈 高度 100%
bodyStyle={{ padding: 16 }}
style={{ ...cardStyle, height: '100%' }}
>
<div style={{ height: 260, position: 'relative', border: '1px solid #F2F3F5', borderRadius: 4, padding: 8 }}>
{/* 模拟时间轴头部 */}
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 10, color: '#86909C', borderBottom: '1px solid #F2F3F5', paddingBottom: 4 }}>
<div style={{ width: 100 }}></div>
<div style={{ position: 'relative', border: '1px solid #F2F3F5', borderRadius: 8, padding: '16px 12px' }}>
{/* 时间轴头部 */}
<div style={{ display: 'flex', fontSize: 10, color: '#86909C', borderBottom: '1px solid #F2F3F5', paddingBottom: 10, textAlign: 'center' }}>
<div style={{ width: 140 }}></div>
<div style={{ flex: 1, display: 'flex', justifyContent: 'space-around' }}>
<span>08:00</span><span>10:00</span><span>12:00</span><span>14:00</span><span>16:00</span><span>18:00</span>
</div>
</div>
{/* 模拟甘特条 */}
<div style={{ display: 'flex', flexDirection: 'column', gap: 12, marginTop: 12 }}>
{/* 甘特条 */}
<div style={{ display: 'flex', flexDirection: 'column', gap: 16, marginTop: 16 }}>
{[
{ label: '无人机机场 A01 (UAV-A01)', tasks: [{ start: '25%', width: '15%', title: 'FL-03 巡检', color: '#165DFF' }, { start: '70%', width: '10%', title: 'FL-07 复检', color: '#165DFF' }] },
{ label: '巡检机器人 RBT-01', tasks: [{ start: '40%', width: '15%', title: 'RB-02 巡检', color: '#FF7D00' }] },
{ label: '除草机器人 GR-01', tasks: [{ start: '10%', width: '25%', title: 'GR-04 阵列除草', color: '#00B42A' }] },
{ label: '清洗无人机 UAV-C01', tasks: [{ start: '60%', width: '20%', title: 'CL-05 组件清洗', color: '#13C2C2' }] },
{ label: '无人机机场 A01', sub: '(UAV-A01)', tasks: [{ start: '25%', width: '18%', title: 'FL-03 热斑巡检', time: '10:00-11:20', color: '#165DFF' }, { start: '75%', width: '12%', title: 'FL-07 复检', time: '16:30-17:10', color: '#165DFF' }] },
{ label: '巡检机器人 RBT-01', sub: '', tasks: [{ start: '45%', width: '15%', title: 'RB-02 围栏巡检', time: '11:30-12:30', color: '#FF7D00' }] },
{ label: '除草机器人 GR-01', sub: '', tasks: [{ start: '10%', width: '22%', title: 'GR-04 阵列除草', time: '09:30-11:30', color: '#00B42A' }] },
{ label: '清洗无人机 UAV-C01', sub: '', tasks: [{ start: '65%', width: '20%', title: 'CL-05 组件清洗', time: '14:00-16:00', color: '#13C2C2' }] },
].map((row, idx) => (
<div key={idx} style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 100, fontSize: 10, color: '#4E5969' }}>{row.label}</div>
<div style={{ flex: 1, height: 32, background: '#F7F8FA', borderRadius: 4, position: 'relative' }}>
<div style={{ width: 140, paddingRight: 12 }}>
<div style={{ fontSize: 11, fontWeight: 600, color: '#1D2129' }}>{row.label}</div>
<div style={{ fontSize: 10, color: '#86909C' }}>{row.sub}</div>
</div>
<div style={{ flex: 1, height: 40, background: '#F7F8FA', borderRadius: 6, position: 'relative' }}>
{row.tasks.map((task, tidx) => (
<div key={tidx} style={{ position: 'absolute', left: task.start, width: task.width, height: '100%', background: task.color, opacity: 0.8, borderRadius: 4, color: '#fff', fontSize: 9, padding: '2px 4px', display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
<div>{task.title}</div>
<div>10:00-11:20</div>
<div key={tidx} style={{
position: 'absolute', left: task.start, width: task.width, height: '100%',
background: task.color, borderRadius: 6, color: '#fff',
padding: '4px 8px', display: 'flex', flexDirection: 'column', justifyContent: 'center',
boxShadow: '0 2px 6px rgba(0,0,0,0.1)', zIndex: 2
}}>
<div style={{ fontSize: 10, fontWeight: 700, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{task.title}</div>
<div style={{ fontSize: 9, opacity: 0.9 }}>{task.time}</div>
</div>
))}
</div>
</div>
))}
</div>
{/* 垂直当前时间红线 */}
<div style={{ position: 'absolute', left: '35%', top: 0, bottom: 0, width: 1, background: '#F53F3F', zIndex: 1 }} />
{/* 当前时间红线 */}
<div style={{ position: 'absolute', left: '38%', top: 0, bottom: 0, width: 2, background: '#F53F3F', zIndex: 1, opacity: 0.6 }}>
<div style={{ width: 6, height: 6, borderRadius: '50%', background: '#F53F3F', position: 'absolute', top: -3, left: -2 }} />
</div>
</div>
</Card>
</Col>
{/* 任务看板 */}
<Col span={10}>
<Col xs={24} xl={10}>
<Card
title={<span style={{ fontSize: 14, fontWeight: 700 }}>工作任务看板</span>}
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>工作任务看板</span>}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, height: '100%', display: 'flex', flexDirection: 'column' }} // 👈 高度 100%
bodyStyle={{ padding: 16 }}
style={{ ...cardStyle, height: '100%' }}
>
<div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}> {/* 👈 自动撑满 */}
<Row gutter={8}>
{[
{ title: '待执行 (3)', bg: '#F7F8FA', list: [{ id: 'FL-07', name: 'AI 复检航线', device: 'UAV-A01', handler: '王工' }, { id: 'CL-05', name: '组件清洗', device: 'UAV-C01', handler: '李工' }] },
{ title: '执行中 (2)', bg: '#E8F3FF', list: [{ id: 'FL-03', name: '无人机热斑巡检', device: 'UAV-A01', handler: '王工', gain: '+8.2%' }, { id: 'GR-04', name: '阵列除草', device: 'GR-01', handler: '赵工' }] },
{ title: '已完成 (4)', bg: '#E8FFEA', list: [{ id: 'FL-01', name: '组件巡检', device: 'UAV-A01', handler: '王工', gain: '+7.1%', time: '08:20' }, { id: 'CL-01', name: '组件清洗', device: 'UAV-C01', handler: '李工', gain: '+5.9%', time: '07:45' }] },
].map((col, idx) => (
<Col span={8} key={idx}>
<div style={{ background: col.bg, borderRadius: 4, padding: 8, height: '100%', minHeight: 260 }}>
<div style={{ fontSize: 12, fontWeight: 700, marginBottom: 8 }}>{col.title}</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
{col.list.map((task, tidx) => (
<div key={tidx} style={{ background: '#fff', borderRadius: 4, padding: 8, boxShadow: '0 1px 2px rgba(0,0,0,0.05)' }}>
<div style={{ fontSize: 11, fontWeight: 700, color: '#165DFF' }}>{task.id} {task.name}</div>
<div style={{ fontSize: 10, color: '#86909C', marginTop: 4 }}>装备: {task.device} | 负责人: {task.handler}</div>
{task.gain && <div style={{ fontSize: 10, color: '#00B42A', marginTop: 4 }}>预计收益: {task.gain}</div>}
{task.time && <div style={{ fontSize: 10, color: '#86909C', marginTop: 2 }}>完成时间: {task.time}</div>}
</div>
))}
</div>
<Row gutter={10}>
{[
{
title: '待执行', count: 3, color: '#4E5969', bg: '#F7F8FA',
list: [
{ id: 'FL-07', name: 'AI 复检航线', device: 'UAV-A01', target: '区块 B-01-B-20' },
{ id: 'CL-05', name: '组件清洗', device: 'UAV-C01', target: '区块 C-01-C-18' },
{ id: 'RB-03', name: '围栏巡检', device: 'RBT-01', target: '围栏全线' }
]
},
{
title: '执行中', count: 2, color: '#165DFF', bg: '#E8F3FF',
list: [
{ id: 'FL-03', name: '无人机巡检', device: 'UAV-A01', target: '区块 B-01-B-20', gain: '8.2%' },
{ id: 'GR-04', name: '阵列除草', device: 'GR-01', target: '区块 D-01-D-16', gain: '6.5%' }
]
},
{
title: '已完成', count: 4, color: '#00B42A', bg: '#E8FFEA',
list: [
{ id: 'FL-01', name: '组件巡检', device: 'UAV-A01', time: '08:20', gain: '7.1%' },
{ id: 'CL-01', name: '组件清洗', device: 'UAV-C01', time: '07:45', gain: '5.9%' }
]
},
].map((col, idx) => (
<Col span={8} key={idx}>
<div style={{ background: col.bg, borderRadius: 10, padding: 10, height: '100%', minHeight: 280 }}>
<div style={{ fontSize: 12, fontWeight: 700, marginBottom: 12, display: 'flex', justifyContent: 'space-between', color: col.color }}>
<span>{col.title} ({col.count})</span>
</div>
</Col>
))}
</Row>
</div>
<div style={{ textAlign: 'right', marginTop: 8 }}>
<Button type="link" size="small">查看全部 <ArrowRightOutlined /></Button>
<div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
{col.list.map((task, tidx) => (
<div key={tidx} style={{ background: '#fff', borderRadius: 8, padding: 10, boxShadow: '0 2px 4px rgba(0,0,0,0.04)', border: '1px solid #F1F2F5' }}>
<div style={{ fontSize: 11, fontWeight: 700, color: '#165DFF', marginBottom: 6 }}>{task.id} {task.name}</div>
<div style={{ fontSize: 10, color: '#86909C' }}>
<div style={{ marginBottom: 2 }}>装备: {task.device || 'UAV-A01'}</div>
{task.target && <div style={{ marginBottom: 2 }}>目标: {task.target}</div>}
{task.gain && <div style={{ color: '#00B42A', fontWeight: 600 }}>预计收益: ↑ {task.gain}</div>}
{task.time && <div style={{ marginTop: 2 }}>完成时间: {task.time}</div>}
</div>
</div>
))}
</div>
</div>
</Col>
))}
</Row>
<div style={{ textAlign: 'center', marginTop: 12 }}>
<Button type="link" size="small" style={{ fontSize: 12, color: '#86909C' }}>查看全部 <ArrowRightOutlined style={{ fontSize: 10 }} /></Button>
</div>
</Card>
</Col>

View File

@@ -144,19 +144,30 @@ export default function AIDiagnosisPage() {
overflow: 'hidden'
};
// 状态标签渲染
const renderStatusTag = (status: string) => {
const colorMap: Record<string, string> = {
'异常': '#F53F3F',
'正常': '#00B42A',
'轻微': '#F7BA1E',
};
return <span style={{ color: colorMap[status], fontWeight: 600 }}>{status}</span>;
let color = '';
if (status === '异常') color = '#ff4d4f';
else if (status === '轻微') color = '#1677ff';
else if (status === '正常') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{status}</Tag>;
};
// 影响程度标签渲染
const renderImpactTag = (impact: string) => {
const colorMap: Record<string, string> = { '高': '#F53F3F', '中': '#FF7D00', '低': '#00B42A' };
return <span style={{ color: colorMap[impact], fontWeight: 600 }}>{impact}</span>;
let color = '';
if (impact === '高') color = '#ff4d4f';
else if (impact === '中') color = '#fa8c16';
else if (impact === '低') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{impact}</Tag>;
};
// 优先级标签渲染(建议措施用)
const renderPriorityTag = (priority: string) => {
let color = '';
if (priority === '高') color = '#ff4d4f';
else if (priority === '中') color = '#fa8c16';
else if (priority === '低') color = '#52c41a';
return <Tag color={color} style={{ margin: 0, fontWeight: 600 }}>{priority}</Tag>;
};
return (
@@ -488,49 +499,122 @@ export default function AIDiagnosisPage() {
bodyStyle={{ padding: 0 }}
style={{ ...cardStyle, height: '100%' }}
>
{/* AI诊断总结 */}
<div style={{ padding: '16px 20px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>AI 智能诊断总结</span>
<Tag color="blue" style={{ margin: 0 }}>实时更新</Tag>
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>AI 诊断总结</span>
<span style={{ fontSize: 13, color: '#86909C' }}>更新时间: 2025-05-20 09:45</span>
</div>
<Table
columns={[
{ title: '诊断项', dataIndex: 'diagnosis', key: 'diagnosis', width: 85 },
{ title: '状态', dataIndex: 'status', key: 'status', render: renderStatusTag, width: 60 },
{ title: '置信度', dataIndex: 'confidence', key: 'confidence', width: 70 },
{ title: '影响', dataIndex: 'impact', key: 'impact', render: renderImpactTag, width: 60 },
{
title: '诊断项',
dataIndex: 'diagnosis',
key: 'diagnosis',
width: 90
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: renderStatusTag,
width: 60
},
{
title: '置信度',
dataIndex: 'confidence',
key: 'confidence',
width: 70
},
{
title: '影响程度',
dataIndex: 'impact',
key: 'impact',
render: renderImpactTag,
width: 70
},
{
title: '详情',
dataIndex: 'detail',
key: 'detail',
ellipsis: true
},
]}
dataSource={[
{ key: '1', diagnosis: '热斑检测', status: '异常', confidence: '92%', impact: '高', detail: '检测到 36 处热斑疑似点' },
{ key: '2', diagnosis: '组串失配', status: '异常', confidence: '90%', impact: '高', detail: '8 串组串存在异常' },
{ key: '3', diagnosis: '遮挡风险', status: '轻微', confidence: '78%', impact: '中', detail: '局部遮挡影响 2% 发电量' },
{ key: '4', diagnosis: '组件衰减', status: '异常', confidence: '86%', impact: '中', detail: '平均衰减率 -5.32%' },
{ key: '5', diagnosis: '逆变器效率异常', status: '正常', confidence: '93%', impact: '低', detail: '所有逆变器运行正常' },
]}
dataSource={aiSummaryData.slice(0, 4)}
pagination={false}
size="small"
className="compact-table"
rowKey="key"
/>
</div>
<Divider style={{ margin: 0 }} />
{/* AI建议与处置 */}
<div style={{ padding: '16px 20px' }}>
<div style={{ fontSize: 15, fontWeight: 700, color: '#1D2129', marginBottom: 16, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
AI 建议与智能处置
<Button type="link" size="small" style={{ fontSize: 12, padding: 0 }}>批量处理</Button>
<div style={{ fontSize: 15, fontWeight: 700, color: '#1D2129', marginBottom: 16 }}>
AI 建议与处置
</div>
<Table
columns={[
{ title: '建议措施', dataIndex: 'measure', key: 'measure', ellipsis: true },
{ title: '收益', dataIndex: 'expectedGain', key: 'expectedGain', render: (g) => <span style={{ color: '#00B42A', fontWeight: 600 }}>{g}</span>, width: 70 },
{
title: '建议措施',
dataIndex: 'measure',
key: 'measure',
ellipsis: true
},
{
title: '优先级',
dataIndex: 'priority',
key: 'priority',
render: renderPriorityTag,
width: 70
},
{
title: '预计收益',
dataIndex: 'gain',
key: 'gain',
render: (g) => <span style={{ color: '#00B42A', fontWeight: 600 }}>{g}</span>,
width: 80
},
{
title: '置信度',
dataIndex: 'confidence',
key: 'confidence',
width: 70
},
{
title: '操作',
key: 'action',
width: 80,
render: (text, record) => (
<Button type="primary" size="small" style={{ fontSize: 11, borderRadius: 6, height: 24 }}>
{record.key === '5' ? '详情' : '派单'}
width: 90,
render: (_, record) => (
<Button
type="primary"
size="small"
style={{ fontSize: 12, borderRadius: 6, height: 28 }}
>
{record.isView ? '查看详情' : '创建工单'}
</Button>
)
},
]}
dataSource={aiRecommendations.slice(0, 4)}
dataSource={[
{ key: '1', measure: '处理热斑组件', priority: '高', gain: '+2.15%', confidence: '92%', isView: false },
{ key: '2', measure: '排查异常组串', priority: '高', gain: '+1.85%', confidence: '90%', isView: false },
{ key: '3', measure: '清洗受遮挡区域', priority: '中', gain: '+0.45%', confidence: '78%', isView: false },
{ key: '4', measure: '跟踪衰减较大组件', priority: '中', gain: '+0.35%', confidence: '86%', isView: false },
{ key: '5', measure: '持续监控逆变器效率', priority: '低', gain: '+0.10%', confidence: '93%', isView: true },
]}
pagination={false}
size="small"
className="compact-table"
rowKey="key"
/>
</div>
</Card>

View File

@@ -79,15 +79,15 @@ export default function StationDashboard() {
];
const patrolRecords = [
{ name: "升压站安防巡检任务", device: "UAV-01", status: "草稿", time: "04-29T..." },
{ name: "B区清洗任务", device: "CLEAN-01", status: "待执行", time: "04-29T..." },
{ name: "A区巡检任务", device: "ROBOT-01", status: "已派发", time: "04-29T..." }
{ name: "升压站安防巡检任务", device: "UAV-01", status: "草稿", time: "04-29T...", person: "张运维" },
{ name: "B区清洗任务", device: "CLEAN-01", status: "待执行", time: "04-29T...", person: "张运维" },
{ name: "A区巡检任务", device: "ROBOT-01", status: "已派发", time: "04-29T...", person: "张运维" }
];
const aiAnalysis = [
{ type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。" },
{ type: "严重", content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。" },
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。" }
{ type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。", desc: "发现2处组件存在异常热斑" },
{ type: "严重", content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。", desc: "3个组串存在发电异常" },
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。", desc: "整体发电偏差-2.8%" }
];
// 图表配置 —— 终极美化版(渐变+紧凑+高级)
@@ -342,33 +342,101 @@ export default function StationDashboard() {
<Row gutter={16}>
<Col span={12}>
<Card title={<span style={{ fontWeight: 800 }}>近期巡检记录</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '0 12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>近期巡检记录</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '0 12px' }}>
<Table
dataSource={patrolRecords}
pagination={false}
size="small"
columns={[
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
{ title: '巡检时间', dataIndex: 'time', key: 'time', render: (t) => t.substring(0, 10) },
{ title: '巡检时间', dataIndex: 'time', key: 'time', },
{ title: '巡检人员', dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
{ title: '状态', dataIndex: 'status', key: 'status', render: (s) => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
]}
/>
</Card>
</Col>
<Col span={12}>
<Card title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><ThunderboltOutlined style={{ color: '#722ed1' }} /> <span style={{ fontSize: 13 }}>热点检测</span></Space>
<Button type="link" size="small">查看详情</Button>
<Card
title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>}
bordered={false}
style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}
>
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
{/* 热点检测 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(114, 46, 209, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<ThunderboltOutlined style={{ fontSize: 24, color: '#722ed1' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>热点检测</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
发现 <span style={{ color: '#165DFF', fontWeight: 600 }}>2</span> 处组件存在异常热斑
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><AppstoreOutlined style={{ color: '#52c41a' }} /> <span style={{ fontSize: 13 }}>组串异常</span></Space>
<Button type="link" size="small">查看详情</Button>
{/* 组串异常 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(82, 196, 26, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<AppstoreOutlined style={{ fontSize: 24, color: '#52c41a' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>组串异常</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
<span style={{ color: '#165DFF', fontWeight: 600 }}>3</span> 个组串存在发电异常
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
<Space><RiseOutlined style={{ color: '#165DFF' }} /> <span style={{ fontSize: 13 }}>发电偏差分析</span></Space>
<Button type="link" size="small">查看详情</Button>
{/* 发电偏差分析 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(22, 93, 255, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<RiseOutlined style={{ fontSize: 24, color: '#165DFF' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>发电偏差分析</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
整体发电偏差 <span style={{ color: '#165DFF', fontWeight: 600 }}>-2.8%</span>
</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
</div>
</Card>
@@ -380,20 +448,92 @@ export default function StationDashboard() {
{/* 右侧:状态与分析 */}
<Col xs={24} xl={6}>
<Space direction="vertical" size={16} style={{ width: '100%' }}>
<Card title={<span style={{ fontWeight: 800 }}>实时告警</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
{realtimeAlerts.map((alert, idx) => (
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12, borderBottom: '1px solid #f5f5f5', paddingBottom: 8 }}>
<div>
<div style={{ fontSize: 13, fontWeight: 500 }}>{alert.type}</div>
<div style={{ fontSize: 11, color: '#999' }}>发生时间: 10:24:15</div>
<Card
title={<span style={{ fontWeight: 800 }}>实时告警</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
{/* 表头 */}
<div style={{
display: 'flex',
justifyContent: 'space-between',
marginBottom: 12,
padding: '0 4px 8px',
borderBottom: '1px solid #f0f0f0',
fontSize: 13,
color: '#666'
}}>
<span style={{ flex: 3 }}>告警内容</span>
<span style={{ flex: 1, textAlign: 'center' }}>级别</span>
<span style={{ flex: 1.5, textAlign: 'right' }}>发生时间</span>
</div>
{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';
}
return (
<div
key={idx}
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 12,
padding: '0 4px',
borderBottom: idx < realtimeAlerts.length - 1 ? '1px solid #f5f5f5' : 'none',
paddingBottom: 8
}}
>
{/* 告警内容(带圆点) */}
<div style={{ display: 'flex', alignItems: 'center', flex: 3, minWidth: 0 }}>
<div style={{
width: 12,
height: 12,
borderRadius: '50%',
backgroundColor: dotColor,
marginRight: 8,
flexShrink: 0
}} />
<span style={{ fontSize: 13, fontWeight: 500, whiteSpace: 'normal', wordBreak: 'break-all' }}>
{alert.type}
</span>
</div>
{/* 级别标签 */}
<div style={{ flex: 1, textAlign: 'center' }}>
<Tag color={tagColor} style={{ fontSize: 12 }}>{alert.level}</Tag>
</div>
{/* 发生时间 */}
<div style={{ flex: 1.5, textAlign: 'right', fontSize: 13, color: '#333' }}>
{alert.time}
</div>
</div>
<Tag color={alert.level === '严重' ? 'error' : 'warning'}>{alert.level}</Tag>
</div>
))}
);
})}
</Card>
<Card title={<span style={{ fontWeight: 800 }}>设备在线状态</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Row gutter={[8, 8]}>
<Card
title={<span style={{ fontWeight: 800 }}>设备在线状态</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
<Row gutter={[16, 16]}>
{[
{ name: '组件阵列', count: '320/320', icon: <AppstoreOutlined /> },
{ name: '逆变器', count: '5/5', icon: <ThunderboltOutlined /> },
@@ -404,11 +544,31 @@ export default function StationDashboard() {
{ name: '无人机', count: '1/1', icon: <RocketOutlined /> },
{ name: '巡检机器人', count: '1/1', icon: <RobotOutlined /> },
].map((item, idx) => (
<Col span={6} key={idx} style={{ textAlign: 'center' }}>
<div style={{ background: '#f9f9f9', borderRadius: 8, padding: '8px 4px' }}>
<div style={{ color: '#165DFF', fontSize: 16 }}>{item.icon}</div>
<div style={{ fontSize: 11, color: '#333', fontWeight: 600, marginTop: 4 }}>{item.count}</div>
<div style={{ fontSize: 10, color: '#999' }}>{item.name}</div>
<Col span={6} key={idx} style={{ display: 'flex', alignItems: 'center' }}>
{/* 绿色圆形图标 */}
<div style={{
width: 20,
height: 20,
borderRadius: '50%',
border: '2px solid #52c41a',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
marginRight: 12,
flexShrink: 0
}}>
<div style={{ fontSize: 12, color: '#52c41a' }}>
{item.icon}
</div>
</div>
{/* 名称+在线数 */}
<div style={{ textAlign: 'left' }}>
<div style={{ fontSize: 12, color: '#333', fontWeight: 600 }}>
{item.name}
</div>
<div style={{ fontSize: 10, color: '#52c41a', fontWeight: 700, marginTop: 4 }}>
{item.count}
</div>
</div>
</Col>
))}
@@ -416,18 +576,24 @@ export default function StationDashboard() {
</Card>
<Card title={<span style={{ fontWeight: 800 }}>天气信息</span>} extra={<Button type="link" size="small">详细 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'start', gap: 20 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{ fontSize: 32, color: '#faad14' }}><CloudOutlined /></div>
<div>
<div style={{ fontSize: 24, fontWeight: 800 }}>28℃</div>
<div style={{ fontSize: 14 }}>晴</div>
<WeatherDisplay type={weatherType} />
<div style={{ flex: 1, flexDirection: "row" }}>
<div style={{ fontSize: 28, fontWeight: 800, color: '#1890ff' }}>
{weatherdata.temperature}℃
</div>
<div style={{ fontSize: 14, color: '#333', marginBottom: 6 }}>
{weatherdata.weather}
</div>
</div>
</div>
<div style={{ fontSize: 12, color: '#666', lineHeight: '20px' }}>
<div>辐照度: 815 W/m²</div>
<div>组件温度: 45.6 ℃</div>
<div>湿度: 56%</div>
<div style={{ fontSize: 12, color: '#666', lineHeight: 1.6 }}>
<div>湿度 {weatherdata.humidity}%</div>
<div>{weatherdata.wind_direction} {weatherdata.wind_power}</div>
<div>{weatherdata.city} · {weatherdata.district}</div>
</div>
</div>
</Card>
@@ -435,14 +601,19 @@ export default function StationDashboard() {
<Card title={<span style={{ fontWeight: 800 }}>清洗建议</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 16 }}>
<div style={{ width: 80, height: 80, position: 'relative' }}>
{/*<RingProgress percent={0.85} width={80} height={80} color={['#00B42A', '#E8FFEA']} innerRadius={0.7} radius={1}
statistic={{
content: {
style: { fontSize: '14px', fontWeight: 800, color: '#000' },
formatter: () => '85分',
},
}}
/>*/}
<UniversalPieChart
data={[
{ name: '清洁度', value: 85, color: '#00B42A' },
{ name: '待清洗', value: 15, color: '#E8FFEA' },
]}
width="100%"
height="100%"
innerRadius={20}
outerRadius={26}
showTooltip={false}
showLegend={false}
showLabel={false}
/>
</div>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>建议清洗时间: <span style={{ color: '#165DFF' }}>3天内</span></div>