Files
one-pipe-system/openspec/changes/update-asset-realtime-sync-timestamps-display/proposal.md
sexygoat 894aea0e74
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m56s
feat: 新增卡视角以及设备视角的实名同步时间,卡状态同步时间,流量同步时间
2026-05-18 12:23:35 +08:00

41 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Change: 更新后台资产信息同步时间展示
## Why
当前后台“资产信息”页虽然已经展示卡状态、实名状态和部分实时信息,但还缺少运营判断数据新鲜度所需的三个时间字段:实名同步时间、卡状态同步时间、流量同步时间。
- 卡资产的 `GET /api/admin/assets/:identifier/realtime-status` 已在顶层返回 `last_real_name_check_at``last_card_status_check_at``last_data_check_at`,但前端未展示。
- 设备资产的同一接口会在 `cards` 列表中按绑定卡返回这三个字段;当前“设备实时信息”区块只消费 `device_realtime`,无法展示当前使用卡的同步时间。
如果不补齐这三个字段,后台在卡页和设备页都无法快速确认上游同步是否及时,也不利于定位实名、停复机和流量状态的延迟问题。
## What Changes
- 更新后台“资产信息”的卡资产“卡信息”区域:
- 新增 `实名同步时间`,映射 `last_real_name_check_at`
- 新增 `卡状态同步时间`,映射 `last_card_status_check_at`
- 新增 `流量同步时间`,映射 `last_data_check_at`
- 更新后台“资产信息”的设备资产“设备实时信息”区域:
- 直接读取设备实时接口 `data` 顶层的 `last_real_name_check_at``last_card_status_check_at``last_data_check_at`
- 当对应字段为空时,显示稳定占位内容
- 更新前端资产实时状态契约和数据合并逻辑:
- 支持卡资产顶层这三个同步时间字段
- 支持设备绑定卡记录中的这三个同步时间字段
- 刷新后合并绑定卡实时数据时,不得丢失这三个字段
## Impact
- Affected specs:
- `asset-information`
- Affected code:
- `src/types/api/asset.ts`
- `src/views/asset-management/asset-information/types.ts`
- `src/views/asset-management/asset-information/composables/useAssetInfo.ts`
- `src/views/asset-management/asset-information/components/BasicInfoCard.vue`
- Dependencies:
- 与活跃变更 `update-admin-asset-device-signal-and-audit-logs` 共享 `asset-information` 能力和 `BasicInfoCard.vue` / `useAssetInfo.ts` 文件范围
- 与活跃变更 `update-order-upload-and-device-switch-mode` 共享设备实时信息区块
- 依赖后端继续按当前接口返回这三个时间字段,无需新增接口
- Breaking changes:
- 无外部接口 breaking change本次仅为前端展示契约和页面展示的增量调整