fix: 修复Load From File,从FTP加载时,无法多次加载同一数据的问题

This commit is contained in:
Xu Zhimeng 2024-07-09 16:08:32 +08:00
parent acdd26424a
commit dc0b9065a5
2 changed files with 6 additions and 3 deletions

View File

@ -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',

View File

@ -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))
}
},