fix: Beta的Calibration修改逻辑。beta数据依赖于Gamma

This commit is contained in:
xiaoguangbin 2023-12-13 17:50:11 +08:00
parent 49379f82fb
commit f7aeeb7a3b
3 changed files with 46 additions and 31 deletions

View File

@ -551,6 +551,10 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
}, },
isBetaReset:{
type: Boolean,
required: false,
}
}, },
data() { data() {
this.columns = columns this.columns = columns
@ -601,14 +605,23 @@ export default {
recalculateROICountsFor: [], recalculateROICountsFor: [],
count: 0, // tableWidgets count: 0, // tableWidgets
// isFirstFitting: true,
isInverse: false, // isInverse: false, //
betaIsFitting: false, betaIsFitting: false,
} }
}, },
created() { created() {
this.$bus.$on('betaRefresh', this.handleReset)
this.$bus.$on('betaRefresh', this.getData)
this.getData() this.getData()
}, },
watch: {
isFirstFitting: {
handler() {
// this.getData()
},
immediate: true
},
},
methods: { methods: {
handleExit() { handleExit() {
this.$emit('exit') this.$emit('exit')
@ -622,7 +635,8 @@ export default {
const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', { const res = await getAction('/spectrumAnalysis/viewBetaDetectorCalibration', {
sampleId, sampleId,
qcFileName, qcFileName,
sampleFileName: inputFileName sampleFileName: inputFileName,
fittingBtn: this.isFirstFitting
}) })
if (res.success) { if (res.success) {
const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } = const { CToE, EToC, betaEnergy, gammaEnergy, gammaGatedBetaSpectrum, histogramData, oldScatterSeries } =
@ -632,7 +646,6 @@ export default {
this.oldScatterSeries = oldScatterSeries this.oldScatterSeries = oldScatterSeries
this.count = oldScatterSeries.length this.count = oldScatterSeries.length
// this.isFirstFitting = true
this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c]) this.betaGammaChartOption.series.data = histogramData.map(({ b, g, c }) => [b, g, c])
this.gammaEnergy = gammaEnergy this.gammaEnergy = gammaEnergy
@ -880,21 +893,20 @@ export default {
// Reset Button // Reset Button
async handleReset() { async handleReset() {
this.$emit('isFitting', false)
this.removeCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName) // fitting 20231101:xiao this.removeCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName) // fitting 20231101:xiao
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel) this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
this.list = [] this.list = []
this.newE2C = [] this.newE2C = []
// reset 20231211xiao // reset 20231211xiao
const res = await postAction('/spectrumAnalysis/resetButton', { const res = await postAction('/spectrumAnalysis/resetButton?tabName=beta&sampleFileName='+this.newSampleData.inputFileName, {})
tabName: "beta",
sampleFileName: this.newSampleData.inputFileName
})
this.figureChartOption = this.oldChartOption this.figureChartOption = this.oldChartOption
this.figureChartOption = cloneDeep(this.oldChartOption) this.figureChartOption = cloneDeep(this.oldChartOption)
this.isFirstFitting = true // this.isFirstFitting = true
this.isInverse = false this.isInverse = false
}, },
@ -919,7 +931,6 @@ export default {
count: this.isFirstFitting || !this.isInverse ? undefined : this.count, count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
}) })
if (success) { if (success) {
// this.isFirstFitting = false
this.betaIsFitting = true this.betaIsFitting = true
this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao
@ -927,7 +938,6 @@ export default {
this.setFirringResult(result) this.setFirringResult(result)
} else { } else {
this.$message.error(message) this.$message.error(message)
} }

View File

@ -472,7 +472,6 @@ export default {
recalculateROICountsFor: [], recalculateROICountsFor: [],
count: 0, // tableWidgets count: 0, // tableWidgets
// isFirstFitting: true,
isInverse: false, // isInverse: false, //
gammaIsFitting: false, gammaIsFitting: false,
} }
@ -486,7 +485,6 @@ export default {
}, },
async getData() { async getData() {
console.log("isFirstFitting>>>"+this.isFirstFitting);
// sampleFileName 20231101xiao // sampleFileName 20231101xiao
const { sampleId = '', qcFileName, inputFileName } = this.newSampleData const { sampleId = '', qcFileName, inputFileName } = this.newSampleData
@ -495,7 +493,8 @@ export default {
const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', { const res = await getAction('/spectrumAnalysis/viewGammaDetectorCalibration', {
sampleId, sampleId,
qcFileName, qcFileName,
sampleFileName: inputFileName sampleFileName: inputFileName,
fittingBtn: this.isFirstFitting
}) })
if (res.success) { if (res.success) {
@ -505,7 +504,6 @@ export default {
this.e2c = EToC this.e2c = EToC
this.oldScatterSeries = oldScatterSeries this.oldScatterSeries = oldScatterSeries
this.count = oldScatterSeries.length this.count = oldScatterSeries.length
// this.isFirstFitting = true
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4) const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
@ -663,13 +661,14 @@ export default {
this.newE2C = [] this.newE2C = []
// reset 20231211xiao // reset 20231211xiao
const res = await postAction('/spectrumAnalysis/resetButton', { const res = await postAction('/spectrumAnalysis/resetButton?tabName=gamma&sampleFileName='+ this.newSampleData.inputFileName, { })
tabName: "gamma",
sampleFileName: this.newSampleData.inputFileName this.$emit('isFitting', false)
})
// Beta
this.$bus.$emit('betaRefresh', {})
this.figureChartOption = cloneDeep(this.oldChartOption) this.figureChartOption = cloneDeep(this.oldChartOption)
this.isFirstFitting = false
this.isInverse = false this.isInverse = false
}, },
@ -696,7 +695,6 @@ export default {
fittingBtn : this.isFirstFitting fittingBtn : this.isFirstFitting
}) })
if (success) { if (success) {
// this.isFirstFitting = true
this.gammaIsFitting = true this.gammaIsFitting = true
this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao
@ -704,6 +702,10 @@ export default {
this.setFirringResult(result) this.setFirringResult(result)
// Beta
this.$bus.$emit('betaRefresh', {})
console.log("betaRefresh>>>");
} else { } else {
this.$message.error(message) this.$message.error(message)
} }

View File

@ -13,7 +13,7 @@
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" :isFirstFitting="gammaEnergyValid" /> <gamma-detector-calibration @isFitting="getFittingFlag_gamma" :isFirstFitting="gammaEnergyValid" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="Beta Detector Calibration" key="beta"> <a-tab-pane tab="Beta Detector Calibration" key="beta">
<beta-detector-calibration @isFitting="getFittingFlag_beta" :isFirstFitting="gammaEnergyValid" /> <beta-detector-calibration @isFitting="getFittingFlag_beta" :isFirstFitting="betaEnergyValid" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<div class="footer"> <div class="footer">
@ -88,12 +88,17 @@ export default {
}, },
getFittingFlag_beta(val) { getFittingFlag_beta(val) {
this.betaEnergyValid = val this.betaEnergyValid = val
console.log('beta-zhiqian>>>' + this.betaEnergyValid) console.log('betaEnergyValid>>>' + this.betaEnergyValid)
}, },
getFittingFlag_gamma(val) { getFittingFlag_gamma(val) {
console.log('zhiqian>>>' + this.gammaEnergyValid)
this.gammaEnergyValid = val this.gammaEnergyValid = val
console.log('zhihou>>>' + this.gammaEnergyValid) // 1. BetaGamma
// 2. Gammabeta
// if(!this.gammaEnergyValid){
// this.betaEnergyValid = val;
// console.log("Beta>>"+this.betaEnergyValid)
// }
console.log('gammaEnergyValid>>>' + this.gammaEnergyValid)
}, },
handleReAnalyse() { handleReAnalyse() {
// todo 1.fitting; 2.isReAnalyze // todo 1.fitting; 2.isReAnalyze
@ -197,15 +202,13 @@ export default {
handleExit() { handleExit() {
console.log('this.currTab>>>' + this.currTab) console.log('this.currTab>>>' + this.currTab)
this.gammaEnergyValid = this.isReanlyze this.gammaEnergyValid = this.isReanlyze
if (!this.isReanlyze) { if (!this.isReanlyze && (!this.gammaEnergyValid || !this.gammaEnergyValid)) {
// ReANalyzefitting 20231101:xiao // ReANalyzefitting 20231101:xiao
if (this.currTab === 'gamma') { // 1. BetaGamma
// 2. reanalyzebeta
this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName) this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
}
if (this.currTab === 'beta') {
this.$ls.remove('CALIBRATION_BETA_' + this.newSampleData.inputFileName) this.$ls.remove('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
} }
}
this.visible = false this.visible = false
}, },
}, },