Browse Source

Alarm widget fix show the incorrect value from alarm details

pull/3217/head
Vladyslav_Prykhodko 6 years ago
committed by Andrew Shvayka
parent
commit
6e1b343f50
  1. 4
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts

4
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -376,6 +376,8 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
}
this.stylesInfo[dataKey.def] = getCellStyleInfo(keySettings);
this.contentsInfo[dataKey.def] = getCellContentInfo(keySettings, 'value, alarm, ctx');
this.contentsInfo[dataKey.def].units = dataKey.units;
this.contentsInfo[dataKey.def].decimals = dataKey.decimals;
this.columnWidth[dataKey.def] = getColumnWidth(keySettings);
this.columns.push(dataKey);
@ -932,7 +934,7 @@ class AlarmsDatasource implements DataSource<AlarmDataInfo> {
}
}
}
alarm[dataKey.label] = value;
alarm[dataKey.name] = value;
});
return alarm;
}

2
ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts

@ -189,7 +189,7 @@ export function getAlarmValue(alarm: AlarmDataInfo, key: EntityColumn) {
if (alarmField) {
return getDescendantProp(alarm, alarmField.value);
} else {
return getDescendantProp(alarm, key.label);
return getDescendantProp(alarm, key.name);
}
}

Loading…
Cancel
Save