s摄像头布局修改
This commit is contained in:
@@ -5,24 +5,30 @@ export function MowerAllView({ serialNumber, robotVideo, error, ready }) {
|
|||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
gap: 8, // 窗口之间间距
|
gap: 8, // 三列之间间距
|
||||||
padding: 8,
|
padding: 8,
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
overflow: 'auto' // 固定宽高后超出滚动
|
overflow: 'auto'
|
||||||
|
}}>
|
||||||
|
{/* ========== 左列:左视 ========== */}
|
||||||
|
<div style={{
|
||||||
|
flex: 1,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: 8,
|
||||||
}}>
|
}}>
|
||||||
{/* 第一行:左视 + 前视 + 右视 三等分 */}
|
|
||||||
<div style={{ display: 'flex', gap: 8, justifyContent: 'center' }}>
|
|
||||||
{/* 左视 */}
|
|
||||||
<div style={{
|
<div style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
border: '1px solid #eae4e4',
|
border: '1px solid #eae4e4',
|
||||||
flexShrink: 0,// 禁止压缩
|
flexShrink: 0,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: "hidden"
|
overflow: "hidden",
|
||||||
|
maxHeight: 240,
|
||||||
|
transform: 'translateY(50%)'
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
deviceId={serialNumber}
|
deviceId={serialNumber}
|
||||||
@@ -34,16 +40,23 @@ export function MowerAllView({ serialNumber, robotVideo, error, ready }) {
|
|||||||
/>
|
/>
|
||||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>左视</div>
|
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>左视</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* 前视 */}
|
{/* ========== 中列:上-前视 下-后视 ========== */}
|
||||||
<div style={{
|
<div style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: 8,
|
||||||
|
}}>
|
||||||
|
{/* 前视 */}
|
||||||
|
<div style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
border: '1px solid #eae4e4',
|
border: '1px solid #eae4e4',
|
||||||
flexShrink: 0,// 禁止压缩
|
flexShrink: 0,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: "hidden"
|
overflow: "hidden",
|
||||||
|
height: 240
|
||||||
}}>
|
}}>
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
deviceId={serialNumber}
|
deviceId={serialNumber}
|
||||||
@@ -55,17 +68,43 @@ export function MowerAllView({ serialNumber, robotVideo, error, ready }) {
|
|||||||
/>
|
/>
|
||||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>前视</div>
|
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>前视</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* 后视 */}
|
||||||
{/* 右视 */}
|
|
||||||
<div style={{
|
<div style={{
|
||||||
flex: 1,
|
|
||||||
//width: 360,
|
|
||||||
height: 240,
|
height: 240,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
border: '1px solid #eae4e4',
|
border: '1px solid #eae4e4',
|
||||||
//flexShrink: 0,// 禁止压缩
|
flexShrink: 0,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: "hidden"
|
overflow: "hidden"
|
||||||
|
}}>
|
||||||
|
<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 style={{
|
||||||
|
flex: 1,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: 8,
|
||||||
|
}}>
|
||||||
|
<div style={{
|
||||||
|
flex: 1,
|
||||||
|
position: 'relative',
|
||||||
|
border: '1px solid #eae4e4',
|
||||||
|
flexShrink: 0,
|
||||||
|
borderRadius: 8,
|
||||||
|
overflow: "hidden",
|
||||||
|
maxHeight: 240,
|
||||||
|
transform: 'translateY(50%)'
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
@@ -79,30 +118,6 @@ export function MowerAllView({ serialNumber, robotVideo, error, ready }) {
|
|||||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>右视</div>
|
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>右视</div>
|
||||||
</div>
|
</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,
|
|
||||||
overflow: "hidden"
|
|
||||||
|
|
||||||
}}>
|
|
||||||
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user