fix:解决beta谱在calibration分析后应用all,其他谱没有缓存calibration参数问题

This commit is contained in:
xiaoguangbin 2023-11-15 19:14:29 +08:00
parent 5797dfc529
commit 006ae8fc22
4 changed files with 43 additions and 15 deletions

View File

@ -17,6 +17,7 @@ export const clearSampleCache = sampleList => {
}
deleteAction(url, params)
store.commit('REMOVE_SAMPLE_DATA', fileName)
Vue.ls.remove(`calibration-gamma:${fileName}`)
Vue.ls.remove(`CALIBRATION_GAMMA_${fileName}`)
Vue.ls.remove(`CALIBRATION_BETA_${fileName}`)
})
}

View File

@ -655,8 +655,8 @@ export default {
// reanalyzefittingReanalyze 20231101xiao
// todo fitting
if(this.getCache("calibration-beta:"+this.newSampleData.inputFileName)) {
this.setFirringResult(this.getCache("calibration-beta:"+this.newSampleData.inputFileName))
if(this.getCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName)) {
this.setFirringResult(this.getCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName))
return false;
}
} else {
@ -877,7 +877,7 @@ export default {
// Reset Button
handleReset() {
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.list = []
this.newE2C = []
@ -914,7 +914,7 @@ export default {
this.betaIsFitting = true
this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao
this.setCache("calibration-beta:"+this.newSampleData.inputFileName, result) // ReAnalyze 20231101xiao
this.setCache("CALIBRATION_BETA_"+this.newSampleData.inputFileName, result) // ReAnalyze 20231101xiao
this.setFirringResult(result)

View File

@ -532,8 +532,8 @@ export default {
// reanalyzefittingReanalyze 20231101xiao
// todo fitting
if(this.getCache("calibration-gamma:"+this.newSampleData.inputFileName)) {
this.setFirringResult(this.getCache("calibration-gamma:"+this.newSampleData.inputFileName))
if(this.getCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName)) {
this.setFirringResult(this.getCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName))
return false;
}
} else {
@ -657,7 +657,7 @@ export default {
// Reset Button
handleReset() {
this.$ls.remove("calibration-gamma:"+this.newSampleData.inputFileName) // fitting 20231101:xiao
this.$ls.remove("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName) // fitting 20231101:xiao
this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel)
this.list = []
this.newE2C = []
@ -693,7 +693,7 @@ export default {
this.gammaIsFitting = false
this.$emit('isFitting', true) // reAnalyzeisFirstFittingtrue 20231101xiao
this.setCache("calibration-gamma:"+this.newSampleData.inputFileName, result) // ReAnalyze 20231101xiao
this.setCache("CALIBRATION_GAMMA_"+this.newSampleData.inputFileName, result) // ReAnalyze 20231101xiao
this.setFirringResult(result)

View File

@ -154,9 +154,11 @@ export default {
this.$bus.$emit('ReAnalyses', res.result)
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
this.clearSameStationCache(
matchedSampleList.filter((item) => item.inputFileName !== this.newSampleData.inputFileName)
let sameStation = matchedSampleList.filter(
(item) => item.inputFileName !== this.newSampleData.inputFileName
)
this.clearSameStationCache(sameStation)
this.setSameStationCalibarationCache(sameStation)
}
} else {
this.$message.warning(res.message)
@ -167,16 +169,41 @@ export default {
//
clearSameStationCache(sampleList) {
sampleList.forEach(({ inputFileName }) => {
console.log('inputFileName>>' + inputFileName)
this.$store.commit('REMOVE_SAMPLE_DATA', inputFileName)
this.$ls.remove('calibration-gamma:' + inputFileName)
})
},
// Calibration 20231115xiao
setSameStationCalibarationCache(sampleList) {
sampleList.forEach(({ inputFileName }) => {
console.log('inputFileName:' + inputFileName)
// tab
if (this.currTab === 'gamma') {
this.$ls.set(
'CALIBRATION_GAMMA_' + inputFileName,
this.$ls.get('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
)
}
if (this.currTab === 'beta') {
this.$ls.set(
'CALIBRATION_BETA_' + inputFileName,
this.$ls.get('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
)
}
})
},
handleExit() {
console.log('this.currTab>>>' + this.currTab)
this.gammaEnergyValid = this.isReanlyze
console.log('exit>>>this.isReanlyze>>>' + this.isReanlyze)
if (!this.isReanlyze && this.$ls.get('calibration-gamma:' + this.newSampleData.inputFileName)) {
this.$ls.remove('calibration-gamma:' + this.newSampleData.inputFileName) // ReANalyzefitting 20231101:xiao
if (!this.isReanlyze) {
// ReANalyzefitting 20231101:xiao
if (this.currTab === 'gamma') {
this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
}
if (this.currTab === 'beta') {
this.$ls.remove('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
}
}
this.visible = false
},