From 8c974aaf35c815fcd6a08eb3c1a864fdd375de6a Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Wed, 27 Sep 2023 17:45:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Beta=20Energy=20Calibration=E5=8F=8AQC?= =?UTF-8?q?=20Flags=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BetaDetectorCalibration.vue | 114 ++++++++++++------ .../components/GammaDetectorCalibration.vue | 7 -- .../BetaGammaEnergyCalibrationModal/index.vue | 13 +- .../SubOperators/BetaGammaQcFlags.vue | 2 +- src/views/spectrumAnalysis/index.vue | 1 - 5 files changed, 83 insertions(+), 54 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue index 3bc7353..9d16ab4 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/BetaDetectorCalibration.vue @@ -8,14 +8,18 @@
- Channel: {{ betaGammaInfo.channel }} - +
+ + {{ betaGammaInfo.channel }} +
+
Gamma Channel Width: - +
- Energy: {{ betaGammaInfo.energy }} + + {{ betaGammaInfo.energy }}
@@ -38,28 +42,30 @@

Gamma-gated Beta Spectrum: QC

-
- - Snapshot - -
-
Channel: {{ tooltipChannel }}
+ +
+ + Snapshot + +
+
Channel: {{ tooltipChannel }}
+
+
- -
+
@@ -180,6 +186,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/ import { graphic } from 'echarts' import { isNullOrUndefined } from '@/utils/util' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' +import axios from 'axios' const initialBetaGammaChartOption = { grid: { @@ -538,11 +545,6 @@ const newCalibrationFuncModel = { export default { mixins: [SampleDataMixin], components: { CustomChart, TitleOverBorder }, - props: { - sampleId: { - type: Number, - }, - }, data() { this.columns = columns @@ -553,6 +555,7 @@ export default { list: [], isLoading: false, + isLoadingGammaGated: false, gammaEnergy: [], gammaGatedBetaSpectrum: [], @@ -596,9 +599,7 @@ export default { } }, created() { - // if (this.sampleId) { this.getData() - // } }, methods: { handleExit() { @@ -676,17 +677,27 @@ export default { // 获取右侧图表数据 async getGammaGated(gammaChannel) { try { + this.cancelLastRequest() + const cancelToken = this.createCancelToken() + this.isLoadingGammaGated = true + const { sampleId, qcFileName } = this.newSampleData const { success, result: { data }, message, - } = await getAction('/spectrumAnalysis/getGammaGated', { - gammaChannel, - sampleId: this.sampleId, - chartHeight: this.gammaEnergy.length, - channelWidth: this.gammaChannelWidth, - }) + } = await getAction( + '/spectrumAnalysis/getGammaGated', + { + gammaChannel, + sampleId, + chartHeight: this.gammaEnergy.length, + channelWidth: this.gammaChannelWidth, + qcFileName, + }, + cancelToken + ) if (success) { + this.isLoadingGammaGated = false const max = Math.max(...data.map(({ y }) => y)) const { max: _max, interval } = splitAxis(max, 0, 4) @@ -702,6 +713,19 @@ export default { } }, + cancelLastRequest() { + if (this._cancelToken && typeof this._cancelToken == 'function') { + this._cancelToken() + } + }, + + createCancelToken() { + const cancelToken = new axios.CancelToken((c) => { + this._cancelToken = c + }) + return cancelToken + }, + // 绿框跟随鼠标移动 handleBetaGammaChartMouseMove(param) { const { offsetX, offsetY } = param @@ -974,6 +998,20 @@ p { justify-content: space-between; } + .energy { + span { + color: #f00; + } + } + + .channel-and-width, + .energy { + label { + width: 60px; + display: inline-block; + } + } + .beta-gamma-chart { height: 353px; position: relative; diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue index 0eb319a..2fc9bb9 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue @@ -434,11 +434,6 @@ const newCalibrationFuncModel = { export default { mixins: [SampleDataMixin], components: { CustomChart, TitleOverBorder }, - props: { - sampleId: { - type: Number, - }, - }, data() { this.columns = columns @@ -475,9 +470,7 @@ export default { } }, created() { - // if (this.sampleId) { this.getData() - // } }, methods: { handleExit() { diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue index 57decf8..df6f889 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue @@ -9,10 +9,10 @@ > - + - +