@flexem/fc-gui 3.0.0-alpha.180 → 3.0.0-alpha.182
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/bundles/@flexem/fc-gui.umd.js +727 -293
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/config/variable/variable-store.d.ts +4 -0
- package/elements/alarm/alarm-element.d.ts +20 -0
- package/elements/alarm/alarm-element.js +312 -70
- package/elements/alarm/alarm-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +10 -0
- package/elements/base/state-control-element.js +21 -3
- 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 +30 -3
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +1 -0
- package/elements/historical-curve/historical-curve.element.js +35 -22
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.js +3 -2
- package/elements/numerical-display/numerical-display-element.d.ts +9 -0
- package/elements/numerical-display/numerical-display-element.js +19 -1
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +9 -0
- package/elements/switch-indicator-light/switch-indicator-light-element.js +20 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.js +7 -2
- package/gui/gui-view.d.ts +15 -1
- package/gui/gui-view.js +78 -4
- package/gui/gui-view.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 +1 -0
- package/modal/write-character/write-character-modal.component.js +5 -1
- package/modal/write-character/write-character-modal.component.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +1 -0
- package/modal/write-value/write-value-modal.component.js +5 -1
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/alarm/alarm.model.d.ts +1 -0
- package/model/character-display/character-display.d.ts +1 -0
- package/model/historical-curve/historical-curve.display-settings.d.ts +1 -0
- package/model/numerical-display/numerical-display.d.ts +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/switch-indicator-light/switch-indicator-light.d.ts +1 -0
- package/package.json +1 -1
- package/view/popup-view.service.d.ts +1 -1
|
@@ -4,7 +4,7 @@ import { VariableCommunicator } from '../../communication';
|
|
|
4
4
|
import { GraphStore, VariableStore } from '../../config';
|
|
5
5
|
import { Localization } from '../../localization';
|
|
6
6
|
import { CharacterDisplay } from '../../model';
|
|
7
|
-
import { OperationRecordService, PermissionChecker } from '../../service';
|
|
7
|
+
import { OperationRecordService, PermissionChecker, ReleasedVariableService } from '../../service';
|
|
8
8
|
import { ReadableElement } from '../base/readable-element';
|
|
9
9
|
import { SecurityChecker } from '../../security';
|
|
10
10
|
export declare class CharacterDisplayElement extends ReadableElement {
|
|
@@ -12,12 +12,13 @@ export declare class CharacterDisplayElement extends ReadableElement {
|
|
|
12
12
|
private readonly graphStore;
|
|
13
13
|
private readonly operationRecordService;
|
|
14
14
|
private readonly securityChecker;
|
|
15
|
+
private readonly releasedVariableService?;
|
|
15
16
|
protected readonly model: CharacterDisplay;
|
|
16
17
|
private readonly accessPermissionService;
|
|
17
18
|
private displayValue;
|
|
18
19
|
private graphs;
|
|
19
20
|
private readonly logger;
|
|
20
|
-
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
21
|
+
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string, releasedVariableService?: ReleasedVariableService);
|
|
21
22
|
get readVariableName(): string;
|
|
22
23
|
get writeVariableName(): string;
|
|
23
24
|
protected updateVariableValue(value: string): void;
|
|
@@ -32,4 +33,13 @@ export declare class CharacterDisplayElement extends ReadableElement {
|
|
|
32
33
|
private doWriteCharacterValue;
|
|
33
34
|
private recordOperation;
|
|
34
35
|
private changeGraph;
|
|
36
|
+
/**
|
|
37
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
38
|
+
*/
|
|
39
|
+
protected getElementSizeForIconScale(): {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
initWidth?: number;
|
|
43
|
+
initHeight?: number;
|
|
44
|
+
} | null;
|
|
35
45
|
}
|
|
@@ -12,12 +12,13 @@ import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify
|
|
|
12
12
|
import { VariableUtil } from '../../utils/variable-util';
|
|
13
13
|
import { TextElementModal } from '../shared/text/text-element';
|
|
14
14
|
export class CharacterDisplayElement extends ReadableElement {
|
|
15
|
-
constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId) {
|
|
15
|
+
constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId, releasedVariableService) {
|
|
16
16
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
17
17
|
this.modalService = modalService;
|
|
18
18
|
this.graphStore = graphStore;
|
|
19
19
|
this.operationRecordService = operationRecordService;
|
|
20
20
|
this.securityChecker = securityChecker;
|
|
21
|
+
this.releasedVariableService = releasedVariableService;
|
|
21
22
|
this.displayValue = '';
|
|
22
23
|
this.graphs = new Map();
|
|
23
24
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
@@ -247,7 +248,10 @@ export class CharacterDisplayElement extends ReadableElement {
|
|
|
247
248
|
}
|
|
248
249
|
checkElementPassword() {
|
|
249
250
|
if (this.model.enablePassword) {
|
|
250
|
-
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
251
|
+
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
252
|
+
initialState: { securityChecker: this.securityChecker, releasedVariableService: this.releasedVariableService },
|
|
253
|
+
backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
|
|
254
|
+
});
|
|
251
255
|
const onClosedSub = modalRef.content.onClosed.subscribe(result => {
|
|
252
256
|
modalRef.hide();
|
|
253
257
|
onClosedSub.unsubscribe();
|
|
@@ -264,7 +268,15 @@ export class CharacterDisplayElement extends ReadableElement {
|
|
|
264
268
|
if (null == this.writeVariableName) {
|
|
265
269
|
return;
|
|
266
270
|
}
|
|
267
|
-
|
|
271
|
+
// 优先使用接口返回的实时字符长度,如果获取不到则使用页面配置中的长度
|
|
272
|
+
let charCount = this.model.charCount;
|
|
273
|
+
if (this.variableStore.getCharCountByVariableName) {
|
|
274
|
+
const runtimeCharCount = this.variableStore.getCharCountByVariableName(this.writeVariableName);
|
|
275
|
+
if (runtimeCharCount !== undefined) {
|
|
276
|
+
charCount = runtimeCharCount;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const args = new WriteCharacterModalArgs(this.writeVariableName, this.model.isPassword, charCount, this.displayValue, this.releasedVariableService);
|
|
268
280
|
const modalRef = this.modalService.show(WriteCharacterModalComponent, {
|
|
269
281
|
initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-write', animated: false
|
|
270
282
|
});
|
|
@@ -309,4 +321,19 @@ export class CharacterDisplayElement extends ReadableElement {
|
|
|
309
321
|
this.rootElement.select('image').attr('xlink:href', null);
|
|
310
322
|
}
|
|
311
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
326
|
+
*/
|
|
327
|
+
getElementSizeForIconScale() {
|
|
328
|
+
var _a, _b;
|
|
329
|
+
if (this.model.size) {
|
|
330
|
+
return {
|
|
331
|
+
width: this.model.size.width,
|
|
332
|
+
height: this.model.size.height,
|
|
333
|
+
initWidth: (_a = this.model.initSize) === null || _a === void 0 ? void 0 : _a.width,
|
|
334
|
+
initHeight: (_b = this.model.initSize) === null || _b === void 0 ? void 0 : _b.height
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
312
339
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"CharacterDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":20,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":29,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":29,"character":48},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":30,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":31,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":32,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":33,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":34,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":35,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":36,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":37,"character":22},{"__symbolic":"reference","name":"string"}]}],"updateVariableValue":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateDisplayValue":[{"__symbolic":"method"}],"getVariableValueText":[{"__symbolic":"method"}],"characterDisplayText":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initClickEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doWriteCharacterValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeGraph":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"CharacterDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":20,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":29,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":29,"character":48},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":30,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":31,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":32,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":33,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":34,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":35,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":36,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":37,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":39,"character":51}]}],"updateVariableValue":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateDisplayValue":[{"__symbolic":"method"}],"getVariableValueText":[{"__symbolic":"method"}],"characterDisplayText":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initClickEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doWriteCharacterValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeGraph":[{"__symbolic":"method"}],"getElementSizeForIconScale":[{"__symbolic":"method"}]}}}}]
|
|
@@ -51,6 +51,7 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
51
51
|
private _fullscreenChangeHandler;
|
|
52
52
|
private _resizeHideHandler;
|
|
53
53
|
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService, guiContext?: GuiContext, releasedVariableService?: ReleasedVariableService);
|
|
54
|
+
private getIconScale;
|
|
54
55
|
dispose(): void;
|
|
55
56
|
private initKeyboardListener;
|
|
56
57
|
private setNeedResize;
|
|
@@ -72,6 +72,16 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
72
72
|
// 订阅语种变化事件 和 文本库缓存更新事件
|
|
73
73
|
this.subscribeLanguageChange();
|
|
74
74
|
}
|
|
75
|
+
getIconScale() {
|
|
76
|
+
const initSize = this.model.displaySetting.initSize;
|
|
77
|
+
const size = this.model.displaySetting.size;
|
|
78
|
+
if (!initSize || !initSize.width || !initSize.height) {
|
|
79
|
+
return 1;
|
|
80
|
+
}
|
|
81
|
+
const scaleX = size.width / initSize.width;
|
|
82
|
+
const scaleY = size.height / initSize.height;
|
|
83
|
+
return Math.min(scaleX, scaleY);
|
|
84
|
+
}
|
|
75
85
|
dispose() {
|
|
76
86
|
clearInterval(this.refreshIntervalId);
|
|
77
87
|
if (this.chartElement) {
|
|
@@ -337,7 +347,10 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
337
347
|
}
|
|
338
348
|
renderChart(result) {
|
|
339
349
|
const chartWidth = this.model.displaySetting.size.width;
|
|
340
|
-
const
|
|
350
|
+
const scale = this.getIconScale();
|
|
351
|
+
// 图表主体与底部操作区之间的预留高度,需要与操作区渲染时使用的同一个 scale 保持一致,
|
|
352
|
+
// 否则图表按未缩放高度占满后,缩放后的操作区会超出元件整体高度
|
|
353
|
+
const chartHeight = this.model.displaySetting.size.height - (this.displayOption.operationAreaHeight + this.displayOption.operationAreaMarginTop) * scale;
|
|
341
354
|
const data = new Array();
|
|
342
355
|
each(this.model.dataSetting.channels, (channel, key) => {
|
|
343
356
|
const values = new Array();
|
|
@@ -347,10 +360,10 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
347
360
|
this.data = data;
|
|
348
361
|
let chart;
|
|
349
362
|
if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
|
|
350
|
-
chart = this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
|
|
363
|
+
chart = this.getMultiBarWithFocusChart(chartWidth, chartHeight, data, scale);
|
|
351
364
|
}
|
|
352
365
|
else {
|
|
353
|
-
chart = this.getLineChart(chartWidth, chartHeight, data);
|
|
366
|
+
chart = this.getLineChart(chartWidth, chartHeight, data, scale);
|
|
354
367
|
}
|
|
355
368
|
// 设置 tooltip 自动隐藏逻辑
|
|
356
369
|
this.setupTooltipAutoHide(chart);
|
|
@@ -400,7 +413,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
400
413
|
console.log(e);
|
|
401
414
|
}
|
|
402
415
|
}
|
|
403
|
-
getLineChart(chartWidth, chartHeight, data) {
|
|
416
|
+
getLineChart(chartWidth, chartHeight, data, scale = 1) {
|
|
404
417
|
const chart = nv.models.lineChart().showLegend(true)
|
|
405
418
|
.margin({ top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight })
|
|
406
419
|
.noData(this.localization.chartNoData);
|
|
@@ -414,7 +427,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
414
427
|
chart.focus.showXAxis(false);
|
|
415
428
|
}
|
|
416
429
|
this.renderCommonProperty(chart, chartWidth, chartHeight, data);
|
|
417
|
-
this.renderOperationArea(chartWidth, chartHeight);
|
|
430
|
+
this.renderOperationArea(chartWidth, chartHeight, scale);
|
|
418
431
|
this.initPoint();
|
|
419
432
|
chart.legend.dispatch.on('legendClick', () => {
|
|
420
433
|
setTimeout(() => {
|
|
@@ -430,7 +443,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
430
443
|
});
|
|
431
444
|
return chart;
|
|
432
445
|
}
|
|
433
|
-
getMultiBarWithFocusChart(chartWidth, chartHeight, data) {
|
|
446
|
+
getMultiBarWithFocusChart(chartWidth, chartHeight, data, scale = 1) {
|
|
434
447
|
const chart = nv.models.multiBarWithFocusChart()
|
|
435
448
|
.margin({
|
|
436
449
|
top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight
|
|
@@ -453,7 +466,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
453
466
|
}
|
|
454
467
|
chart.xAxis.tickFormat(d => this.timeFormat(d, '%x %X'));
|
|
455
468
|
this.renderCommonProperty(chart, chartWidth, chartHeight, data);
|
|
456
|
-
this.renderOperationArea(chartWidth, chartHeight);
|
|
469
|
+
this.renderOperationArea(chartWidth, chartHeight, scale);
|
|
457
470
|
const focusContext = this.rootElement.select('.nv-context');
|
|
458
471
|
focusContext.select('.nv-barsWrap.nvd3-svg').attr('transform', 'translate(0,30)');
|
|
459
472
|
focusContext.select('.nv-brushBackground').attr('transform', 'translate(0,30)');
|
|
@@ -614,17 +627,17 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
614
627
|
.remove();
|
|
615
628
|
}
|
|
616
629
|
}
|
|
617
|
-
renderOperationArea(chartWidth, chartHeight) {
|
|
630
|
+
renderOperationArea(chartWidth, chartHeight, scale = 1) {
|
|
618
631
|
const backgroundColor = this.model.displaySetting.axisSetting.filterBackgroudColor || 'inherit';
|
|
619
|
-
const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop})`)
|
|
620
|
-
.append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
|
|
621
|
-
.append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
|
|
632
|
+
const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop * scale})`)
|
|
633
|
+
.append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight * scale).attr('fill', 'none')
|
|
634
|
+
.append('xhtml:div').style('height', (this.displayOption.operationAreaHeight * scale - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
|
|
622
635
|
const rect = this.$element.parent().parent().find('rect');
|
|
623
636
|
const fillColor = rect.attr('fill');
|
|
624
637
|
const dropdownBg = this.model.displaySetting.axisSetting.filterBackgroudColor || fillColor || '#fff';
|
|
625
638
|
const dropdownWrapper = operationArea.append('div')
|
|
626
639
|
.style('display', 'inline-block')
|
|
627
|
-
.style('margin-left', this.displayOption.marginLeft + 'px')
|
|
640
|
+
.style('margin-left', (this.displayOption.marginLeft * scale) + 'px')
|
|
628
641
|
.style('vertical-align', 'middle');
|
|
629
642
|
const selectedText = this.timePeriods.find(t => t.key === Number(this.currentTimePeriod));
|
|
630
643
|
const arrowIconUrl = 'url("data:image/svg+xml,'
|
|
@@ -636,14 +649,14 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
636
649
|
.style('background-image', arrowIconUrl)
|
|
637
650
|
.style('background-repeat', 'no-repeat')
|
|
638
651
|
.style('background-position', 'right 4px center')
|
|
639
|
-
.style('font-size', this.displayOption.operationSelectFontSize)
|
|
652
|
+
.style('font-size', (parseFloat(this.displayOption.operationSelectFontSize) * scale) + 'px')
|
|
640
653
|
.style('cursor', 'pointer')
|
|
641
654
|
.style('padding', '0 18px 0 4px')
|
|
642
655
|
.style('border', '1px solid #ccc')
|
|
643
656
|
.style('border-radius', '2px')
|
|
644
657
|
.style('white-space', 'nowrap')
|
|
645
|
-
.style('line-height', (this.displayOption.operationAreaHeight - 8) + 'px')
|
|
646
|
-
.style('min-height', (this.displayOption.operationAreaHeight - 8) + 'px')
|
|
658
|
+
.style('line-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
|
|
659
|
+
.style('min-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
|
|
647
660
|
.text(selectedText ? selectedText.name : '');
|
|
648
661
|
const dropdownListEl = document.createElement('div');
|
|
649
662
|
dropdownListEl.style.cssText = 'display:none;position:fixed;background:' + dropdownBg
|
|
@@ -658,9 +671,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
658
671
|
.style('padding', '4px 8px')
|
|
659
672
|
.style('cursor', 'pointer')
|
|
660
673
|
.style('white-space', 'nowrap')
|
|
661
|
-
.style('font-size', this.displayOption.operationSelectFontSize)
|
|
662
|
-
.style('line-height', (this.displayOption.operationAreaHeight - 8) + 'px')
|
|
663
|
-
.style('min-height', (this.displayOption.operationAreaHeight - 8) + 'px')
|
|
674
|
+
.style('font-size', (parseFloat(this.displayOption.operationSelectFontSize) * scale) + 'px')
|
|
675
|
+
.style('line-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
|
|
676
|
+
.style('min-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
|
|
664
677
|
.style('background', tp.key === Number(this.currentTimePeriod) ? '#1890ff' : 'transparent')
|
|
665
678
|
.style('color', tp.key === Number(this.currentTimePeriod) ? '#fff' : '#333')
|
|
666
679
|
.text(tp.name)
|
|
@@ -755,24 +768,24 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
755
768
|
window.addEventListener('resize', this._resizeHideHandler);
|
|
756
769
|
// 滚动时收起
|
|
757
770
|
document.addEventListener('scroll', hideDropdown, true);
|
|
758
|
-
const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
|
|
771
|
+
const buttonWidth = (this.displayOption.operationButtonWidth * scale) + 'px', buttonHeight = (this.displayOption.operationButtonHeight * scale) + 'px';
|
|
759
772
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
760
773
|
.style('float', 'right').style('background-image', 'url(assets/img/black_last_page.png)')
|
|
761
774
|
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
762
775
|
.on('click', () => { this.loadLastPage(); });
|
|
763
776
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
764
777
|
.style('float', 'right').style('background-image', 'url(assets/img/black_next_page.png)')
|
|
765
|
-
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
778
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin * scale}px 0 0`)
|
|
766
779
|
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
767
780
|
.on('click', () => { this.loadNextPage(); });
|
|
768
781
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
769
782
|
.style('float', 'right').style('background-image', 'url(assets/img/black_previous_page.png)')
|
|
770
|
-
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
783
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin * scale}px 0 0`)
|
|
771
784
|
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
772
785
|
.on('click', () => { this.loadPreviousPage(); });
|
|
773
786
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
774
787
|
.style('float', 'right').style('background-image', 'url(assets/img/black_first_page.png)')
|
|
775
|
-
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
788
|
+
.style('margin', `0 ${this.displayOption.operationButtonMargin * scale}px 0 0`)
|
|
776
789
|
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
777
790
|
.on('click', () => { this.loadFirstPage(); });
|
|
778
791
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":77,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":78,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":79,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":80,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":81,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":82,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":84,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":85,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":86,"character":38},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":87,"character":51}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"fmtDatetimeLocal":[{"__symbolic":"method"}],"showCustomTimeRangeModal":[{"__symbolic":"method"}],"showCustomTimeRangeModalFallback":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":77,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":78,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":79,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":80,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":81,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":82,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":84,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":85,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":86,"character":38},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":87,"character":51}]}],"getIconScale":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"fmtDatetimeLocal":[{"__symbolic":"method"}],"showCustomTimeRangeModal":[{"__symbolic":"method"}],"showCustomTimeRangeModalFallback":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
package/elements/main-element.js
CHANGED
|
@@ -84,7 +84,7 @@ export class MainElement {
|
|
|
84
84
|
this.elements.push(new ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(LOCALIZATION), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
85
85
|
break;
|
|
86
86
|
case GuiConsts.components.characterKey:
|
|
87
|
-
this.elements.push(new CharacterDisplayElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
87
|
+
this.elements.push(new CharacterDisplayElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context.releasedVariableService));
|
|
88
88
|
break;
|
|
89
89
|
case GuiConsts.components.textKey:
|
|
90
90
|
this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
@@ -318,7 +318,8 @@ export class MainElement {
|
|
|
318
318
|
each(this.elements, e => {
|
|
319
319
|
if (e instanceof HistoricalCurveElement || e instanceof VideoElement
|
|
320
320
|
|| e instanceof WeatherElement || e instanceof NumericalDisplayElement || e instanceof TextElement
|
|
321
|
-
|| e instanceof AirQualityElement || e instanceof SwitchIndicatorLightElement || e instanceof ScrollAlarmElement
|
|
321
|
+
|| e instanceof AirQualityElement || e instanceof SwitchIndicatorLightElement || e instanceof ScrollAlarmElement
|
|
322
|
+
|| e instanceof AlarmElement) {
|
|
322
323
|
e.dispose();
|
|
323
324
|
}
|
|
324
325
|
});
|
|
@@ -57,4 +57,13 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
57
57
|
private formatFloatDisplayText;
|
|
58
58
|
private isNumeric;
|
|
59
59
|
private formatDisplayTextUnit;
|
|
60
|
+
/**
|
|
61
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
62
|
+
*/
|
|
63
|
+
protected getElementSizeForIconScale(): {
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
66
|
+
initWidth?: number;
|
|
67
|
+
initHeight?: number;
|
|
68
|
+
} | null;
|
|
60
69
|
}
|
|
@@ -164,7 +164,10 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
164
164
|
}
|
|
165
165
|
checkElementPassword() {
|
|
166
166
|
if (this.model.enablePassword) {
|
|
167
|
-
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
167
|
+
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
168
|
+
initialState: { securityChecker: this.securityChecker, releasedVariableService: this.releasedVariableService },
|
|
169
|
+
backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
|
|
170
|
+
});
|
|
168
171
|
const onClosedSub = modalRef.content.onClosed.subscribe(result => {
|
|
169
172
|
modalRef.hide();
|
|
170
173
|
onClosedSub.unsubscribe();
|
|
@@ -491,4 +494,19 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
491
494
|
}
|
|
492
495
|
return displayText;
|
|
493
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
499
|
+
*/
|
|
500
|
+
getElementSizeForIconScale() {
|
|
501
|
+
var _a, _b;
|
|
502
|
+
if (this.model.size) {
|
|
503
|
+
return {
|
|
504
|
+
width: this.model.size.width,
|
|
505
|
+
height: this.model.size.height,
|
|
506
|
+
initWidth: (_a = this.model.initSize) === null || _a === void 0 ? void 0 : _a.width,
|
|
507
|
+
initHeight: (_b = this.model.initSize) === null || _b === void 0 ? void 0 : _b.height
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
return null;
|
|
511
|
+
}
|
|
494
512
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":29,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":73,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":74,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":75,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":76,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":77,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":78,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":79,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":80,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":81,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":82,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":83,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":85,"character":38}]}],"dispose":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":29,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":73,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":74,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":75,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":76,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":77,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":78,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":79,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":80,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":81,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":82,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":83,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":85,"character":38}]}],"dispose":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}],"getElementSizeForIconScale":[{"__symbolic":"method"}]}}}}]
|
|
@@ -40,6 +40,15 @@ export declare class SwitchIndicatorLightElement extends ConditionalEnableElemen
|
|
|
40
40
|
private currentStateIdChange;
|
|
41
41
|
private switchToState;
|
|
42
42
|
private initGraphAndText;
|
|
43
|
+
/**
|
|
44
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
45
|
+
*/
|
|
46
|
+
protected getElementSizeForIconScale(): {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
initWidth?: number;
|
|
50
|
+
initHeight?: number;
|
|
51
|
+
} | null;
|
|
43
52
|
/**
|
|
44
53
|
* 释放资源
|
|
45
54
|
*/
|
|
@@ -116,8 +116,12 @@ export class SwitchIndicatorLightElement extends ConditionalEnableElement {
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
checkElementPassword(afterConfirm) {
|
|
119
|
+
var _a;
|
|
119
120
|
if (this.model.enablePassword) {
|
|
120
|
-
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
121
|
+
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
122
|
+
initialState: { securityChecker: this.securityChecker, releasedVariableService: (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.releasedVariableService },
|
|
123
|
+
backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
|
|
124
|
+
});
|
|
121
125
|
const onClosedSub = modalRef.content.onClosed.subscribe(result => {
|
|
122
126
|
modalRef.hide();
|
|
123
127
|
onClosedSub.unsubscribe();
|
|
@@ -263,6 +267,21 @@ export class SwitchIndicatorLightElement extends ConditionalEnableElement {
|
|
|
263
267
|
this.textStateElement = new TextStateElement(this.model.states, width, height, this.logger, this.model.version, this.model.states, this.model.textLibrary, this.textLibraryService, this.languageService, this.guiContext, true, this.model.fontStyleCultures);
|
|
264
268
|
this.$element.append(this.textStateElement.Element);
|
|
265
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* 提供元件尺寸信息用于状态图标缩放
|
|
272
|
+
*/
|
|
273
|
+
getElementSizeForIconScale() {
|
|
274
|
+
var _a, _b;
|
|
275
|
+
if (this.model.size) {
|
|
276
|
+
return {
|
|
277
|
+
width: this.model.size.width,
|
|
278
|
+
height: this.model.size.height,
|
|
279
|
+
initWidth: (_a = this.model.initSize) === null || _a === void 0 ? void 0 : _a.width,
|
|
280
|
+
initHeight: (_b = this.model.initSize) === null || _b === void 0 ? void 0 : _b.height
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
266
285
|
/**
|
|
267
286
|
* 释放资源
|
|
268
287
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"SwitchIndicatorLightElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-enable-element","name":"ConditionalEnableElement","line":33,"character":49},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":52,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":53,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":54,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":55,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":56,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":57,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":58,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":59,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":60,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":61,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"TextLibraryService","line":63,"character":46},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":64,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":65,"character":38}]}],"handleMouseUp":[{"__symbolic":"method"}],"initOnDocMouseUpEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doSwitchOperator":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"initSwitchOperator":[{"__symbolic":"method"}],"initIndictorLightOperator":[{"__symbolic":"method"}],"currentStateIdChange":[{"__symbolic":"method"}],"switchToState":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"checkState":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"SwitchIndicatorLightElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-enable-element","name":"ConditionalEnableElement","line":33,"character":49},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":52,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":53,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":54,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":55,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":56,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":57,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":58,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":59,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":60,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":61,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"TextLibraryService","line":63,"character":46},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":64,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":65,"character":38}]}],"handleMouseUp":[{"__symbolic":"method"}],"initOnDocMouseUpEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doSwitchOperator":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"initSwitchOperator":[{"__symbolic":"method"}],"initIndictorLightOperator":[{"__symbolic":"method"}],"currentStateIdChange":[{"__symbolic":"method"}],"switchToState":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"getElementSizeForIconScale":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"checkState":[{"__symbolic":"method"}]}}}}]
|
|
@@ -132,8 +132,12 @@ export class ViewOperationElement extends ConditionalEnableElement {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
checkElementPassword() {
|
|
135
|
+
var _a;
|
|
135
136
|
if (this.model.enablePassword) {
|
|
136
|
-
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
137
|
+
const modalRef = this.modalService.show(VerifyPasswordModalComponent, {
|
|
138
|
+
initialState: { securityChecker: this.securityChecker, releasedVariableService: (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.releasedVariableService },
|
|
139
|
+
backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
|
|
140
|
+
});
|
|
137
141
|
const onClosedSub = modalRef.content.onClosed.subscribe(result => {
|
|
138
142
|
modalRef.hide();
|
|
139
143
|
onClosedSub.unsubscribe();
|
|
@@ -177,7 +181,8 @@ export class ViewOperationElement extends ConditionalEnableElement {
|
|
|
177
181
|
popView() {
|
|
178
182
|
const viewIndex = this.model.viewIndex;
|
|
179
183
|
if (null != viewIndex) {
|
|
180
|
-
|
|
184
|
+
const triggerRect = this.$element[0].getBoundingClientRect();
|
|
185
|
+
this.popupViewService.popView(viewIndex, this.hostContainerId, this.el, triggerRect).subscribe(() => this.recordViewOperation(), error => this.logger.error(`ToggleView(${viewIndex}) failed. ${error}`));
|
|
181
186
|
$(`#${this.hostContainerId} video`)
|
|
182
187
|
.addClass('video-hidden')
|
|
183
188
|
.css('visibility', 'hidden');
|
package/gui/gui-view.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare class GuiView implements PopupViewService {
|
|
|
12
12
|
private readonly bsModalService;
|
|
13
13
|
private readonly context;
|
|
14
14
|
private readonly parentView?;
|
|
15
|
+
/** showShadow() 给阴影留白,内容整体右下偏移的量,"按钮附近"定位需要据此修正才能让可见内容与按钮对齐 */
|
|
16
|
+
private static readonly SHADOW_INSET;
|
|
15
17
|
get element(): HTMLElement;
|
|
16
18
|
get rawWidth(): number;
|
|
17
19
|
get rawHeight(): number;
|
|
@@ -34,7 +36,19 @@ export declare class GuiView implements PopupViewService {
|
|
|
34
36
|
resize(size: Size, resizeMode: ViewResizeMode, svgRootClass: string): void;
|
|
35
37
|
load(config: ViewModel, guiOptions: GuiOptions): void;
|
|
36
38
|
loadElementState(): void;
|
|
37
|
-
popView(viewIndex: number, hostContainerId: string, el: ElementRef): Observable<void>;
|
|
39
|
+
popView(viewIndex: number, hostContainerId: string, el: ElementRef, triggerRect?: DOMRect): Observable<void>;
|
|
40
|
+
/**
|
|
41
|
+
* 把屏幕像素矩形(如按钮的 getBoundingClientRect)换算为当前画面 SVG 坐标系下的矩形。
|
|
42
|
+
* 用 getScreenCTM 而不是简单的宽高比换算,因为画面容器宽高比与 rawWidth/rawHeight 不一致时
|
|
43
|
+
* SVG 会按 preserveAspectRatio 留白(letterbox),线性比例换算会有偏差。
|
|
44
|
+
*/
|
|
45
|
+
private toLocalRect;
|
|
46
|
+
/**
|
|
47
|
+
* 按钮附近:按钮与弹出画面之间留缝隙,两侧都放得下时默认放右侧,放不下时放在放得下的一侧;
|
|
48
|
+
* 竖直方向默认与按钮顶部对齐,下方放不下时改为与按钮底部对齐;
|
|
49
|
+
* 左右两侧都放不下(弹窗比画面还宽)时直接退化为画面居中,不再跟随按钮
|
|
50
|
+
*/
|
|
51
|
+
private getNearButtonPosition;
|
|
38
52
|
closeView(): void;
|
|
39
53
|
moveView(movementX: number, movementY: number): void;
|
|
40
54
|
showMusk(): void;
|