From e642ecbd1650fc5d1f1f2f7767979a48cf50a5c6 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Fri, 22 May 2026 13:50:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=AA=E7=BA=BF=E9=9D=A2=E6=9D=BF=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=98=BE=E7=A4=BA=20=20=20=E7=AE=97=E6=B3=95=E5=88=86?= =?UTF-8?q?=E6=9E=90=E8=B0=83=E7=94=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=A1=88?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/aiAnalysis.ts | 15 + src/components/devices/DeviceOverviewPage.tsx | 75 +- src/components/useWebRTCStream.tsx | 4 +- src/pages/Agri.jsx | 4232 ++++++++++++++++- 4 files changed, 4303 insertions(+), 23 deletions(-) diff --git a/src/api/aiAnalysis.ts b/src/api/aiAnalysis.ts index 5c5367e..ded9f2f 100644 --- a/src/api/aiAnalysis.ts +++ b/src/api/aiAnalysis.ts @@ -54,3 +54,18 @@ export function submitSegmentationAnalyze(formData: FormData) { export function getSegmentationHistory() { return fetch(`${SEGMENT_BASE}/api/v1/segmentation/analyses/report`).then(res => res.json()); } + +//热成像调用服务器案例 + +export function getHotDemo() { + return fetch(`${SEGMENT_BASE}/demo/run`, { + method: 'POST', + }).then(res => res.json()); +} + +//目标检测 调用服务器案例 +export function getTargetDemo() { + return fetch(`${DETECT_BASE}/demo/run`, { + method: 'POST', + }).then(res => res.json()); +} diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index 16b2fa2..6a3cf7a 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -20,6 +20,8 @@ import { getDeviceListApi, getLiveStream, getPlaneDeviceList } from '../../api/d import { RootState } from '@/src/store'; import DroneLivePlayer from '../VolcRtcPlayer.jsx'; import AgoraTextTest from '../AgoraRtc.tsx'; +import { useWebRTCPlayer } from '../useWebRTCStream.tsx'; +import VideoPlayer from '../VideoPlayer.tsx.tsx'; const { Content } = Layout; const { Text, Title } = Typography; @@ -123,6 +125,15 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, })); }, [devicesAll]); + const [mowerView, setMowerView] = useState('front'); + const isUAV = !!selectedDevice?.device_sn; + + // 机器人 WebRTC 视频(和你第二个页面逻辑一致) + const { video: robotVideo, error, ready } = useWebRTCPlayer( + selectedDevice?.serialNumber || '', + `webrtc://1.95.137.212/live/livestream/${selectedDevice?.serialNumber}`, + ); + const handleStart = () => message.success('任务已启动'); const handlePause = () => message.info('任务已暂停'); @@ -414,29 +425,67 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll, + {/* 实时画面 */}
实时画面 - 实时监控 + {/* 角度选择下拉框 */} + {!isUAV && ( +