Files
web-Iot/src/components/devices/mowerAllView.jsx

124 lines
2.9 KiB
React
Raw Normal View History

2026-07-23 14:04:59 +08:00
2026-06-15 09:20:01 +08:00
import VideoPlayer from '../VideoPlayer.tsx';
2026-07-23 14:04:59 +08:00
export function MowerAllView({ serialNumber, robotVideo, error, ready }) {
2026-07-08 11:23:03 +08:00
return (
2026-07-23 14:04:59 +08:00
<div style={{
display: 'flex',
width: '100%',
height: '100%',
gap: 8, // 三列之间间距
padding: 8,
boxSizing: 'border-box',
overflow: 'auto'
}}>
{/* ========== 左列:左视 ========== */}
2026-07-08 11:23:03 +08:00
<div style={{
2026-07-23 14:04:59 +08:00
flex: 1,
display: 'flex',
flexDirection: 'column',
gap: 8,
2026-07-08 11:23:03 +08:00
}}>
2026-07-23 14:04:59 +08:00
<div style={{
flex: 1,
position: 'relative',
border: '1px solid #eae4e4',
flexShrink: 0,
borderRadius: 8,
overflow: "hidden",
maxHeight: 240,
transform: 'translateY(50%)'
2026-07-08 10:25:11 +08:00
2026-07-23 14:04:59 +08:00
}}>
<VideoPlayer
deviceId={serialNumber}
2026-07-08 11:23:03 +08:00
idx={3}
2026-07-23 14:04:59 +08:00
className="w-full h-full object-contain"
video={robotVideo}
2026-07-08 11:23:03 +08:00
error={error}
ready={ready}
/>
2026-07-23 14:04:59 +08:00
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>左视</div>
</div>
</div>
{/* ========== 中列:上-前视 下-后视 ========== */}
<div style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
gap: 8,
}}>
{/* 前视 */}
<div style={{
position: 'relative',
border: '1px solid #eae4e4',
flexShrink: 0,
borderRadius: 8,
overflow: "hidden",
height: 240
}}>
<VideoPlayer
deviceId={serialNumber}
idx={1}
className="w-full h-full object-contain"
video={robotVideo}
2026-07-08 11:23:03 +08:00
error={error}
ready={ready}
/>
2026-07-23 14:04:59 +08:00
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>前视</div>
</div>
{/* 后视 */}
<div style={{
height: 240,
position: 'relative',
border: '1px solid #eae4e4',
flexShrink: 0,
borderRadius: 8,
overflow: "hidden"
}}>
<VideoPlayer
deviceId={serialNumber}
2026-07-08 11:23:03 +08:00
idx={2}
2026-07-23 14:04:59 +08:00
className="w-full h-full object-contain"
video={robotVideo}
2026-07-08 11:23:03 +08:00
error={error}
ready={ready}
/>
2026-07-23 14:04:59 +08:00
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>后视</div>
</div>
</div>
2026-07-08 11:23:03 +08:00
2026-07-23 14:04:59 +08:00
<div style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
gap: 8,
}}>
2026-06-15 09:20:01 +08:00
<div style={{
2026-07-23 14:04:59 +08:00
flex: 1,
position: 'relative',
border: '1px solid #eae4e4',
flexShrink: 0,
2026-06-15 09:20:01 +08:00
borderRadius: 8,
2026-07-23 14:04:59 +08:00
overflow: "hidden",
maxHeight: 240,
transform: 'translateY(50%)'
2026-06-15 09:20:01 +08:00
}}>
2026-07-23 14:04:59 +08:00
<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>
2026-06-15 09:20:01 +08:00
</div>
2026-07-23 14:04:59 +08:00
</div>
2026-06-15 09:20:01 +08:00
</div>
2026-07-23 14:04:59 +08:00
)
2026-06-15 09:20:01 +08:00
}