feat: 卡新增IMEI
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m47s

This commit is contained in:
sexygoat
2026-05-26 18:07:39 +08:00
parent 878d93a865
commit fe0093972f
10 changed files with 152 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
<!-- 卡专属字段 -->
<template v-if="cardInfo?.asset_type === 'card'">
<ElDescriptionsItem label="ICCID">{{ cardInfo?.iccid || '-' }}</ElDescriptionsItem>
<ElDescriptionsItem label="IMEI">{{ cardInfo?.gateway_card_imei || '-' }}</ElDescriptionsItem>
<ElDescriptionsItem label="运营商账户">{{
cardInfo?.carrier_name || '-'
}}</ElDescriptionsItem>
@@ -521,6 +522,7 @@
series_name?: string
real_name_at?: string | null
supplier?: string
gateway_card_imei?: string
gateway_extend?: string
last_sync_time?: string | null
last_data_check_at?: string | null

View File

@@ -20,6 +20,9 @@ type TrafficDisplaySource = {
enable_virtual_data?: boolean | null
}
const normalizeOptionalText = (value?: string | null) =>
typeof value === 'string' ? value.trim() : ''
const NULLABLE_REALTIME_CARD_FIELDS = new Set([
'last_data_check_at',
'last_real_name_check_at',
@@ -92,6 +95,7 @@ export function useAssetInfo() {
if (response.code === 0 && response.data) {
const data = response.data
const resolvedGatewayCardImei = normalizeOptionalText(data.gateway_card_imei)
// 获取资产标识符
const assetIdentifier = data.asset_type === 'card' ? data.iccid : data.virtual_no
@@ -128,6 +132,8 @@ export function useAssetInfo() {
carrier_name: data.carrier_name || '',
supplier: data.supplier || '',
network_status: data.network_status,
gateway_card_imei: resolvedGatewayCardImei,
resolved_gateway_card_imei: resolvedGatewayCardImei,
gateway_extend: data.gateway_extend ?? '',
bound_device_id: data.bound_device_id,
bound_device_no: data.bound_device_no || '',
@@ -307,6 +313,13 @@ export function useAssetInfo() {
if (data.real_name_status !== undefined) {
cardInfo.value.real_name_status = data.real_name_status
}
if ('gateway_card_imei' in data) {
const resolvedGatewayCardImei = normalizeOptionalText(
cardInfo.value?.resolved_gateway_card_imei
)
cardInfo.value.gateway_card_imei =
resolvedGatewayCardImei || normalizeOptionalText(data.gateway_card_imei)
}
if (data.last_sync_time !== undefined) {
cardInfo.value.last_sync_time = data.last_sync_time
}

View File

@@ -28,6 +28,7 @@ export interface AssetInfo {
sn?: string
cards?: BindingCard[]
status?: number
gateway_card_imei?: string
gateway_extend?: string
last_sync_time?: string | null
last_data_check_at?: string | null