diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue index c17a17a..5673589 100644 --- a/src/views/spectrumAnalysis/beta-analysis.vue +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -170,13 +170,14 @@ export default { this.sampleDetail = data this.emitGetFiles(data) } - // this.ROIAnalyzeLists = data.ROIAnalyzeLists + this.ROIAnalyzeLists = data.ROIAnalyzeLists } else { if (newVal.sampleId) { this.getSampleDetail() } else { this.getSelfStationSampleDetail() } + this.ROIAnalyzeLists = [] } await this.$nextTick() this.$refs.betaChartRef.handleUnzoom() @@ -185,6 +186,15 @@ export default { deep: true, }, }, + created() { + this.$bus.$on('selfRefresh', this.handleRefresh) + this.$bus.$on('selfAccept', this.handleAccept) + }, + beforeDestroy() { + this.cancelLastRequest() + this.$bus.$on('selfRefresh', this.handleRefresh) + this.$bus.$off('selfAccept', this.handleAccept) + }, methods: { async getAnalyzeCurrentSpectrum() { try { @@ -478,6 +488,8 @@ export default { ] this.roiParamList = cloneDeep(this.boundaryList) + + this.$bus.$emit('selfAnalyzeSampleTypeChange', val) }, cancelLastRequest() { if (this._cancelToken && typeof this._cancelToken == 'function') { @@ -507,9 +519,50 @@ export default { this.$set(this.boundaryList, index, [start, end]) this.$set(this.roiParamList, index, [start, end]) }, - }, - destroyed() { - this.cancelLastRequest() + + // 从分析工具刷新部分数据 + handleRefresh(data, index) { + this.ROIAnalyzeLists[index] = this.$set(this.ROIAnalyzeLists, index, data) + + const { inputFileName } = this.sample + updateSampleData({ + inputFileName, + key: 'ROIAnalyzeLists', + data: this.ROIAnalyzeLists, + }) + }, + + // 分析工具Accept时刷新部分数据 + handleAccept(data, index) { + const { + allData, + peak, + shadowChannelChart, + shadowEnergyChart, + shapeChannelData, + shapeEnergyData, + barChart, + BaseCtrls, + } = data + + this.ROIAnalyzeLists[index] = this.$set(this.ROIAnalyzeLists, index, { + allData, + peak, + shadowChannelChart, + shadowEnergyChart, + shapeChannelData, + shapeEnergyData, + barChart, + BaseCtrls, + }) + + const { inputFileName } = this.sample + updateSampleData({ + inputFileName, + key: 'ROIAnalyzeLists', + data: this.ROIAnalyzeLists, + }) + }, }, } diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/EditSlopeModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/EditSlopeModal.vue new file mode 100644 index 0000000..4dc3de0 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/EditSlopeModal.vue @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/FitPeaksAndBaselineModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/FitPeaksAndBaselineModal.vue new file mode 100644 index 0000000..e234442 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/FitPeaksAndBaselineModal.vue @@ -0,0 +1,246 @@ + + + + + + Fixed + + + + + + + + Peaks + + Cancel + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/GeneralCommentModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/GeneralCommentModal.vue new file mode 100644 index 0000000..5dab8bb --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/GeneralCommentModal.vue @@ -0,0 +1,69 @@ + + + + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewChart.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewChart.vue new file mode 100644 index 0000000..414c40f --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewChart.vue @@ -0,0 +1,149 @@ + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewModal.vue new file mode 100644 index 0000000..cae40bd --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/NuclideReviewModal.vue @@ -0,0 +1,587 @@ + + + + + < + + + + + + + + Search + + > + + + + + + Nuclide + + + {{ item }} + + + + + + + + + + {{ info.name }} + + + + + {{ info.halfLife }} + + + + + {{ info.halfLifeErr }} + + + + + {{ info.lines }} + + + + + + + + + + + + + + + + + + < + + + + {{ chartItem.title }} + + + + {{ chartItem.bottom }} + + + + > + + + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/PeakCommentModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/PeakCommentModal.vue new file mode 100644 index 0000000..b2e13b7 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/PeakCommentModal.vue @@ -0,0 +1,76 @@ + + + + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/RectList.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/RectList.vue new file mode 100644 index 0000000..b66ab19 --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/components/RectList.vue @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/index.vue new file mode 100644 index 0000000..07a2e4a --- /dev/null +++ b/src/views/spectrumAnalysis/components/Modals/BetaAnalyzeInteractiveToolModal/index.vue @@ -0,0 +1,2035 @@ + + + + + + + + + + + + + + + + + + < + 6 Peaks with Anthro.Nuclides + > + + + + + + ROI{{ _ }} + + Nuclide Review Window + Add Peak Comment + Add General Comment + + + + + + + + + + + + + Insert + + + Delete + + + Fit + + + + < + > + + + + BaseLine + + + + + + (A)dd CP + + + (R)emove CP + + + (M)odify CP + + + Edit (S)lope + + + Undo + + + Replot + + + Accept + + + Cancel + + + + + + Reset Chart + + + + + + + + + + Possible Nuclide + + + + + {{ possible }} + + + + + + + Nuclide Identified + + + + {{ identified }} + + + + + + {{ model.possibleNuclide }} + Add + Del + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/BetaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/BetaDetectorCalibration.vue index f2b4b3a..8a7381a 100644 --- a/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/BetaDetectorCalibration.vue +++ b/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/BetaDetectorCalibration.vue @@ -305,8 +305,8 @@ const initialGammaGatedChartOption = { }, xAxis: { min: 0, - max: 256, - interval: 64, + max: 512, + interval: 128, axisLine: { lineStyle: { color: 'rgb(119, 181, 213, 0.5)', @@ -360,7 +360,7 @@ const initialGammaGatedChartOption = { fontSize: 14, color: '#5b9cba', }, - nameGap: 25, + nameGap: 40, }, series: { type: 'line', @@ -429,8 +429,8 @@ const initialFigureChartOption = { }, xAxis: { min: 0, - max: 256, - interval: 64, + max: 0, + interval: 0, axisLine: { lineStyle: { color: 'rgb(119, 181, 213, 0.5)', @@ -670,9 +670,11 @@ export default { oldScatterSeries, newCToE, newEToC, + tableWidgets, } = res.result this.c2e = CToE this.e2c = EToC + this.list = tableWidgets this.oldScatterSeries = oldScatterSeries this.count = oldScatterSeries.length @@ -686,7 +688,19 @@ export default { const gammaEnergyMax = Math.max(...gammaEnergyValue) const gammaEnergyMin = Math.min(...gammaEnergyValue) - const { max, min, interval } = splitAxis(gammaEnergyMax, gammaEnergyMin, 4) + const tableWidgetsEnergyMax = Math.min(...tableWidgets.map((item) => item.energy)) + const tableWidgetsChannelMax = Math.min(...tableWidgets.map((item) => item.channel)) + + const { max, min, interval } = splitAxis(Math.max(gammaEnergyMax, tableWidgetsEnergyMax), gammaEnergyMin, 4) + const { max: xMax, xInterval } = splitAxis( + Math.max(gammaEnergyValue.length - 1, tableWidgetsChannelMax), + 0, + 4, + 1 + ) + + this.figureChartOption.xAxis.max = xMax + this.figureChartOption.xAxis.interval = xInterval this.figureChartOption.yAxis.max = max this.figureChartOption.yAxis.min = min @@ -697,10 +711,15 @@ export default { this.oldChartOption = cloneDeep(this.figureChartOption) + this.figureChartOption.series[1].markPoint.data = tableWidgets.map((item) => ({ + xAxis: item.channel, + yAxis: item.energy, + })) + // 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao // todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据 - if (this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName)) { - this.setFirringResult(this.getCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName)) + if (this.getCache('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName)) { + this.setFirringResult(this.getCache('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName)) return false } @@ -736,8 +755,8 @@ export default { this.currEnergy = this.gammaEnergy[yAxis][0].toPrecision(6) // 设置当前选中位置的Energy this.channelAndEnergyModel = { - channel: yAxis, - energy: this.currEnergy, + channel: undefined, + energy: undefined, } this.getGammaGated(yAxis) @@ -830,7 +849,7 @@ export default { this.tooltipChannel = xAxis this.tooltipPosition.top = offsetY - if (xAxis > 187) { + if (xAxis > 424) { this.tooltipPosition.left = offsetX - 125 } else { this.tooltipPosition.left = offsetX + 20 @@ -934,7 +953,7 @@ export default { // 点击Reset Button 重置 async handleReset() { this.$emit('isFitting', false) - this.removeCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao + this.removeCache('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel) this.list = [] this.newE2C = [] @@ -978,7 +997,7 @@ export default { this.betaIsFitting = true this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao - this.setCache('CALIBRATION_BETA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao + this.setCache('SELF_STATION_CALIBRATION_BETA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao this.setFirringResult(result) } else { @@ -1090,7 +1109,7 @@ export default { computed: { rectHeight() { const { top, bottom } = initialBetaGammaChartOption.grid - const totalHeight = 427 - top - bottom + const totalHeight = 549 - top - bottom return (totalHeight / 4096) * this.gammaChannelWidth }, }, diff --git a/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/GammaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/GammaDetectorCalibration.vue index ae529ad..96fbe6d 100644 --- a/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/GammaDetectorCalibration.vue +++ b/src/views/spectrumAnalysis/components/Modals/NewBetaModals/CalibrationModal/components/GammaDetectorCalibration.vue @@ -545,8 +545,8 @@ export default { // 如果点击过reanalyze则渲染之前fitting的数据,如果没点Reanalyze,数据会在窗口关闭时删掉 20231101:xiao // todo 现在能谱数据没有缓存,刷新页面时也会获取到fitting的数据 - if (this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) { - this.setFirringResult(this.getCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) + if (this.getCache('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) { + this.setFirringResult(this.getCache('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName)) return false } @@ -680,7 +680,7 @@ export default { // 点击Reset Button 重置 async handleReset() { - this.$ls.remove('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao + this.$ls.remove('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName) // 删除fitting之后缓存的数据 20231101:xiao this.newCalibrationFuncModel = cloneDeep(newCalibrationFuncModel) this.list = [] this.newE2C = [] @@ -727,7 +727,7 @@ export default { this.gammaIsFitting = true this.$emit('isFitting', true) // 点击reAnalyze按钮,将isFirstFitting改为true 20231101:xiao - this.setCache('CALIBRATION_GAMMA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao + this.setCache('SELF_STATION_CALIBRATION_GAMMA_' + this.newSampleData.inputFileName, result) // 缓存数据,如果点击ReAnalyze需要回显数据 20231101:xiao this.setFirringResult(result) diff --git a/src/views/spectrumAnalysis/components/RoiLimits/components/RoiLimitItem.vue b/src/views/spectrumAnalysis/components/RoiLimits/components/RoiLimitItem.vue index 4383902..b9440cb 100644 --- a/src/views/spectrumAnalysis/components/RoiLimits/components/RoiLimitItem.vue +++ b/src/views/spectrumAnalysis/components/RoiLimits/components/RoiLimitItem.vue @@ -169,11 +169,13 @@ export default { created() { this.option.tooltip.formatter = this.handleTooltipFormat this.option.series[0].itemStyle.color = 'yellow' - this.option.brush = { toolbox: [] } this.$bus.$on('changeROILimitsYAxisType', this.changeYAxisType) this.$bus.$on('roiLimitItemUnzoom', this.handleUnZoom) this.$bus.$on('roiLimitItemChange', this.handleLimitItemChange) }, + mounted() { + this.option.brush = { toolbox: [] } + }, beforeDestroy() { this.$bus.$off('changeROILimitsYAxisType', this.changeYAxisType) this.$bus.$off('roiLimitItemUnzoom', this.handleUnZoom) @@ -435,6 +437,8 @@ export default { handler(val) { if (val && Object.keys(val).length) { this.handleAnalyzeResult() + + console.log('%c [ ]-441', 'font-size:13px; background:pink; color:#bf2c9f;', ) } }, immediate: true, @@ -489,6 +493,7 @@ export default { img { width: 100%; height: 100%; + display: block; } } } diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 1eebddb..0479dce 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -127,6 +127,14 @@ /> + + + + @@ -301,6 +309,7 @@ import BGLogViewer from './components/Modals/BetaGammaModals/BGLogViewer.vue' import { saveAs } from 'file-saver' import CompareFromDbModal from './components/Modals/CompareFromDBModal.vue' import { clearSampleData, getSampleData, updateSampleDataAnaly } from '@/utils/SampleStore' +import BetaAnalyzeInteractiveToolModal from './components/Modals/BetaAnalyzeInteractiveToolModal/index.vue' // 分析类型 const ANALYZE_TYPE = { @@ -357,6 +366,7 @@ export default { BgLogViewer: BGLogViewer, CompareFromDbModal, CalibrationModal, + BetaAnalyzeInteractiveToolModal, }, provide() { @@ -616,14 +626,23 @@ export default { dbName, fileName, analyst, - status + status, } getAction('/gamma/initValue', params) }) willAddList .filter(({ sampleType, inputFileName }) => sampleType == 'B' && inputFileName !== this.sampleData.inputFileName) .forEach( - ({ inputFileName: sampleFileName, gasFileName, detFileName, qcFileName, dbName, sampleId, analyst, status }) => { + ({ + inputFileName: sampleFileName, + gasFileName, + detFileName, + qcFileName, + dbName, + sampleId, + analyst, + status, + }) => { const params = { sampleId, dbName, @@ -632,7 +651,7 @@ export default { gasFileName, detFileName, qcFileName, - status + status, } getAction('/spectrumAnalysis/initValue', params) } @@ -1382,6 +1401,12 @@ export default { if (this.isBeta) this.$refs.betaAnalysisRef.getAnalyzeAllSpectrum() }, }, + { + type: 'a-menu-item', + title: 'Interactive Tool', + show: this.isBeta, + handler: () => this.$refs.betaAnalyzeInteractiveToolRef.open(), + }, ], }, ],
{{ chartItem.title }}
{{ chartItem.bottom }}
+ < + 6 Peaks with Anthro.Nuclides + > +