import React, { useState } from 'react';
import {
Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge,
Tabs, Input, Switch, Divider, Tooltip, Timeline
} from 'antd';
import {
PlusOutlined, ImportOutlined, NodeIndexOutlined, SafetyCertificateOutlined,
SaveOutlined, FullscreenOutlined, EnvironmentOutlined, RobotOutlined,
BranchesOutlined, CloudOutlined, ThunderboltOutlined, CheckCircleOutlined,
InfoCircleOutlined, ClockCircleOutlined, RiseOutlined, FallOutlined,
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 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: 12, border: 'none', boxShadow: '0 2px 12px rgba(0,0,0,0.04)' };
// 顶部统计卡片数据
const topCards = [
{
title: '今日航线计划',
value: '18',
unit: '条',
trend: '较昨日 +2',
trendColor: '#00B42A',
icon: ,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
{
title: '执行中任务',
value: '6',
unit: '个',
desc: '进行中',
icon: ,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
{
title: '待审批任务',
value: '4',
unit: '个',
trend: '较昨日 -1',
trendColor: '#F53F3F',
icon: ,
color: '#FF7D00',
bg: 'linear-gradient(135deg, #FFF7E6 0%, #FFE4BA 100%)'
},
{
title: '任务完成率',
value: '92',
unit: '%',
trend: '较昨日 +6%',
trendColor: '#00B42A',
icon: ,
color: '#00B42A',
bg: 'linear-gradient(135deg, #E8FFEA 0%, #AFF0B5 100%)'
},
{
title: 'AI 优化收益',
value: '+7.8',
unit: '%',
trend: '较昨日 +1.2%',
trendColor: '#00B42A',
icon: ,
color: '#722ED1',
bg: 'linear-gradient(135deg, #F9F0FF 0%, #EFDBFF 100%)'
},
{
title: '覆盖装备',
value: '4 类 / 9 台',
unit: '',
desc: '全部在线',
icon: ,
color: '#165DFF',
bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)'
},
];
return (
{topCards.map((item, index) => (
{React.cloneElement(item.icon as React.ReactElement, { size: 18 })}
{item.title}
{item.value}
{item.unit}
{item.trend || item.desc}
))}
{/* 中间主要内容区 */}
{/* 左侧:航线编辑与路径规划 */}
航线编辑与路径规划}
size="small"
extra={
} style={{ borderRadius: 4, fontSize: 11 }}>新增
} style={{ borderRadius: 4, fontSize: 11 }}>导入
} style={{ borderRadius: 4, fontSize: 11 }}>优化
} style={{ borderRadius: 4, fontSize: 11 }}>保存
} style={{ borderRadius: 4 }} />
}
bordered={false}
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden' }}
style={{ ...cardStyle, marginBottom: 10 }}
>
{/* 地图区域 */}
{/* SVG 航线与区域覆盖 */}
{/* 左侧图例 - 拟真样式 */}
无人机航线
巡检机器人路线
除草路线
清洗航线
充电点
补水点
{/* 地图交互层 */}
{/* 右下角地图缩放控制 */}
{/* 航点列表 */}
航点列表 航线:FL-03}
size="small"
extra={}
bordered={false}
bodyStyle={{ padding: 0, height: "100%" }}
style={{
...cardStyle,
flex: 1,
display: "flex",
flexDirection: "column",
height: "100%",
}}
>
{t} },
{ title: '坐标/区域', dataIndex: 'coord', width: 120, ellipsis: true },
{ title: '动作', dataIndex: 'action', width: 80, render: (a) => {a} },
{ title: '高度(m)', dataIndex: 'height', width: 70 },
{ title: '速度(m/s)', dataIndex: 'speed', width: 90 },
{ title: '停留(s)', dataIndex: 'stay', width: 70 },
{ title: '备注', dataIndex: 'remark', ellipsis: true },
]}
style={{ height: "100%" }}
/>
{/* 右侧:任务编排、参数与天气 */}
任务编排与 AI 建议}
bordered={false}
bodyStyle={{ padding: '12px 16px' }}
style={{ ...cardStyle, marginBottom: 16 }}
>
{t} },
{ title: '装备', dataIndex: 'device', width: 80 },
{ title: '类型', dataIndex: 'type', ellipsis: true },
{ title: '优先级', dataIndex: 'level', width: 80, render: (l) => ▲ {l} },
{ title: '建议时间', dataIndex: 'time', width: 110 },
{ title: '状态', dataIndex: 'status', width: 90, render: (s) => {s} },
]}
/>
AI 建议:
}>
推荐优先执行 FL-03 航线
14:00-16:00 风速最佳
区块 B-12 存在高温风险
航线参数 / 作业参数}
extra={当前航线:FL-03}
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ ...cardStyle, marginBottom: 16 }}
>
{[
{ label: '飞行高度', value: '35', unit: 'm' },
{ label: '速度', value: '6', unit: 'm/s' },
{ label: '航向重叠', value: '75', unit: '%' },
{ label: '旁向重叠', value: '65', unit: '%' },
{ label: '安全返航电量', value: '25', unit: '%' },
{ label: '清洗喷洒量', value: '120', unit: 'ml/㎡' },
{ label: '除草宽幅', value: '1.2', unit: 'm' },
{ label: '巡检采样频率', value: '2', unit: 'Hz' },
].map((item, idx) => (
{item.label}
{item.unit}
))}
避障开关
夜航限制
天气窗口与执行约束}
bordered={false}
bodyStyle={{ padding: '16px' }}
style={cardStyle}
>
{[
{ label: '风速', value: '2.8 m/s', desc: '适宜', icon: , color: '#165DFF' },
{ label: '温度', value: '28℃', desc: '适宜', icon: , color: '#FF7D00' },
{ label: '降水概率', value: '10%', desc: '极低', icon: , color: '#165DFF' },
{ label: 'GNSS 质量', value: '良好', desc: '适宜', icon: , color: '#00B42A' },
].map((item, idx) => (
{item.icon}
{item.label}
{item.value}
{item.desc}
))}
16:30 后风速升高,建议提前完成任务
预计 14:00-16:00 为最佳执行窗口
{/* 底部内容区 */}
{/* 甘特图/排班视图 */}
任务甘特视图 / 排班视图 今日 (2025-05-24)}
extra={}
bordered={false}
bodyStyle={{ padding: 16 }}
style={{ ...cardStyle, height: '100%' }}
>
{/* 时间轴头部 */}
08:0010:0012:0014:0016:0018:00
{/* 甘特条 */}
{[
{ 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) => (
{row.tasks.map((task, tidx) => (
))}
))}
{/* 当前时间红线 */}
{/* 任务看板 */}
工作任务看板}
bordered={false}
bodyStyle={{ padding: 16 }}
style={{ ...cardStyle, height: '100%' }}
>
{[
{
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.title} ({col.count})
{col.list.map((task, tidx) => (
{task.id} {task.name}
装备: {task.device || 'UAV-A01'}
{task.target &&
目标: {task.target}
}
{task.gain &&
预计收益: ↑ {task.gain}
}
{task.time &&
完成时间: {task.time}
}
))}
))}
);
}