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

@@ -89,6 +89,7 @@ export interface AssetResolveResponse {
supplier?: string // 供应商
activation_status?: number // 激活状态
enable_polling?: boolean // 是否参与轮询
gateway_card_imei?: string // Gateway 返回的卡 IMEI
gateway_extend?: string // Gateway 卡状态扩展字段,原样返回上游 extend
// ===== 设备专属字段 (asset_type === 'device' 时) =====
@@ -181,6 +182,7 @@ export interface AssetRealtimeStatusResponse {
network_status?: NetworkStatus // 网络状态(仅 card
real_name_status?: RealNameStatus // 实名状态(仅 card
realname_policy?: string // 实名认证策略(仅 card
gateway_card_imei?: string // Gateway 返回的卡 IMEI
current_month_usage_mb?: number // 本月已用流量 MB仅 card
last_gateway_reading_mb?: number // 运营商周期月内已用流量 MB仅 card
last_sync_time?: string | null // 最后同步时间(仅 card

View File

@@ -353,6 +353,7 @@ export interface StandaloneCardQueryParams extends PaginationParams {
// 单卡信息
export interface StandaloneIotCard {
gateway_card_imei?: string // 网关侧返回的卡 IMEI可空
id: number // 卡ID
iccid: string // ICCID
imsi?: string // IMSI (可选)

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

View File

@@ -1094,6 +1094,7 @@ const formItems: SearchFormItem[] = baseFormItems
// 列配置
const columnOptions = [
{ label: 'ICCID', prop: 'iccid' },
{ label: 'IMEI', prop: 'gateway_card_imei' },
{ label: 'MSISDN', prop: 'msisdn' },
{ label: '卡虚拟号', prop: 'virtual_no' },
{ label: '运营商', prop: 'carrier_name' },
@@ -1226,6 +1227,13 @@ const { columnChecks, columns } = useCheckedColumns(() => [
)
}
},
{
prop: 'gateway_card_imei',
label: 'IMEI',
width: 180,
showOverflowTooltip: true,
formatter: (row: StandaloneIotCard) => row.gateway_card_imei || '-'
},
{
prop: 'msisdn',
label: 'MSISDN',