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
} from '@ant-design/icons';
const { Text, Title } = Typography;
export default function WayLinePage() {
const [activeMainTab, setActiveTab] = useState('wayline');
const cardStyle = { borderRadius: 8, border: 'none', boxShadow: '0 2px 8px rgba(0,0,0,0.05)' };
// 模拟数据
const topCards = [
{ title: '今日航线计划', value: '18', unit: '条', trend: '较昨日 +2', color: '#165DFF', icon: },
{ title: '执行中任务', value: '6', unit: '个', desc: '进行中', color: '#165DFF', icon: },
{ title: '待审批任务', value: '4', unit: '个', trend: '较昨日 -1', color: '#FF7D00', icon: },
{ title: '任务完成率', value: '92', unit: '%', trend: '较昨日 +6%', color: '#00B42A', icon: },
{ title: 'AI 优化收益', value: '+7.8', unit: '%', trend: '较昨日 +1.2%', color: '#722ED1', icon: },
{ title: '覆盖装备', value: '4类 / 9台', unit: '', desc: '全部在线', color: '#165DFF', icon: },
];
return (
{/* 顶部统计卡片 */}
{topCards.map((item, index) => (
{item.icon}
{item.title}
{item.value}
{item.unit}
{item.trend || item.desc}
))}
{/* 中间主要内容区 */}
{/* 左侧:航线编辑与路径规划 */}
航线编辑与路径规划}
extra={
}>新增航线
}>导入模板
}>路径优化
}>风险检查
}>保存草稿
} />
}
bordered={false}
bodyStyle={{ padding: 0, position: 'relative' }}
style={{ ...cardStyle, marginBottom: "16px" }}
>
{/* 模拟地图区域 */}
{/* 左侧图例 */}
无人机航线
巡检机器人路线
除草路线
清洗航线
< ThunderboltOutlined style={{ color: '#00B42A' }} /> 充电点
补水点
禁飞区
{/* 地图上的模拟标注 */}
航点列表 航线:FL-03 (无人机热斑巡检)}
extra={}
bordered={false}
bodyStyle={{ padding: 0 }}
style={cardStyle}
>
{/* 右侧:任务编排、参数与天气 */}
任务编排与 AI 建议}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, marginBottom: 12 }}
>
{t} },
{ title: '装备', dataIndex: 'device' },
{ title: '类型', dataIndex: 'type', ellipsis: true },
{ title: '优先级', dataIndex: 'level', render: (l) => ▲ {l} },
{ title: '建议时间', dataIndex: 'time' },
{ title: '预计时长', dataIndex: 'duration' },
{ title: '状态', dataIndex: 'status', render: (s) => {s} },
]}
/>
AI 建议:
}>
推荐优先执行 FL-03 航线
14:00-16:00 风速最佳
区块 B-12 存在高温风险
航线参数 / 作业参数}
extra={当前航线:FL-03}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, marginBottom: 12 }}
>
{[
{ 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: 12 }}
style={cardStyle}
>
{[
{ label: '风速', value: '2.8 m/s', desc: '适宜', icon: , color: '#165DFF' },
{ label: '温度', value: '28℃', desc: '适宜', icon: < ThunderboltOutlined />, 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: 12 }}
style={{ ...cardStyle, height: '100%' }} // 👈 高度 100%
>
{/* 模拟时间轴头部 */}
08:0010:0012:0014:0016:0018:00
{/* 模拟甘特条 */}
{[
{ 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' }] },
].map((row, idx) => (
{row.label}
{row.tasks.map((task, tidx) => (
))}
))}
{/* 垂直当前时间红线 */}
{/* 任务看板 */}
工作任务看板}
bordered={false}
bodyStyle={{ padding: 12 }}
style={{ ...cardStyle, height: '100%', display: 'flex', flexDirection: 'column' }} // 👈 高度 100%
>
{/* 👈 自动撑满 */}
{[
{ 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.title}
{col.list.map((task, tidx) => (
{task.id} {task.name}
装备: {task.device} | 负责人: {task.handler}
{task.gain &&
预计收益: {task.gain}
}
{task.time &&
完成时间: {task.time}
}
))}
))}
);
}