From c66d18182fc85b8f1747753626da253777f49679 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Thu, 4 Dec 2025 09:27:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(api/rfid):=20=E6=96=B0=E5=A2=9E=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=AE=BE=E5=A4=87=E6=9C=80=E6=96=B0=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 getDeviceLatestRecords 接口,获取每个设备的最新读取记录 - 返回数据包括设备ID、编号、名称、最新条码、时间和读取状态 - 在 types.ts 中新增 DeviceLatestRecordVO 类型定义 - 更新接口导出列表,包含新类型 DeviceLatestRecordVO --- src/api/rfid/dashboard/index.ts | 14 +++++++++++++- src/api/rfid/dashboard/types.ts | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) 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; +}