From 3411b66c71345e4005e0275b30e7b859c4967470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E8=BF=9B?= Date: Sat, 7 Nov 2026 17:07:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=20ICCID=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8F=B7=E3=80=81=E5=A5=97=E9=A4=90=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E3=80=81=E8=BF=90=E8=90=A5=E5=95=86=E5=90=8D=E7=A7=B0=E4=B8=8E?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BA=BA=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=86=85=E9=83=A8=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 卡 / 设备列优先显示 ICCID、设备号(IMEI),后端未返回时才退回内部 ID - 运营商账户筛选改为按名称搜索 --- scripts/tests/trafficRecords.test.mjs | 34 +++++++++++++++++++ .../traffic-records/CardDailyUsages.vue | 23 +++++++------ .../PackageTrafficAdjustments.vue | 30 +++++++++------- .../PackageUsageDailyRecords.vue | 31 ++++++++++------- .../RefundPostProcessAttempts.vue | 11 +++++- .../TrafficCollectionRecords.vue | 15 ++++---- src/composables/useRecordList.ts | 25 +++++++++++++- src/types/api/trafficRecords.ts | 13 +++++++ src/utils/business/trafficRecords.ts | 24 +++++++++++++ 9 files changed, 163 insertions(+), 43 deletions(-) diff --git a/scripts/tests/trafficRecords.test.mjs b/scripts/tests/trafficRecords.test.mjs index c91b516..a0c1d55 100644 --- a/scripts/tests/trafficRecords.test.mjs +++ b/scripts/tests/trafficRecords.test.mjs @@ -110,3 +110,37 @@ test('退款后处理状态与权限码常量', () => { assert.equal(constants.labelOf(constants.TRAFFIC_DECISION_LABELS, 'new_value'), 'new_value') assert.equal(constants.labelOf(constants.TRAFFIC_DECISION_LABELS, ''), '-') }) + +test('卡 / 设备展示优先用 ICCID、设备号,没有时才显示内部 ID', () => { + assert.equal( + utils.assetDisplay({ iot_card_id: 367218, iccid: '89860624660030813727' }), + '89860624660030813727' + ) + assert.equal( + utils.assetDisplay({ + device_id: 49323, + device_virtual_no: '60003081372', + device_imei: '869555083099518' + }), + '60003081372(IMEI 869555083099518)' + ) + assert.equal( + utils.assetDisplay({ + device_id: 1, + device_virtual_no: '862639078983683', + device_imei: '862639078983683' + }), + '862639078983683' + ) + assert.equal( + utils.assetDisplay({ device_id: 1, device_imei: '869555083099518' }), + '869555083099518' + ) + assert.equal(utils.assetDisplay({ iot_card_id: 367218 }), '卡ID 367218') + assert.equal(utils.assetDisplay({ device_id: 49323 }), '设备ID 49323') + assert.equal(utils.assetDisplay({}), '-') + assert.equal(utils.nameOrId('移动账户A', 3), '移动账户A') + assert.equal(utils.nameOrId('', 3), 'ID 3') + assert.equal(utils.nameOrId('', 7, '账号ID'), '账号ID 7') + assert.equal(utils.nameOrId(undefined, 0), '-') +}) diff --git a/src/components/business/traffic-records/CardDailyUsages.vue b/src/components/business/traffic-records/CardDailyUsages.vue index 3511e27..13abb74 100644 --- a/src/components/business/traffic-records/CardDailyUsages.vue +++ b/src/components/business/traffic-records/CardDailyUsages.vue @@ -23,7 +23,9 @@ - + + + @@ -47,10 +49,10 @@