fix: 修复未用661.657减去Energy导致的Energy值错误

This commit is contained in:
Xu Zhimeng 2023-12-11 15:34:27 +08:00
parent 6ba0a75e53
commit 1c7098cbaa

View File

@ -187,6 +187,7 @@ import { graphic } from 'echarts'
import { isNullOrUndefined } from '@/utils/util'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import axios from 'axios'
import { add } from 'xe-utils/methods'
const initialBetaGammaChartOption = {
grid: {
@ -680,7 +681,7 @@ export default {
// gamma-gated beta spectrum
const yAxis = parseInt(point[1].toFixed())
this.currEnergy = parseFloat(this.gammaEnergy[yAxis][0].toFixed(2)) // Energy
this.currEnergy = this.gammaEnergy[yAxis][0].toPrecision(6) // Energy
this.channelAndEnergyModel = {
channel: undefined,
energy: undefined,
@ -783,7 +784,9 @@ export default {
}
this.tooltipVisible = true
this.channelAndEnergyModel.channel = xAxis
this.channelAndEnergyModel.energy = this.currEnergy
if(!isNullOrUndefined(this.currEnergy)) {
this.channelAndEnergyModel.energy = add(661.657, -this.currEnergy)
}
}
},