From 7d29399802313dbb8ed1e8439f99cd30abd8f781 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 25 Sep 2023 16:58:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Reprocessing=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=8F=8A=E4=B8=89=E4=B8=AACalibration=E4=B8=AD=E7=9A=84Set=20t?= =?UTF-8?q?o=20Current=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomModal/index.vue | 6 +- .../components/Modals/AnalyzeSettingModal.vue | 2 +- .../Modals/EfficiencyCalibrationModal.vue | 22 +++- .../Modals/EnergyCalibrationModal.vue | 22 +++- .../Modals/ResolutionCalibrationModal.vue | 22 +++- src/views/spectrumAnalysis/gamma-analysis.vue | 103 ++++++++---------- src/views/spectrumAnalysis/index.vue | 11 +- 7 files changed, 103 insertions(+), 85 deletions(-) diff --git a/src/components/CustomModal/index.vue b/src/components/CustomModal/index.vue index 6927dc4..a463199 100644 --- a/src/components/CustomModal/index.vue +++ b/src/components/CustomModal/index.vue @@ -63,8 +63,10 @@ export default { if (this.okHandler instanceof Function) { try { this.confirmLoading = true - await this.okHandler() - this.visible = false + const success = await this.okHandler() + if(success !== false) { + this.visible = false + } } catch (error) { console.error(error) } finally { diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue index a855d14..cc39cab 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeSettingModal.vue @@ -203,7 +203,7 @@ export default { } catch (error) { console.error(error) } finally { - throw new Error('Not Close') + return false } }, }, diff --git a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue index 614d4bc..8b94e10 100644 --- a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue @@ -44,7 +44,7 @@ :pagination="false" size="small" :class="list.length ? 'has-data' : ''" - :scroll="{ y: 182 }" + :scroll="{ y: 193 }" :selectedRowKeys.sync="selectedRowKeys" :canDeselect="false" @rowClick="handleRowClick" @@ -116,7 +116,7 @@ import ModalMixin from '@/mixins/ModalMixin' import TitleOverBorder from '../TitleOverBorder.vue' import CustomChart from '@/components/CustomChart/index.vue' -import { getAction, postAction } from '@/api/manage' +import { getAction, postAction, putAction } from '@/api/manage' import { cloneDeep } from 'lodash' import { buildLineSeries } from '@/utils/chartHelper' import SampleDataMixin from '../../SampleDataMixin' @@ -573,8 +573,20 @@ export default { this.getData(item) }, - handleSetToCurrent() { + async handleSetToCurrent() { this.appliedDataSource = this.currSelectedDataSource + try { + const { inputFileName: fileName } = this.sampleData + + const { success, message } = await putAction( + `/gamma/setCurrentEfficiency?fileName=${fileName}¤tName=${this.currSelectedDataSource}` + ) + if (!success) { + this.$message.error(message) + } + } catch (error) { + console.error(error) + } } } } @@ -621,7 +633,7 @@ export default { &.has-data { ::v-deep { .ant-table-body { - height: 182px; + height: 193px; background-color: #06282a; } } @@ -629,7 +641,7 @@ export default { ::v-deep { .ant-table-placeholder { - height: 183px; + height: 194px; display: flex; justify-content: center; align-items: center; diff --git a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue index fd35e5d..0da4f10 100644 --- a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue @@ -44,7 +44,7 @@ :pagination="false" size="small" :class="list.length ? 'has-data' : ''" - :scroll="{ y: 182 }" + :scroll="{ y: 193 }" :selectedRowKeys.sync="selectedRowKeys" :canDeselect="false" @rowClick="handleRowClick" @@ -111,7 +111,7 @@ import ModalMixin from '@/mixins/ModalMixin' import TitleOverBorder from '../TitleOverBorder.vue' import CustomChart from '@/components/CustomChart/index.vue' -import { getAction, postAction } from '@/api/manage' +import { getAction, postAction, putAction } from '@/api/manage' import { cloneDeep } from 'lodash' import { buildLineSeries } from '@/utils/chartHelper' import SampleDataMixin from '../../SampleDataMixin' @@ -532,8 +532,20 @@ export default { this.getData(item) }, - handleSetToCurrent() { + async handleSetToCurrent() { this.appliedDataSource = this.currSelectedDataSource + try { + const { inputFileName: fileName } = this.sampleData + + const { success, message } = await putAction( + `/gamma/setCurrentEnergy?fileName=${fileName}¤tName=${this.currSelectedDataSource}` + ) + if (!success) { + this.$message.error(message) + } + } catch (error) { + console.error(error) + } } } } @@ -580,7 +592,7 @@ export default { &.has-data { ::v-deep { .ant-table-body { - height: 182px; + height: 193px; background-color: #06282a; } } @@ -588,7 +600,7 @@ export default { ::v-deep { .ant-table-placeholder { - height: 183px; + height: 194px; display: flex; justify-content: center; align-items: center; diff --git a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue index ca12e79..a092112 100644 --- a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue @@ -44,7 +44,7 @@ :pagination="false" size="small" :class="list.length ? 'has-data' : ''" - :scroll="{ y: 182 }" + :scroll="{ y: 193 }" :selectedRowKeys.sync="selectedRowKeys" :canDeselect="false" @rowClick="handleRowClick" @@ -111,7 +111,7 @@ import ModalMixin from '@/mixins/ModalMixin' import TitleOverBorder from '../TitleOverBorder.vue' import CustomChart from '@/components/CustomChart/index.vue' -import { getAction, postAction } from '@/api/manage' +import { getAction, postAction, putAction } from '@/api/manage' import { cloneDeep } from 'lodash' import { buildLineSeries } from '@/utils/chartHelper' import SampleDataMixin from '../../SampleDataMixin' @@ -530,8 +530,20 @@ export default { this.getData(item) }, - handleSetToCurrent() { + async handleSetToCurrent() { this.appliedDataSource = this.currSelectedDataSource + try { + const { inputFileName: fileName } = this.sampleData + + const { success, message } = await putAction( + `/gamma/setCurrentResolution?fileName=${fileName}¤tName=${this.currSelectedDataSource}` + ) + if (!success) { + this.$message.error(message) + } + } catch (error) { + console.error(error) + } } } } @@ -578,7 +590,7 @@ export default { &.has-data { ::v-deep { .ant-table-body { - height: 182px; + height: 193px; background-color: #06282a; } } @@ -586,7 +598,7 @@ export default { ::v-deep { .ant-table-placeholder { - height: 183px; + height: 194px; display: flex; justify-content: center; align-items: center; diff --git a/src/views/spectrumAnalysis/gamma-analysis.vue b/src/views/spectrumAnalysis/gamma-analysis.vue index bce2a30..b2a957c 100644 --- a/src/views/spectrumAnalysis/gamma-analysis.vue +++ b/src/views/spectrumAnalysis/gamma-analysis.vue @@ -90,6 +90,9 @@ /> + + + @@ -101,13 +104,14 @@ import QcFlags from './components/SubOperators/QcFlags.vue' import GraphAssistance from './components/SubOperators/GraphAssistance.vue' import NuclideLibrary from './components/SubOperators/NuclideLibrary.vue' import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue' -import { getAction } from '@/api/manage' +import { getAction, postAction } from '@/api/manage' import Response from './response.json' import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper' import { cloneDeep } from 'lodash' import axios from 'axios' import NuclideReviewModal from './components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue' import CompareFileListModal from './components/Modals/CompareFileListModal.vue' +import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue' // 初始配置 const initialOption = { @@ -273,6 +277,7 @@ export default { ButtonWithSwitchIcon, NuclideReviewModal, CompareFileListModal, + ReProcessingModal, }, data() { return { @@ -308,6 +313,8 @@ export default { currChannel: -1, compareFileListModalVisible: false, // Compare 弹窗 + reprocessingModalVisible: false, // 重新分析弹窗 + isProcessing: false, // 正在处理 } }, created() { @@ -1086,63 +1093,9 @@ export default { // 从分析工具刷新部分数据 handleRefresh(data) { - const { allData, shadowChannelChart, shadowEnergyChart, shapeChannelData, shapeEnergyData } = data - - const channelPeakGroup = allData.filter((item) => item.name == 'Peak' && item.group == 'channel') - const energyPeakGroup = allData.filter((item) => item.name == 'Peak' && item.group == 'energy') - - const channelBaseLine = allData.find((item) => item.name == 'BaseLine' && item.group == 'channel') - const energyBaseLine = allData.find((item) => item.name == 'BaseLine' && item.group == 'energy') - - const channelLcLine = allData.find((item) => item.name == 'Lc' && item.group == 'channel') - const energyLcLine = allData.find((item) => item.name == 'Lc' && item.group == 'energy') - - const channelScacLine = allData.find((item) => item.name == 'Scac' && item.group == 'channel') - const energyScacLine = allData.find((item) => item.name == 'Scac' && item.group == 'energy') - - this.allEnergy = allData.find((item) => item.name == 'Energy' && item.group == 'energy') - this.allChannel = allData.find((item) => item.name == 'Count' && item.group == 'channel') - - // 保存Peak Line - this.channelPeakGroup = channelPeakGroup - this.energyPeakGroup = energyPeakGroup - - // 保存 Spectrum Line - this.shadowChannelChart = shadowChannelChart - this.shadowEnergyChart = shadowEnergyChart - - // 保存基线 - this.channelBaseLine = channelBaseLine - this.energyBaseLine = energyBaseLine - - // 保存Lc - this.channelLcLine = channelLcLine - this.energyLcLine = energyLcLine - - // 保存Scac - this.channelScacLine = channelScacLine - this.energyScacLine = energyScacLine - - // 保存 基线控制点 - this.shapeChannelData = shapeChannelData - this.shapeEnergyData = shapeEnergyData - - this.opts.notMerge = true - this.redrawPeakLine() - this.redrawCtrlPointBySeriesName() - - this.redrawLineBySeriesName('BaseLine', this.energyBaseLine, this.channelBaseLine, this.graphAssistance.Baseline) - this.redrawLineBySeriesName('LcLine', this.energyLcLine, this.channelLcLine, this.graphAssistance.Lc) - this.redrawLineBySeriesName('ScacLine', this.energyScacLine, this.channelScacLine, this.graphAssistance.SCAC) - this.redrawLineBySeriesName('Spectrum', this.shadowEnergyChart, this.shadowChannelChart) - - this.redrawThumbnailChart() - - this.clearCompareLine() - - this.$nextTick(() => { - this.resetChartOpts() - }) + this.reset() + data.DetailedInformation = this.detailedInfomation + this.dataProsess(data) }, // 分析工具Accept时刷新部分数据 @@ -1189,6 +1142,40 @@ export default { this.energyCompareLine = [] }, + // 重新分析 + async reProcessing() { + if (this.isProcessing) { + return + } + + if (this.isLoading) { + this.$message.warn('Sample is Loading') + return + } + + try { + this.isLoading = true + this.reset() + + const { inputFileName: fileName } = this.sample + const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileName}`) + if (success) { + result.DetailedInformation = this.detailedInfomation + this.dataProsess(result) + } else { + this.isLoading = false + const arr = message.split('\n') + this.$warning({ + title: 'Warning', + content: () => arr.map((text) =>
{text}
), + }) + } + } catch (error) { + console.error(error) + } + // this.reprocessingModalVisible = true + }, + // 重置缩略图表y轴最大值 resetThumbnailChartDataMax() { this.thumbnailOption.yAxis.max = 'dataMax' diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 9490742..ea7de82 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -89,10 +89,6 @@ - - - - @@ -209,7 +205,6 @@ 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 ReProcessingModal from './components/Modals/ReProcessingModal/index.vue' import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue' import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue' import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue' @@ -256,7 +251,6 @@ export default { AnalyzeSettingModal, AnalyzeInteractiveToolModal, KorsumModal, - ReProcessingModal, ZeroTimeModal, EfficiencyCalibrationModal, EnergyCalibrationModal, @@ -314,7 +308,6 @@ export default { saveSettingModalVisible: false, // 保存设置弹窗 analyzeConfigureModalVisible: false, // 分析设置弹窗 - reprocessingModalVisible: false, // 重新分析弹窗 analyzeInteractiveToolModalVisible: false, // 分析工具弹窗 zeroTimeModalVisible: false, // Zero Time 弹窗 korsumModalShow: false, // Korsum 弹窗 @@ -762,9 +755,9 @@ export default { }, { type: 'a-menu-item', - title: 'ReProcessing', + title: 'Reprocessing', show: this.isGamma, - handler: () => (this.reprocessingModalVisible = true), + handler: () => this.$refs.gammaAnalysisRef.reProcessing(), }, { type: 'a-menu-item',