From d5491bfcee74a0030484a41a22c0c912c1710755 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Wed, 22 Nov 2023 09:40:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0Peak=20Infomation?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=BA=A2=E7=BA=BF=E6=97=B6=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=81=9A=E7=84=A6=E5=9B=BE=E8=A1=A8=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E8=AE=A9=E9=94=AE=E7=9B=98=E4=BA=8B=E4=BB=B6=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/gamma-analysis.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/spectrumAnalysis/gamma-analysis.vue b/src/views/spectrumAnalysis/gamma-analysis.vue index 7427a69..a1f598a 100644 --- a/src/views/spectrumAnalysis/gamma-analysis.vue +++ b/src/views/spectrumAnalysis/gamma-analysis.vue @@ -895,7 +895,7 @@ export default { // 点击图表,设置红线 handleChartClick(param) { - this.$refs.chartContainerRef.focus() + this.focusChart() const { offsetX, offsetY } = param const point = getXAxisAndYAxisByPosition(this.getChart(), offsetX, offsetY) if (point) { @@ -910,6 +910,11 @@ export default { } }, + // 聚焦图表容器,以接收keydown事件 + focusChart() { + this.$refs.chartContainerRef.focus() + }, + // 设置图表底部的标题 setChartBottomTitle(channel, energy, counts) { const { index, find } = findNearPeak(channel, this.peakList) @@ -981,10 +986,13 @@ export default { // peak info 点击左右方向 handlePeakInfoChange(direction) { this.moveMarkLine(direction) + this.focusChart() }, // 触发Peak Infomation handleTogglePeak() { + this.focusChart() + const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum') const xAxis = spectrumLineSeries.markLine.data[0].xAxis const channel = this.isEnergy ? this.getChannelByEnergy(xAxis) : parseInt(xAxis.toFixed())