机器人
This commit is contained in:
@@ -187,7 +187,7 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
|
||||
{ title: '操作', key: 'action', width: 100, render: () => <Space><Button size="small" type="text" icon={<EditOutlined />} /><Button size="small" type="text" icon={<SettingOutlined />} /></Space> }
|
||||
]}
|
||||
dataSource={dynamicScheduleList}
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 'max-content', y: 320 }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -247,14 +247,24 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 12, maxHeight: "100px", overflow: "auto", scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 12, maxHeight: "160px", overflow: "auto", scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>产品类型</span>
|
||||
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.productName)}</span>
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>设备SN</span>
|
||||
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}</span>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 8 }}>
|
||||
<span style={{ color: '#666', fontSize: 12, whiteSpace: 'nowrap' }}>设备SN</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 12,
|
||||
wordBreak: 'break-all', // 强制换行
|
||||
whiteSpace: 'normal', // 允许换行
|
||||
textAlign: 'right', // 右对齐
|
||||
maxWidth: '70%', // 限制宽度,避免撑满
|
||||
}}
|
||||
>
|
||||
{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
||||
</span>
|
||||
</div>
|
||||
{selectedDevice.activeTime && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
@@ -268,14 +278,15 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
|
||||
<span style={{ fontSize: 12 }}>v{selectedDevice.firmwareVersion}</span>
|
||||
</div>
|
||||
)}
|
||||
{selectedDevice.device_sn && (
|
||||
{/* 无人机特定信息 */}
|
||||
{(selectedDevice.productName?.includes('无人机') || selectedDevice.device_sn) && (
|
||||
<>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>高度</span>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>飞行高度</span>
|
||||
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.height)} m</span>
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>风速</span>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>飞行风速</span>
|
||||
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.wind_speed)} m/s</span>
|
||||
</div>
|
||||
</>
|
||||
@@ -300,11 +311,14 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
|
||||
</div>
|
||||
<div style={{ width: '100%', height: 160, borderRadius: 8, position: 'relative', overflow: 'hidden', background: '#000' }}>
|
||||
<DroneLivePlayer streamData={planeVideo?.[0] || null} />
|
||||
{selectedDevice.device_sn && (
|
||||
<div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, background: 'rgba(0,0,0,0.6)', color: '#fff', display: 'flex', justifyContent: 'space-between', padding: '8px 12px', fontSize: 14 }}>
|
||||
<span>高度 {fix2(selectedDevice.height)}m</span>
|
||||
<span>风速 {fix2(selectedDevice.wind_speed)}m/s</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
<div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, background: 'rgba(0,0,0,0.6)', color: '#fff', display: 'flex', justifyContent: 'space-between', padding: '8px 12px', fontSize: 14 }}>
|
||||
<span>高度 {fix2(selectedDevice.height)}m</span>
|
||||
<span>风速 {fix2(selectedDevice.wind_speed)}m/s</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -347,21 +361,41 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card title="环境与飞行条件" bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
|
||||
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
|
||||
<div style={{ display: "flex", border: "1px solid #e8e8e8", borderRadius: 12, overflow: "hidden", flex: 1 }}>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>风速</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.wind_speed)} m/s</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>温度</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.environment_temperature)}℃</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>降雨</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{getVal(selectedDevice?.rainfall)}</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>RTK</div><div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>{selectedDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</div></div>
|
||||
{/* 条件渲染:只有无人机显示环境与飞行条件 */}
|
||||
{(selectedDevice?.productName?.includes('无人机') || selectedDevice?.device_sn) && (
|
||||
<Card title="环境与飞行条件" bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
|
||||
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
|
||||
<div style={{ display: "flex", border: "1px solid #e8e8e8", borderRadius: 12, overflow: "hidden", flex: 1 }}>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>风速</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.wind_speed)} m/s</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>温度</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.environment_temperature)}℃</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>降雨</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{getVal(selectedDevice?.rainfall)}</div></div>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>RTK</div><div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>{selectedDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</div></div>
|
||||
</div>
|
||||
<div style={{ width: 110, padding: '12px 8px', borderRadius: 8, background: '#f6ffed', border: '1px solid #b7eb8f', textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a' }}>适宜执行</div>
|
||||
<div style={{ width: 18, height: 18, borderRadius: '50%', background: '#52c41a', display: 'flex', alignItems: 'center', justifyContent: 'center' }}><CheckCircleOutlined style={{ fontSize: 12, color: '#fff' }} /></div>
|
||||
<div style={{ fontSize: 11, color: '#666' }}>可正常作业</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 110, padding: '12px 8px', borderRadius: 8, background: '#f6ffed', border: '1px solid #b7eb8f', textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a' }}>适宜执行</div>
|
||||
<div style={{ width: 18, height: 18, borderRadius: '50%', background: '#52c41a', display: 'flex', alignItems: 'center', justifyContent: 'center' }}><CheckCircleOutlined style={{ fontSize: 12, color: '#fff' }} /></div>
|
||||
<div style={{ fontSize: 11, color: '#666' }}>可正常作业</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{/* 条件渲染:机器人显示其余信息(此处以任务详情为例) */}
|
||||
{(!selectedDevice?.productName?.includes('无人机') && !selectedDevice?.device_sn) && (
|
||||
<Card title="机器人作业状态" bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Statistic title="累计里程" value={128.5} suffix="km" valueStyle={{ fontSize: 20 }} />
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Statistic title="本次作业耗时" value={45} suffix="min" valueStyle={{ fontSize: 20 }} />
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Statistic title="预计剩余时间" value={12} suffix="min" valueStyle={{ fontSize: 20 }} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
<Card title={<><ClockCircleOutlined /> 任务执行时间线</>} bordered={false} style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}>今天 2025-05-24</div>}>
|
||||
<Timeline mode="left">
|
||||
|
||||
Reference in New Issue
Block a user