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