From dc0b9065a59864d6ed2905d539d6250b5f316a89 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Tue, 9 Jul 2024 16:08:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DLoad=20From=20File?= =?UTF-8?q?=EF=BC=8C=E4=BB=8EFTP=E5=8A=A0=E8=BD=BD=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=A4=9A=E6=AC=A1=E5=8A=A0=E8=BD=BD=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/beta-analysis.vue | 6 ++++-- .../components/Modals/LoadFromFileModal.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue index ec8aafa..6f89a97 100644 --- a/src/views/spectrumAnalysis/beta-analysis.vue +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -82,6 +82,7 @@ import RoiLimits from './components/RoiLimits.vue' import RoiParam from './components/RoiParam.vue' import axios from 'axios' import { getAction, postAction, deleteAction } from '../../api/manage' +import { addSampleData, getSampleData } from '@/utils/SampleStore' const SampleType = [ { label: 'Sample Data', @@ -132,7 +133,7 @@ export default { sample: { async handler(newVal, oldVal) { // this.resultDisplay = [] - const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName) + const sampleData = getSampleData(newVal.inputFileName) if (sampleData) { const { data, from } = sampleData this.sampleDetail = data @@ -148,6 +149,7 @@ export default { this.getSelfStationSampleDetail() } } + await this.$nextTick() this.$refs.betaChartRef.handleUnzoom() }, immediate: true, @@ -300,7 +302,7 @@ export default { const cancelToken = this.createCancelToken() const { success, result, message } = await getAction('/selfStation/loadFromFile', params, cancelToken) if (success) { - this.$store.commit('ADD_SAMPLE_DATA', { + addSampleData({ inputFileName, data: result, from: 'file', diff --git a/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue b/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue index a8c766c..d953c51 100644 --- a/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/LoadFromFileModal.vue @@ -207,6 +207,7 @@ import { FilePicker } from '@/utils/FilePicker' import { readFile, zipFile } from '@/utils/file' import { isSample, PHDParser, PHD_DATA_TYPE } from '@/utils/phdHelper' import ModalMixin from '@/mixins/ModalMixin' +import { cloneDeep } from 'lodash' const columns = [ { @@ -764,7 +765,7 @@ export default { } } else { this.visible = false - this.$emit('loadFormFile', this.list) + this.$emit('loadFormFile', cloneDeep(this.list)) } },