feat: 自建台站Calibration中的ReAnalyse接口对接和功能修改
This commit is contained in:
parent
3723cbb730
commit
71dabdaed5
|
@ -69,11 +69,7 @@
|
||||||
<div class="beta-gamma-analysis-main-right">
|
<div class="beta-gamma-analysis-main-right">
|
||||||
<beta-gamma-chart-container>
|
<beta-gamma-chart-container>
|
||||||
<template slot="title"> Beta-Gated-Gamma-Spectrum </template>
|
<template slot="title"> Beta-Gated-Gamma-Spectrum </template>
|
||||||
<roi-limits
|
<roi-limits ref="RoiChartRef" :ROILists="ROILists" :ROIAnalyzeLists="ROIAnalyzeLists" />
|
||||||
ref="RoiChartRef"
|
|
||||||
:ROILists="ROILists"
|
|
||||||
:ROIAnalyzeLists="ROIAnalyzeLists"
|
|
||||||
/>
|
|
||||||
</beta-gamma-chart-container>
|
</beta-gamma-chart-container>
|
||||||
<!-- 底部显示 -->
|
<!-- 底部显示 -->
|
||||||
<div class="beta-gamma-analysis-main-bottom">
|
<div class="beta-gamma-analysis-main-bottom">
|
||||||
|
@ -239,11 +235,13 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.$bus.$on('selfRefresh', this.handleRefresh)
|
this.$bus.$on('selfRefresh', this.handleRefresh)
|
||||||
this.$bus.$on('selfAccept', this.handleAccept)
|
this.$bus.$on('selfAccept', this.handleAccept)
|
||||||
|
this.$bus.$on('ReAnalyses', this.updateByReprocessingData)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
this.$bus.$on('selfRefresh', this.handleRefresh)
|
this.$bus.$off('selfRefresh', this.handleRefresh)
|
||||||
this.$bus.$off('selfAccept', this.handleAccept)
|
this.$bus.$off('selfAccept', this.handleAccept)
|
||||||
|
this.$bus.$off('ReAnalyses', this.updateByReprocessingData)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 从分析或来自db的谱信息拿到分析结果列表
|
// 从分析或来自db的谱信息拿到分析结果列表
|
||||||
|
@ -272,38 +270,7 @@ export default {
|
||||||
formData.append('processKey', `${userId}_${this.timerStamp}`)
|
formData.append('processKey', `${userId}_${this.timerStamp}`)
|
||||||
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
||||||
if (success) {
|
if (success) {
|
||||||
const analyseList = this.getROIAnalyzeListsFromResult(result)
|
this.updateByReprocessingData(result)
|
||||||
this.ROIAnalyzeLists = this.spectraType == 'sample' ? analyseList : []
|
|
||||||
updateSampleData({
|
|
||||||
inputFileName,
|
|
||||||
key: 'ROIAnalyzeLists',
|
|
||||||
data: analyseList,
|
|
||||||
})
|
|
||||||
|
|
||||||
// 更新XeData
|
|
||||||
updateSampleData({
|
|
||||||
inputFileName,
|
|
||||||
key: 'XeData',
|
|
||||||
data: result.XeData,
|
|
||||||
})
|
|
||||||
this.resultDisplay = result.XeData
|
|
||||||
|
|
||||||
const { betaEnergyData, gammaEnergyData } = result
|
|
||||||
// 更新 betaEnergyData 和 gammaEnergyData
|
|
||||||
this.betaEnergyData = betaEnergyData
|
|
||||||
this.gammaEnergyData = gammaEnergyData
|
|
||||||
|
|
||||||
// 更新sample的 betaEnergyData 和 gammaEnergyData
|
|
||||||
updateSampleData({
|
|
||||||
inputFileName,
|
|
||||||
key: 'sample.betaEnergyData',
|
|
||||||
data: betaEnergyData,
|
|
||||||
})
|
|
||||||
updateSampleData({
|
|
||||||
inputFileName,
|
|
||||||
key: 'sample.gammaEnergyData',
|
|
||||||
data: gammaEnergyData,
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
const arr = message.split('\n')
|
const arr = message.split('\n')
|
||||||
this.$warning({
|
this.$warning({
|
||||||
|
@ -318,6 +285,48 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateByReprocessingData(result) {
|
||||||
|
const { inputFileName } = this.sample
|
||||||
|
const analyseList = this.getROIAnalyzeListsFromResult(result)
|
||||||
|
this.ROIAnalyzeLists = this.spectraType == 'sample' ? analyseList : []
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'ROIAnalyzeLists',
|
||||||
|
data: analyseList,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 更新XeData
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'XeData',
|
||||||
|
data: result.XeData,
|
||||||
|
})
|
||||||
|
this.resultDisplay = result.XeData
|
||||||
|
|
||||||
|
const { betaEnergyData, gammaEnergyData } = result
|
||||||
|
// 更新 betaEnergyData 和 gammaEnergyData
|
||||||
|
this.betaEnergyData = betaEnergyData
|
||||||
|
this.gammaEnergyData = gammaEnergyData
|
||||||
|
|
||||||
|
// 更新sample的 betaEnergyData 和 gammaEnergyData
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'sample.betaEnergyData',
|
||||||
|
data: betaEnergyData,
|
||||||
|
})
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'sample.gammaEnergyData',
|
||||||
|
data: gammaEnergyData,
|
||||||
|
})
|
||||||
|
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'isReprocessed',
|
||||||
|
data: true,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 分析全部
|
// 分析全部
|
||||||
getAnalyzeAllSpectrum() {
|
getAnalyzeAllSpectrum() {
|
||||||
this.$message.warning('尚未实现该功能')
|
this.$message.warning('尚未实现该功能')
|
||||||
|
|
|
@ -24,7 +24,9 @@
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</title-over-border>
|
</title-over-border>
|
||||||
<div class="footer-btns">
|
<div class="footer-btns">
|
||||||
<a-button type="primary" @click="handleReAnalyse">Reanalyse Spectrum Using New Calibration</a-button>
|
<a-button type="primary" :loading="isReanalysing" @click="handleReAnalyse">
|
||||||
|
Reanalyse Spectrum Using New Calibration
|
||||||
|
</a-button>
|
||||||
<a-button type="primary" class="exit" @click="handleExit">Exit</a-button>
|
<a-button type="primary" class="exit" @click="handleExit">Exit</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,7 +39,7 @@ import { postAction } from '@/api/manage'
|
||||||
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
|
import BetaDetectorCalibration from './components/BetaDetectorCalibration.vue'
|
||||||
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
|
import GammaDetectorCalibration from './components/GammaDetectorCalibration.vue'
|
||||||
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
|
import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder.vue'
|
||||||
import { removeSampleData } from '@/utils/SampleStore'
|
import { getSampleData, removeSampleData } from '@/utils/SampleStore'
|
||||||
export default {
|
export default {
|
||||||
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
||||||
mixins: [SampleDataMixin],
|
mixins: [SampleDataMixin],
|
||||||
|
@ -55,6 +57,7 @@ export default {
|
||||||
betaEnergyValid: false,
|
betaEnergyValid: false,
|
||||||
gammaEnergyValid: false,
|
gammaEnergyValid: false,
|
||||||
isReanlyze: false,
|
isReanlyze: false,
|
||||||
|
isReanalysing: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -76,8 +79,16 @@ export default {
|
||||||
// }
|
// }
|
||||||
console.log('gammaEnergyValid>>>' + this.gammaEnergyValid)
|
console.log('gammaEnergyValid>>>' + this.gammaEnergyValid)
|
||||||
},
|
},
|
||||||
handleReAnalyse() {
|
async handleReAnalyse() {
|
||||||
// todo 1.fitting之后才能点击; 2.isReAnalyze需要缓存
|
const {
|
||||||
|
data: { isReprocessed },
|
||||||
|
} = getSampleData(this.newSampleData.inputFileName)
|
||||||
|
|
||||||
|
if (!isReprocessed) {
|
||||||
|
this.$message.warning('Please analyze the spectrum first')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.gammaEnergyValid && !this.betaEnergyValid) {
|
if (!this.gammaEnergyValid && !this.betaEnergyValid) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -120,25 +131,21 @@ export default {
|
||||||
currentFileName: this.newSampleData.inputFileName,
|
currentFileName: this.newSampleData.inputFileName,
|
||||||
currentQCFileName: this.newSampleData.qcFileName,
|
currentQCFileName: this.newSampleData.qcFileName,
|
||||||
}
|
}
|
||||||
postAction('/selfStation/ReAnalyse', params).then((res) => {
|
|
||||||
if (res.success) {
|
try {
|
||||||
res.result.XeData.forEach((item) => {
|
this.isReanalysing = true
|
||||||
|
const { success, result, message } = await postAction('/selfStation/ReAnalyse', params)
|
||||||
|
if (success) {
|
||||||
|
result.XeData.forEach((item) => {
|
||||||
item.conc = parseFloat(item.conc.toPrecision(6))
|
item.conc = parseFloat(item.conc.toPrecision(6))
|
||||||
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
item.concErr = parseFloat(item.concErr.toPrecision(6))
|
||||||
item.lc = parseFloat(item.lc.toPrecision(6))
|
|
||||||
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
item.mdc = parseFloat(item.mdc.toPrecision(6))
|
||||||
})
|
})
|
||||||
this.$emit('sendXeData', res.result.XeData)
|
this.$emit('sendXeData', result.XeData)
|
||||||
this.$emit('reAnalyCurr', res.result.savedAnalysisResult, res.result.XeData)
|
this.$emit('reAnalyCurr', result.savedAnalysisResult, result.XeData)
|
||||||
this.isReanlyze = true
|
this.isReanlyze = true
|
||||||
this.handleExit()
|
this.handleExit()
|
||||||
this.$bus.$emit('ReAnalyses', res.result)
|
this.$bus.$emit('ReAnalyses', result)
|
||||||
if (res.result.bProcessed) {
|
|
||||||
this.$message.success(res.result.message)
|
|
||||||
} else {
|
|
||||||
this.$message.warning(res.result.message)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
|
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
|
||||||
let sameStation = matchedSampleList.filter(
|
let sameStation = matchedSampleList.filter(
|
||||||
(item) => item.inputFileName !== this.newSampleData.inputFileName
|
(item) => item.inputFileName !== this.newSampleData.inputFileName
|
||||||
|
@ -147,9 +154,13 @@ export default {
|
||||||
this.setSameStationCalibarationCache(sameStation)
|
this.setSameStationCalibarationCache(sameStation)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(message)
|
||||||
}
|
}
|
||||||
})
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
this.isReanalysing = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 清理相同台站的缓存
|
// 清理相同台站的缓存
|
||||||
|
|
Loading…
Reference in New Issue
Block a user