f封装完成点 无人机和 机器人 地图清空实时轨迹和清空规划轨迹
This commit is contained in:
@@ -10,7 +10,8 @@ import {
|
||||
BranchesOutlined, CloudOutlined, ThunderboltOutlined, CheckCircleOutlined,
|
||||
InfoCircleOutlined, ClockCircleOutlined,
|
||||
SettingOutlined, WarningOutlined, ArrowRightOutlined,
|
||||
SearchOutlined, MoreOutlined, AimOutlined, PlayCircleOutlined
|
||||
SearchOutlined, MoreOutlined, AimOutlined, PlayCircleOutlined,
|
||||
DeleteOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
Plane, Navigation, Wind, Thermometer, Droplets, Satellite,
|
||||
@@ -52,6 +53,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
const [persistentDroneData, setPersistentDroneData] = useState(null); // 持久化无人机数据
|
||||
const [persistentHostData, setPersistentHostData] = useState(null); // 持久化机场数据
|
||||
const [clearNavLine, setClearNavLine] = useState(0);
|
||||
const [clearPlanLine, setClearPlanLine] = useState(0);
|
||||
|
||||
// 获取数据
|
||||
const fetchAllData = async () => {
|
||||
@@ -540,6 +543,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
fetchWaylineList();
|
||||
}, [])
|
||||
|
||||
|
||||
// 初始化默认设备
|
||||
useEffect(() => {
|
||||
if (planedevices?.length) {
|
||||
@@ -851,6 +855,29 @@ export default function WayLinePage({ onRefresh }) {
|
||||
size="small"
|
||||
extra={
|
||||
<Space size={4}>
|
||||
<Button
|
||||
size="small"
|
||||
icon={<DeleteOutlined />}
|
||||
type="primary"
|
||||
style={{ borderRadius: 4 }}
|
||||
onClick={() => {
|
||||
setClearNavLine((v) => v + 1);
|
||||
}}
|
||||
>
|
||||
清空实时轨迹
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
icon={<DeleteOutlined />}
|
||||
danger
|
||||
style={{ borderRadius: 4 }}
|
||||
onClick={() => {
|
||||
setPoints([]);
|
||||
setClearPlanLine((v) => v + 1);
|
||||
}}
|
||||
>
|
||||
清空规划航线
|
||||
</Button>
|
||||
<Button size="small" icon={<PlusOutlined />} style={{ borderRadius: 4 }}>新增</Button>
|
||||
<Button size="small" icon={<ImportOutlined />} style={{ borderRadius: 4 }}>导入</Button>
|
||||
<Button size="small" icon={<NodeIndexOutlined />} style={{ borderRadius: 4 }}>优化</Button>
|
||||
@@ -864,7 +891,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
>
|
||||
<div style={{ width: '100%', height: 420, background: '#e8f3ff url(https://picsum.photos/seed/solar_map_v2/1600/1000) center/cover', position: 'relative' }}>
|
||||
<CesiumMap realtimePosition={realtimePosition} drawRealTime={true}
|
||||
points={points} focusLocation={focusLocation} from="device-control" realtimeType='plane' />
|
||||
points={points} focusLocation={focusLocation} from="device-control" realtimeType='plane' ifClearNavLine={clearNavLine} ifClearPlanLine={clearPlanLine} />
|
||||
<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' }}></span> 无人机航线</div>
|
||||
|
||||
Reference in New Issue
Block a user