fix: 在线
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m20s

This commit is contained in:
sexygoat
2026-05-21 15:43:36 +08:00
parent a69f972766
commit b364fb4aec
2 changed files with 5 additions and 5 deletions

View File

@@ -130,11 +130,11 @@
}}</ElDescriptionsItem> }}</ElDescriptionsItem>
<ElDescriptionsItem label="在线状态"> <ElDescriptionsItem label="在线状态">
<ElTag <ElTag
v-if="selectedDeviceStatusCard?.network_status !== undefined" v-if="cardInfo?.online_status !== undefined"
:type="selectedDeviceStatusCard.network_status === 1 ? 'success' : 'danger'" :type="getOnlineStatusType(cardInfo?.online_status)"
size="small" size="small"
> >
{{ selectedDeviceStatusCard.network_status === 1 ? '正常' : '停机' }} {{ getOnlineStatusName(cardInfo?.online_status) }}
</ElTag> </ElTag>
<span v-else>-</span> <span v-else>-</span>
</ElDescriptionsItem> </ElDescriptionsItem>
@@ -651,7 +651,7 @@
}) })
}) })
// 设备详情状态字段统一从选中的绑定卡取值: // 设备详情里的实名状态和实名时间从选中的绑定卡取值:
// 只有一张卡时直接取该卡,多张卡时仅取 is_current=true 的卡。 // 只有一张卡时直接取该卡,多张卡时仅取 is_current=true 的卡。
const selectedDeviceStatusCard = computed(() => { const selectedDeviceStatusCard = computed(() => {
if (!props.cardInfo?.cards || props.cardInfo.cards.length === 0) { if (!props.cardInfo?.cards || props.cardInfo.cards.length === 0) {

View File

@@ -332,7 +332,7 @@ export function useAssetInfo() {
} }
if (data.cards && data.cards.length > 0) { if (data.cards && data.cards.length > 0) {
// 合并实时卡数据与原始卡数据,保留 real_name_at 等静态字段。 // 合并实时卡数据与原始卡数据,保留 real_name_at 等静态字段。
// 设备详情的实名状态、在线状态、实名时间统一依赖选中的绑定卡,因此不能在实时刷新时丢掉这些字段。 // 设备详情的实名状态、实名时间依赖选中的绑定卡,因此不能在实时刷新时丢掉这些字段。
cardInfo.value.cards = mergeAssetBoundCards(cardInfo.value.cards || [], data.cards) cardInfo.value.cards = mergeAssetBoundCards(cardInfo.value.cards || [], data.cards)
} }
if (data.last_data_check_at !== undefined) { if (data.last_data_check_at !== undefined) {