Commit ed309651cc69bd9d3601f84ea898c53c68a78d9c

Authored by ww
1 parent c1f1307c

fix: DEFECT-1941 修复数据看板实时数据表格设备属性名为undefined

@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 import { useComponentScale } from '../../../hook/useComponentScale'; 13 import { useComponentScale } from '../../../hook/useComponentScale';
14 import { useMultipleDataFetch } from '../../../hook/socket/useSocket'; 14 import { useMultipleDataFetch } from '../../../hook/socket/useSocket';
15 import { MultipleDataFetchUpdateFn } from '../../../hook/socket/useSocket.type'; 15 import { MultipleDataFetchUpdateFn } from '../../../hook/socket/useSocket.type';
  16 + import { useDeviceProfileQueryContext } from '/@/views/visual/palette/hooks/useDeviceProfileQueryContext';
16 17
17 interface IList { 18 interface IList {
18 [key: string]: string | number | object; 19 [key: string]: string | number | object;
@@ -65,13 +66,17 @@ @@ -65,13 +66,17 @@
65 columns, 66 columns,
66 }); 67 });
67 68
  69 + const { getDeviceProfileTslByIdWithIdentifier } = useDeviceProfileQueryContext();
  70 +
68 const getDesign = computed(() => { 71 const getDesign = computed(() => {
69 const { persetOption, option } = props.config; 72 const { persetOption, option } = props.config;
70 const { dataSource = [] } = option || {}; 73 const { dataSource = [] } = option || {};
71 const { unit: presetUnit, showDeviceName: presetShowDeviceName } = persetOption || {}; 74 const { unit: presetUnit, showDeviceName: presetShowDeviceName } = persetOption || {};
72 const convert = dataSource.map((item) => { 75 const convert = dataSource.map((item) => {
  76 + const { functionName } =
  77 + getDeviceProfileTslByIdWithIdentifier?.(item.deviceProfileId, item.attribute) || {};
73 return { 78 return {
74 - [item.attribute + '-' + item.deviceId]: item.deviceName + '-' + item.attributeName, 79 + [item.attribute + '-' + item.deviceId]: item.deviceName + '-' + functionName,
75 id: item.deviceId, 80 id: item.deviceId,
76 }; 81 };
77 }); 82 });