优化一些 周六的内容
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import AgoraRTC, { IAgoraRTCClient, IRemoteVideoTrack } from "agora-rtc-sdk-ng";
|
import AgoraRTC, { IAgoraRTCClient, IRemoteVideoTrack } from "agora-rtc-sdk-ng";
|
||||||
import { Badge, message } from "antd";
|
import { Badge, message } from "antd";
|
||||||
const APP_ID = "875f6494d87548e783fefbf33f598c97";
|
const APP_ID = "7887b4db6033410d9ac3264b40ca9c1a";
|
||||||
const TOKEN = "007eJxTYIjPuZr09PC0znd6+z0MMyL6ZHb68OetXW+kO1vHU2ZNtYECg4W5aZqZiaVJCpBhYpFqbmGclpqWlGZsnGZqaZFsaT6pZH5WQyAjA7e+LysjAwSC+JwMxmYlqcUlugZGDAwAbuYeJg==";
|
const TOKEN = "007eJxTYKjmeKazOKdUZ5qMsU389u45l6ruuuQlze8o+OZWHdBUHK3AYG5hYZ5kkpJkZmBsbGJokGKZmGxsZGaSZGKQnGiZbJh4dsuSrIZARoYFWw4zMTJAIIjPxWBiqFuSkVqUm5jDwAAA1JUhaw==";
|
||||||
export default function AgrtcRoomRobot({ CHANNEL }) {
|
export default function AgrtcRoomRobot({ CHANNEL }) {
|
||||||
const [uid] = useState(() => Number(Math.floor(Math.random() * 100000)));
|
const [uid] = useState(() => Number(Math.floor(Math.random() * 100000)));
|
||||||
const [connected, setConnected] = useState(false);
|
const [connected, setConnected] = useState(false);
|
||||||
|
|||||||
@@ -335,12 +335,12 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
polygonRef.current = null;
|
polygonRef.current = null;
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
if (planLineRef.current) {
|
//if (planLineRef.current) {
|
||||||
try {
|
// try {
|
||||||
viewer.entities.remove(planLineRef.current);
|
// viewer.entities.remove(planLineRef.current);
|
||||||
planLineRef.current = null;
|
// planLineRef.current = null;
|
||||||
} catch (e) { }
|
// } catch (e) { }
|
||||||
}
|
//}
|
||||||
|
|
||||||
const validPoints = points?.filter(p => {
|
const validPoints = points?.filter(p => {
|
||||||
|
|
||||||
|
|||||||
@@ -1235,18 +1235,9 @@ export default function DeviceStatusPage() {
|
|||||||
)
|
)
|
||||||
) : mowerView === 'front' ? (
|
) : mowerView === 'front' ? (
|
||||||
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
||||||
{device?.hasHost ? (
|
{/*<AgrtcRoomRobot CHANNEL={device?.serialNumber || ''} />*/}
|
||||||
<AgrtcRoomRobot CHANNEL={device?.serialNumber || ''} />
|
<AgrtcRoomRobot CHANNEL={"41-thermal"} />
|
||||||
) : (
|
|
||||||
<VideoPlayer
|
|
||||||
deviceId={device?.serialNumber}
|
|
||||||
idx={1}
|
|
||||||
className="w-full h-full object-contain"
|
|
||||||
video={robotVideo}
|
|
||||||
error={error}
|
|
||||||
ready={ready}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ export default function RobotTaskPage() {
|
|||||||
if (runningPoolTask) return;
|
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;
|
if (!runningTask) return;
|
||||||
//fetchRouteDetail(runningTask?.id);
|
//fetchRouteDetail(runningTask?.id);
|
||||||
@@ -339,7 +339,6 @@ export default function RobotTaskPage() {
|
|||||||
|
|
||||||
}, [devices, taskPoolList, executingRobot, runningPoolTask]);
|
}, [devices, taskPoolList, executingRobot, runningPoolTask]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('runningPoolTask, proPoints', runningPoolTask, proPoints);
|
|
||||||
if (!runningPoolTask?.id || !proPoints?.taskId) return;
|
if (!runningPoolTask?.id || !proPoints?.taskId) return;
|
||||||
if (runningPoolTask?.id == proPoints?.taskId) {
|
if (runningPoolTask?.id == proPoints?.taskId) {
|
||||||
setPoints(proPoints?.data || []);
|
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);
|
const targetDevice = devices?.find(d => d.serialNumber === runningPoolTask.deviceId);
|
||||||
if (targetDevice) {
|
if (targetDevice) {
|
||||||
setExecute(true);
|
setExecute(true);
|
||||||
@@ -622,7 +621,7 @@ export default function RobotTaskPage() {
|
|||||||
fetchTaskPoolList();
|
fetchTaskPoolList();
|
||||||
fetchTaskHistoryList();
|
fetchTaskHistoryList();
|
||||||
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(selectedRobotForExecute); } else { controllerRef.current?.switchDevice(selectedRobotForExecute); }
|
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(selectedRobotForExecute); } else { controllerRef.current?.switchDevice(selectedRobotForExecute); }
|
||||||
setShowVideo(true); // 连接成功后自动打开视频
|
//setShowVideo(true); // 连接成功后自动打开视频
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setExecute(false);
|
setExecute(false);
|
||||||
@@ -937,7 +936,15 @@ export default function RobotTaskPage() {
|
|||||||
{
|
{
|
||||||
title: t('devices.device'),
|
title: t('devices.device'),
|
||||||
dataIndex: 'deviceId',
|
dataIndex: 'deviceId',
|
||||||
width: 320,
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('devices.taskId'),
|
||||||
|
dataIndex: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('devices.routeId'),
|
||||||
|
dataIndex: 'routeId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('roles.status'),
|
title: t('roles.status'),
|
||||||
|
|||||||
@@ -1270,6 +1270,8 @@ const en = {
|
|||||||
fixed2EquipmentFixed2NameFixed2: 'Equipment Name ',
|
fixed2EquipmentFixed2NameFixed2: 'Equipment Name ',
|
||||||
|
|
||||||
statusFixed2: '通讯 Status Fixed2',
|
statusFixed2: '通讯 Status Fixed2',
|
||||||
|
taskId: "taskId",
|
||||||
|
routeId: "routeId",
|
||||||
|
|
||||||
videoFixed2: ' Airport video',
|
videoFixed2: ' Airport video',
|
||||||
|
|
||||||
|
|||||||
@@ -871,7 +871,7 @@ const zh = {
|
|||||||
satelliteCount: '卫星数量 {{count}}',
|
satelliteCount: '卫星数量 {{count}}',
|
||||||
savePathTitle: '保存路径标题',
|
savePathTitle: '保存路径标题',
|
||||||
savePlan: '保存计划',
|
savePlan: '保存计划',
|
||||||
saving: '节省',
|
saving: '保存中...',
|
||||||
searchDeviceName: '搜索设备名称',
|
searchDeviceName: '搜索设备名称',
|
||||||
searchWaylinePlaceholder: '搜索航线占位',
|
searchWaylinePlaceholder: '搜索航线占位',
|
||||||
selectDevice: '选择设备',
|
selectDevice: '选择设备',
|
||||||
@@ -1283,6 +1283,8 @@ const zh = {
|
|||||||
statusFixed2: '通讯状态',
|
statusFixed2: '通讯状态',
|
||||||
|
|
||||||
videoFixed2: '机场视频',
|
videoFixed2: '机场视频',
|
||||||
|
taskId: "任务ID",
|
||||||
|
routeId: "路线ID",
|
||||||
|
|
||||||
fixed2TaskSuspended2Fixed2CompletedFixed2: '任务已完成',
|
fixed2TaskSuspended2Fixed2CompletedFixed2: '任务已完成',
|
||||||
|
|
||||||
|
|||||||
10
src/main.tsx
10
src/main.tsx
@@ -9,10 +9,10 @@ import './index.css';
|
|||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<StrictMode>
|
{/*<StrictMode>*/}
|
||||||
<Appantd>
|
<Appantd>
|
||||||
<App />
|
<App />
|
||||||
</Appantd>
|
</Appantd>
|
||||||
</StrictMode>,
|
{/*</StrictMode>,*/}
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user