@flexem/fc-gui 3.0.0-alpha.70 → 3.0.0-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/bundles/@flexem/fc-gui.umd.js +37 -67
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/alarm/alarm-element.d.ts +1 -0
- package/elements/alarm/alarm-element.js +37 -60
- package/elements/alarm/alarm-element.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ export declare class AlarmElement extends ConditionalDisplayElement {
|
|
|
23
23
|
private page;
|
|
24
24
|
private totalCount;
|
|
25
25
|
private pageSize;
|
|
26
|
+
private getAlarmDataId;
|
|
26
27
|
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, alarmsStore: AlarmsStore, signalRAppId: string);
|
|
27
28
|
dispose(): void;
|
|
28
29
|
private getValidTimePeriods;
|
|
@@ -4,8 +4,7 @@ import { GetAlarmsArgs } from '../../config';
|
|
|
4
4
|
import * as moment from 'moment';
|
|
5
5
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
6
6
|
import { LOCALIZATION } from '../../localization';
|
|
7
|
-
import { find
|
|
8
|
-
import { AlarmState } from './alarm-state-enum';
|
|
7
|
+
import { find } from 'lodash';
|
|
9
8
|
export class AlarmElement extends ConditionalDisplayElement {
|
|
10
9
|
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId) {
|
|
11
10
|
var _a;
|
|
@@ -55,32 +54,7 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
55
54
|
if (!find(this.alarmNames, itemName => itemName === alarm.name)) {
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
if (alarm.state === AlarmState.AlarmStateTriggered.valueOf()) {
|
|
60
|
-
if (!isNil(currentAlarm)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
pull(this.currentAlarmList, this.currentAlarmList.find(record => alarm.name === record.name));
|
|
64
|
-
this.currentAlarmList.unshift(alarm);
|
|
65
|
-
this.totalCount += 1;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
if (isNil(currentAlarm)) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
remove(this.currentAlarmList, currentAlarm);
|
|
72
|
-
this.totalCount -= 1;
|
|
73
|
-
}
|
|
74
|
-
this.alarmList = [];
|
|
75
|
-
this.currentAlarmList.forEach(item => {
|
|
76
|
-
this.alarmList.push([
|
|
77
|
-
item.name,
|
|
78
|
-
item.message,
|
|
79
|
-
item.alarmLevel,
|
|
80
|
-
moment(item.triggeredTime).format('YYYY-MM-DD HH:mm:ss')
|
|
81
|
-
]);
|
|
82
|
-
});
|
|
83
|
-
this.renderElement();
|
|
57
|
+
this.init();
|
|
84
58
|
});
|
|
85
59
|
}
|
|
86
60
|
this.init();
|
|
@@ -110,38 +84,41 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
110
84
|
return timePeriods;
|
|
111
85
|
}
|
|
112
86
|
init() {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
item
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
item
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
87
|
+
clearTimeout(this.getAlarmDataId);
|
|
88
|
+
this.getAlarmDataId = setTimeout(() => {
|
|
89
|
+
if (this.model.filterSetting.alarmType) {
|
|
90
|
+
this.updateQueryTimeRange();
|
|
91
|
+
const input = new GetAlarmsArgs(this.alarmNames, this.startTime, this.endTime, this.pageSize, this.page * this.pageSize);
|
|
92
|
+
this.alarmsStore.getHistoryAlarms(input).subscribe(result => {
|
|
93
|
+
if (!result.error) {
|
|
94
|
+
this.totalCount = result.totalCount;
|
|
95
|
+
this.alarmList = result.items.map(item => [
|
|
96
|
+
item.name,
|
|
97
|
+
item.message,
|
|
98
|
+
item.alarmLevel,
|
|
99
|
+
item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
|
|
100
|
+
]);
|
|
101
|
+
this.renderElement();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const input = new GetAlarmsArgs(this.alarmNames, undefined, undefined, this.pageSize, this.page * this.pageSize);
|
|
107
|
+
this.alarmsStore.getCurrentAlarms(input).subscribe(result => {
|
|
108
|
+
if (!result.error) {
|
|
109
|
+
this.totalCount = result.totalCount;
|
|
110
|
+
this.currentAlarmList = result.items;
|
|
111
|
+
this.alarmList = this.currentAlarmList.map(item => [
|
|
112
|
+
item.name,
|
|
113
|
+
item.message,
|
|
114
|
+
item.alarmLevel,
|
|
115
|
+
item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
|
|
116
|
+
]);
|
|
117
|
+
this.renderElement();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, 500);
|
|
145
122
|
}
|
|
146
123
|
renderElement() {
|
|
147
124
|
this.rootElement.selectAll('*').remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":16,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":49,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":50,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":51,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":52,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":53,"character":23},{"__symbolic":"reference","module":"../../config","name":"AlarmsStore","line":54,"character":38},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}]}}}}]
|