AnalysisSystemForRadionucli.../src/views/spectrumAnalysis/index.vue

1332 lines
42 KiB
Vue
Raw Normal View History

2023-05-10 08:40:05 +08:00
<template>
2023-06-28 19:25:11 +08:00
<div class="spectrum-analysis">
<!-- 顶部操作栏 -->
<div class="spectrum-analysis-operators">
<template v-for="operation in operations">
<a-dropdown
v-if="operation.show !== false"
class="spectrum-analysis-operators-item"
overlayClassName="spectrum-analysis-operators-dropdown-overlay"
:overlay-style="operation.style"
:key="operation.title"
>
<a-button type="primary">{{ operation.title }}</a-button>
<div slot="overlay">
<template v-for="(child, index) in operation.children">
<component :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
<template v-for="item in child.children">
<component v-if="item.show !== false" :is="item.type" :key="item.title" @click="item.handler">
{{ item.title }}
</component>
</template>
</component>
</template>
</div>
</a-dropdown>
</template>
2023-06-28 19:25:11 +08:00
</div>
<!-- 顶部操作栏结束 -->
<!-- 频谱分析部分 -->
<div class="spectrum-analysis-main">
<!-- Gamma 分析 -->
<gamma-analysis v-if="isGamma" ref="gammaAnalysisRef" :sample="sampleData" />
<!-- Gamma 分析 -->
<!-- Beta-Gamma 分析 -->
2023-09-14 19:44:56 +08:00
<!-- <beta-gamma-analysis v-else-if="isBetaGamma" ref="betaGammaAnalysisRef" :sample="sampleData" /> -->
<beta-gamma-analysis
v-else-if="isBetaGamma"
ref="betaGammaAnalysisRef"
@getFiles="getFiles"
@sendInfo="getStationName"
2023-09-14 19:44:56 +08:00
:sample="sampleData"
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
/>
<!-- Beta-Gamma 分析 -->
<div v-else class="empty">Please Select a Sample</div>
2023-06-28 19:25:11 +08:00
<resize-observer @notify="handleResize" />
</div>
<!-- 频谱分析部分结束 -->
<!-- 从数据库加载开始 -->
<load-from-db-modal v-model="loadFromDbModalVisible" @loadSample="handleLoadSampleFromDB" />
<!-- 从数据库加载结束 -->
<!-- 从文件加载开始 -->
<load-from-file-modal v-model="loadFromFileModalVisible" @loadFormFile="handleLoadSampleFromFile" />
<!-- 从文件加载结束 -->
<!-- Strip 弹窗开始 -->
<strip-modal v-model="stripModalVisible" />
<!-- Strip 弹窗结束 -->
<!-- Ftransit 弹窗开始 -->
<ftranslt-modal v-model="ftransltModalVisible" />
<!-- Ftransit 弹窗结束 -->
<!-- Peak Infomation 弹窗开始 -->
<peak-infomation v-model="peakInfomationModalVisible" />
<!-- Peak Infomation 弹窗结束 -->
<!-- Nuclide Activity and MDC 弹窗开始 -->
<nuclide-activity-and-mdc-modal v-model="nuclideActivityAndMDCModalVisible" />
<!-- Nuclide Activity and MDC 弹窗结束 -->
2023-07-11 09:10:34 +08:00
<!-- Save Setting 弹窗开始 -->
<save-setting-modal v-model="saveSettingModalVisible" />
<!-- Save Setting 弹窗结束 -->
<!-- 分析-设置弹窗开始 -->
<analyze-setting-modal v-model="analyzeConfigureModalVisible" :sampleId="sampleData.sampleId" />
2023-07-11 09:10:34 +08:00
<!-- 分析-设置弹窗结束 -->
<!-- 分析工具弹窗开始 -->
<analyze-interactive-tool-modal v-model="analyzeInteractiveToolModalVisible" :sampleId="sampleData.sampleId" />
2023-07-11 09:10:34 +08:00
<!-- 分析工具弹窗结束 -->
<!-- Korsum 弹窗开始 -->
<korsum-modal v-model="korsumModalShow" />
<!-- Korsum 弹窗结束 -->
<!-- Zero Time 弹窗开始 -->
<zero-time-modal v-model="zeroTimeModalVisible" :sampleId="sampleData.sampleId" />
<!-- Zero Time 弹窗结束 -->
<!-- Efficiency Calibration 弹窗开始 -->
<efficiency-calibration-modal v-model="efficiencyCalibrationModalShow" />
<!-- Efficiency Calibration 弹窗结束 -->
<!-- Energy Calibration 弹窗开始 -->
<energy-calibration-modal v-model="energyCalibrationModalShow" />
<!-- Energy Calibration 弹窗结束 -->
<!-- Resolution Calibration 弹窗开始 -->
<resolution-calibration-modal v-model="resolutionCalibrationModalShow" />
<!-- Resolution Calibration 弹窗结束 -->
<!-- SpectrumComments 弹窗开始 -->
<spectrum-comments-modal v-model="gammaCommentsModalVisible" :isAdd="isGammaCommentsAdd" />
<!-- SpectrumComments 弹窗结束 -->
<!-- Color Config 弹窗开始 -->
<color-config-modal v-model="colorConfigModalVisible" />
<!-- Color Config 弹窗结束 -->
<!-- Data Processing Log 弹窗开始 -->
<data-processing-log-modal v-model="dataProcessingLogModalVisible" :sampleId="sampleData.sampleId" />
<!-- Data Processing Log 弹窗结束 -->
<!-- Config User Library 弹窗开始 -->
<config-user-library-modal v-model="configUserLibModalVisible" />
<!-- Config User Library 弹窗结束 -->
<!-- Nuclide Library 弹窗开始 -->
<nuclide-library-modal v-model="nuclideLibraryModalVisible" />
<!-- Nuclide Library 弹窗结束 -->
<!-- Arr RRR 弹窗开始 -->
<arr-rrr-modal v-model="arrOrRRRModalVisible" :type="arrOrRRRModalType" :extraData="this.arrOrRRRModalExtraData" />
<!-- Arr 弹窗结束 -->
<!-- Spectrum 弹窗开始 -->
<spectrum-modal v-model="spectrumModalVisible" />
<!-- Spectrum 弹窗结束 -->
<!-- SampleInfo 弹窗开始 -->
<sample-infomation-modal v-model="sampleInfomationModalVisible" />
<!-- SampleInfo 弹窗结束 -->
<!-- Qc Results 弹窗开始 -->
<qc-results-modal v-model="qcResultsModalVisible" />
<!-- Qc Results 弹窗结束 -->
<!-- RLR 弹窗开始 -->
<rlr-modal v-model="rlrModalVisible" />
<!-- RLR 弹窗结束 -->
<automatic-analysis-log-modal v-model="autoAnalysisMogModalVisible" :type="autoAnalysisMogModalType" />
<!-- Beta-Gamma 的Comments 弹窗 -->
<beta-gamma-comments-modal
v-model="betaGammaCommentsModalVisible"
:isAdd="isBetaGammaCommentsAdd"
@sendInfo="getcommentsInfo"
/>
<!-- Beta-Gamma 的Comments 结束 -->
<!-- Beta-Gamma 的Energy Calibration开始 -->
<beta-gamma-energy-calibration-modal
v-model="betaGammaEnergyCalibrationModalVisible"
:sampleId="this.sampleData.sampleId"
@sendInfo="getCheckFlag"
/>
<!-- Beta-Gamma 的Energy Calibration结束 -->
<!-- Beta-Gamma Extrapolation 弹窗开始 -->
<beta-gamma-extrapolation-modal v-model="betaGammaExtrapolationModalVisible" />
<!-- Beta-Gamma Extrapolation 弹窗结束 -->
<!-- Beta-Gamma Spectrum 弹窗 -->
<beta-gamma-spectrum-modal v-model="betaGammaSpectrumModalVisible" :sampleId="this.sampleData.sampleId" />
<!-- Beta-Gamma Spectrum 弹窗 结束 -->
<!-- Beta-Gamma Sample Infomation 弹窗 -->
<beta-gamma-sample-infomation-modal
v-model="betaGammaSampleInfomationModalVisible"
:sampleId="this.sampleData.sampleId"
/>
<!-- Beta-Gamma Sample Infomation 弹窗 结束 -->
<!-- Beta-Gamma QC Result 弹窗 -->
<beta-gamma-qc-results-modal v-model="betaGammaQCResultsModalVisible" :sampleId="this.sampleData.sampleId" />
<!-- Beta-Gamma QC Result 弹窗 结束 -->
<!-- Beta-Gamma RLR 弹窗 -->
<beta-gamma-rlr-modal v-model="betaGammaRlrModalVisible" :sampleData="sampleData" />
<!-- Beta-Gamma RLR 弹窗 结束 -->
<!-- Beta-Gamma Statistics Paramer History 弹窗 -->
<statistics-paramer-history-modal v-model="statisticsParamerHistoryModalVisible" />
<!-- Beta-Gamma Statistics Paramer History 弹窗 结束 -->
2023-06-28 19:25:11 +08:00
</div>
</template>
<script>
2023-09-14 19:44:56 +08:00
import { postAction } from '@/api/manage'
2023-06-28 19:25:11 +08:00
import GammaAnalysis from './gamma-analysis.vue'
import BetaGammaAnalysis from './beta-gamma-analysis.vue'
import SpectraListInMenu from './components/SpectraListInMenu.vue'
import LoadFromDbModal from './components/Modals/LoadFromDBModal.vue'
import LoadFromFileModal from './components/Modals/LoadFromFileModal.vue'
import PeakInfomation from './components/PeakInfomation.vue'
import NuclideActivityAndMdcModal from './components/Modals/NuclideActivityAndMDCModal.vue'
2023-07-11 09:10:34 +08:00
import MultiLevelMenu from './components/MultiLevelMenu.vue'
import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
import KorsumModal from './components/Modals/KorsumModal.vue'
import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue'
import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue'
import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue'
import ResolutionCalibrationModal from './components/Modals/ResolutionCalibrationModal.vue'
import SpectrumCommentsModal from './components/Modals/SpectrumCommentsModal.vue'
import ColorConfigModal from './components/Modals/ColorConfigModal.vue'
import DataProcessingLogModal from './components/Modals/DataProcessingLogModal.vue'
import ConfigUserLibraryModal from './components/Modals/ConfigUserLibraryModal.vue'
import NuclideLibraryModal from './components/Modals/NuclideLibraryModal.vue'
import ArrRrrModal from './components/Modals/ArrRrrModal.vue'
import SpectrumModal from './components/Modals/SpectrumModal.vue'
import SampleInfomationModal from './components/Modals/SampleInfomationModal.vue'
import QcResultsModal from './components/Modals/QcResultsModal.vue'
import RlrModal from './components/Modals/RLRModal/index.vue'
import BetaGammaCommentsModal from './components/Modals/BetaGammaModals/BetaGammaCommentsModal.vue'
import BetaGammaSpectrumModal from './components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue'
import BetaGammaSampleInfomationModal from './components/Modals/BetaGammaModals/BetaGammaSampleInfomationModal.vue'
import BetaGammaQcResultsModal from './components/Modals/BetaGammaModals/BetaGammaQCResultsModal.vue'
import BetaGammaRlrModal from './components/Modals/BetaGammaModals/BetaGammaRLRModal/index.vue'
import StatisticsParamerHistoryModal from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModal.vue'
import FtransltModal from './components/Modals/FtransltModal/index.vue'
import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue'
import StripModal from './components/Modals/StripModal.vue'
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
import { getAction } from '@/api/manage'
2023-06-28 19:25:11 +08:00
// 分析类型
const ANALYZE_TYPE = {
GAMMA: 'gammaAnalysis',
BETA_GAMMA: 'betaGammaAnalysis',
2023-06-28 19:25:11 +08:00
}
export default {
components: {
BetaGammaAnalysis,
GammaAnalysis,
SpectraListInMenu,
LoadFromDbModal,
LoadFromFileModal,
PeakInfomation,
2023-07-11 09:10:34 +08:00
NuclideActivityAndMdcModal,
MultiLevelMenu,
SaveSettingModal,
AnalyzeSettingModal,
AnalyzeInteractiveToolModal,
KorsumModal,
ZeroTimeModal,
EfficiencyCalibrationModal,
EnergyCalibrationModal,
ResolutionCalibrationModal,
SpectrumCommentsModal,
ColorConfigModal,
DataProcessingLogModal,
ConfigUserLibraryModal,
NuclideLibraryModal,
ArrRrrModal,
SpectrumModal,
SampleInfomationModal,
QcResultsModal,
RlrModal,
BetaGammaCommentsModal,
BetaGammaSpectrumModal,
BetaGammaSampleInfomationModal,
BetaGammaQcResultsModal,
BetaGammaRlrModal,
StatisticsParamerHistoryModal,
FtransltModal,
BetaGammaEnergyCalibrationModal,
StripModal,
AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal,
2023-06-28 19:25:11 +08:00
},
provide() {
return {
sample: () => {
return this.sampleData
},
newSample: () => {
return this.newSampleData
},
}
},
2023-06-28 19:25:11 +08:00
data() {
this.ANALYZE_TYPE = ANALYZE_TYPE
return {
analysisType: null, // 分析类型
sampleList: [],
2023-07-11 09:10:34 +08:00
loadFromDbModalVisible: false, // 从数据库加载弹窗
loadFromFileModalVisible: false, // 从文件加载弹窗
stripModalVisible: false, // Strip 弹窗
ftransltModalVisible: false, // Ftransit 弹窗
sampleData: {}, // 要分析的谱数据
newSampleData: {}, // 要分析的谱数据
2023-07-11 09:10:34 +08:00
saveSettingModalVisible: false, // 保存设置弹窗
analyzeConfigureModalVisible: false, // 分析设置弹窗
analyzeInteractiveToolModalVisible: false, // 分析工具弹窗
zeroTimeModalVisible: false, // Zero Time 弹窗
korsumModalShow: false, // Korsum 弹窗
efficiencyCalibrationModalShow: false, // Calibration -> Efficiency 弹窗
energyCalibrationModalShow: false, // Calibration -> Energy 弹窗
resolutionCalibrationModalShow: false, // Calibration -> Resolution 弹窗
gammaCommentsModalVisible: false, // Comments -> Spectrum Comments 弹窗
isGammaCommentsAdd: true, // Spectrum Comments 是否是新增
colorConfigModalVisible: false, // Help -> Color Config 弹窗
dataProcessingLogModalVisible: false, // Log -> Data Processing Log 弹窗
configUserLibModalVisible: false, // NuclideLibrary -> Config User Library 弹窗
nuclideLibraryModalVisible: false, // NuclideLibrary -> Nuclide Library 弹窗
peakInfomationModalVisible: false, // Reports -> PeakInfo 弹窗
arrOrRRRModalVisible: false, // Reports -> ARR 或RRR 弹窗
arrOrRRRModalType: 1, // Reports -> ARR 或RRR 弹窗类型
arrOrRRRModalExtraData: {},
nuclideActivityAndMDCModalVisible: false, // Reports -> Radionuclide Activity 弹窗
spectrumModalVisible: false, // Reports -> Spectrum 弹窗
sampleInfomationModalVisible: false, // Reports -> Sample Infomation 弹窗
qcResultsModalVisible: false, // Reports -> Qc Results 弹窗
rlrModalVisible: false, // Reports -> RLR 弹窗
autoAnalysisMogModalVisible: false, // Log -> Automatic Analysis Log 弹窗
autoAnalysisMogModalType: 1, // Log -> Automatic Analysis Log 弹窗类型 1为gamma 2为 betagamma
/**
* 以下是beta-gamma跟前面不同的弹窗
**/
betaGammaCommentsModalVisible: false, // beta-gamma Comments
isBetaGammaCommentsAdd: false, // beta-gamma comments 是否新增
betaGammaEnergyCalibrationModalVisible: false, // beta-gamma 的 Energy Calibration 弹窗
betaGammaExtrapolationModalVisible: false, // beta-gamma 的 Extrapolation 弹窗
betaGammaSpectrumModalVisible: false, // beta-gamma spectrum 弹窗
betaGammaSampleInfomationModalVisible: false, // beta-gamma sample infomation 弹窗
betaGammaQCResultsModalVisible: false, // beta-gamma QC Result 弹窗
betaGammaRlrModalVisible: false, // beta-gamma RLR 弹窗
statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History 弹窗
2023-09-14 19:44:56 +08:00
analyseCurrentSpectrumData: {},
resultDisplayFlag: [],
params_toDB: {
comment: '',
stationName: '',
dbName: '',
sampleFileName: '',
gasFileName: '',
detFileName: '',
qcFileName: '',
bGammaEnergyValidSample: false,
bBetaEnergyValidSample: false,
bGammaEnergyValidGas: false,
bBetaEnergyValidGas: false,
bGammaEnergyValidDet: false,
bBetaEnergyValidDet: false,
checkSample: false,
checkGas: false,
checkDet: false,
xe131mFlag: null,
xe133Flag: null,
xe133mFlag: null,
xe135Flag: null,
},
2023-06-28 19:25:11 +08:00
}
},
created() {
this.$bus.$on('reanalyse', this.handleReanalyse)
this.loadSelectedSample({
sampleId: 426530,
sampleType: 'G',
dbName: 'auto',
inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
})
},
destroyed() {
this.$bus.$off('reanalyse', this.handleReanalyse)
},
2023-06-28 19:25:11 +08:00
methods: {
getcommentsInfo(val) {
this.params_toDB.comment = val.spectrumAnalysisCommentInfo
},
getStationName(arg, val) {
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
},
getCheckFlag(val) {
this.params_toDB.checkSample = val.checkSample
this.params_toDB.checkGas = val.checkGas
this.params_toDB.checkDet = val.checkDet
},
// formDB 来源 吧接口返回的文件名称添加到sampleData
2023-09-14 19:44:56 +08:00
getFiles(val) {
this.newSampleData = { ...this.sampleData, ...val }
2023-09-14 19:44:56 +08:00
},
/**
* 从数据库加载-选择完成
* @param {any[]} sampleList
*/
handleLoadSampleFromDB(sampleList) {
const ids = this.sampleList.map((item) => item.sampleId) // 当前Sample列表中的所有id
const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
this.sampleList = this.sampleList.concat(willAddList)
},
handleLoadSampleFromFile(sampleList) {
let arr = sampleList.filter((item) => {
if (Object.keys(item).length > 4) {
if (item.gasFileName && item.detFileName && item.qcFileName && item.gasFileStatus && item.detFileStatus) {
2023-09-11 11:01:23 +08:00
return item
} else if (!item.gasFileName && !item.detFileName && !item.qcFileName) {
return item
}
}
})
arr.forEach((item) => {
item.dbName = ''
item.sampleId = ''
item.inputFileName = item.sampleFileName
item.sampleType = item.sampleSystemType
})
const names = this.sampleList.map((item) => item.inputFileName) // 当前Sample列表中的所有id
const willAddList = arr.filter((item) => !names.includes(item.inputFileName))
this.sampleList = this.sampleList.concat(willAddList)
},
// 加载选中的样本
async loadSelectedSample(sample) {
console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:#bf2c9f;', sample)
// B是beta-gamma P G是gamma
if (sample.sampleType == 'B') {
this.analysisType = ANALYZE_TYPE.BETA_GAMMA
} else {
this.analysisType = ANALYZE_TYPE.GAMMA
}
this.sampleData = this.newSampleData = sample
},
// 清理全部
handleCleanAll() {
this.sampleList = []
this.analysisType = undefined
this.sampleData = {}
},
2023-07-11 09:10:34 +08:00
// 保存结果到文件, 服务端生成文件,前端下载
handleSaveResultsToFile() {
this.saveSettingModalVisible = true
},
2023-07-11 09:10:34 +08:00
/**
* 保存结果到数据库
* @param { 'all' | 'current' } type
*/
async handleSaveResultsToDB(type) {
if (this.isBetaGamma) {
if (type === 'current') {
this.handleSaveResultsToDB_Cuurrent()
}
} else if (this.isGamma) {
if (type == 'current') {
const hideLoading = this.$message.loading('Saving...', 0)
try {
const { success, message } = await getAction('/gamma/saveToDB', {
fileName: this.sampleData.inputFileName
})
if (success) {
this.$message.success('Save Success')
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
hideLoading()
}
}
}
},
handleSaveResultsToDB_Cuurrent() {
// xeflag params_toDB
if (this.resultDisplayFlag.length > 0) {
this.resultDisplayFlag.forEach((item) => {
if (item.nuclideName === 'Xe131m') {
this.params_toDB.xe131mFlag = item.nidFlag
} else if (item.nuclideName === 'Xe133') {
this.params_toDB.xe133Flag = item.nidFlag
} else if (item.nuclideName === 'Xe133m') {
this.params_toDB.xe133mFlag = item.nidFlag
} else if (item.nuclideName === 'Xe135') {
this.params_toDB.xe135Flag = item.nidFlag
}
})
this.params_toDB.sampleFileName = this.newSampleData.inputFileName
this.params_toDB.gasFileName = this.newSampleData.gasFileName
this.params_toDB.detFileName = this.newSampleData.detFileName
this.params_toDB.qcFileName = this.newSampleData.qcFileName
this.params_toDB.dbName = this.newSampleData.dbName
postAction('/spectrumAnalysis/saveToDB', this.params_toDB).then((res) => {
if (res.success) {
this.$message.success('Save Successfully!')
} else {
this.$message.warning('Fail To Save')
}
})
}
},
2023-07-11 09:10:34 +08:00
/**
* 将谱列表中所有谱数据均以IMS2.0格式保存为PHD文件
* 服务端生成文件前端下载
* @param { 'all' | 'current' } type
*/
handleSavePHDToFile(type) {
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
},
2023-07-11 09:10:34 +08:00
handleReprocessAll() {
console.log('%c [ handleReprocessAll ]-216', 'font-size:13px; background:pink; color:#bf2c9f;')
},
// 查看Comments
handleViewComments() {
// 如果是gamma
if (this.isGamma) {
this.gammaCommentsModalVisible = true
this.isGammaCommentsAdd = false
}
// 如果是beta-gamma
else {
this.betaGammaCommentsModalVisible = true
this.isBetaGammaCommentsAdd = false
}
},
// 添加Comments
handleAddComments() {
// 如果是gamma
if (this.isGamma) {
this.gammaCommentsModalVisible = true
this.isGammaCommentsAdd = true
}
// 如果是beta-gamma
else {
this.betaGammaCommentsModalVisible = true
this.isBetaGammaCommentsAdd = true
}
},
// 查看软件操作帮助文档
handleHelp() {
console.log('%c [ handleHelp ]-221', 'font-size:13px; background:pink; color:#bf2c9f;')
},
2023-06-28 19:25:11 +08:00
handleResize() {
this.$refs.gammaAnalysisRef && this.$refs.gammaAnalysisRef.resize()
this.$refs.betaGammaAnalysisRef && this.$refs.betaGammaAnalysisRef.resize()
},
// Beta-Gamma Energy Calibration 的重新分析
handleReanalyse(...data) {
this.$refs.betaGammaAnalysisRef.reanalyse(data)
},
2023-09-14 19:44:56 +08:00
// beta Analyze current spectrum 分析接口
getAnalyzeCurrentSpectrum() {
let params = {
dbNames: [this.newSampleData.dbName],
sampleIds: [this.newSampleData.sampleId],
sampleFileNames: [this.newSampleData.inputFileName],
gasFileNames: [this.newSampleData.gasFileName],
detFileNames: [this.newSampleData.detFileName],
2023-09-14 19:44:56 +08:00
}
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
if (res.success) {
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
item.conc = item.conc.toFixed(6)
item.concErr = item.concErr.toFixed(6)
item.lc = item.lc.toFixed(6)
item.mdc = item.mdc.toFixed(6)
})
2023-09-14 19:44:56 +08:00
} else {
this.$message.warning(res.message)
}
})
},
handleEnergyCalib() {
if (this.newSampleData.sampleId) {
if (this.newSampleData.qcFileName) {
this.betaGammaEnergyCalibrationModalVisible = true
}
} else {
if (this.newSampleData.qcFileStatus && this.newSampleData.qcFileName) {
this.betaGammaEnergyCalibrationModalVisible = true
}
}
},
2023-06-28 19:25:11 +08:00
},
computed: {
// 顶部菜单栏配置
2023-06-28 19:25:11 +08:00
operations() {
return [
{
title: 'SAMPLE',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Load From DB',
handler: () => (this.loadFromDbModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Load From File',
handler: () => (this.loadFromFileModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Compare',
show: this.isGamma,
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
},
{
type: 'a-menu-item',
title: 'Strip',
show: this.isGamma,
handler: () => (this.stripModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Ftransit',
show: this.isGamma,
handler: () => (this.ftransltModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Clean All',
handler: this.handleCleanAll,
},
],
2023-06-28 19:25:11 +08:00
},
{
type: 'a-divider',
attrs: {
style: {
marginTop: '5px',
marginBottom: '5px',
display: this.sampleList.length ? '' : 'none',
},
},
},
{
type: 'SpectraListInMenu',
attrs: {
list: this.sampleList,
},
on: {
change: (spectra) => {
if (spectra) {
this.loadSelectedSample(spectra)
} else {
this.analysisType = undefined
this.sampleData = {}
}
},
},
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'SAVE',
children: [
{
2023-07-11 09:10:34 +08:00
type: 'MultiLevelMenu',
attrs: {
children: [
{
title: 'Save Results to File',
2023-07-11 09:10:34 +08:00
},
{
title: 'Save Results to DB',
children: [
{
title: 'Save Current',
key: 'current',
2023-07-11 09:10:34 +08:00
},
{
title: 'Save All',
key: 'all',
},
],
2023-07-11 09:10:34 +08:00
},
{
title: 'Save PHD to File',
children: [
{
title: 'Save Current',
key: 'current',
2023-07-11 09:10:34 +08:00
},
{
title: 'Save All',
key: 'all',
},
],
},
2023-07-11 09:10:34 +08:00
],
width: '170px',
2023-07-11 09:10:34 +08:00
},
on: {
menuClick: () => {
this.handleSaveResultsToFile()
},
2023-07-11 09:10:34 +08:00
submenuClick: ({ item, child }) => {
if (item.title == 'Save Results to DB') {
this.handleSaveResultsToDB(child.key)
} else if (item.title == 'Save PHD to File') {
this.handleSavePHDToFile(child.key)
}
},
},
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'ANALYZE',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
2023-07-11 09:10:34 +08:00
title: 'Configure',
show: this.isGamma,
handler: () => (this.analyzeConfigureModalVisible = true),
2023-07-11 09:10:34 +08:00
},
{
type: 'a-menu-item',
title: 'Reprocessing',
show: this.isGamma,
handler: () => this.$refs.gammaAnalysisRef.reProcessing(),
},
{
type: 'a-menu-item',
2023-07-11 09:10:34 +08:00
title: 'Reprocess All',
show: this.isGamma,
handler: this.handleReprocessAll,
2023-07-11 09:10:34 +08:00
},
{
type: 'a-menu-item',
title: 'Interactive Tool',
show: this.isGamma,
handler: () => (this.analyzeInteractiveToolModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Zero Time',
show: this.isGamma,
handler: () => (this.zeroTimeModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Korsum',
show: this.isGamma,
handler: () => (this.korsumModalShow = true),
},
{
type: 'a-menu-item',
title: 'Analyze current spectrum',
show: this.isBetaGamma,
2023-09-14 19:44:56 +08:00
handler: () => {
this.getAnalyzeCurrentSpectrum()
},
},
{
type: 'a-menu-item',
title: 'Analyze all spectra',
show: this.isBetaGamma,
handler: () => {},
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'CALIBRATION',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Energy',
show: this.isGamma,
handler: () => (this.energyCalibrationModalShow = true),
},
{
type: 'a-menu-item',
title: 'Resolution',
show: this.isGamma,
handler: () => (this.resolutionCalibrationModalShow = true),
},
{
type: 'a-menu-item',
title: 'Efficiency',
show: this.isGamma,
handler: () => (this.efficiencyCalibrationModalShow = true),
},
{
type: 'a-menu-item',
title: 'Energy Calibration',
show: this.isBetaGamma,
handler: () => this.handleEnergyCalib(),
},
{
type: 'a-menu-item',
title: 'Extrapolation',
show: this.isBetaGamma,
handler: () => (this.betaGammaExtrapolationModalVisible = true),
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'NUCLIDELIBRARY',
show: !this.isBetaGamma,
2023-06-28 19:25:11 +08:00
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Nuclide Library',
handler: () => (this.nuclideLibraryModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Config User Library',
handler: () => (this.configUserLibModalVisible = true),
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'STATISTIC',
show: this.isBetaGamma,
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'MDC & Activity Concentration',
handler: () => (this.statisticsParamerHistoryModalVisible = true),
},
],
},
],
},
2023-06-28 19:25:11 +08:00
{
title: 'COMMENTS',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'View Comments',
show: this.isBetaGamma,
handler: this.handleViewComments,
},
{
type: 'a-menu-item',
title: 'Add Comments',
show: this.isBetaGamma,
handler: this.handleAddComments,
},
{
type: 'a-menu-item',
title: 'View',
show: this.isGamma,
handler: this.handleViewComments,
},
{
type: 'a-menu-item',
title: 'Add',
show: this.isGamma,
handler: this.handleAddComments,
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'REPORTS',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Peak Infomation',
handler: () => (this.peakInfomationModalVisible = true),
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'ARR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 1
},
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'RRR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 2
},
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'Radionuclide Activity',
handler: () => (this.nuclideActivityAndMDCModalVisible = true),
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'Spectrum',
handler: () => (this.spectrumModalVisible = true),
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'Sample Infomation',
handler: () => (this.sampleInfomationModalVisible = true),
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'QC Results',
handler: () => (this.qcResultsModalVisible = true),
show: this.isGamma,
},
{
type: 'a-menu-item',
title: 'RLR',
handler: () => (this.rlrModalVisible = true),
show: this.isGamma,
},
// 以下是beta-gamma的下拉
{
type: 'a-menu-item',
title: 'View ARR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}
this.arrOrRRRModalType = 3
},
show: this.isBetaGamma,
},
{
type: 'a-menu-item',
title: 'View RRR',
handler: () => {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {
dbName: this.sampleData.dbName,
sampleData: false,
GasBgData: false,
DetBgData: false,
QCData: false,
bGammaEnergyValid: false,
bBetaEnergyValid: false,
}
this.arrOrRRRModalType = 4
},
show: this.isBetaGamma,
},
{
type: 'a-menu-item',
title: 'View spectrum',
handler: () => (this.betaGammaSpectrumModalVisible = true),
show: this.isBetaGamma,
},
{
type: 'a-menu-item',
title: 'View Sample Infomation',
handler: () => (this.betaGammaSampleInfomationModalVisible = true),
show: this.isBetaGamma,
},
{
type: 'a-menu-item',
title: 'QC results',
handler: () => (this.betaGammaQCResultsModalVisible = true),
show: this.isBetaGamma,
},
{
type: 'a-menu-item',
title: 'RLR',
handler: () => (this.betaGammaRlrModalVisible = true),
show: this.isBetaGamma,
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'LOG',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Automatic Analysis Log',
handler: () => {
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
this.autoAnalysisMogModalVisible = true
},
},
{
type: 'a-menu-item',
title: 'BG log viewer',
show: this.isBetaGamma,
handler: () => {},
},
{
type: 'a-menu-item',
title: 'GammaViewer Log',
show: this.isGamma,
handler: () => (this.dataProcessingLogModalVisible = true),
},
],
},
],
2023-06-28 19:25:11 +08:00
},
{
title: 'HELP',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Help',
handler: this.handleHelp,
},
{
type: 'a-menu-item',
title: 'Color Config',
show: this.isGamma,
handler: () => (this.colorConfigModalVisible = true),
},
],
},
],
},
2023-06-28 19:25:11 +08:00
]
},
// 当前类型是否是Gamma
isGamma() {
return this.analysisType == ANALYZE_TYPE.GAMMA
},
// 当前类型是否是Beta-Gamma
isBetaGamma() {
return this.analysisType == ANALYZE_TYPE.BETA_GAMMA
},
},
2023-06-28 19:25:11 +08:00
}
</script>
<style lang="less" scoped>
.spectrum-analysis {
padding-top: 17px;
height: 100%;
display: flex;
flex-direction: column;
// 顶部操作栏开始
&-operators {
flex-shrink: 0;
display: flex;
justify-content: space-between;
flex-wrap: nowrap;
overflow: auto;
&-item {
width: 158px;
border: 1px solid rgba(12, 235, 201, 0.6);
border-top-width: 3px;
height: 30px;
background-color: rgba(51, 202, 217, 0.2);
color: #ccede8;
&:not(:last-child) {
margin-right: 15px;
}
::v-deep {
span {
text-shadow: none;
line-height: 26px;
letter-spacing: 2px;
}
}
&:nth-child(4) {
width: 224px;
}
&:nth-child(5) {
width: 268px;
}
&:nth-child(6) {
width: 257px;
}
&:nth-child(7) {
width: 234px;
}
&:nth-child(8) {
width: 125px;
}
}
}
// 顶部操作栏结束
::v-deep {
// 二级操作栏开始
.spectrum-analysis-sub-operators {
flex-shrink: 0;
margin-bottom: 19px;
display: flex;
flex-wrap: nowrap;
overflow: auto;
2023-06-28 19:25:11 +08:00
.pop-over-with-icon {
height: 32px;
2023-06-28 19:25:11 +08:00
&:not(:last-child) {
margin-right: 11px;
}
2023-06-28 19:25:11 +08:00
&:nth-child(1) {
width: 256px;
}
&:nth-child(2) {
width: 186px;
}
&:nth-child(3) {
width: 246px;
}
&:nth-child(4) {
width: 246px;
}
2023-06-28 19:25:11 +08:00
}
.peak-info {
width: 306px;
height: 32px;
display: inline-block;
}
2023-06-28 19:25:11 +08:00
}
// 二级操作栏结束
2023-06-28 19:25:11 +08:00
}
// 主体部分开始
&-main {
margin-top: 15px;
height: calc(100% - 45px);
overflow: hidden;
2023-06-28 19:25:11 +08:00
}
// 主体部分结束
}
</style>
<style lang="less" scoped>
::v-deep {
.pop-over-with-icon {
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #0a544e;
height: 100%;
padding: 0 11px;
cursor: pointer;
.text {
font-family: MicrosoftYaHei;
color: #ade6ee;
letter-spacing: 1px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
user-select: none;
}
img {
margin-left: 5px;
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
flex-shrink: 0;
user-select: none;
}
&.ant-popover-open {
img {
transform: rotate(180deg);
}
}
}
}
</style>
<style lang="less">
.spectrum-analysis-operators-dropdown-overlay {
background-color: #03353f;
.ant-menu {
background: transparent;
padding: 0;
position: relative;
border-right: 0;
2023-07-11 09:10:34 +08:00
&-submenu {
&-active {
background-color: #055565 !important;
}
&-title {
height: 30px !important;
line-height: 30px !important;
color: #fff;
margin: 0;
&:active {
background-color: #055565 !important;
}
.ant-menu-submenu-arrow {
&::before,
&::after {
background: #fff !important;
}
}
}
}
&-item {
color: #fff;
font-family: Arial;
border: 0;
background-color: transparent !important;
padding: 4px 14px;
height: 30px;
line-height: 22px;
2023-07-11 09:10:34 +08:00
margin: 0 !important;
&:hover {
background-color: #055565 !important;
}
&-selected {
font-weight: normal;
}
&-disabled {
color: #476d74 !important;
&:hover {
background-color: transparent !important;
}
}
}
}
}
.empty {
padding-top: 100px;
font-size: 20px;
font-weight: bold;
text-align: center;
}
.figure-chart-option-tooltip {
background-color: #00aa7f !important;
border-color: #00aa7f !important;
.channel {
color: #fff;
}
.energy {
color: #00d1f0;
}
.warning {
color: yellow;
}
}
.popover-with-icon {
z-index: 999;
.ant-popover-inner-content {
padding: 8px;
}
}
</style>