@flexem/fc-gui 3.0.0-alpha.19 → 3.0.0-alpha.190
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 +413 -0
- package/assets/img/black_first_page.png +0 -0
- package/assets/img/black_last_page.png +0 -0
- package/assets/img/black_next_page.png +0 -0
- package/assets/img/black_previous_page.png +0 -0
- package/assets/img/exclamation-outline-circle.png +0 -0
- package/bundles/@flexem/fc-gui.umd.js +37817 -32408
- 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 +5 -0
- package/communication/variable/variable-state-enum.d.ts +1 -0
- package/communication/variable/variable-state-enum.js +1 -0
- package/communication/variable/variable-state-enum.metadata.json +1 -1
- package/communication/variable/variable-value.d.ts +4 -1
- package/communication/variable/variable-value.js +4 -1
- package/communication/variable/variable-value.metadata.json +1 -1
- 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 +12 -0
- package/config/alarm/get-alarms-args.js +13 -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/gui-feature-config.d.ts +3 -0
- package/config/gui-feature-config.js +3 -0
- package/config/gui-feature-config.metadata.json +1 -0
- package/config/index.d.ts +2 -0
- package/config/index.js +2 -0
- package/config/index.metadata.json +1 -1
- package/config/variable/variable-store.d.ts +5 -0
- package/elements/air-quality/air-quality-element.js +3 -4
- package/elements/alarm/alarm-element.d.ts +106 -0
- package/elements/alarm/alarm-element.js +836 -0
- package/elements/alarm/alarm-element.metadata.json +1 -0
- package/elements/alarm/alarm-table-scrollbar.d.ts +35 -0
- package/elements/alarm/alarm-table-scrollbar.js +170 -0
- package/elements/alarm/alarm-table-scrollbar.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +10 -2
- package/elements/bar-graph-element.js +135 -5
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +6 -1
- package/elements/base/readable-element.js +69 -2
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +13 -1
- package/elements/base/state-control-element.js +42 -8
- package/elements/base/state-control-element.metadata.json +1 -1
- package/elements/character-display/character-display-element.d.ts +12 -2
- package/elements/character-display/character-display-element.js +35 -7
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/datetime-display/datetime-display-element.d.ts +1 -0
- package/elements/datetime-display/datetime-display-element.js +10 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/datetime-display/time-zone-select-json.d.ts +8 -0
- package/elements/datetime-display/time-zone-select-json.js +558 -0
- package/elements/historical-curve/historical-curve.element.d.ts +45 -3
- package/elements/historical-curve/historical-curve.element.js +707 -45
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +1 -0
- package/elements/main-element.js +72 -10
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +7 -1
- package/elements/meter-element.js +76 -7
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +31 -3
- package/elements/numerical-display/numerical-display-element.js +166 -15
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +4 -0
- package/elements/per-view-variable-communicator.js +21 -1
- package/elements/per-view-variable-communicator.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +13 -1
- package/elements/ring-graph/ring-graph-element.js +164 -3
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/scroll-alarm/scroll-alarm-element.d.ts +79 -0
- package/elements/scroll-alarm/scroll-alarm-element.js +845 -0
- package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -0
- package/elements/shared/graph/graph-state-element.d.ts +1 -0
- package/elements/shared/graph/graph-state-element.js +30 -1
- package/elements/shared/graph/graph-state-element.metadata.json +1 -1
- package/elements/shared/text/text-element.d.ts +14 -0
- package/elements/shared/text/text-element.js +38 -6
- package/elements/shared/text/text-element.metadata.json +1 -1
- package/elements/shared/text/text-state-element.d.ts +39 -2
- package/elements/shared/text/text-state-element.js +242 -67
- package/elements/shared/text/text-state-element.metadata.json +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +28 -2
- package/elements/static-elements/hyperlink-element.js +153 -4
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +28 -2
- package/elements/static-elements/text-element.js +162 -12
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +10 -3
- package/elements/switch-indicator-light/bit-indicator-light-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +20 -2
- package/elements/switch-indicator-light/switch-indicator-light-element.js +92 -15
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.js +10 -3
- package/elements/switch-indicator-light/word-indicator-light-operator.metadata.json +1 -1
- package/elements/video/video-element.d.ts +10 -0
- package/elements/video/video-element.js +139 -21
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +28 -2
- package/elements/view-operation/view-operation.element.js +172 -8
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.js +0 -1
- package/gui/gui-context.d.ts +25 -2
- package/gui/gui-host.d.ts +1 -1
- package/gui/gui-view.d.ts +19 -2
- package/gui/gui-view.js +147 -12
- 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 +11 -0
- package/localization/localization.service.js +16 -5
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +12 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/alert/alert-modal.component.js +1 -1
- package/modal/alert/alert-modal.component.less +13 -5
- package/modal/alert/alert-modal.component.metadata.json +1 -1
- package/modal/confirm-operation/confirm-operation-modal.component.html +2 -2
- package/modal/confirm-operation/confirm-operation-modal.component.js +2 -2
- package/modal/confirm-operation/confirm-operation-modal.component.less +10 -7
- package/modal/confirm-operation/confirm-operation-modal.component.metadata.json +1 -1
- package/modal/verify-password/verify-password-modal.component.d.ts +6 -2
- package/modal/verify-password/verify-password-modal.component.html +2 -2
- package/modal/verify-password/verify-password-modal.component.js +11 -5
- package/modal/verify-password/verify-password-modal.component.less +9 -0
- package/modal/verify-password/verify-password-modal.component.metadata.json +1 -1
- package/modal/write-character/write-character-modal-args.d.ts +3 -1
- package/modal/write-character/write-character-modal-args.js +2 -1
- package/modal/write-character/write-character-modal-args.metadata.json +1 -1
- package/modal/write-character/write-character-modal.component.d.ts +4 -2
- package/modal/write-character/write-character-modal.component.html +4 -4
- package/modal/write-character/write-character-modal.component.js +11 -5
- package/modal/write-character/write-character-modal.component.less +15 -0
- package/modal/write-character/write-character-modal.component.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +5 -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 +16 -8
- package/modal/write-value/write-value-modal.component.html +10 -5
- package/modal/write-value/write-value-modal.component.js +103 -21
- package/modal/write-value/write-value-modal.component.less +16 -1
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/alarm/alarm.model.d.ts +14 -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/font-setting-model.d.ts +22 -1
- package/model/base/font-setting-model.metadata.json +1 -1
- package/model/base/readable-model.d.ts +4 -0
- package/model/character-display/character-display.d.ts +1 -0
- package/model/datetime-display/datetime-display.d.ts +1 -0
- package/model/historical-curve/historical-curve-axis-settings.d.ts +11 -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/historical-curve/historical-curve-chanel.model.d.ts +8 -0
- package/model/historical-curve/historical-curve.display-settings.d.ts +1 -0
- package/model/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-display.d.ts +1 -0
- package/model/numerical-display/numerical-operation.d.ts +10 -2
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/scroll-alarm/scroll-alarm.model.d.ts +21 -0
- package/model/scroll-alarm/scroll-alarm.model.js +0 -0
- package/model/scroll-alarm/scroll-alarm.model.metadata.json +1 -0
- package/model/settings/popup/view-popup-location-type.d.ts +2 -1
- package/model/settings/popup/view-popup-location-type.js +1 -0
- package/model/settings/popup/view-popup-location-type.metadata.json +1 -1
- package/model/shared/state/state.d.ts +1 -0
- package/model/shared/state/state.js +1 -0
- package/model/shared/state/state.metadata.json +1 -1
- package/model/shared/text/font.d.ts +1 -1
- package/model/shared/text/text.d.ts +3 -0
- package/model/switch-indicator-light/switch-indicator-light.d.ts +3 -0
- package/model/view-operation/view-operation-element.model.d.ts +7 -1
- package/package.json +1 -1
- package/public_api.js +1 -0
- package/remote/communication/variable/remote-variable-communicator.d.ts +30 -0
- package/remote/communication/variable/remote-variable-communicator.js +193 -3
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +8 -0
- package/service/index.d.ts +4 -0
- package/service/index.js +1 -0
- package/service/index.metadata.json +1 -1
- package/service/language.service.d.ts +37 -0
- package/service/language.service.js +0 -0
- package/service/language.service.metadata.json +1 -0
- 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/system-text-library.service.d.ts +77 -0
- package/service/system-text-library.service.js +29 -0
- package/service/system-text-library.service.metadata.json +1 -0
- package/service/text-library.service.d.ts +49 -0
- package/service/text-library.service.js +0 -0
- package/service/text-library.service.metadata.json +1 -0
- package/shared/gui-consts.d.ts +2 -0
- package/shared/gui-consts.js +3 -1
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/fbox-data-type.service.js +40 -0
- package/utils/numerical-operation.service.js +28 -4
- package/view/popup-view.service.d.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":22,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":68,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":69,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":70,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":71,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":72,"character":23},{"__symbolic":"reference","module":"../../config","name":"AlarmsStore","line":73,"character":38},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":75,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":76,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":77,"character":38}]}],"dispose":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getHeaderTextByColumn":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"refreshCurrentPageData":[{"__symbolic":"method"}],"updateTableContent":[{"__symbolic":"method"}],"renderScrollWindow":[{"__symbolic":"method"}],"updateScrollThumb":[{"__symbolic":"method"}],"getMaxWindowStart":[{"__symbolic":"method"}],"getIconScale":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"buildHeaderRow":[{"__symbolic":"method"}],"buildDataRow":[{"__symbolic":"method"}],"renderPlainTable":[{"__symbolic":"method"}],"renderScrollableTable":[{"__symbolic":"method"}],"bindScrollHoverEvents":[{"__symbolic":"method"}],"unbindScrollHoverEvents":[{"__symbolic":"method"}],"moveScrollWindowBy":[{"__symbolic":"method"}],"getCanvasScaleY":[{"__symbolic":"method"}],"getScreenRowHeight":[{"__symbolic":"method"}],"supportsMouseHover":[{"__symbolic":"method"}],"startAutoScroll":[{"__symbolic":"method"}],"scrollOneRow":[{"__symbolic":"method"}],"autoNextPage":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class AlarmTableScrollbar {
|
|
2
|
+
private readonly y;
|
|
3
|
+
private readonly height;
|
|
4
|
+
private readonly visibleRows;
|
|
5
|
+
private readonly onChange;
|
|
6
|
+
private readonly onPause;
|
|
7
|
+
private readonly onResume;
|
|
8
|
+
private readonly group;
|
|
9
|
+
private readonly track;
|
|
10
|
+
private readonly thumb;
|
|
11
|
+
private readonly ownerDocument;
|
|
12
|
+
private maxStart;
|
|
13
|
+
private start;
|
|
14
|
+
private thumbHeight;
|
|
15
|
+
private thumbTop;
|
|
16
|
+
private dragging;
|
|
17
|
+
private hovered;
|
|
18
|
+
private dragStartY;
|
|
19
|
+
private dragStartRow;
|
|
20
|
+
constructor(parent: SVGElement, x: number, y: number, width: number, height: number, visibleRows: number, onChange: (start: number) => void, onPause: () => void, onResume: () => void);
|
|
21
|
+
get isInteracting(): boolean;
|
|
22
|
+
update(start: number, totalRows: number): void;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
private createElement;
|
|
25
|
+
private setRect;
|
|
26
|
+
private getLocalY;
|
|
27
|
+
private readonly handleStart;
|
|
28
|
+
private readonly handleMove;
|
|
29
|
+
private readonly handleEnd;
|
|
30
|
+
private readonly handleLeave;
|
|
31
|
+
private readonly handleEnter;
|
|
32
|
+
private readonly handleKeyDown;
|
|
33
|
+
private unbindDrag;
|
|
34
|
+
private supportsMouseHover;
|
|
35
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
|
|
2
|
+
const TRACK_COLOR = '#f0f1f4';
|
|
3
|
+
const THUMB_COLOR = '#c5cbd4';
|
|
4
|
+
const ACTIVE_THUMB_COLOR = '#adb6c2';
|
|
5
|
+
export class AlarmTableScrollbar {
|
|
6
|
+
constructor(parent, x, y, width, height, visibleRows, onChange, onPause, onResume) {
|
|
7
|
+
this.y = y;
|
|
8
|
+
this.height = height;
|
|
9
|
+
this.visibleRows = visibleRows;
|
|
10
|
+
this.onChange = onChange;
|
|
11
|
+
this.onPause = onPause;
|
|
12
|
+
this.onResume = onResume;
|
|
13
|
+
this.maxStart = 0;
|
|
14
|
+
this.start = 0;
|
|
15
|
+
this.thumbHeight = 0;
|
|
16
|
+
this.thumbTop = 0;
|
|
17
|
+
this.dragging = false;
|
|
18
|
+
this.hovered = false;
|
|
19
|
+
this.dragStartY = 0;
|
|
20
|
+
this.dragStartRow = 0;
|
|
21
|
+
this.handleStart = (event) => {
|
|
22
|
+
if (!this.maxStart || ('button' in event && event.button !== 0) || ('touches' in event && event.touches.length !== 1))
|
|
23
|
+
return;
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
event.stopPropagation();
|
|
26
|
+
this.onPause();
|
|
27
|
+
const localY = this.getLocalY(event);
|
|
28
|
+
// The full gutter is clickable, including the transparent sides of the thumb.
|
|
29
|
+
if (localY < this.y + this.thumbTop || localY > this.y + this.thumbTop + this.thumbHeight) {
|
|
30
|
+
this.onChange(this.start + (localY < this.y + this.thumbTop ? -this.visibleRows : this.visibleRows));
|
|
31
|
+
this.onResume();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.dragging = true;
|
|
35
|
+
this.dragStartY = localY;
|
|
36
|
+
this.dragStartRow = this.start;
|
|
37
|
+
this.thumb.setAttribute('fill', ACTIVE_THUMB_COLOR);
|
|
38
|
+
this.thumb.style.cursor = 'grabbing';
|
|
39
|
+
this.ownerDocument.addEventListener('mousemove', this.handleMove);
|
|
40
|
+
this.ownerDocument.addEventListener('mouseup', this.handleEnd);
|
|
41
|
+
this.ownerDocument.addEventListener('touchmove', this.handleMove, { passive: false });
|
|
42
|
+
this.ownerDocument.addEventListener('touchend', this.handleEnd);
|
|
43
|
+
this.ownerDocument.addEventListener('touchcancel', this.handleEnd);
|
|
44
|
+
this.ownerDocument.defaultView.addEventListener('blur', this.handleEnd);
|
|
45
|
+
};
|
|
46
|
+
this.handleMove = (event) => {
|
|
47
|
+
if (!this.dragging || ('touches' in event && event.touches.length !== 1))
|
|
48
|
+
return;
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
const travel = this.height - this.thumbHeight;
|
|
52
|
+
if (travel <= 0)
|
|
53
|
+
return;
|
|
54
|
+
const rowDelta = Math.round((this.getLocalY(event) - this.dragStartY) / travel * this.maxStart);
|
|
55
|
+
this.onChange(this.dragStartRow + rowDelta);
|
|
56
|
+
};
|
|
57
|
+
this.handleEnd = () => {
|
|
58
|
+
if (!this.dragging)
|
|
59
|
+
return;
|
|
60
|
+
this.dragging = false;
|
|
61
|
+
this.unbindDrag();
|
|
62
|
+
this.thumb.setAttribute('fill', THUMB_COLOR);
|
|
63
|
+
this.thumb.style.cursor = 'grab';
|
|
64
|
+
this.onResume();
|
|
65
|
+
};
|
|
66
|
+
this.handleLeave = () => {
|
|
67
|
+
this.hovered = false;
|
|
68
|
+
this.onResume();
|
|
69
|
+
};
|
|
70
|
+
this.handleEnter = () => {
|
|
71
|
+
if (!this.supportsMouseHover())
|
|
72
|
+
return;
|
|
73
|
+
this.hovered = true;
|
|
74
|
+
this.onPause();
|
|
75
|
+
};
|
|
76
|
+
this.handleKeyDown = (event) => {
|
|
77
|
+
const targets = {
|
|
78
|
+
ArrowUp: this.start - 1,
|
|
79
|
+
ArrowDown: this.start + 1,
|
|
80
|
+
PageUp: this.start - this.visibleRows,
|
|
81
|
+
PageDown: this.start + this.visibleRows,
|
|
82
|
+
Home: 0,
|
|
83
|
+
End: this.maxStart
|
|
84
|
+
};
|
|
85
|
+
if (!(event.key in targets))
|
|
86
|
+
return;
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
this.onChange(targets[event.key]);
|
|
90
|
+
};
|
|
91
|
+
this.ownerDocument = parent.ownerDocument;
|
|
92
|
+
this.group = this.createElement('g');
|
|
93
|
+
this.group.setAttribute('role', 'scrollbar');
|
|
94
|
+
this.group.setAttribute('aria-orientation', 'vertical');
|
|
95
|
+
this.group.setAttribute('aria-valuemin', '0');
|
|
96
|
+
this.group.setAttribute('tabindex', '0');
|
|
97
|
+
this.group.style.cursor = 'default';
|
|
98
|
+
this.track = this.createElement('rect');
|
|
99
|
+
this.setRect(this.track, x, y, width, height);
|
|
100
|
+
this.track.setAttribute('fill', TRACK_COLOR);
|
|
101
|
+
this.track.setAttribute('rx', '0');
|
|
102
|
+
this.thumb = this.createElement('rect');
|
|
103
|
+
this.setRect(this.thumb, x, y, width, height);
|
|
104
|
+
this.thumb.setAttribute('fill', THUMB_COLOR);
|
|
105
|
+
this.thumb.setAttribute('rx', String(width / 2));
|
|
106
|
+
this.thumb.style.transition = 'fill 120ms ease';
|
|
107
|
+
this.thumb.style.cursor = 'grab';
|
|
108
|
+
this.group.appendChild(this.track);
|
|
109
|
+
this.group.appendChild(this.thumb);
|
|
110
|
+
parent.appendChild(this.group);
|
|
111
|
+
this.group.addEventListener('mousedown', this.handleStart);
|
|
112
|
+
this.group.addEventListener('touchstart', this.handleStart, { passive: false });
|
|
113
|
+
this.group.addEventListener('keydown', this.handleKeyDown);
|
|
114
|
+
this.group.addEventListener('mouseenter', this.handleEnter);
|
|
115
|
+
this.group.addEventListener('mouseleave', this.handleLeave);
|
|
116
|
+
}
|
|
117
|
+
get isInteracting() {
|
|
118
|
+
return this.dragging || this.hovered;
|
|
119
|
+
}
|
|
120
|
+
update(start, totalRows) {
|
|
121
|
+
this.maxStart = Math.max(0, totalRows - this.visibleRows);
|
|
122
|
+
this.start = Math.min(this.maxStart, Math.max(0, start));
|
|
123
|
+
this.group.setAttribute('display', this.maxStart ? 'inline' : 'none');
|
|
124
|
+
this.group.setAttribute('aria-valuemax', String(this.maxStart));
|
|
125
|
+
this.group.setAttribute('aria-valuenow', String(this.start));
|
|
126
|
+
this.thumbHeight = Math.min(this.height, Math.max(20, this.height * this.visibleRows / Math.max(1, totalRows)));
|
|
127
|
+
this.thumbTop = this.maxStart ? (this.height - this.thumbHeight) * this.start / this.maxStart : 0;
|
|
128
|
+
this.thumb.setAttribute('height', String(this.thumbHeight));
|
|
129
|
+
this.thumb.setAttribute('y', String(this.y + this.thumbTop));
|
|
130
|
+
}
|
|
131
|
+
dispose() {
|
|
132
|
+
this.dragging = false;
|
|
133
|
+
this.unbindDrag();
|
|
134
|
+
this.group.removeEventListener('mousedown', this.handleStart);
|
|
135
|
+
this.group.removeEventListener('touchstart', this.handleStart);
|
|
136
|
+
this.group.removeEventListener('keydown', this.handleKeyDown);
|
|
137
|
+
this.group.removeEventListener('mouseenter', this.handleEnter);
|
|
138
|
+
this.group.removeEventListener('mouseleave', this.handleLeave);
|
|
139
|
+
this.group.remove();
|
|
140
|
+
}
|
|
141
|
+
createElement(name) {
|
|
142
|
+
return this.ownerDocument.createElementNS('http://www.w3.org/2000/svg', name);
|
|
143
|
+
}
|
|
144
|
+
setRect(rect, x, y, width, height) {
|
|
145
|
+
rect.setAttribute('x', String(x));
|
|
146
|
+
rect.setAttribute('y', String(y));
|
|
147
|
+
rect.setAttribute('width', String(width));
|
|
148
|
+
rect.setAttribute('height', String(height));
|
|
149
|
+
}
|
|
150
|
+
getLocalY(event) {
|
|
151
|
+
const pointer = 'touches' in event ? event.touches[0] : event;
|
|
152
|
+
const point = this.group.ownerSVGElement.createSVGPoint();
|
|
153
|
+
point.x = pointer.clientX;
|
|
154
|
+
point.y = pointer.clientY;
|
|
155
|
+
const matrix = this.group.getScreenCTM();
|
|
156
|
+
return matrix ? point.matrixTransform(matrix.inverse()).y : point.y;
|
|
157
|
+
}
|
|
158
|
+
unbindDrag() {
|
|
159
|
+
this.ownerDocument.removeEventListener('mousemove', this.handleMove);
|
|
160
|
+
this.ownerDocument.removeEventListener('mouseup', this.handleEnd);
|
|
161
|
+
this.ownerDocument.removeEventListener('touchmove', this.handleMove);
|
|
162
|
+
this.ownerDocument.removeEventListener('touchend', this.handleEnd);
|
|
163
|
+
this.ownerDocument.removeEventListener('touchcancel', this.handleEnd);
|
|
164
|
+
this.ownerDocument.defaultView.removeEventListener('blur', this.handleEnd);
|
|
165
|
+
}
|
|
166
|
+
supportsMouseHover() {
|
|
167
|
+
const view = this.ownerDocument.defaultView;
|
|
168
|
+
return !!view && (!view.matchMedia || view.matchMedia('(hover: hover) and (pointer: fine)').matches);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmTableScrollbar":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":20,"character":16,"context":{"typeName":"SVGElement"}},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"error","message":"Expression form not supported","line":26,"character":35},{"__symbolic":"error","message":"Expression form not supported","line":27,"character":34},{"__symbolic":"error","message":"Expression form not supported","line":28,"character":35}]}],"update":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"createElement":[{"__symbolic":"method"}],"setRect":[{"__symbolic":"method"}],"getLocalY":[{"__symbolic":"method"}],"unbindDrag":[{"__symbolic":"method"}],"supportsMouseHover":[{"__symbolic":"method"}]}}}}]
|
|
@@ -5,17 +5,25 @@ 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;
|
|
11
13
|
private readonly $barText;
|
|
12
|
-
private
|
|
14
|
+
private defaultTransform;
|
|
13
15
|
private defaultBarColor;
|
|
14
16
|
private defaultUpperLimitColor;
|
|
15
17
|
private defaultLowerLimitColor;
|
|
16
18
|
private barText;
|
|
19
|
+
private valueObj;
|
|
20
|
+
private isNeedUpdateScale;
|
|
21
|
+
private needAddNumber;
|
|
17
22
|
get readVariableName(): string;
|
|
18
23
|
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
24
|
+
private initTransform;
|
|
19
25
|
private initFrameNode;
|
|
20
|
-
|
|
26
|
+
private updateValueObj;
|
|
27
|
+
private updateScale;
|
|
28
|
+
updateVariableValue(value: number, variableName: any): void;
|
|
21
29
|
}
|
|
@@ -2,6 +2,7 @@ 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
7
|
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
7
8
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
@@ -9,6 +10,15 @@ export class BarGraphElement extends ReadableElement {
|
|
|
9
10
|
this.defaultUpperLimitColor = '#ff4448';
|
|
10
11
|
this.defaultLowerLimitColor = '#0f60e8';
|
|
11
12
|
this.barText = '';
|
|
13
|
+
this.valueObj = {};
|
|
14
|
+
this.isNeedUpdateScale = false;
|
|
15
|
+
this.needAddNumber = 0;
|
|
16
|
+
if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
|
|
17
|
+
|| this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
|
|
18
|
+
this.isNeedUpdateScale = true;
|
|
19
|
+
this.updateScale();
|
|
20
|
+
this.isNeedUpdateScale = false;
|
|
21
|
+
}
|
|
12
22
|
this.$barRect = this.$element.find('rect');
|
|
13
23
|
this.$barText = this.$element.find('text[id="text"]').last();
|
|
14
24
|
if (this.model.version && this.model.version >= 1) {
|
|
@@ -19,7 +29,7 @@ export class BarGraphElement extends ReadableElement {
|
|
|
19
29
|
}
|
|
20
30
|
setTimeout(() => {
|
|
21
31
|
this.initFrameNode();
|
|
22
|
-
}
|
|
32
|
+
});
|
|
23
33
|
}
|
|
24
34
|
get readVariableName() {
|
|
25
35
|
if (!this.model) {
|
|
@@ -36,15 +46,133 @@ export class BarGraphElement extends ReadableElement {
|
|
|
36
46
|
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
37
47
|
}
|
|
38
48
|
}
|
|
49
|
+
initTransform() {
|
|
50
|
+
if (this.needAddNumber <= 3)
|
|
51
|
+
return;
|
|
52
|
+
this.$element[0].childNodes.forEach((node, index) => {
|
|
53
|
+
// const matrixE = node.transform.baseVal[0].matrix.e;
|
|
54
|
+
// node.transform.baseVal[0].matrix.e = matrixE + (this.needAddNumber - 3) * 7;
|
|
55
|
+
if (!node.transform.baseVal[0])
|
|
56
|
+
return;
|
|
57
|
+
if (node.nodeName === 'g') {
|
|
58
|
+
const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
|
|
59
|
+
const rootNode = node.parentNode.parentNode.parentElement;
|
|
60
|
+
const clipPath = $(rootNode).find(`clipPath[id="${nodeValue}"]`);
|
|
61
|
+
const demoPath = clipPath.find('path');
|
|
62
|
+
const dValues = demoPath.attr('d').split(',');
|
|
63
|
+
const retValues = [];
|
|
64
|
+
dValues.forEach((line) => {
|
|
65
|
+
const values = [];
|
|
66
|
+
line.split(' ').forEach((item) => {
|
|
67
|
+
const nItem = Number(item);
|
|
68
|
+
if (nItem === -1) {
|
|
69
|
+
item = nItem - (this.needAddNumber - 3) * 7;
|
|
70
|
+
}
|
|
71
|
+
values.push(item);
|
|
72
|
+
});
|
|
73
|
+
retValues.push(values.join(' '));
|
|
74
|
+
});
|
|
75
|
+
demoPath.attr('d', retValues.join(','));
|
|
76
|
+
}
|
|
77
|
+
else if (index === this.$element[0].childNodes.length - 1) {
|
|
78
|
+
this.defaultTransform = node.attributes['transform'].value;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
39
82
|
initFrameNode() {
|
|
40
83
|
const arcPath = Snap(this.$element[0]);
|
|
41
84
|
const b = arcPath.getBBox(true);
|
|
42
85
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
43
86
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
87
|
+
updateValueObj(value, variableName) {
|
|
88
|
+
var _a, _b, _c;
|
|
89
|
+
if (((_a = this.model.readVariable) === null || _a === void 0 ? void 0 : _a.name) === variableName) {
|
|
90
|
+
this.isNeedUpdateScale = false;
|
|
91
|
+
this.valueObj.value = value;
|
|
92
|
+
}
|
|
93
|
+
if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
|
|
94
|
+
this.isNeedUpdateScale = true;
|
|
95
|
+
this.valueObj.min = value;
|
|
96
|
+
}
|
|
97
|
+
if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
|
|
98
|
+
this.isNeedUpdateScale = true;
|
|
99
|
+
this.valueObj.max = value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
updateScale() {
|
|
103
|
+
if (!this.isNeedUpdateScale) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const textElements = this.$element.find('g:first > text');
|
|
107
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
108
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
109
|
+
min = Number(min);
|
|
110
|
+
max = Number(max);
|
|
111
|
+
if (isNaN(min) || isNaN(max)) {
|
|
112
|
+
min = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
113
|
+
max = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
114
|
+
}
|
|
115
|
+
if (this.model.maxValueType === VariableValueType.Variable || this.model.minValueType === VariableValueType.Variable) {
|
|
116
|
+
this.needAddNumber = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
|
|
117
|
+
this.initTransform();
|
|
118
|
+
}
|
|
119
|
+
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
120
|
+
for (let i = 0; i < textElements.length; i++) {
|
|
121
|
+
const text = textElements[i];
|
|
122
|
+
if (!text.innerHTML) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
|
|
126
|
+
// 整数位和小数位格式化;
|
|
127
|
+
if (this.model.fractionDigits > 0) {
|
|
128
|
+
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
129
|
+
}
|
|
130
|
+
if (!isNaN(sacleValue)) {
|
|
131
|
+
text.innerHTML = sacleValue;
|
|
132
|
+
if (this.model.minValueType !== VariableValueType.Constant || this.model.maxValueType !== VariableValueType.Constant) {
|
|
133
|
+
// FLEXCLOUD-2619 刻度未对齐问题
|
|
134
|
+
let translateX = 0;
|
|
135
|
+
const sacleLen = sacleValue.toString().length;
|
|
136
|
+
switch (sacleLen) {
|
|
137
|
+
case 1:
|
|
138
|
+
translateX = 13;
|
|
139
|
+
break;
|
|
140
|
+
case 2:
|
|
141
|
+
translateX = 7;
|
|
142
|
+
break;
|
|
143
|
+
case 3:
|
|
144
|
+
translateX = this.model.fractionDigits ? 5 : 0;
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
if (sacleLen > 3 && this.needAddNumber > 3) {
|
|
148
|
+
translateX = -(sacleLen - 3) * 7;
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
if (this.model.minValueType !== VariableValueType.Constant && this.model.maxValueType === VariableValueType.Constant) {
|
|
153
|
+
const maxLen = this.model.max && this.model.max.toString().length;
|
|
154
|
+
translateX += maxLen > 2 ? (maxLen - 3) * 7 : 0;
|
|
155
|
+
}
|
|
156
|
+
text.transform.baseVal[0].matrix.e = translateX;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
updateVariableValue(value, variableName) {
|
|
162
|
+
this.updateValueObj(value, variableName);
|
|
163
|
+
this.updateScale();
|
|
164
|
+
const variableValue = Number(this.valueObj.value);
|
|
165
|
+
let maxValue = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
166
|
+
let minValue = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
167
|
+
minValue = Number(minValue);
|
|
168
|
+
maxValue = Number(maxValue);
|
|
169
|
+
if (isNaN(minValue) || isNaN(maxValue)) {
|
|
170
|
+
minValue = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
171
|
+
maxValue = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
172
|
+
}
|
|
173
|
+
if (isNaN(variableValue)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
48
176
|
const useAlarmLimit = this.model.useAlarmLimit;
|
|
49
177
|
const useAlarmUpperLimit = null != this.model.upperLimit;
|
|
50
178
|
const useAlarmLowerLimit = null != this.model.lowerLimit;
|
|
@@ -112,3 +240,5 @@ export class BarGraphElement extends ReadableElement {
|
|
|
112
240
|
}
|
|
113
241
|
}
|
|
114
242
|
}
|
|
243
|
+
BarGraphElement.DEFAULT_MIN_VALUE = 0;
|
|
244
|
+
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":39,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../service","name":"PermissionChecker","line":39,"character":57},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":40,"character":30},{"__symbolic":"reference","module":"../config","name":"VariableStore","line":41,"character":23},{"__symbolic":"reference","module":"../localization","name":"Localization","line":42,"character":22},{"__symbolic":"reference","name":"string"}]}],"initTransform":[{"__symbolic":"method"}],"initFrameNode":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
|
|
@@ -9,7 +9,12 @@ export declare abstract class ReadableElement extends ConditionalEnableElement {
|
|
|
9
9
|
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
10
10
|
init(variableName: string): void;
|
|
11
11
|
get readVariableName(): string;
|
|
12
|
-
|
|
12
|
+
get minVariableName(): string;
|
|
13
|
+
get minValueType(): any;
|
|
14
|
+
get maxVariableName(): string;
|
|
15
|
+
get maxValueType(): any;
|
|
16
|
+
private getVariableName;
|
|
17
|
+
protected abstract updateVariableValue(value: any, variableName: any): void;
|
|
13
18
|
reportStateChanged(variableState: VariableState): void;
|
|
14
19
|
reportValueChanged(value: VariableValue): void;
|
|
15
20
|
}
|
|
@@ -3,6 +3,7 @@ import { VariableState } from '../../communication';
|
|
|
3
3
|
import { ConditionalEnableElement } from './conditional-enable-element';
|
|
4
4
|
import { forEach } from 'lodash';
|
|
5
5
|
import { VariableUtil } from '../../utils/variable-util';
|
|
6
|
+
import { GuiFeatureConfig } from '../../config';
|
|
6
7
|
export class ReadableElement extends ConditionalEnableElement {
|
|
7
8
|
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
8
9
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
@@ -36,6 +37,33 @@ export class ReadableElement extends ConditionalEnableElement {
|
|
|
36
37
|
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
get minVariableName() {
|
|
41
|
+
if (!this.model.minValueType) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return this.getVariableName(this.model.minVariable);
|
|
45
|
+
}
|
|
46
|
+
get minValueType() {
|
|
47
|
+
return this.model.minValueType;
|
|
48
|
+
}
|
|
49
|
+
get maxVariableName() {
|
|
50
|
+
if (!this.model.maxValueType) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return this.getVariableName(this.model.maxVariable);
|
|
54
|
+
}
|
|
55
|
+
get maxValueType() {
|
|
56
|
+
return this.model.maxValueType;
|
|
57
|
+
}
|
|
58
|
+
getVariableName(variable) {
|
|
59
|
+
if (!this.model) {
|
|
60
|
+
throw new Error('Model cannot be null');
|
|
61
|
+
}
|
|
62
|
+
if (!variable) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
66
|
+
}
|
|
39
67
|
reportStateChanged(variableState) {
|
|
40
68
|
forEach(this.elementStates, elementState => {
|
|
41
69
|
if (elementState.variableName === variableState.variableName) {
|
|
@@ -45,14 +73,53 @@ export class ReadableElement extends ConditionalEnableElement {
|
|
|
45
73
|
});
|
|
46
74
|
}
|
|
47
75
|
reportValueChanged(value) {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
48
77
|
forEach(this.elementStates, elementState => {
|
|
49
78
|
if (elementState.variableName === value.variableName) {
|
|
50
79
|
elementState.state = value.state;
|
|
51
80
|
this.changeStates();
|
|
52
81
|
}
|
|
53
82
|
});
|
|
54
|
-
|
|
55
|
-
|
|
83
|
+
// 处理系统变量"设备状态"
|
|
84
|
+
if (value.systemName === '设备状态') {
|
|
85
|
+
let name = value.customStatus;
|
|
86
|
+
const language = ((_b = (_a = window.abp.localization) === null || _a === void 0 ? void 0 : _a.currentLanguage) === null || _b === void 0 ? void 0 : _b.name) || ((_d = (_c = this.localization.localizationService) === null || _c === void 0 ? void 0 : _c.translate) === null || _d === void 0 ? void 0 : _d.currentLang);
|
|
87
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
88
|
+
const isTraditionalChinese = language === 'zh-Hant' || language === 'zh-TW' || language === 'zh-tw';
|
|
89
|
+
if (!name) {
|
|
90
|
+
switch (value.state) {
|
|
91
|
+
case 1:
|
|
92
|
+
name = isTraditionalChinese ? '線上' : (isChinese ? '在线' : 'Online');
|
|
93
|
+
break;
|
|
94
|
+
case 3:
|
|
95
|
+
name = isTraditionalChinese ? '離線' : (isChinese ? '离线' : 'Offline');
|
|
96
|
+
break;
|
|
97
|
+
case 4:
|
|
98
|
+
name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
|
|
99
|
+
break;
|
|
100
|
+
case 5:
|
|
101
|
+
name = isTraditionalChinese ? '未綁定' : (isChinese ? '未绑定' : 'Unbound');
|
|
102
|
+
break;
|
|
103
|
+
default:
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (value.state === 4) {
|
|
107
|
+
name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
|
|
108
|
+
}
|
|
109
|
+
this.updateVariableValue(name, '设备状态');
|
|
110
|
+
return; // 处理完"设备状态"后直接返回
|
|
111
|
+
}
|
|
112
|
+
// 处理系统变量"当前语种ID"
|
|
113
|
+
if (value.variableName === '当前语种ID') {
|
|
114
|
+
// 直接使用变量值(数字或null)
|
|
115
|
+
this.updateVariableValue(value.value, value.variableName);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// 处理普通变量
|
|
119
|
+
if (this.state === State.Normal || this.state === State.Disable || (GuiFeatureConfig.isOfflineDisplayEnabled && this.state === State.Offline)
|
|
120
|
+
|| value.variableName === this.minVariableName
|
|
121
|
+
|| value.variableName === this.maxVariableName) {
|
|
122
|
+
this.updateVariableValue(value.value, value.variableName);
|
|
56
123
|
}
|
|
57
124
|
}
|
|
58
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ReadableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-enable-element","name":"ConditionalEnableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ReadableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-enable-element","name":"ConditionalEnableElement","line":10,"character":46},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":14,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":14,"character":98},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":15,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":15,"character":52},{"__symbolic":"reference","name":"string"}]}],"init":[{"__symbolic":"method"}],"getVariableName":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"reportStateChanged":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="jquery" />
|
|
2
|
+
/// <reference types="jqueryui" />
|
|
1
3
|
import { PermissionChecker } from '../../service';
|
|
2
4
|
import { Localization } from '../../localization';
|
|
3
5
|
import { VariableCommunicator, VariableState } from '../../communication';
|
|
@@ -9,9 +11,19 @@ export declare abstract class StateControlElement extends ConditionalDynamicDisp
|
|
|
9
11
|
isEnable: boolean;
|
|
10
12
|
elementStates: VariableState[];
|
|
11
13
|
state: State;
|
|
12
|
-
|
|
14
|
+
currentRect: JQuery;
|
|
13
15
|
preState: State;
|
|
14
16
|
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
17
|
+
/**
|
|
18
|
+
* 子类可覆盖此方法提供元件当前大小和初始大小,用于状态图标缩放计算
|
|
19
|
+
* @returns {{ width: number, height: number, initWidth?: number, initHeight?: number }}
|
|
20
|
+
*/
|
|
21
|
+
protected getElementSizeForIconScale(): {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
initWidth?: number;
|
|
25
|
+
initHeight?: number;
|
|
26
|
+
} | null;
|
|
15
27
|
initState(): void;
|
|
16
28
|
updateElementStates(newElementStates: VariableState[]): void;
|
|
17
29
|
addElementState(newElementState: VariableState): void;
|