Files
one-pipe-system/openspec/changes/update-asset-device-detail-bound-card-status-source/proposal.md
sexygoat dfb78006ac
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m15s
fix: 分页器一直显示和资产信息使用单卡
2026-05-21 14:39:21 +08:00

44 lines
2.5 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
当前后台“资产信息”的设备详情里,`实名状态``在线状态``实名时间` 这三个字段的取值来源不一致:
- `实名状态` 当前优先读取设备绑定卡中的当前卡状态
- `在线状态` 仍读取设备顶层 `online_status`
- `实名时间` 仍读取设备顶层 `real_name_at`
当设备只绑定一张卡,或设备绑定多张卡并发生切卡时,这三个字段可能分别来自不同对象,导致页面展示口径不一致,运营人员无法准确判断“当前使用卡”的实名与联网状态。
后端已经在设备资产详情的 `cards` 列表中返回每张绑定卡的 `real_name_status``network_status``real_name_at``is_current`。前端需要明确统一取值规则,避免继续混用设备顶层字段和绑定卡字段。
## What Changes
- 更新后台“资产信息”的设备详情字段取值规则:
-`cards` 只有一张绑定卡时,`实名状态``在线状态``实名时间` 直接取该卡的 `real_name_status``network_status``real_name_at`
-`cards` 有多张绑定卡时,以上三个字段统一取 `is_current=true` 的绑定卡
- 设备详情这三个字段不再在存在可选绑定卡时混用设备顶层 `real_name_status``online_status``real_name_at`
- 当前端无法选出符合规则的绑定卡时:
- 保留字段标签
- 显示稳定占位内容
- 不得猜测性回退到任意非当前卡
- 更新资产详情绑定卡契约与状态合并规范:
- 绑定卡记录需要支持 `real_name_at`
- 刷新设备实时状态后,不得无故丢失已解析出的绑定卡 `real_name_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:
- 依赖后端继续在设备资产详情 `cards` 列表中返回 `real_name_status``network_status``real_name_at``is_current`
- 与活跃变更 `update-device-activation-status-filter-and-display` 共享 `asset-information` 的设备基础信息展示区域
- 与活跃变更 `update-asset-realtime-sync-timestamps-display` 共享设备绑定卡状态合并逻辑
- Breaking changes:
- 无外部接口 breaking change本次仅调整后台设备详情字段取值口径