Commit ed309651cc69bd9d3601f84ea898c53c68a78d9c

Authored by ww
1 parent c1f1307c

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

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