From b94b11aa9ad7efcf06b27b8430c9ca5c2a01dee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Fri, 24 Nov 2023 17:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=20gamma=20=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20=E8=A7=A6=E5=8F=91result=20save=20all=20=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/spectrumAnalysis/index.vue | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index b800491..4ddcfc1 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -429,6 +429,7 @@ export default { percentBar: 0, analysedFileName: '', //分析完成的文件名称 currSampleDet: [], // DetailedInformation + allSampleDet: {}, // DetailedInformation all } }, created() { @@ -533,7 +534,6 @@ export default { * @param {Array} willAddList */ callInitValue(willAddList) { - console.log('willAddListwillAddList', willAddList) willAddList .filter( ({ sampleType, inputFileName }) => sampleType !== 'B' && inputFileName !== this.sampleData.inputFileName @@ -567,7 +567,7 @@ export default { // 加载选中的样本 async loadSelectedSample(sample) { - console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:#bf2c9f;', sample) + console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:red;', sample) // B是beta-gamma P G是gamma if (sample.sampleType == 'B') { this.analysisType = ANALYZE_TYPE.BETA_GAMMA @@ -575,6 +575,7 @@ export default { this.analysisType = ANALYZE_TYPE.GAMMA } this.sampleData = this.newSampleData = sample + this.currSampleDet = this.allSampleDet[sample.inputFileName] this.params_toDB.savedAnalysisResult = sample.sampleId ? true : false this.params_toDB.comment = '' }, @@ -728,6 +729,25 @@ export default { hideLoading() this.isSaving = false } + } else { + this.allSampleDet = [] + let count = 0 + let gammaList = this.sampleList.filter(({ sampleType }) => sampleType !== 'B') + let length = gammaList.length + gammaList.forEach(({ inputFileName: fileName }) => { + const params = { + fileName, + } + getAction('/gamma/saveToDB', params).then(({ result }) => { + // this.allSampleDet[fileName]= [...result.DetailedInformation] + this.$set(this.allSampleDet, fileName, [...result.DetailedInformation]) + count += 1 + if (count == length) { + this.isSaving = false + this.currSampleDet = this.allSampleDet[this.sampleData.inputFileName] + } + }) + }) } } else { this.$message.warn('Please Analyse Spectrum First')