diff --git a/src/api/rfid/dashboard/index.ts b/src/api/rfid/dashboard/index.ts index d30aa7d..773743b 100644 --- a/src/api/rfid/dashboard/index.ts +++ b/src/api/rfid/dashboard/index.ts @@ -6,7 +6,8 @@ import { LocationTreeNode, SuccessRateTrend, StatisticsOverview, - AlarmStatVO + AlarmStatVO, + DeviceLatestRecordVO } from './types'; // ==================== 新增接口(按需刷新) ==================== @@ -50,6 +51,17 @@ export const getSuccessRateTrends = (): AxiosPromise => { }); }; +/** + * 【接口4】获取设备最新读取记录 + * 返回每个设备的最新一条读取记录,包括设备ID、编号、最新条码和时间 + */ +export const getDeviceLatestRecords = (): AxiosPromise => { + return request({ + url: '/rfid/dashboard/deviceLatestRecords', + method: 'get' + }); +}; + // ==================== 原有接口(保留) ==================== /** diff --git a/src/api/rfid/dashboard/types.ts b/src/api/rfid/dashboard/types.ts index 6c0e767..7ea0598 100644 --- a/src/api/rfid/dashboard/types.ts +++ b/src/api/rfid/dashboard/types.ts @@ -129,3 +129,22 @@ export interface SuccessRateTrend { /** 昨日同一小时成功率 */ yesterdaySuccessRate: number | null; } + +/** + * 设备最新读取记录(接口4返回) + * 返回每个设备的最新一条读取记录信息 + */ +export interface DeviceLatestRecordVO { + /** 设备ID */ + deviceId: number; + /** 设备编号 */ + deviceCode: string; + /** 设备名称 */ + deviceName: string; + /** 最新条码信息 */ + latestBarcode: string | null; + /** 最新记录时间 */ + latestRecordTime: string | null; + /** 读取状态 (1-成功; 0-失败) */ + readStatus: string | null; +}