Commit 55d596925e66b449ac3701cf79ce8bf6534450d3

Authored by xp.Huang
2 parents 6f53d5ee a20f2a4c

Merge branch 'fix/device-object-model' into 'main_dev'

fix: 修复物模型结构体属性无数据上报时,使用--表示

See merge request yunteng/thingskit-front!1092
@@ -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>