Browse Source
Merge pull request #5423 from vvlladd28/bug/map-utils/parse-data-index
[3.3.2]UI: Fixed map-utils parse data - not correct index (timeseries without aggregation)
pull/5424/head
Igor Kulikov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
5 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/common-maps-utils.ts
|
|
|
@ -330,12 +330,12 @@ export function parseData(input: DatasourceData[], dataIndex?: number): Formatte |
|
|
|
deviceType: null |
|
|
|
}; |
|
|
|
entityArray.filter(el => el.data.length).forEach(el => { |
|
|
|
dataIndex = isDefined(dataIndex) ? dataIndex : el.data.length - 1; |
|
|
|
if (!obj.hasOwnProperty(el.dataKey.label) || el.data[dataIndex][1] !== '') { |
|
|
|
obj[el.dataKey.label] = el.data[dataIndex][1]; |
|
|
|
obj[el.dataKey.label + '|ts'] = el.data[dataIndex][0]; |
|
|
|
const index = isDefined(dataIndex) ? dataIndex : el.data.length - 1; |
|
|
|
if (!obj.hasOwnProperty(el.dataKey.label) || el.data[index][1] !== '') { |
|
|
|
obj[el.dataKey.label] = el.data[index][1]; |
|
|
|
obj[el.dataKey.label + '|ts'] = el.data[index][0]; |
|
|
|
if (el.dataKey.label.toLowerCase() === 'type') { |
|
|
|
obj.deviceType = el.data[dataIndex][1]; |
|
|
|
obj.deviceType = el.data[index][1]; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|