From b026200b253b918a28ecb55137a116fcc352a77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Wed, 8 Nov 2023 14:28:14 +0800 Subject: [PATCH] =?UTF-8?q?BetaGamma=20Analyser=20Log=20=E5=92=8C=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E4=B8=80=E6=A0=B7=20=E7=9B=B4=E6=8E=A5=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=96=87=E4=BB=B6=EF=BC=8C=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modals/BetaGammaModals/BGLogViewer.vue | 16 +++++-- .../Modals/DataProcessingLogModal.vue | 46 ++++++------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BGLogViewer.vue b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BGLogViewer.vue index f16bb6d..6c4be6f 100644 --- a/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BGLogViewer.vue +++ b/src/views/spectrumAnalysis/components/Modals/BetaGammaModals/BGLogViewer.vue @@ -13,7 +13,7 @@ import ModalMixin from '@/mixins/ModalMixin' import { getAction } from '@/api/manage' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' -import { showSaveFileModal } from '@/utils/file' +import { saveAs } from 'file-saver' export default { mixins: [ModalMixin, SampleDataMixin], data() { @@ -25,7 +25,14 @@ export default { async getDetail() { try { this.isLoading = true - const { dbName, sampleId, inputFileName: sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData + const { + dbName, + sampleId, + inputFileName: sampleFileName, + gasFileName, + detFileName, + qcFileName, + } = this.newSampleData const result = await getAction('/spectrumAnalysis/viewBGLogViewer', { dbName, sampleId, @@ -34,7 +41,7 @@ export default { detFileName, qcFileName, }) - if(typeof result == 'string') { + if (typeof result == 'string') { this.content = result } else { const { success, result, message } = res @@ -56,8 +63,9 @@ export default { }, handleClick() { + let name = this.newSampleData.inputFileName.split('.')[0] const blob = new Blob([this.content], { type: 'text/plain' }) - showSaveFileModal(blob, 'txt') + saveAs(blob, `${name}_beta analysis log.txt`) }, }, } diff --git a/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue b/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue index d0b72fc..aa34f88 100644 --- a/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/DataProcessingLogModal.vue @@ -3,7 +3,7 @@
{{ text }}
-
+
Export Cancel @@ -15,64 +15,48 @@