diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue index eef4c43..9c416de 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue @@ -429,11 +429,14 @@ export default { this.myChart = this.$refs.chartTwoDRef.getChartInstance() let graphicHeight = this.$refs.TwoChartRef.clientHeight graphic1.shape.height = graphicHeight + let minleft = this.myChart.convertToPixel({ xAxisId: '2' }, 0) + let maxRight = this.myChart.convertToPixel({ xAxisId: '2' }, 1024) graphic1.position = [ this.myChart.convertToPixel({ xAxisId: '2' }, minX), this.myChart.convertToPixel({ yAxisId: '3' }, maxY), ] graphic1.ondrag = function () { + this.position[0] = this.position[0] < minleft ? minleft : this.position[0] let [a, lineSeries] = _this.twoDOption.series _this.startChannel = parseInt(_this.myChart.convertFromPixel({ xAxisId: '2' }, this.position[0])) const rect = [ @@ -451,12 +454,14 @@ export default { // } // _this.twoDOption.series.splice(1, _this.twoDOption.series.length - 1, ...lineSeries) } + // > maxRight ? maxRight : currRight graphic2.shape.height = graphicHeight graphic2.position = [ this.myChart.convertToPixel({ xAxisId: '2' }, maxX), this.myChart.convertToPixel({ yAxisId: '3' }, maxY), ] graphic2.ondrag = function () { + this.position[0] = this.position[0] > maxRight ? maxRight : this.position[0] let [a, lineSeries] = _this.twoDOption.series _this.endChannel = parseInt(_this.myChart.convertFromPixel({ xAxisId: '2' }, this.position[0])) const rect = [ @@ -682,6 +687,8 @@ export default { color: '#99CA53', } // this.reDrawRect() + } else { + this.$emit('update:isLoading', false) } } catch (error) { console.error(error)