@flexem/fc-gui 3.0.0-alpha.113 → 3.0.0-alpha.114
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 +37 -7
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +1 -0
- package/elements/historical-curve/historical-curve.element.js +28 -2
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +2 -4
- package/elements/video/video-element.js +7 -1
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
46
46
|
private updateQueryTimeRange;
|
|
47
47
|
private reRenderElement;
|
|
48
48
|
private renderElement;
|
|
49
|
+
setupTooltipAutoHide(chart: any): void;
|
|
49
50
|
private renderChart;
|
|
50
51
|
initPoint(): void;
|
|
51
52
|
private getLineChart;
|
|
@@ -152,6 +152,28 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
+
setupTooltipAutoHide(chart) {
|
|
156
|
+
const chartContainer = this.rootElement.select('.nv-focus').node();
|
|
157
|
+
if (!chartContainer || !chart)
|
|
158
|
+
return;
|
|
159
|
+
let timeoutId;
|
|
160
|
+
// 鼠标移入图表时显示 tooltip
|
|
161
|
+
chartContainer.addEventListener('mouseover', () => {
|
|
162
|
+
hideTooltipAfterDelay();
|
|
163
|
+
});
|
|
164
|
+
const clearTooltipTimeout = () => {
|
|
165
|
+
if (timeoutId) {
|
|
166
|
+
clearTimeout(timeoutId);
|
|
167
|
+
timeoutId = null;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const hideTooltipAfterDelay = () => {
|
|
171
|
+
clearTooltipTimeout();
|
|
172
|
+
timeoutId = setTimeout(() => {
|
|
173
|
+
chart.tooltip.hidden(true);
|
|
174
|
+
}, 2000); // 2秒延迟
|
|
175
|
+
};
|
|
176
|
+
}
|
|
155
177
|
renderChart(result) {
|
|
156
178
|
const chartWidth = this.model.displaySetting.size.width;
|
|
157
179
|
const chartHeight = this.model.displaySetting.size.height - this.displayOption.operationAreaHeight - this.displayOption.operationAreaMarginTop;
|
|
@@ -163,12 +185,16 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
163
185
|
});
|
|
164
186
|
this.data = data;
|
|
165
187
|
nv.addGraph(() => {
|
|
188
|
+
let chart;
|
|
166
189
|
if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
|
|
167
|
-
|
|
190
|
+
chart = this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
|
|
168
191
|
}
|
|
169
192
|
else {
|
|
170
|
-
|
|
193
|
+
chart = this.getLineChart(chartWidth, chartHeight, data);
|
|
171
194
|
}
|
|
195
|
+
// 设置 tooltip 自动隐藏逻辑
|
|
196
|
+
this.setupTooltipAutoHide(chart);
|
|
197
|
+
return chart;
|
|
172
198
|
});
|
|
173
199
|
}
|
|
174
200
|
initPoint() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"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":"HistoryDataStore","line":73,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__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":21,"character":44},"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":"HistoryDataStore","line":73,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__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"}],"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"}]}}}}]
|
|
@@ -72,9 +72,7 @@ export class SwitchIndicatorLightElement extends ConditionalEnableElement {
|
|
|
72
72
|
this.isWriteRestorationDownValue = true;
|
|
73
73
|
}, 1000);
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
d3.event.preventDefault();
|
|
77
|
-
}
|
|
75
|
+
d3.event.preventDefault();
|
|
78
76
|
}
|
|
79
77
|
});
|
|
80
78
|
this.rootElement.on(this.isMobileMode && isMobile ? 'touchend' : 'mouseup', () => {
|
|
@@ -104,7 +102,7 @@ export class SwitchIndicatorLightElement extends ConditionalEnableElement {
|
|
|
104
102
|
this.isWriteRestorationDownValue = false;
|
|
105
103
|
if (!this.model.useIndicatorLight) {
|
|
106
104
|
this.switchToState(0);
|
|
107
|
-
if (d3.event
|
|
105
|
+
if (d3.event) {
|
|
108
106
|
d3.event.preventDefault();
|
|
109
107
|
}
|
|
110
108
|
}
|
|
@@ -93,7 +93,7 @@ export class VideoElement extends ConditionalDisplayElement {
|
|
|
93
93
|
playsInline webkit-playsinline `;
|
|
94
94
|
if (this.isMobileMode) {
|
|
95
95
|
if (isAndroid) {
|
|
96
|
-
videoHtml += '
|
|
96
|
+
videoHtml += ' muted></video>';
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
videoHtml += ' controls muted></video>';
|
|
@@ -115,6 +115,12 @@ export class VideoElement extends ConditionalDisplayElement {
|
|
|
115
115
|
}
|
|
116
116
|
try {
|
|
117
117
|
this.videoPlayer = new EZUIPlayer(videoId);
|
|
118
|
+
if (isAndroid) {
|
|
119
|
+
// 确保在 EZUIPlayer 初始化后才调用 play 方法
|
|
120
|
+
this.videoPlayer.on('canplay', () => {
|
|
121
|
+
this.videoPlayer.play();
|
|
122
|
+
});
|
|
123
|
+
}
|
|
118
124
|
}
|
|
119
125
|
catch (err) {
|
|
120
126
|
console.log(err);
|