- Channel: {{ betaGammaInfo.channel }}
-
+
+
+ {{ betaGammaInfo.channel }}
+
+
Gamma Channel Width:
-
+
- Energy: {{ betaGammaInfo.energy }}
+
+ {{ betaGammaInfo.energy }}
@@ -38,28 +42,30 @@
Gamma-gated Beta Spectrum: QC
-
@@ -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 @@
>
-
+
-
+
-
- Snapshot
-
-
-
+
+
Channel: {{ tooltipChannel }}
+
+
+ Snapshot
+
+
-
-
+
+
Channel: {{ tooltipChannel }}
+