调整数据监测

This commit is contained in:
2025-12-20 15:32:44 +08:00
parent d0b7e6c768
commit a9959ce537

View File

@ -36,7 +36,7 @@
<template #default="{ row }">
<div class="status-badge" :class="{ online: row.online }">
<div class="status-dot"></div>
<span>{{ row.online ? '在线' : '离线' }}</span>
<span>{{ row.sfzx == '1' ? '在线' : '离线' }}</span>
</div>
</template>
</el-table-column>
@ -113,14 +113,14 @@ const fetchData = async () => {
}
const res = await getMonitorList(params) || {}
// 通道是否在线0 不在线 、1 在线
const onlineStatus = {
0: '不在线',
1: '在线'
}
// const onlineStatus = {
// '0': '离线',
// '1': '在线'
// }
// 处理数据,添加在线状态
data.value = (res || []).map(item => ({
...item,
online: onlineStatus[item.sfzx]
online: item.sfzx == '1' ? 1 : 0
}))
} catch (error) {
ElMessage.error(`获取${props.title}数据失败`)
@ -137,7 +137,7 @@ const total = ref(0)
// 获取表格行类名
const getRowClassName = ({ row }) => {
return row.online == 1 ? 'online-row' : 'offline-row'
return row.online == '1' ? 'online-row' : 'offline-row'
}
// 刷新处理