From 6609b7cb9240886af3485d78cf7ffc5427367ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Sat, 28 Oct 2023 16:32:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?beta=20viewSpectrum=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BetaGammaSpectrumModal.vue | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue index 69eef1f..2b87122 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaSpectrumModal.vue @@ -37,28 +37,35 @@ export default { detBg: [], gasBg: [], qc: [], - sample: [] + sample: [], }, isLoading: true, fileName: '', - currTab: 1 + currTab: 1, } }, methods: { async getContent() { try { this.isLoading = true - const { sampleId, dbName, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData + const { + sampleId, + dbName, + inputFileName: sampleFileName, + gasFileName, + detFileName, + qcFileName, + } = this.newSampleData const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', { sampleId, dbName, sampleFileName, gasFileName, detFileName, - qcFileName + qcFileName, }) if (success) { - if(result) { + if (result) { this.content = result } } else { @@ -78,42 +85,42 @@ export default { this.currTab = key }, handleOk() { - this.fileName="" - let text = "" + this.fileName = '' + let text = '' if (this.currTab == 1) { - text=this.content.sample.join('\n') + text = this.content.sample.join('\n') } else if (this.currTab == 2) { - text=this.content.gasBg.join('\n') - }else if (this.currTab == 3) { - text=this.content.detBg.join('\n') - }else if (this.currTab == 4) { - text=this.content.qc.join('\n') + text = this.content.gasBg.join('\n') + } else if (this.currTab == 3) { + text = this.content.detBg.join('\n') + } else if (this.currTab == 4) { + text = this.content.qc.join('\n') } - if (text) { - let strData = new Blob([text], { type: 'text/plain;charset=utf-8' }); + if (text) { + let strData = new Blob([text], { type: 'text/plain;charset=utf-8' }) // saveAs(strData, `GammaViewer Log.txt`) let _this = this this.$confirm({ title: 'Please enter file name', - content: h => , + content: (h) => , okText: 'Cancle', cancelText: 'Save', - okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, - cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, + okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } }, + cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } }, onOk() { - console.log('Cancel'); + console.log('Cancel') }, onCancel() { if (_this.fileName) { saveAs(strData, `${_this.fileName}.txt`) } }, - }); + }) } else { - this.$message.warning("No data can be saved!") + this.$message.warning('No data can be saved!') } - } - } + }, + }, } From 95ba9eed73975a3c6ae201fcc3fa40f33c3d1a45 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Sat, 28 Oct 2023 17:20:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9Energy=20Calibration?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/GammaDetectorCalibration.vue | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) 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 aa1ec94..6355345 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/components/GammaDetectorCalibration.vue @@ -95,9 +95,9 @@ C to E : E = - + - *C + - *C 2 + + + *C + + *C 2

@@ -154,6 +154,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/ import { cloneDeep } from 'lodash' import { isNullOrUndefined } from '@/utils/util' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' +import { f } from 'vue-area-linkage' const initialGammaSpectrumChartOption = { grid: { @@ -571,6 +572,11 @@ export default { energy, }) + // add之后 需要清空chart黄色的线 20231028:Xiao + if(this.figureChartOption.series[1].data) { + this.figureChartOption.series[1].data = [] + } + this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy }) const { min, max } = this.getFigureChartMaxAndMin() @@ -593,6 +599,18 @@ export default { this.isInverse = true }, + // 输入框发生变化 + newCalibrationFuncModelChange(val,a) { + // 输入内容的时候 需要清空table数据 20231028:Xiao + this.list = [] + // 需要清空chart黄色的线 20231028:Xiao + if(this.figureChartOption.series[1].data) { + this.figureChartOption.series[1].data = [] + } + if(this.figureChartOption.series[1].markPoint.data) { + this.figureChartOption.series[1].markPoint.data = [] + } + }, // 删除表格里的单项 handleDel(index) { @@ -634,15 +652,20 @@ export default { // 点击Fitting按钮执行重新计算 async handleFitting() { const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v) - if (hasEmpty) { + if (hasEmpty && this.list.length < 3) { return } try { const { success, result, message } = await postAction('/spectrumAnalysis/fitting', { ...this.newCalibrationFuncModel, - tempPoints: this.isFirstFitting - ? this.oldScatterSeries - : this.list.map((item) => ({ x: item.channel, y: item.energy })), + // 修改逻辑,如果列表中有数据 以列表的数据优先进行分析 20231028:Xiao + tempPoints: this.list.length > 0 + ? this.list.map((item) => ({ x: item.channel, y: item.energy })) + : this.oldScatterSeries, + + // tempPoints: this.isFirstFitting + // ? this.oldScatterSeries + // : this.list.map((item) => ({ x: item.channel, y: item.energy })), count: this.isFirstFitting || !this.isInverse ? undefined : this.count, }) if (success) {