Showing
1 changed file
with
6 additions
and
3 deletions
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | import { BasicModal, useModal } from '/@/components/Modal'; | 14 | import { BasicModal, useModal } from '/@/components/Modal'; |
15 | import { getDeviceAttrs } from '/@/api/device/deviceManager'; | 15 | import { getDeviceAttrs } from '/@/api/device/deviceManager'; |
16 | import { DeviceRecord } from '/@/api/device/model/deviceModel'; | 16 | import { DeviceRecord } from '/@/api/device/model/deviceModel'; |
17 | - import { isArray, isNull, isObject } from '/@/utils/is'; | 17 | + import { isArray, isNull, isNullOrUnDef, isObject } from '/@/utils/is'; |
18 | import { useGlobSetting } from '/@/hooks/setting'; | 18 | import { useGlobSetting } from '/@/hooks/setting'; |
19 | import { ModeSwitchButton, EnumTableCardMode } from '/@/components/Widget'; | 19 | import { ModeSwitchButton, EnumTableCardMode } from '/@/components/Widget'; |
20 | import { toRaw } from 'vue'; | 20 | import { toRaw } from 'vue'; |
@@ -285,7 +285,7 @@ | @@ -285,7 +285,7 @@ | ||
285 | 285 | ||
286 | const formatValue = (item: SocketInfoDataSourceItemType) => { | 286 | const formatValue = (item: SocketInfoDataSourceItemType) => { |
287 | return item.type === DataTypeEnum.BOOL | 287 | return item.type === DataTypeEnum.BOOL |
288 | - ? !isNull(item.value) | 288 | + ? !isNullOrUnDef(item.value) |
289 | ? !!Number(item.value) | 289 | ? !!Number(item.value) |
290 | ? item.boolOpen | 290 | ? item.boolOpen |
291 | : item.boolClose | 291 | : item.boolClose |
@@ -400,7 +400,10 @@ | @@ -400,7 +400,10 @@ | ||
400 | > | 400 | > |
401 | <div class="font-medium truncate">{{ item.value[key].name }}</div> | 401 | <div class="font-medium truncate">{{ item.value[key].name }}</div> |
402 | <div class="flex-auto font-bold text-lg text-left ml-4 truncate"> | 402 | <div class="flex-auto font-bold text-lg text-left ml-4 truncate"> |
403 | - <Tooltip :title="formatValue(item)" placement="topLeft"> | 403 | + <Tooltip |
404 | + :title="formatValue(item.value[key] as SocketInfoDataSourceItemType)" | ||
405 | + placement="topLeft" | ||
406 | + > | ||
404 | <span> | 407 | <span> |
405 | {{ formatValue(item.value[key] as SocketInfoDataSourceItemType) }} | 408 | {{ formatValue(item.value[key] as SocketInfoDataSourceItemType) }} |
406 | </span> | 409 | </span> |