From 6803f4936aa578f2fa0ffee518465ec8093644d6 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Wed, 7 Aug 2024 10:45:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=BB=BA=E5=8F=B0=E7=AB=99ROI?= =?UTF-8?q?=E6=A1=86=E7=A7=BB=E5=8A=A8=E6=97=B6=E8=B6=85=E5=87=BA=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/beta-analysis.vue | 1 + .../components/BetaGammaSpectrum.vue | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue index d30157c..e4fe20c 100644 --- a/src/views/spectrumAnalysis/beta-analysis.vue +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -548,6 +548,7 @@ export default { handleBoundaryChange(evt) { const { index, start, end } = evt this.$set(this.roiParamList, index, [start, end]) + this.$refs.betaChartRef.setBoundaryList(cloneDeep(this.roiParamList)) }, // 从分析工具刷新部分数据 diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue index 7936f32..9d57ac2 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue @@ -535,8 +535,18 @@ export default { this.currBoundaryItem.width = nextLeft - this.boundaryRight this.direction = 'right' } else { - this.currBoundaryItem.left = nextLeft - this.currBoundaryItem.width = nextWidth + // 如果将要超出容器左边线 + if (nextLeft < 0) { + this.currBoundaryItem.left = 0 + this.currBoundaryItem.width = nextWidth + nextLeft + this.handleBorderMouseLeave() + return + } + // 设置为将要移动到的位置 + else { + this.currBoundaryItem.left = nextLeft + this.currBoundaryItem.width = nextWidth + } this.direction = 'left' } } @@ -549,7 +559,16 @@ export default { this.currBoundaryItem.left = prevLeft + nextWidth this.currBoundaryItem.width = -nextWidth } else { - this.currBoundaryItem.width = nextWidth + // 如果将要超出容器右边线 + if (this.currBoundaryItem.left + nextWidth > this.boundaryContainerPosition.width) { + this.currBoundaryItem.width = this.boundaryContainerPosition.width - this.currBoundaryItem.left + this.handleBorderMouseLeave() + return + } + // 设置为将要移动到的位置 + else { + this.currBoundaryItem.width = nextWidth + } this.direction = 'right' } }