优化一些 周六的内容

This commit is contained in:
mmc
2026-09-14 09:12:40 +08:00
parent 65aa966606
commit e4dffc7ff9
7 changed files with 33 additions and 31 deletions

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useRef, useState } from "react";
import AgoraRTC, { IAgoraRTCClient, IRemoteVideoTrack } from "agora-rtc-sdk-ng";
import { Badge, message } from "antd";
const APP_ID = "875f6494d87548e783fefbf33f598c97";
const TOKEN = "007eJxTYIjPuZr09PC0znd6+z0MMyL6ZHb68OetXW+kO1vHU2ZNtYECg4W5aZqZiaVJCpBhYpFqbmGclpqWlGZsnGZqaZFsaT6pZH5WQyAjA7e+LysjAwSC+JwMxmYlqcUlugZGDAwAbuYeJg==";
const APP_ID = "7887b4db6033410d9ac3264b40ca9c1a";
const TOKEN = "007eJxTYKjmeKazOKdUZ5qMsU389u45l6ruuuQlze8o+OZWHdBUHK3AYG5hYZ5kkpJkZmBsbGJokGKZmGxsZGaSZGKQnGiZbJh4dsuSrIZARoYFWw4zMTJAIIjPxWBiqFuSkVqUm5jDwAAA1JUhaw==";
export default function AgrtcRoomRobot({ CHANNEL }) {
const [uid] = useState(() => Number(Math.floor(Math.random() * 100000)));
const [connected, setConnected] = useState(false);

View File

@@ -335,12 +335,12 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
polygonRef.current = null;
} catch (e) { }
}
if (planLineRef.current) {
try {
viewer.entities.remove(planLineRef.current);
planLineRef.current = null;
} catch (e) { }
}
//if (planLineRef.current) {
// try {
// viewer.entities.remove(planLineRef.current);
// planLineRef.current = null;
// } catch (e) { }
//}
const validPoints = points?.filter(p => {

View File

@@ -1235,18 +1235,9 @@ export default function DeviceStatusPage() {
)
) : mowerView === 'front' ? (
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
{device?.hasHost ? (
<AgrtcRoomRobot CHANNEL={device?.serialNumber || ''} />
) : (
<VideoPlayer
deviceId={device?.serialNumber}
idx={1}
className="w-full h-full object-contain"
video={robotVideo}
error={error}
ready={ready}
/>
)}
{/*<AgrtcRoomRobot CHANNEL={device?.serialNumber || ''} />*/}
<AgrtcRoomRobot CHANNEL={"41-thermal"} />
</div>
) : (
<div style={{ position: 'relative', width: '100%', height: '100%' }}>

View File

@@ -312,7 +312,7 @@ export default function RobotTaskPage() {
if (runningPoolTask) return;
// 查找正在执行中的任务
const runningTask = taskPoolList.find(item => ['EXECUTING', 'PAUSE'].includes(item.taskStaus));
const runningTask = taskPoolList.find(item => ['EXECUTING', 'PAUSE', "NEW"].includes(item.taskStaus));
if (!runningTask) return;
//fetchRouteDetail(runningTask?.id);
@@ -339,7 +339,6 @@ export default function RobotTaskPage() {
}, [devices, taskPoolList, executingRobot, runningPoolTask]);
useEffect(() => {
console.log('runningPoolTask, proPoints', runningPoolTask, proPoints);
if (!runningPoolTask?.id || !proPoints?.taskId) return;
if (runningPoolTask?.id == proPoints?.taskId) {
setPoints(proPoints?.data || []);
@@ -533,7 +532,7 @@ export default function RobotTaskPage() {
// 只有当任务是执行状态,并且没有连接的设备时,才自动连接
if ((runningPoolTask.taskStaus == 'EXECUTING' || runningPoolTask.taskStaus == 'PAUSE') && !executingRobot) {
if ((runningPoolTask.taskStaus == 'EXECUTING' || runningPoolTask.taskStaus == 'PAUSE' || runningPoolTask.taskStaus == 'NEW') && !executingRobot) {
const targetDevice = devices?.find(d => d.serialNumber === runningPoolTask.deviceId);
if (targetDevice) {
setExecute(true);
@@ -622,7 +621,7 @@ export default function RobotTaskPage() {
fetchTaskPoolList();
fetchTaskHistoryList();
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(selectedRobotForExecute); } else { controllerRef.current?.switchDevice(selectedRobotForExecute); }
setShowVideo(true); // 连接成功后自动打开视频
//setShowVideo(true); // 连接成功后自动打开视频
} else {
setExecute(false);
@@ -937,7 +936,15 @@ export default function RobotTaskPage() {
{
title: t('devices.device'),
dataIndex: 'deviceId',
width: 320,
width: 180,
},
{
title: t('devices.taskId'),
dataIndex: 'id',
},
{
title: t('devices.routeId'),
dataIndex: 'routeId',
},
{
title: t('roles.status'),