路径规划界面增加视频 封装拖拽组件 和 全景视频组件 设备状态界面增加完成点 机器人任务界面的topcard值的优化
This commit is contained in:
@@ -53,6 +53,7 @@ import VideoPlayer from '../VideoPlayer.tsx';
|
||||
import DeviceController from './DeviceController';
|
||||
import { DatePicker } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import { MowerAllView } from './MowerAllView';
|
||||
import { useMqtt } from '@/hooks/useMqtt';
|
||||
import envConfig from '../../../env';
|
||||
const { RangePicker } = DatePicker;
|
||||
@@ -70,6 +71,8 @@ export default function DeviceStatusPage({
|
||||
const [devices, setDevices] = useState([]);
|
||||
const [planedevices, setPlaneDevices] = useState([]);
|
||||
const [devicesAll, setDevicesAll] = useState([]);
|
||||
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
||||
|
||||
|
||||
// 获取数据
|
||||
const fetchAllData = async () => {
|
||||
@@ -112,6 +115,11 @@ export default function DeviceStatusPage({
|
||||
}
|
||||
};
|
||||
|
||||
const handleFinishEdPoint = (point) => {
|
||||
setArrivedPoint(point);
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
fetchAllData();
|
||||
}, [userInfo, stationId]);
|
||||
@@ -367,6 +375,8 @@ export default function DeviceStatusPage({
|
||||
controller.onHasControlRightChange = setHasControlRight;
|
||||
controller.onRequestControlStatusChange = setConnecting;
|
||||
controller.onWsStatusChange = setWsStatus;
|
||||
controller.handleArrivedPoint = handleFinishEdPoint;
|
||||
|
||||
|
||||
controller.onPermissionRequest = (content) => {
|
||||
setModalContent(content);
|
||||
@@ -628,7 +638,7 @@ export default function DeviceStatusPage({
|
||||
>
|
||||
{!isUAV && (
|
||||
<Space style={{ marginBottom: 8 }}>
|
||||
<Button type={mowerView === 'front' ? 'primary' : 'default'} icon={<CameraOutlined />} onClick={() => setMowerView('front')}>前视</Button>
|
||||
<Button type={mowerView === 'front' ? 'primary' : 'default'} onClick={() => setMowerView('front')}>前视</Button>
|
||||
<Button type={mowerView === 'back' ? 'primary' : 'default'} onClick={() => setMowerView('back')}>后视</Button>
|
||||
<Button type={mowerView === 'left' ? 'primary' : 'default'} onClick={() => setMowerView('left')}>左视</Button>
|
||||
<Button type={mowerView === 'right' ? 'primary' : 'default'} onClick={() => setMowerView('right')}>右视</Button>
|
||||
@@ -658,101 +668,12 @@ export default function DeviceStatusPage({
|
||||
) : robotVideo ? (
|
||||
// 全景模式 = T 型排布
|
||||
mowerView === 'all' ? (
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
gap: 8, // 窗口之间间距
|
||||
padding: 8,
|
||||
boxSizing: 'border-box',
|
||||
overflow: 'auto' // 固定宽高后超出滚动
|
||||
}}>
|
||||
{/* 第一行:左视 + 前视 + 右视 三等分 */}
|
||||
<div style={{ display: 'flex', gap: 8, justifyContent: 'center' }}>
|
||||
{/* 左视 */}
|
||||
<div style={{
|
||||
width: 360, // 固定宽度
|
||||
height: 240, // 固定高度
|
||||
position: 'relative',
|
||||
border: '1px solid #eae4e4',
|
||||
flexShrink: 0,// 禁止压缩
|
||||
borderRadius: 8,
|
||||
}}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={3}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>左视</div>
|
||||
</div>
|
||||
|
||||
{/* 前视 */}
|
||||
<div style={{
|
||||
width: 360,
|
||||
height: 240,
|
||||
position: 'relative',
|
||||
border: '1px solid #eae4e4',
|
||||
flexShrink: 0,// 禁止压缩
|
||||
borderRadius: 8,
|
||||
}}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={1}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>前视</div>
|
||||
</div>
|
||||
|
||||
{/* 右视 */}
|
||||
<div style={{
|
||||
width: 360,
|
||||
height: 240,
|
||||
position: 'relative',
|
||||
border: '1px solid #eae4e4',
|
||||
flexShrink: 0,// 禁止压缩
|
||||
borderRadius: 8,
|
||||
}}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={4}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>右视</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 第二行:后视 单独一行居中 */}
|
||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||
<div style={{
|
||||
width: 360,
|
||||
height: 240,
|
||||
position: 'relative',
|
||||
border: '1px solid #eae4e4',
|
||||
flexShrink: 0,// 禁止压缩
|
||||
borderRadius: 8,
|
||||
}}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={2}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>后视</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<MowerAllView
|
||||
serialNumber={serialNumber}
|
||||
robotVideo={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
) : (
|
||||
// 单画面模式
|
||||
<VideoPlayer
|
||||
@@ -822,6 +743,7 @@ export default function DeviceStatusPage({
|
||||
realtimePosition={realtimePosition}
|
||||
realtimeType={realtimeType}
|
||||
drawRealTime={true}
|
||||
finishPoint={arrivedPoint}
|
||||
ifClearNavLine={clearNavLine}
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
/>
|
||||
@@ -987,6 +909,6 @@ export default function DeviceStatusPage({
|
||||
>
|
||||
<p>{modalContent.content}</p>
|
||||
</Modal>
|
||||
</div>
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user