设备状态界面

This commit is contained in:
mmc
2026-05-12 08:34:13 +08:00
parent daf93a50e2
commit 0999d1b739
51 changed files with 1788 additions and 31 deletions

View File

@@ -51,7 +51,13 @@ export default function DeviceIndexPage() {
setDevices(devData);
setPlaneDevices(planeData);
setDevicesAll([...devData, ...planeData]);
const all = [...devData, ...planeData];
setDevicesAll(all);
// 如果当前没选中,默认选第一个
if (!selectedSn && all.length > 0) {
setSelectedSn(all[0].device_sn || all[0].serialNumber);
}
} catch (err) {
console.error('数据请求失败', err);
@@ -74,6 +80,8 @@ export default function DeviceIndexPage() {
planedevices={planedevices}
devicesAll={devicesAll}
onViewStatus={handleViewStatus}
selectedSn={selectedSn}
onDeviceSelect={(sn) => setSelectedSn(sn)}
/>;
}
if (activeTab === 'status') {