@flexem/fc-gui 3.0.0-alpha.7 → 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 +301 -0
- package/bundles/@flexem/fc-gui.umd.js +18503 -17019
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +5 -5
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/communication/variable/variable-communicator.d.ts +3 -2
- package/config/alarm/alarm.store.d.ts +6 -0
- package/config/alarm/alarm.store.js +0 -0
- package/config/alarm/alarm.store.metadata.json +1 -0
- package/config/alarm/get-alarms-args.d.ts +9 -0
- package/config/alarm/get-alarms-args.js +9 -0
- package/config/alarm/get-alarms-args.metadata.json +1 -0
- package/config/alarm/index.d.ts +2 -0
- package/config/alarm/index.js +1 -0
- package/config/alarm/index.metadata.json +1 -0
- package/config/config-store.d.ts +2 -0
- package/config/index.d.ts +1 -0
- package/config/index.js +1 -0
- package/config/index.metadata.json +1 -1
- package/elements/air-quality/air-quality-element.d.ts +31 -0
- package/elements/air-quality/air-quality-element.js +194 -0
- package/elements/air-quality/air-quality-element.metadata.json +1 -0
- package/elements/alarm/alarm-element.d.ts +39 -0
- package/elements/alarm/alarm-element.js +300 -0
- package/elements/alarm/alarm-element.metadata.json +1 -0
- package/elements/alarm/alarm-state-enum.d.ts +4 -0
- package/elements/alarm/alarm-state-enum.js +5 -0
- package/elements/alarm/alarm-state-enum.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +8 -2
- package/elements/bar-graph-element.js +72 -6
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/base-element.d.ts +2 -1
- package/elements/base/base-element.js +2 -1
- package/elements/base/base-element.metadata.json +1 -1
- package/elements/base/conditional-control-element.d.ts +1 -1
- package/elements/base/conditional-control-element.js +3 -3
- package/elements/base/conditional-control-element.metadata.json +1 -1
- package/elements/base/conditional-display-element.d.ts +1 -1
- package/elements/base/conditional-display-element.js +4 -4
- package/elements/base/conditional-display-element.metadata.json +1 -1
- package/elements/base/conditional-dynamic-display-element.d.ts +1 -1
- package/elements/base/conditional-dynamic-display-element.js +3 -3
- package/elements/base/conditional-dynamic-display-element.metadata.json +1 -1
- package/elements/base/conditional-enable-element.d.ts +1 -1
- package/elements/base/conditional-enable-element.js +4 -4
- package/elements/base/conditional-enable-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +7 -2
- package/elements/base/readable-element.js +33 -4
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +1 -1
- package/elements/base/state-control-element.js +2 -2
- package/elements/base/state-control-element.metadata.json +1 -1
- package/elements/character-display/character-display-element.d.ts +1 -1
- package/elements/character-display/character-display-element.js +2 -2
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/datetime-display/datetime-display-element.d.ts +1 -1
- package/elements/datetime-display/datetime-display-element.js +2 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +1 -1
- package/elements/historical-curve/historical-curve.element.js +104 -15
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +2 -1
- package/elements/main-element.js +48 -26
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +8 -2
- package/elements/meter-element.js +78 -9
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +8 -2
- package/elements/numerical-display/numerical-display-element.js +47 -11
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +4 -2
- package/elements/per-view-variable-communicator.js +12 -4
- package/elements/per-view-variable-communicator.metadata.json +1 -1
- package/elements/pipe/pipe-element.d.ts +1 -1
- package/elements/pipe/pipe-element.js +2 -2
- package/elements/pipe/pipe-element.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +11 -2
- package/elements/ring-graph/ring-graph-element.js +108 -5
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/shared/graph/graph-state-element.js +0 -3
- package/elements/shared/text/text-element.js +13 -2
- package/elements/shared/text/text-state-element.js +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +1 -1
- package/elements/static-elements/hyperlink-element.js +2 -2
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/image-element.d.ts +1 -1
- package/elements/static-elements/image-element.js +2 -2
- package/elements/static-elements/image-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +1 -1
- package/elements/static-elements/text-element.js +2 -2
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +4 -4
- package/elements/switch-indicator-light/bit-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/bit-switch-operator.js +22 -2
- package/elements/switch-indicator-light/bit-switch-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +9 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +97 -28
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -5
- package/elements/switch-indicator-light/word-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/word-switch-operator.js +9 -2
- package/elements/switch-indicator-light/word-switch-operator.metadata.json +1 -1
- package/elements/table/table-element.d.ts +1 -1
- package/elements/table/table-element.js +2 -2
- package/elements/table/table-element.metadata.json +1 -1
- package/elements/vector-graphics/ellipse-element.d.ts +1 -1
- package/elements/vector-graphics/ellipse-element.js +2 -2
- package/elements/vector-graphics/ellipse-element.metadata.json +1 -1
- package/elements/vector-graphics/poly-line-element.d.ts +1 -1
- package/elements/vector-graphics/poly-line-element.js +2 -2
- package/elements/vector-graphics/poly-line-element.metadata.json +1 -1
- package/elements/vector-graphics/polygon-element.d.ts +1 -1
- package/elements/vector-graphics/polygon-element.js +2 -2
- package/elements/vector-graphics/polygon-element.metadata.json +1 -1
- package/elements/vector-graphics/rectangle-element.d.ts +1 -1
- package/elements/vector-graphics/rectangle-element.js +2 -2
- package/elements/vector-graphics/rectangle-element.metadata.json +1 -1
- package/elements/vector-graphics/sector-element.d.ts +1 -1
- package/elements/vector-graphics/sector-element.js +2 -2
- package/elements/vector-graphics/sector-element.metadata.json +1 -1
- package/elements/vector-graphics/straight-line-element.d.ts +1 -1
- package/elements/vector-graphics/straight-line-element.js +2 -2
- package/elements/vector-graphics/straight-line-element.metadata.json +1 -1
- package/elements/video/video-element.d.ts +1 -2
- package/elements/video/video-element.js +53 -54
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +1 -1
- package/elements/view-operation/view-operation.element.js +2 -2
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.d.ts +1 -1
- package/elements/weather/weater-element.js +2 -3
- package/elements/weather/weater-element.metadata.json +1 -1
- package/gui/gui-context.d.ts +2 -1
- package/gui/gui-host.d.ts +1 -1
- package/gui/gui-view.d.ts +1 -0
- package/gui/gui-view.js +3 -2
- package/gui/gui-view.metadata.json +1 -1
- package/gui/gui.component.d.ts +3 -0
- package/gui/gui.component.js +15 -2
- package/gui/gui.component.metadata.json +1 -1
- package/localization/localization.service.d.ts +7 -0
- package/localization/localization.service.js +8 -1
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +8 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +4 -1
- package/modal/write-value/write-value-modal-args.js +3 -1
- package/modal/write-value/write-value-modal-args.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +9 -7
- package/modal/write-value/write-value-modal.component.html +5 -2
- package/modal/write-value/write-value-modal.component.js +39 -22
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/air-quality/air-quality-info.d.ts +23 -0
- package/model/air-quality/air-quality-info.js +4 -0
- package/model/air-quality/air-quality-info.metadata.json +1 -0
- package/model/air-quality/air-quality.model.d.ts +7 -0
- package/model/air-quality/air-quality.model.js +0 -0
- package/model/air-quality/air-quality.model.metadata.json +1 -0
- package/model/alarm/alarm.model.d.ts +13 -0
- package/model/alarm/alarm.model.js +0 -0
- package/model/alarm/alarm.model.metadata.json +1 -0
- package/model/bar-graph/bar-graph.d.ts +4 -0
- package/model/base/readable-model.d.ts +4 -0
- package/model/historical-curve/historical-curve-axis-settings.d.ts +7 -0
- package/model/historical-curve/historical-curve-axis-settings.js +5 -0
- package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
- package/model/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-display.d.ts +1 -0
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/shared/condition/bit-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/bit-condition-item-observer.js +4 -4
- package/model/shared/condition/condition-items-result-observer.d.ts +1 -1
- package/model/shared/condition/condition-items-result-observer.js +22 -12
- package/model/shared/condition/condition-items-result-observer.metadata.json +1 -1
- package/model/shared/condition/convert-condition-model.d.ts +5 -0
- package/model/shared/condition/convert-condition-model.js +0 -0
- package/model/shared/condition/convert-condition-model.metadata.json +1 -0
- package/model/shared/condition/relation-condition-result.d.ts +2 -1
- package/model/shared/condition/relation-condition-result.js +2 -1
- package/model/shared/condition/relation-condition-result.metadata.json +1 -1
- package/model/shared/condition/word-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/word-condition-item-observer.js +11 -11
- package/model/shared/dynamic-display/dynamic-display.d.ts +1 -1
- package/model/shared/dynamic-display/dynamic-display.js +4 -4
- package/model/shared/dynamic-display/dynamic-display.metadata.json +1 -1
- package/model/shared/rotation/rotation-behavior.d.ts +1 -1
- package/model/shared/rotation/rotation-behavior.js +2 -2
- package/model/shared/rotation/rotation-behavior.metadata.json +1 -1
- package/model/shared/rotation/rotation-observer.d.ts +2 -1
- package/model/shared/rotation/rotation-observer.js +3 -2
- package/model/shared/rotation/rotation-observer.metadata.json +1 -1
- package/model/shared/translation/translation-behavior.d.ts +1 -1
- package/model/shared/translation/translation-behavior.js +3 -3
- package/model/shared/translation/translation-behavior.metadata.json +1 -1
- package/model/shared/translation/translation-observer.d.ts +1 -1
- package/model/shared/translation/translation-observer.js +2 -2
- package/model/shared/translation/translation-observer.metadata.json +1 -1
- package/model/switch-indicator-light/bit-switch-operation.d.ts +2 -1
- package/model/switch-indicator-light/bit-switch-operation.js +1 -0
- package/model/switch-indicator-light/bit-switch-operation.metadata.json +1 -1
- package/package.json +1 -1
- package/remote/communication/variable/remote-variable-communicator.d.ts +7 -2
- package/remote/communication/variable/remote-variable-communicator.js +38 -9
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +5 -2
- package/service/index.d.ts +1 -0
- package/service/index.metadata.json +1 -1
- package/service/released-variable/index.d.ts +1 -0
- package/service/released-variable/index.js +0 -0
- package/service/released-variable/index.metadata.json +1 -0
- package/service/released-variable/released-variable.service.d.ts +4 -0
- package/service/released-variable/released-variable.service.js +0 -0
- package/service/released-variable/released-variable.service.metadata.json +1 -0
- package/service/weather.service.d.ts +1 -0
- package/shared/gui-consts.d.ts +2 -0
- package/shared/gui-consts.js +2 -0
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/data-type.service.d.ts +4 -7
- package/utils/data-type/data-type.service.js +29 -17
- package/utils/numerical-operation.service.js +2 -2
- package/gui/scripts/config.js +0 -6
- package/gui/scripts/require.js +0 -2145
- package/libs/nvd3/build/nv.d3.min.js +0 -13
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import * as d3 from 'd3';
|
|
2
|
+
import { ConditionalDisplayElement } from '../base/conditional-display-element';
|
|
3
|
+
import { GetAlarmsArgs } from '../../config';
|
|
4
|
+
import * as moment from 'moment';
|
|
5
|
+
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
6
|
+
import { LOCALIZATION } from '../../localization';
|
|
7
|
+
import { find } from 'lodash';
|
|
8
|
+
export class AlarmElement extends ConditionalDisplayElement {
|
|
9
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId) {
|
|
10
|
+
var _a;
|
|
11
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
12
|
+
this.alarmsStore = alarmsStore;
|
|
13
|
+
this.displayOption = {
|
|
14
|
+
dataLimit: 500,
|
|
15
|
+
dataZoomHeight: 32,
|
|
16
|
+
marginLeft: 1,
|
|
17
|
+
marginRight: 20,
|
|
18
|
+
mobileMinWidth: 450,
|
|
19
|
+
operationAreaHeight: 32,
|
|
20
|
+
operationAreaMarginTop: 10,
|
|
21
|
+
operationSelectFontSize: '16px',
|
|
22
|
+
operationButtonWidth: 24,
|
|
23
|
+
operationButtonHeight: 24,
|
|
24
|
+
operationButtonMargin: 4
|
|
25
|
+
};
|
|
26
|
+
this.alarmNames = [];
|
|
27
|
+
this.alarmList = [];
|
|
28
|
+
this.currentAlarmList = [];
|
|
29
|
+
this.page = 0;
|
|
30
|
+
this.totalCount = 0;
|
|
31
|
+
this.pageSize = 5;
|
|
32
|
+
this.rootElement.selectAll('*').remove();
|
|
33
|
+
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
34
|
+
this.localization = injector.get(LOCALIZATION);
|
|
35
|
+
this.variableCommunicator = variableCommunicator;
|
|
36
|
+
this.timePeriods = this.getValidTimePeriods();
|
|
37
|
+
this.pageSize = this.model.generalSetting.pageSize;
|
|
38
|
+
if (this.model.filterSetting) {
|
|
39
|
+
this.alarmNames = this.model.filterSetting.detailsData.map(item => item.name);
|
|
40
|
+
this.currentTimePeriod = (_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.displayPeriod;
|
|
41
|
+
this.updateQueryTimeRange();
|
|
42
|
+
if (this.model.filterSetting.alarmType) {
|
|
43
|
+
this.refreshIntervalId = setInterval(() => {
|
|
44
|
+
this.loadFirstPage();
|
|
45
|
+
this.logger.debug(`[GUI]Refresh Alarm Table:${d3.time.format('%x %X')(new Date())}`);
|
|
46
|
+
}, this.model.filterSetting.refreshCycle * 60 * 1000);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
variableCommunicator.subscribeUserDeviceAlarms(signalRAppId).subscribe(alarmWithAppId => {
|
|
50
|
+
if (alarmWithAppId.appId !== this.signalRAppId) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const alarm = alarmWithAppId.alarm;
|
|
54
|
+
if (!find(this.alarmNames, itemName => itemName === alarm.name)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.init();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
this.init();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.totalCount = 0;
|
|
64
|
+
this.alarmList = [];
|
|
65
|
+
this.renderElement();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
dispose() {
|
|
69
|
+
clearInterval(this.refreshIntervalId);
|
|
70
|
+
if (this.element) {
|
|
71
|
+
this.element.tooltip.hidden(true);
|
|
72
|
+
}
|
|
73
|
+
this.logger.debug(`[GUI]Dispose Alarm Table Refresh Interval:${d3.time.format('%x %X')(new Date())}`);
|
|
74
|
+
}
|
|
75
|
+
getValidTimePeriods() {
|
|
76
|
+
const timePeriods = new Array();
|
|
77
|
+
timePeriods.push({ key: 6, name: this.localization.lastThirtyMinutes });
|
|
78
|
+
timePeriods.push({ key: 1, name: this.localization.lastOneHour });
|
|
79
|
+
timePeriods.push({ key: 7, name: this.localization.lastEightHour });
|
|
80
|
+
timePeriods.push({ key: 2, name: this.localization.lastTwentyFourHours });
|
|
81
|
+
timePeriods.push({ key: 3, name: this.localization.lastSevenDays });
|
|
82
|
+
timePeriods.push({ key: 4, name: this.localization.lastThirtyDays });
|
|
83
|
+
timePeriods.push({ key: 5, name: this.localization.lastOneYear });
|
|
84
|
+
return timePeriods;
|
|
85
|
+
}
|
|
86
|
+
init() {
|
|
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);
|
|
122
|
+
}
|
|
123
|
+
renderElement() {
|
|
124
|
+
this.rootElement.selectAll('*').remove();
|
|
125
|
+
const elementHeight = this.model.size.height;
|
|
126
|
+
this.element = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
|
|
127
|
+
this.element.setAttribute('width', this.model.size.width.toString());
|
|
128
|
+
this.element.setAttribute('height', elementHeight.toString());
|
|
129
|
+
this.$element.append(this.element);
|
|
130
|
+
const table = document.createElement('table');
|
|
131
|
+
table.style.cssText = `border: 2px solid ${this.model.generalSetting.stroke};
|
|
132
|
+
height: ${elementHeight - 39}`;
|
|
133
|
+
let tr = document.createElement('tr');
|
|
134
|
+
let fontString = '';
|
|
135
|
+
if (this.model.generalSetting.headerFont.isItalic) {
|
|
136
|
+
fontString += 'italic ';
|
|
137
|
+
}
|
|
138
|
+
if (this.model.generalSetting.headerFont.isBold) {
|
|
139
|
+
fontString += 'bold ';
|
|
140
|
+
}
|
|
141
|
+
fontString += this.model.generalSetting.headerFont.fontSize + ' ' + this.model.generalSetting.headerFont.fontFamily;
|
|
142
|
+
tr.style.cssText = `height: ${this.model.heights[0]}px;
|
|
143
|
+
background: ${this.model.generalSetting.headerFillColor};
|
|
144
|
+
color: ${this.model.generalSetting.headerFont.color};
|
|
145
|
+
font: ${fontString};
|
|
146
|
+
text-align: ${this.model.generalSetting.headerFont.textAlign};
|
|
147
|
+
${this.model.generalSetting.headerFont.isUnderline ? 'text-decoration: underline' : ''};
|
|
148
|
+
vertical-align: middle;`;
|
|
149
|
+
for (let i = 0; i < 4; i++) {
|
|
150
|
+
const th = document.createElement('th');
|
|
151
|
+
th.innerHTML = this.model.columLabels[i];
|
|
152
|
+
th.style.cssText = `width: ${this.model.widths[i] / this.model.size.width * 100}%;
|
|
153
|
+
border-style: solid;
|
|
154
|
+
border-color: ${this.model.generalSetting.splitLine};
|
|
155
|
+
border-left-width: ${!i || this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;`;
|
|
156
|
+
tr.appendChild(th);
|
|
157
|
+
}
|
|
158
|
+
table.appendChild(tr);
|
|
159
|
+
const levelColors = ['#3695FF', '#FFE900', '#FFA800', '#E84F4F'];
|
|
160
|
+
for (let i = 0; i < this.pageSize; i++) {
|
|
161
|
+
tr = document.createElement('tr');
|
|
162
|
+
tr.style.cssText = `height: ${this.model.heights[i + 1]}px;
|
|
163
|
+
background: ${this.model.generalSetting.tableFillColor};
|
|
164
|
+
font: ${this.model.generalSetting.fontStyle};
|
|
165
|
+
color: ${this.model.generalSetting.fontColor};
|
|
166
|
+
text-align: ${this.model.generalSetting.textAlign};
|
|
167
|
+
vertical-align: middle;`;
|
|
168
|
+
for (let j = 0; j < 4; j++) {
|
|
169
|
+
const td = document.createElement('td');
|
|
170
|
+
td.style.cssText = `border-style: solid;
|
|
171
|
+
border-color: ${this.model.generalSetting.splitLine};
|
|
172
|
+
border-top-width: ${this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;
|
|
173
|
+
border-left-width: ${!j || this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;`;
|
|
174
|
+
if (this.alarmList[i]) {
|
|
175
|
+
if (j !== 2) {
|
|
176
|
+
td.innerHTML = this.alarmList[i][j];
|
|
177
|
+
td.style.cssText += `${this.model.generalSetting.isUnderline ? 'text-decoration: underline' : ''};`;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const alarmLevel = document.createElement('div');
|
|
181
|
+
let alarmHeight = parseInt(this.model.generalSetting.fontSize) + 15;
|
|
182
|
+
if (alarmHeight > this.model.heights[i + 1])
|
|
183
|
+
alarmHeight = this.model.heights[i + 1];
|
|
184
|
+
let margin = '0 15px';
|
|
185
|
+
if (this.model.generalSetting.textAlign === 'left') {
|
|
186
|
+
margin = '0 30px 0 0';
|
|
187
|
+
}
|
|
188
|
+
else if (this.model.generalSetting.textAlign === 'right') {
|
|
189
|
+
margin = '0 0 0 30px';
|
|
190
|
+
}
|
|
191
|
+
alarmLevel.style.cssText = `margin: ${margin};
|
|
192
|
+
border-radius: 5px;
|
|
193
|
+
background: ${levelColors[this.alarmList[i][j]]};
|
|
194
|
+
color: #ffffff;
|
|
195
|
+
width: ${this.model.widths[j] - 30}px;
|
|
196
|
+
height: ${alarmHeight}px;
|
|
197
|
+
max-height: ${this.model.heights[i + 1]}px;
|
|
198
|
+
display: flex;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
align-items: center;
|
|
201
|
+
${this.model.generalSetting.isUnderline ? 'text-decoration: underline' : ''};`;
|
|
202
|
+
alarmLevel.innerHTML = this.model.levelText[this.alarmList[i][j]];
|
|
203
|
+
td.appendChild(alarmLevel);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
tr.appendChild(td);
|
|
207
|
+
}
|
|
208
|
+
table.appendChild(tr);
|
|
209
|
+
}
|
|
210
|
+
this.element.appendChild(table);
|
|
211
|
+
this.renderOperationArea(this.model.size.width, elementHeight - 39);
|
|
212
|
+
}
|
|
213
|
+
renderOperationArea(chartWidth, chartHeight) {
|
|
214
|
+
var _a;
|
|
215
|
+
const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop})`)
|
|
216
|
+
.append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
|
|
217
|
+
.append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
|
|
218
|
+
if ((_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.alarmType) {
|
|
219
|
+
const selectElement = operationArea.append('select').style('margin-left', this.displayOption.marginLeft + 'px')
|
|
220
|
+
.style('font-size', this.displayOption.operationSelectFontSize).on('change', () => {
|
|
221
|
+
const displayTimePeriod = this.rootElement.select('select').property('value');
|
|
222
|
+
this.updateTimeRange(displayTimePeriod);
|
|
223
|
+
this.init();
|
|
224
|
+
});
|
|
225
|
+
const options = selectElement.selectAll('option').data(this.timePeriods).enter().append('option');
|
|
226
|
+
options.text(d => d.name).attr('value', d => d.key).property('selected', d => d.key === Number(this.currentTimePeriod));
|
|
227
|
+
}
|
|
228
|
+
const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
|
|
229
|
+
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
230
|
+
.style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/last_page.svg)')
|
|
231
|
+
.on('click', () => { this.loadLastPage(); });
|
|
232
|
+
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
233
|
+
.style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/next_page.svg)')
|
|
234
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
235
|
+
.on('click', () => { this.loadNextPage(); });
|
|
236
|
+
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
237
|
+
.style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/previous_page.svg)')
|
|
238
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
239
|
+
.on('click', () => { this.loadPreviousPage(); });
|
|
240
|
+
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
241
|
+
.style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/first_page.svg)')
|
|
242
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
243
|
+
.on('click', () => { this.loadFirstPage(); });
|
|
244
|
+
}
|
|
245
|
+
updateTimeRange(timePeriodType) {
|
|
246
|
+
this.currentTimePeriod = +timePeriodType;
|
|
247
|
+
this.updateQueryTimeRange();
|
|
248
|
+
}
|
|
249
|
+
updateQueryTimeRange() {
|
|
250
|
+
this.endTime = moment();
|
|
251
|
+
switch (this.currentTimePeriod) {
|
|
252
|
+
case 1:
|
|
253
|
+
this.startTime = moment().subtract(1, 'hours');
|
|
254
|
+
break;
|
|
255
|
+
case 3:
|
|
256
|
+
this.startTime = moment().subtract(7, 'days');
|
|
257
|
+
break;
|
|
258
|
+
case 4:
|
|
259
|
+
this.startTime = moment().subtract(30, 'days');
|
|
260
|
+
break;
|
|
261
|
+
case 5:
|
|
262
|
+
this.startTime = moment().subtract(1, 'years');
|
|
263
|
+
break;
|
|
264
|
+
case 6:
|
|
265
|
+
this.startTime = moment().subtract(30, 'minutes');
|
|
266
|
+
break;
|
|
267
|
+
case 7:
|
|
268
|
+
this.startTime = moment().subtract(8, 'hours');
|
|
269
|
+
break;
|
|
270
|
+
default:
|
|
271
|
+
this.startTime = moment().subtract(1, 'days');
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
loadFirstPage() {
|
|
275
|
+
this.page = 0;
|
|
276
|
+
this.init();
|
|
277
|
+
}
|
|
278
|
+
loadNextPage() {
|
|
279
|
+
let last_page = Math.ceil(this.totalCount / this.pageSize);
|
|
280
|
+
if (last_page)
|
|
281
|
+
last_page--;
|
|
282
|
+
if (this.page < last_page) {
|
|
283
|
+
this.page++;
|
|
284
|
+
}
|
|
285
|
+
this.init();
|
|
286
|
+
}
|
|
287
|
+
loadPreviousPage() {
|
|
288
|
+
if (this.page > 0) {
|
|
289
|
+
this.page--;
|
|
290
|
+
}
|
|
291
|
+
this.init();
|
|
292
|
+
}
|
|
293
|
+
loadLastPage() {
|
|
294
|
+
let last_page = Math.ceil(this.totalCount / this.pageSize);
|
|
295
|
+
if (last_page)
|
|
296
|
+
last_page--;
|
|
297
|
+
this.page = last_page;
|
|
298
|
+
this.init();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmState":{"AlarmStateTriggered":1,"AlarmStateRecovered":0}}}]
|
|
@@ -5,6 +5,8 @@ import { ReadableElement } from './base/readable-element';
|
|
|
5
5
|
import { VariableStore } from '../config';
|
|
6
6
|
import { PermissionChecker } from '../service';
|
|
7
7
|
export declare class BarGraphElement extends ReadableElement {
|
|
8
|
+
private static DEFAULT_MIN_VALUE;
|
|
9
|
+
private static DEFAULT_MAX_VALUE;
|
|
8
10
|
readonly model: BarGraph;
|
|
9
11
|
private readonly $barRect;
|
|
10
12
|
private readonly barElement;
|
|
@@ -14,8 +16,12 @@ export declare class BarGraphElement extends ReadableElement {
|
|
|
14
16
|
private defaultUpperLimitColor;
|
|
15
17
|
private defaultLowerLimitColor;
|
|
16
18
|
private barText;
|
|
19
|
+
private valueObj;
|
|
20
|
+
private isNeedUpdateScale;
|
|
17
21
|
get readVariableName(): string;
|
|
18
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
22
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
19
23
|
private initFrameNode;
|
|
20
|
-
|
|
24
|
+
private updateValueObj;
|
|
25
|
+
private updateScale;
|
|
26
|
+
updateVariableValue(value: number, variableName: any): void;
|
|
21
27
|
}
|
|
@@ -2,13 +2,22 @@ import { BarGraphDirection } from '../model';
|
|
|
2
2
|
import { ReadableElement } from './base/readable-element';
|
|
3
3
|
import { calculatePercent } from './shared/math-utils';
|
|
4
4
|
import { VariableUtil } from '../utils/variable-util';
|
|
5
|
+
import { VariableValueType } from '../model/shared/condition/variable-value-type';
|
|
5
6
|
export class BarGraphElement extends ReadableElement {
|
|
6
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
7
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
8
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
8
9
|
this.defaultBarColor = '#6fd149';
|
|
9
10
|
this.defaultUpperLimitColor = '#ff4448';
|
|
10
11
|
this.defaultLowerLimitColor = '#0f60e8';
|
|
11
12
|
this.barText = '';
|
|
13
|
+
this.valueObj = {};
|
|
14
|
+
this.isNeedUpdateScale = false;
|
|
15
|
+
if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
|
|
16
|
+
|| this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
|
|
17
|
+
this.isNeedUpdateScale = true;
|
|
18
|
+
this.updateScale();
|
|
19
|
+
this.isNeedUpdateScale = false;
|
|
20
|
+
}
|
|
12
21
|
this.$barRect = this.$element.find('rect');
|
|
13
22
|
this.$barText = this.$element.find('text[id="text"]').last();
|
|
14
23
|
if (this.model.version && this.model.version >= 1) {
|
|
@@ -41,10 +50,65 @@ export class BarGraphElement extends ReadableElement {
|
|
|
41
50
|
const b = arcPath.getBBox(true);
|
|
42
51
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
43
52
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
updateValueObj(value, variableName) {
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
if (((_a = this.model.readVariable) === null || _a === void 0 ? void 0 : _a.name) === variableName) {
|
|
56
|
+
this.isNeedUpdateScale = false;
|
|
57
|
+
this.valueObj.value = value;
|
|
58
|
+
}
|
|
59
|
+
if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
|
|
60
|
+
this.isNeedUpdateScale = true;
|
|
61
|
+
this.valueObj.min = value;
|
|
62
|
+
}
|
|
63
|
+
if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
|
|
64
|
+
this.isNeedUpdateScale = true;
|
|
65
|
+
this.valueObj.max = value;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
updateScale() {
|
|
69
|
+
if (!this.isNeedUpdateScale) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const textElements = this.$element.find('g:first > text');
|
|
73
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
74
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
75
|
+
min = Number(min);
|
|
76
|
+
max = Number(max);
|
|
77
|
+
if (isNaN(min) || isNaN(max)) {
|
|
78
|
+
min = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
79
|
+
max = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
80
|
+
}
|
|
81
|
+
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
82
|
+
for (let i = 0; i < textElements.length; i++) {
|
|
83
|
+
const text = textElements[i];
|
|
84
|
+
if (!text.innerHTML) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
|
|
88
|
+
// 整数位和小数位格式化;
|
|
89
|
+
if (this.model.fractionDigits > 0) {
|
|
90
|
+
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
91
|
+
}
|
|
92
|
+
if (!isNaN(sacleValue)) {
|
|
93
|
+
text.innerHTML = sacleValue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
updateVariableValue(value, variableName) {
|
|
98
|
+
this.updateValueObj(value, variableName);
|
|
99
|
+
this.updateScale();
|
|
100
|
+
const variableValue = Number(this.valueObj.value);
|
|
101
|
+
let maxValue = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
102
|
+
let minValue = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
103
|
+
minValue = Number(minValue);
|
|
104
|
+
maxValue = Number(maxValue);
|
|
105
|
+
if (isNaN(minValue) || isNaN(maxValue)) {
|
|
106
|
+
minValue = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
107
|
+
maxValue = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
108
|
+
}
|
|
109
|
+
if (isNaN(variableValue)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
48
112
|
const useAlarmLimit = this.model.useAlarmLimit;
|
|
49
113
|
const useAlarmUpperLimit = null != this.model.upperLimit;
|
|
50
114
|
const useAlarmLowerLimit = null != this.model.lowerLimit;
|
|
@@ -112,3 +176,5 @@ export class BarGraphElement extends ReadableElement {
|
|
|
112
176
|
}
|
|
113
177
|
}
|
|
114
178
|
}
|
|
179
|
+
BarGraphElement.DEFAULT_MIN_VALUE = 0;
|
|
180
|
+
BarGraphElement.DEFAULT_MAX_VALUE = 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"BarGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base/readable-element","name":"ReadableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"BarGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base/readable-element","name":"ReadableElement","line":10,"character":37},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":38,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../service","name":"PermissionChecker","line":38,"character":57},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":39,"character":30},{"__symbolic":"reference","module":"../config","name":"VariableStore","line":40,"character":23},{"__symbolic":"reference","module":"../localization","name":"Localization","line":41,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import * as d3 from 'd3-selection';
|
|
4
4
|
import { BaseElementModel } from '../../model';
|
|
5
5
|
export declare abstract class BaseElement {
|
|
6
|
+
protected readonly signalRAppId: string;
|
|
6
7
|
protected readonly $element: JQuery;
|
|
7
8
|
protected readonly rootElement: d3.Selection<any, {}, null, undefined>;
|
|
8
9
|
protected model: BaseElementModel;
|
|
9
|
-
constructor(element: HTMLElement);
|
|
10
|
+
constructor(element: HTMLElement, signalRAppId?: string);
|
|
10
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as d3 from 'd3-selection';
|
|
2
2
|
export class BaseElement {
|
|
3
|
-
constructor(element) {
|
|
3
|
+
constructor(element, signalRAppId = '') {
|
|
4
|
+
this.signalRAppId = signalRAppId;
|
|
4
5
|
this.$element = $(element);
|
|
5
6
|
this.rootElement = d3.select(element);
|
|
6
7
|
this.model = JSON.parse(this.rootElement.attr('data-model'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"BaseElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":9,"character":25,"context":{"typeName":"HTMLElement"}}]}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"BaseElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":9,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","name":"string"}]}]}}}}]
|
|
@@ -9,7 +9,7 @@ export declare abstract class ConditionalControlElement extends StateControlElem
|
|
|
9
9
|
protected readonly variableCommunicator: VariableCommunicator;
|
|
10
10
|
protected readonly variableStore: VariableStore;
|
|
11
11
|
protected abstract readonly model: ConditionalControlModel;
|
|
12
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
12
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
13
13
|
protected abstract updateElement(value: ConditionControlResultValue): void;
|
|
14
14
|
private initConditionalControl;
|
|
15
15
|
private recoverData;
|
|
@@ -7,8 +7,8 @@ import { StateControlElement } from './state-control-element';
|
|
|
7
7
|
import { VariableUtil } from '../../utils/variable-util';
|
|
8
8
|
import { VariableDefinition } from '../../communication/variable/variable-definition';
|
|
9
9
|
export class ConditionalControlElement extends StateControlElement {
|
|
10
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
11
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
10
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
11
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
12
12
|
this.variableCommunicator = variableCommunicator;
|
|
13
13
|
this.variableStore = variableStore;
|
|
14
14
|
this.recoverData();
|
|
@@ -27,7 +27,7 @@ export class ConditionalControlElement extends StateControlElement {
|
|
|
27
27
|
controlConditionResult.conditionResultChanged.subscribe(result => {
|
|
28
28
|
this.updateElement(result);
|
|
29
29
|
});
|
|
30
|
-
controlConditionResult.requestData();
|
|
30
|
+
controlConditionResult.requestData(this.signalRAppId);
|
|
31
31
|
}
|
|
32
32
|
recoverData() {
|
|
33
33
|
if (!this.model) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":15,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":20,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":21,"character":105},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":21,"character":134}]}],"updateElement":[{"__symbolic":"method"}],"initConditionalControl":[{"__symbolic":"method"}],"recoverData":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":15,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":20,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":21,"character":105},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":21,"character":134},{"__symbolic":"reference","name":"string"}]}],"updateElement":[{"__symbolic":"method"}],"initConditionalControl":[{"__symbolic":"method"}],"recoverData":[{"__symbolic":"method"}]}}}}]
|
|
@@ -8,7 +8,7 @@ export declare abstract class ConditionalDisplayElement extends BaseElement {
|
|
|
8
8
|
protected readonly variableCommunicator: VariableCommunicator;
|
|
9
9
|
protected readonly variableStore: VariableStore;
|
|
10
10
|
protected abstract readonly model: ConditionalDisplayModel;
|
|
11
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
11
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
|
|
12
12
|
private initDisplay;
|
|
13
13
|
private checkDisplayConditionAndPermission;
|
|
14
14
|
private updateVisibilityByCondition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConditionItemsResultObserver } from '../../model';
|
|
2
2
|
import { BaseElement } from './base-element';
|
|
3
3
|
export class ConditionalDisplayElement extends BaseElement {
|
|
4
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore) {
|
|
5
|
-
super(element);
|
|
4
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, signalRAppId) {
|
|
5
|
+
super(element, signalRAppId);
|
|
6
6
|
this.permissionChecker = permissionChecker;
|
|
7
7
|
this.variableCommunicator = variableCommunicator;
|
|
8
8
|
this.variableStore = variableStore;
|
|
@@ -43,7 +43,7 @@ export class ConditionalDisplayElement extends BaseElement {
|
|
|
43
43
|
this.hide();
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
conditionResult.requestData();
|
|
46
|
+
conditionResult.requestData(this.signalRAppId);
|
|
47
47
|
}
|
|
48
48
|
updateVisibilityByCondition() {
|
|
49
49
|
if (null == this.model.conditionItems || !this.model.conditionItems.length) {
|
|
@@ -58,7 +58,7 @@ export class ConditionalDisplayElement extends BaseElement {
|
|
|
58
58
|
this.hide();
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
conditionResult.requestData();
|
|
61
|
+
conditionResult.requestData(this.signalRAppId);
|
|
62
62
|
}
|
|
63
63
|
updateVisibilityByPermission() {
|
|
64
64
|
if (!this.model.displayPermissionCodes || !this.model.displayPermissionCodes.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base-element","name":"BaseElement","line":6,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":10,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":11,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":12,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":13,"character":42}]}],"initDisplay":[{"__symbolic":"method"}],"checkDisplayConditionAndPermission":[{"__symbolic":"method"}],"updateVisibilityByCondition":[{"__symbolic":"method"}],"updateVisibilityByPermission":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base-element","name":"BaseElement","line":6,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":10,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":11,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":12,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":13,"character":42},{"__symbolic":"reference","name":"string"}]}],"initDisplay":[{"__symbolic":"method"}],"checkDisplayConditionAndPermission":[{"__symbolic":"method"}],"updateVisibilityByCondition":[{"__symbolic":"method"}],"updateVisibilityByPermission":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}]}}}}]
|
|
@@ -16,7 +16,7 @@ export declare abstract class ConditionalDynamicDisplayElement extends Condition
|
|
|
16
16
|
protected rotatedHor: number;
|
|
17
17
|
protected rotatedVer: number;
|
|
18
18
|
protected transform: string;
|
|
19
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
19
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
|
|
20
20
|
protected initDynamicBehavior(): void;
|
|
21
21
|
protected getActualSize(): Size;
|
|
22
22
|
protected getActualLocation(): Point;
|
|
@@ -3,8 +3,8 @@ import { DynamicDisplay } from '../../model/shared/dynamic-display/dynamic-displ
|
|
|
3
3
|
import { ConditionalDisplayElement } from './conditional-display-element';
|
|
4
4
|
import { GuiConsts } from '../../shared';
|
|
5
5
|
export class ConditionalDynamicDisplayElement extends ConditionalDisplayElement {
|
|
6
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.variableCommunicator = variableCommunicator;
|
|
9
9
|
this.variableStore = variableStore;
|
|
10
10
|
this.initDynamicBehavior();
|
|
@@ -16,7 +16,7 @@ export class ConditionalDynamicDisplayElement extends ConditionalDisplayElement
|
|
|
16
16
|
const strokeWidth = this.model.strokeWidth ? this.model.strokeWidth : 0;
|
|
17
17
|
this.hor = location.x - Number(strokeWidth) / 2;
|
|
18
18
|
this.ver = location.y - Number(strokeWidth) / 2;
|
|
19
|
-
const behavior = new DynamicDisplay(this.model.dynamicSetting, this.variableCommunicator, this.variableStore, location);
|
|
19
|
+
const behavior = new DynamicDisplay(this.model.dynamicSetting, this.variableCommunicator, this.variableStore, location, this.signalRAppId);
|
|
20
20
|
behavior.doBehavior.subscribe(result => {
|
|
21
21
|
if (this.model.angle) {
|
|
22
22
|
this.ang = Number(this.model.angle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDynamicDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-display-element","name":"ConditionalDisplayElement","line":10,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":23,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":24,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":25,"character":42}]}],"initDynamicBehavior":[{"__symbolic":"method"}],"getActualSize":[{"__symbolic":"method"}],"getActualLocation":[{"__symbolic":"method"}],"isBold":[{"__symbolic":"method"}],"isItalic":[{"__symbolic":"method"}],"fontFamily":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDynamicDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-display-element","name":"ConditionalDisplayElement","line":10,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":23,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":24,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":25,"character":42},{"__symbolic":"reference","name":"string"}]}],"initDynamicBehavior":[{"__symbolic":"method"}],"getActualSize":[{"__symbolic":"method"}],"getActualLocation":[{"__symbolic":"method"}],"isBold":[{"__symbolic":"method"}],"isItalic":[{"__symbolic":"method"}],"fontFamily":[{"__symbolic":"method"}]}}}}]
|
|
@@ -12,7 +12,7 @@ export declare abstract class ConditionalEnableElement extends StateControlEleme
|
|
|
12
12
|
protected abstract readonly model: ConditionalEnableModel;
|
|
13
13
|
isGrantedPermission: boolean;
|
|
14
14
|
isInitialized: boolean;
|
|
15
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
15
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
16
16
|
private initialize;
|
|
17
17
|
private updateEnableStateByConditionAndPermission;
|
|
18
18
|
private updateEnableStateByCondition;
|