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] =?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!') } - } - } + }, + }, }