fix: 记录查询列表显示 ICCID、设备号、套餐名称、运营商名称与操作人,不再显示内部 ID
Some checks failed
构建并部署前端到测试环境 / deploy (push) Has been cancelled

- 卡 / 设备列优先显示 ICCID、设备号(IMEI),后端未返回时才退回内部 ID
- 运营商账户筛选改为按名称搜索
This commit is contained in:
邹进
2026-11-07 17:07:31 +09:00
parent 984db9889c
commit 3411b66c71
9 changed files with 163 additions and 43 deletions

View File

@@ -125,6 +125,30 @@ export function formatMb(value: unknown): string {
return `${Number.isInteger(number) ? number : number.toFixed(2)} MB`
}
/** 卡 / 设备展示:优先 ICCID、设备号(IMEI),都没有时才显示内部 ID */
export function assetDisplay(row: {
iot_card_id?: number | null
iccid?: string
device_id?: number | null
device_virtual_no?: string
device_imei?: string
}): string {
if (row.iccid) return row.iccid
if (row.device_virtual_no || row.device_imei) {
const no = row.device_virtual_no || row.device_imei
return row.device_imei && row.device_imei !== no
? `${no}(IMEI ${row.device_imei})`
: String(no)
}
if (row.iot_card_id) return `卡ID ${row.iot_card_id}`
if (row.device_id) return `设备ID ${row.device_id}`
return '-'
}
/** 名称为空时退回显示 ID */
export const nameOrId = (name?: string, id?: number | null, idLabel = 'ID'): string =>
name || (id ? `${idLabel} ${id}` : '-')
export function errorMessage(error: unknown): string {
const data = (error as { response?: { data?: { msg?: string; message?: string } } })?.response
?.data