声网视频组件完成 总览界面和 任务规划界面 都显示 了 根据机器配备的几路视频 显示
This commit is contained in:
@@ -19,6 +19,8 @@ import { MapEditorView } from './MapEditorView';
|
||||
import type { ViewStats } from './WayLineView';
|
||||
import { backToRestPointCommand } from '@/api/mapEdit';
|
||||
import { sendEmergencyStop, subscribeEmergencyStop, syncEmergencyStop } from './emergencyStopControl';
|
||||
import AgrtcRoomRobot from '../AgrtcRoomRobot.js';
|
||||
import { deviceRunParamSelectByDeviceId } from '@/api/stationManage/index.js';
|
||||
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
@@ -109,6 +111,7 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
|
||||
// 当前激活的Tab
|
||||
const [activeTab, setActiveTab] = useState('pool'); // 'task' for 任务列表, 'pool' for 任务池, 'history' for 历史任务
|
||||
const [cameraNum, setCameraNum] = useState(0);
|
||||
|
||||
// 任务池和历史任务筛选表单
|
||||
const [poolFilterForm, setPoolFilterForm] = useState({
|
||||
@@ -1384,6 +1387,26 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
setDeviceStatistics(res.data || {});
|
||||
}
|
||||
});
|
||||
|
||||
const id = selectedMachineSn;
|
||||
if (!id || !stationId) {
|
||||
setCameraNum(1);
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
deviceRunParamSelectByDeviceId({ deviceId: id }).then((res) => {
|
||||
if (cancelled) return;
|
||||
if (res?.code === 200) {
|
||||
const n = Number(res.data?.cameraNum);
|
||||
setCameraNum(Number.isFinite(n) && n >= 1 && n <= 4 ? n : 1);
|
||||
console.log('[DSP] deviceRunParam res.data=', res.data);
|
||||
} else {
|
||||
setCameraNum(1);
|
||||
}
|
||||
}).catch(() => {
|
||||
if (!cancelled) setCameraNum(1);
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
}, [selectedMachineSn]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -3105,22 +3128,18 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
</Row>*/}
|
||||
|
||||
|
||||
{/*{showVideo && executingRobot && execute && taskPoolList.length > 0 && (
|
||||
{showVideo && (
|
||||
<DraggableBox
|
||||
defaultPosition={{ x: 50, y: 50 }}
|
||||
title={t('devices.robotPanoramaVideo', { robot: executingRobot.deviceAlias || executingRobot.serialNumber })}
|
||||
title={t('devices.robotPanoramaVideo', { robot: targetRobot.deviceAlias || targetRobot.serialNumber })}
|
||||
onClose={() => setShowVideo(false)}
|
||||
>
|
||||
<div style={{ height: '100%', width: '100%' }}>
|
||||
<MowerAllView
|
||||
serialNumber={executingRobot.serialNumber}
|
||||
robotVideo={robotVideo}
|
||||
ready={ready}
|
||||
error={error}
|
||||
/>
|
||||
<AgrtcRoomRobot channel={targetRobot?.serialNumber || targetRobot?.device_sn || ""} cameraCount={cameraNum} />
|
||||
|
||||
</div>
|
||||
</DraggableBox>
|
||||
)}*/}
|
||||
)}
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user