优化一些细节

This commit is contained in:
mmc
2026-11-16 14:33:48 +08:00
parent 831e1086d3
commit d9f4b752dd
5 changed files with 71 additions and 53 deletions

View File

@@ -423,7 +423,7 @@ export default function DeviceOverviewPage() {
if (!selectedDevice) return null;
const sn = selectedDevice.device_sn || selectedDevice.serialNumber;
const wsData = realtimeMap[sn] || {};
setDeviceStatistics(wsData || {})
//setDeviceStatistics(wsData || {})
return {
@@ -1181,7 +1181,7 @@ export default function DeviceOverviewPage() {
</div>
<div style={{ display: 'flex', justifyContent: "space-between", flexWrap: 'wrap', gap: 6 }}>
<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleStart}>{t('devices.s23')}</Button>
{/*<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleStart}>{t('devices.s23')}</Button>*/}
{/*<Button style={{ borderRadius: 8, flex: 1 }} onClick={handlePause}>{t('video.pause')}</Button>*/}
<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleAutoBack}>{t('devices.returnHome')}</Button>
{/*<Button style={{ flex: 1, background: '#52c41a', borderColor: '#52c41a', color: "#fff", borderRadius: 8, }} onClick={handleRecharge}>{t('devices.s24')}</Button>*/}
@@ -1359,9 +1359,9 @@ export default function DeviceOverviewPage() {
}}
>
<Statistic
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.statTotalDistance')}</span>}
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.statTotalDistance')}(m)</span>}
value={deviceStatistics?.distance ? Number(deviceStatistics.distance).toFixed(2) : Number(deviceStatistics?.workArea / 0.7 || 0).toFixed(2)}
suffix="m"
suffix=""
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
/>
</div>
@@ -1378,9 +1378,9 @@ export default function DeviceOverviewPage() {
}}
>
<Statistic
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s50')}</span>}
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s50')}(㎡)</span>}
value={Number(deviceStatistics?.workArea || 0).toFixed(2)}
suffix="㎡"
suffix=""
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
/>
</div>
@@ -1397,9 +1397,9 @@ export default function DeviceOverviewPage() {
}}
>
<Statistic
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s51')}</span>}
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s51')}(min)</span>}
value={Number(deviceStatistics?.time || 0).toFixed(2)}
suffix="min"
suffix=""
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
/>
</div>