Browse Source
Merge pull request #3218 from vvlladd28/bug/road-map
[3.0] Change get index date for map widget
pull/3225/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/maps-utils.ts
|
|
|
@ -249,10 +249,11 @@ export function parseData(input: DatasourceData[]): FormattedData[] { |
|
|
|
deviceType: null |
|
|
|
}; |
|
|
|
entityArray.filter(el => el.data.length).forEach(el => { |
|
|
|
obj[el?.dataKey?.label] = el?.data[0][0] ? el?.data[0][1] : null; |
|
|
|
obj[el?.dataKey?.label + '|ts'] = el?.data[0][0] || null; |
|
|
|
const indexDate = el?.data?.length ? el.data.length - 1 : 0; |
|
|
|
obj[el?.dataKey?.label] = el?.data[indexDate][0] ? el?.data[indexDate][1] : null; |
|
|
|
obj[el?.dataKey?.label + '|ts'] = el?.data[indexDate][0] || null; |
|
|
|
if (el?.dataKey?.label === 'type') { |
|
|
|
obj.deviceType = el?.data[0][1]; |
|
|
|
obj.deviceType = el?.data[indexDate][1]; |
|
|
|
} |
|
|
|
}); |
|
|
|
return obj; |
|
|
|
|