fix: 分页器一直显示和资产信息使用单卡
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m15s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m15s
This commit is contained in:
@@ -107,9 +107,14 @@
|
||||
</ElTag>
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="实名状态">
|
||||
<ElTag :type="getRealNameStatusType(currentCard?.real_name_status)" size="small">
|
||||
{{ getRealNameStatusName(currentCard?.real_name_status) }}
|
||||
<ElTag
|
||||
v-if="selectedDeviceStatusCard"
|
||||
:type="getRealNameStatusType(selectedDeviceStatusCard.real_name_status)"
|
||||
size="small"
|
||||
>
|
||||
{{ getRealNameStatusName(selectedDeviceStatusCard.real_name_status) }}
|
||||
</ElTag>
|
||||
<span v-else>-</span>
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="激活状态">
|
||||
{{ cardInfo?.activation_status_name || '-' }}
|
||||
@@ -119,12 +124,19 @@
|
||||
cardInfo?.device_model || '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="实名时间">{{
|
||||
cardInfo?.real_name_at ? formatDateTime(cardInfo.real_name_at) : '-'
|
||||
selectedDeviceStatusCard?.real_name_at
|
||||
? formatDateTime(selectedDeviceStatusCard.real_name_at)
|
||||
: '-'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="在线状态">
|
||||
<ElTag :type="getOnlineStatusType(cardInfo?.online_status)" size="small">
|
||||
{{ getOnlineStatusName(cardInfo?.online_status) }}
|
||||
<ElTag
|
||||
v-if="selectedDeviceStatusCard?.network_status !== undefined"
|
||||
:type="selectedDeviceStatusCard.network_status === 1 ? 'success' : 'danger'"
|
||||
size="small"
|
||||
>
|
||||
{{ selectedDeviceStatusCard.network_status === 1 ? '正常' : '停机' }}
|
||||
</ElTag>
|
||||
<span v-else>-</span>
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="虚拟号">{{ cardInfo?.virtual_no || '-' }}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="切卡模式">{{
|
||||
@@ -478,7 +490,7 @@
|
||||
is_current: boolean
|
||||
network_status?: number
|
||||
real_name_status?: number
|
||||
real_name_at?: string
|
||||
real_name_at?: string | null
|
||||
realname_policy?: string
|
||||
gateway_extend?: string
|
||||
last_data_check_at?: string | null
|
||||
@@ -507,7 +519,7 @@
|
||||
status?: number
|
||||
shop_name?: string
|
||||
series_name?: string
|
||||
real_name_at?: string
|
||||
real_name_at?: string | null
|
||||
supplier?: string
|
||||
gateway_extend?: string
|
||||
last_sync_time?: string | null
|
||||
@@ -639,11 +651,17 @@
|
||||
})
|
||||
})
|
||||
|
||||
// 获取当前使用的卡
|
||||
const currentCard = computed(() => {
|
||||
// 设备详情状态字段统一从选中的绑定卡取值:
|
||||
// 只有一张卡时直接取该卡,多张卡时仅取 is_current=true 的卡。
|
||||
const selectedDeviceStatusCard = computed(() => {
|
||||
if (!props.cardInfo?.cards || props.cardInfo.cards.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (props.cardInfo.cards.length === 1) {
|
||||
return props.cardInfo.cards[0]
|
||||
}
|
||||
|
||||
return props.cardInfo.cards.find((card: BindingCard) => card.is_current) || null
|
||||
})
|
||||
|
||||
|
||||
@@ -331,8 +331,8 @@ export function useAssetInfo() {
|
||||
cardInfo.value.device_protect_status = data.device_protect_status
|
||||
}
|
||||
if (data.cards && data.cards.length > 0) {
|
||||
// 合并实时卡数据与原始卡数据,保留 real_name_at 等静态字段
|
||||
// 仅用实时接口中非 null/undefined 的字段覆盖,避免清掉 resolve 接口返回的静态数据
|
||||
// 合并实时卡数据与原始卡数据,保留 real_name_at 等静态字段。
|
||||
// 设备详情的实名状态、在线状态、实名时间统一依赖选中的绑定卡,因此不能在实时刷新时丢掉这些字段。
|
||||
cardInfo.value.cards = mergeAssetBoundCards(cardInfo.value.cards || [], data.cards)
|
||||
}
|
||||
if (data.last_data_check_at !== undefined) {
|
||||
|
||||
@@ -47,6 +47,7 @@ export interface BindingCard {
|
||||
slot_position?: number
|
||||
network_status?: number
|
||||
real_name_status?: number
|
||||
real_name_at?: string | null
|
||||
realname_policy?: string
|
||||
gateway_extend?: string
|
||||
last_data_check_at?: string | null
|
||||
|
||||
Reference in New Issue
Block a user