map中 增加显示障碍物代码 未测试,优化显示实时路径,完善返航点、分区的绘制显示 障碍物 支持拖动半径显示 地图增加图例,优化机器人任务界面的逻辑 无需收到刷新接口,根据传输任务完成情况 调用接口,已测试
This commit is contained in:
@@ -70,7 +70,6 @@ export default function RobotTaskPage() {
|
||||
const [realtimeMap, setRealtimeMap] = useState<any>({});
|
||||
const [execute, setExecute] = useState(false); // 是否执行任务
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
||||
const { modal } = App.useApp();
|
||||
const [polyPoints, setPolyPoints] = useState([]);
|
||||
|
||||
@@ -183,10 +182,19 @@ export default function RobotTaskPage() {
|
||||
|
||||
|
||||
}
|
||||
const handleFinishEdPoint = (point) => {
|
||||
setArrivedPoint(point);
|
||||
const fetchAllData = async () => {
|
||||
if (!stationId) return;
|
||||
|
||||
try {
|
||||
const deviceRes = await getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId });
|
||||
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
||||
setDevices(devData);
|
||||
} catch (err) {
|
||||
console.error('数据请求失败', err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 根据任务ID获取路径并显示在地图上
|
||||
const loadTaskPath = async (taskId) => {
|
||||
//return;
|
||||
@@ -287,6 +295,9 @@ export default function RobotTaskPage() {
|
||||
console.log('收到 route_post 消息:', msg);
|
||||
setProPoints(msg);
|
||||
};
|
||||
controller.deviceStatusChangedMsg = () => {
|
||||
fetchAllData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -459,17 +470,6 @@ export default function RobotTaskPage() {
|
||||
|
||||
|
||||
// 获取数据
|
||||
const fetchAllData = async () => {
|
||||
if (!stationId) return;
|
||||
|
||||
try {
|
||||
const deviceRes = await getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId });
|
||||
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
||||
setDevices(devData);
|
||||
} catch (err) {
|
||||
console.error('数据请求失败', err);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchAllData();
|
||||
@@ -1112,17 +1112,17 @@ export default function RobotTaskPage() {
|
||||
</Popconfirm>
|
||||
{/*//)}*/}
|
||||
|
||||
{/*{record.taskStaus === 'EXECUTING' && (*/}
|
||||
<Popconfirm
|
||||
title={t('devices.confirmPauseTask')}
|
||||
onConfirm={() => handlePauseTask(record)}
|
||||
okText={t('common.ok')} cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button type="text" size="small" style={{ color: '#FF9500' }} onClick={(e) => e.stopPropagation()}>
|
||||
{t('video.pause')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{/*)}/*/}
|
||||
{record.taskStaus === 'EXECUTING' && (
|
||||
<Popconfirm
|
||||
title={t('devices.confirmPauseTask')}
|
||||
onConfirm={() => handlePauseTask(record)}
|
||||
okText={t('common.ok')} cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button type="text" size="small" style={{ color: '#FF9500' }} onClick={(e) => e.stopPropagation()}>
|
||||
{t('video.pause')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
)}
|
||||
|
||||
{record.taskStaus === 'PAUSE' && (
|
||||
<Popconfirm
|
||||
@@ -1562,7 +1562,6 @@ export default function RobotTaskPage() {
|
||||
realtimeType="robot"
|
||||
from="devicesTask"
|
||||
drawRealTime={execute}
|
||||
finishPoint={arrivedPoint}
|
||||
ifClearNavLine={clearNavLine}
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
routeMode={routeMode}
|
||||
@@ -1707,12 +1706,12 @@ export default function RobotTaskPage() {
|
||||
fetchTaskPoolList();
|
||||
fetchTaskHistoryList();
|
||||
}} />
|
||||
<Tooltip title={t('devices.createTask')}>
|
||||
{/*<Tooltip title={t('devices.createTask')}>
|
||||
<PlusOutlined
|
||||
style={{ cursor: 'pointer', color: '#165DFF', fontSize: 14 }}
|
||||
onClick={() => setIsTaskModalOpen(true)}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Tooltip>*/}
|
||||
</Space>
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user