WIP: 增加 calibration 弹窗
This commit is contained in:
parent
dc0b9065a5
commit
eb2ab9416e
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,282 @@
|
|||
<template>
|
||||
<custom-modal
|
||||
v-model="visible"
|
||||
:width="1200"
|
||||
title="Tool of Calibration"
|
||||
class="beta-gamma-tool-of-calibration"
|
||||
:footer="null"
|
||||
destroy-on-close
|
||||
@cancel="handleExit"
|
||||
>
|
||||
<a-tabs :animated="false" v-model="currTab">
|
||||
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
||||
<gamma-detector-calibration @isFitting="getFittingFlag_gamma" :isFirstFitting="gammaEnergyValid" />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
||||
<beta-detector-calibration @isFitting="getFittingFlag_beta" :isFirstFitting="betaEnergyValid" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<div class="footer">
|
||||
<title-over-border title="New Calibration is Applied to">
|
||||
<a-radio-group v-model="newCalibrationIsAppliedTo">
|
||||
<p>
|
||||
<a-radio value="AllSpectrum">All Spectra</a-radio>
|
||||
</p>
|
||||
<a-radio value="CurrentSpectrum">Current Spectrum</a-radio>
|
||||
</a-radio-group>
|
||||
</title-over-border>
|
||||
<title-over-border title="Recalculate ROI Counts For">
|
||||
<a-checkbox-group v-model="recalculateROICountsFor" @change="recalculateROICountsForChange">
|
||||
<p>
|
||||
<a-checkbox value="sample">Sample Data</a-checkbox>
|
||||
<a-checkbox value="gasBg">GasBg Data</a-checkbox>
|
||||
</p>
|
||||
<a-checkbox value="detBg">DetBg Data</a-checkbox>
|
||||
<a-checkbox value="qc">QC Data</a-checkbox>
|
||||
</a-checkbox-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" class="exit" @click="handleExit">Exit</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
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'
|
||||
export default {
|
||||
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
||||
mixins: [SampleDataMixin],
|
||||
props: {
|
||||
sampleList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
currTab: 'gamma',
|
||||
newCalibrationIsAppliedTo: 'CurrentSpectrum',
|
||||
recalculateROICountsFor: [],
|
||||
checkFlag: {
|
||||
checkSample: false,
|
||||
checkGas: false,
|
||||
checkDet: false,
|
||||
},
|
||||
betaEnergyValid: false,
|
||||
gammaEnergyValid: false,
|
||||
isReanlyze: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.currTab = 'gamma'
|
||||
this.visible = true
|
||||
},
|
||||
|
||||
recalculateROICountsForChange(checkedVal) {
|
||||
this.recalculateROICountsFor = checkedVal
|
||||
this.checkFlag.checkSample = checkedVal.includes('sample') ? true : false
|
||||
this.checkFlag.checkGas = checkedVal.includes('gasBg') ? true : false
|
||||
this.checkFlag.checkDet = checkedVal.includes('detBg') ? true : false
|
||||
this.$emit('sendInfo', this.checkFlag)
|
||||
},
|
||||
getFittingFlag_beta(val) {
|
||||
this.betaEnergyValid = val
|
||||
console.log('betaEnergyValid>>>' + this.betaEnergyValid)
|
||||
},
|
||||
getFittingFlag_gamma(val) {
|
||||
this.gammaEnergyValid = val
|
||||
// 1. Beta数据依赖于Gamma
|
||||
// 2. 如果Gamma情况数据,beta也需要
|
||||
// if(!this.gammaEnergyValid){
|
||||
// this.betaEnergyValid = val;
|
||||
// console.log("重置Beta>>"+this.betaEnergyValid)
|
||||
// }
|
||||
console.log('gammaEnergyValid>>>' + this.gammaEnergyValid)
|
||||
},
|
||||
handleReAnalyse() {
|
||||
// todo 1.fitting之后才能点击; 2.isReAnalyze需要缓存
|
||||
if (!this.gammaEnergyValid && !this.betaEnergyValid) {
|
||||
return false
|
||||
}
|
||||
const regExp = /^([A-Z]{1,}\d{1,})_/
|
||||
const regMatched = this.newSampleData.inputFileName.match(regExp)
|
||||
const currStationName = regMatched[1]
|
||||
const dbNames = [],
|
||||
sampleIds = [],
|
||||
sampleFileNames = [],
|
||||
gasFileNames = [],
|
||||
detFileNames = [],
|
||||
qcFileNames = []
|
||||
|
||||
const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName))
|
||||
matchedSampleList.forEach(
|
||||
({ dbName, sampleId, inputFileName, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
|
||||
dbNames.push(dbName || '')
|
||||
sampleIds.push(sampleId || '')
|
||||
sampleFileNames.push(sampleFileName || inputFileName || '')
|
||||
gasFileNames.push(gasFileName || '')
|
||||
detFileNames.push(detFileName || '')
|
||||
qcFileNames.push(qcFileStatus ? qcFileName : '')
|
||||
}
|
||||
)
|
||||
|
||||
let params = {
|
||||
applyType: this.newCalibrationIsAppliedTo,
|
||||
sampleData: this.recalculateROICountsFor.includes('sample') ? true : false,
|
||||
gasBgData: this.recalculateROICountsFor.includes('gasBg') ? true : false,
|
||||
detBgData: this.recalculateROICountsFor.includes('detBg') ? true : false,
|
||||
qcData: this.recalculateROICountsFor.includes('qc') ? true : false,
|
||||
betaEnergyValid: this.betaEnergyValid,
|
||||
gammaEnergyValid: this.gammaEnergyValid,
|
||||
dbNames,
|
||||
sampleIds,
|
||||
sampleFileNames,
|
||||
gasFileNames,
|
||||
detFileNames,
|
||||
qcFileNames,
|
||||
currentFileName: this.newSampleData.inputFileName,
|
||||
currentQCFileName: this.newSampleData.qcFileName,
|
||||
}
|
||||
postAction('/spectrumAnalysis/ReAnalyse', params).then((res) => {
|
||||
if (res.success) {
|
||||
res.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.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)
|
||||
}
|
||||
|
||||
if (this.newCalibrationIsAppliedTo == 'AllSpectrum') {
|
||||
let sameStation = matchedSampleList.filter(
|
||||
(item) => item.inputFileName !== this.newSampleData.inputFileName
|
||||
)
|
||||
this.clearSameStationCache(sameStation)
|
||||
this.setSameStationCalibarationCache(sameStation)
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 清理相同台站的缓存
|
||||
clearSameStationCache(sampleList) {
|
||||
sampleList.forEach(({ inputFileName }) => {
|
||||
removeSampleData(inputFileName)
|
||||
})
|
||||
},
|
||||
// 相同台站能谱缓存一样的Calibration数据 20231115:xiao
|
||||
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
|
||||
if (!this.isReanlyze && (!this.gammaEnergyValid || !this.gammaEnergyValid)) {
|
||||
// 如果没有点击ReANalyze,删除fitting之后缓存的数据 20231101:xiao
|
||||
// 1. Beta数据依赖于Gamma
|
||||
// 2. 点击reanalyze,如果beta有数据也要缓存
|
||||
this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)
|
||||
this.$ls.remove('CALIBRATION_BETA_' + this.newSampleData.inputFileName)
|
||||
}
|
||||
this.visible = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.beta-gamma-tool-of-calibration {
|
||||
.ant-modal-body {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.ant-tabs-nav .ant-tabs-tab {
|
||||
padding: 5px 10px;
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep {
|
||||
.ant-modal {
|
||||
top: 5px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.ant-form-item-label,
|
||||
.ant-form-item-control {
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
.title-over-border-content {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
||||
.title-over-border {
|
||||
&:first-child {
|
||||
flex: 4;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
flex: 5;
|
||||
|
||||
.ant-checkbox-wrapper {
|
||||
width: 145px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-btns {
|
||||
flex: 6;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 20px;
|
||||
align-items: center;
|
||||
|
||||
.exit {
|
||||
width: 130px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -242,6 +242,8 @@
|
|||
<statistics-paramer-history-modal v-model="statisticsParamerHistoryModalVisible" />
|
||||
<!-- Beta-Gamma 的 Statistics Paramer History 弹窗 结束 -->
|
||||
<bg-log-viewer v-model="bgLogViewerVisible" />
|
||||
|
||||
<CalibrationModal :sampleList="sampleList" ref="newCalibrationModalRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -289,6 +291,8 @@ import FtransltModal from './components/Modals/FtransltModal/index.vue'
|
|||
import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue'
|
||||
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
|
||||
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
|
||||
import CalibrationModal from './components/Modals/NewBetaModals/CalibrationModal/index.vue'
|
||||
|
||||
import { getAction } from '@/api/manage'
|
||||
import { clearSampleCache } from './clearSampleCache'
|
||||
import { fetchAndDownload } from '@/utils/file'
|
||||
|
@ -352,6 +356,7 @@ export default {
|
|||
BetaGammaExtrapolationModal,
|
||||
BgLogViewer: BGLogViewer,
|
||||
CompareFromDbModal,
|
||||
CalibrationModal,
|
||||
},
|
||||
|
||||
provide() {
|
||||
|
@ -1028,6 +1033,11 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 新的beta的
|
||||
handleNewBetaEnergyCalib() {
|
||||
this.$refs.newCalibrationModalRef.show()
|
||||
},
|
||||
|
||||
// 获取颜色配置
|
||||
async getColorConfig() {
|
||||
try {
|
||||
|
@ -1407,7 +1417,16 @@ export default {
|
|||
if (this.isBeta) this.efficiencyCalibrationModalShow_beta = true
|
||||
},
|
||||
},
|
||||
// 自建的那个beta
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Energy Calibration',
|
||||
show: this.isBeta,
|
||||
handler: () => this.handleNewBetaEnergyCalib(),
|
||||
},
|
||||
|
||||
{
|
||||
// 旧的beta
|
||||
type: 'a-menu-item',
|
||||
title: 'Energy Calibration',
|
||||
show: this.isBetaGamma,
|
||||
|
|
Loading…
Reference in New Issue
Block a user