diff --git a/src/views/spectrumAnalysis/beta-gamma-analysis.vue b/src/views/spectrumAnalysis/beta-gamma-analysis.vue index 7fb98b8..82eda6e 100644 --- a/src/views/spectrumAnalysis/beta-gamma-analysis.vue +++ b/src/views/spectrumAnalysis/beta-gamma-analysis.vue @@ -251,7 +251,6 @@ export default { if (success) { this.sampleDetail = result this.changeChartByType('sample') - this.isLoading = false this.$emit('getFiles', { detFileName: result.detBg.fileName, gasFileName: result.gasBg.fileName, @@ -262,6 +261,8 @@ export default { } } catch (error) { console.error(error) + } finally { + this.isLoading = false } }, async getSampleDetail_file() { diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue index 2a42fd6..0c6f33b 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue @@ -476,7 +476,8 @@ export default { isAccepting: false, isReploting: false, - operationStack: [] // 操作记录 + operationStack: [], // 操作记录 + replotNeeded: false } }, created() { @@ -563,6 +564,7 @@ export default { this.btnGroupType = 1 this.opts.notMerge = false this.isFitting = false + this.replotNeeded = false this.$nextTick(() => { this.option.brush = { toolbox: [] } this.selectedKeys = [] @@ -611,13 +613,12 @@ export default { } } - const selectedRow = this.list[index] - - this.selectedKeys = [selectedRow.index] - - this.getSelPosNuclide(selectedRow) - - this.selectedTableItem = selectedRow + if (this.list.length) { + const selectedRow = this.list[index] + this.selectedKeys = [selectedRow.index] + this.getSelPosNuclide(selectedRow) + this.selectedTableItem = selectedRow + } // 如果点击了Fit按钮 if (this.isFitting) { @@ -1027,6 +1028,7 @@ export default { if (this.btnGroupType == 1) { this.btnGroupType = 2 this.baseCtrls_Copy = cloneDeep(this.BaseCtrls) + this.replotNeeded = false // 供编辑的白色基线 const baseLineEditSeries = buildLineSeries( @@ -1100,6 +1102,7 @@ export default { // 重新生成基线 redrawBaseLine() { + this.replotNeeded = true try { console.time('updateBaseLine') const res = updateBaseLine(JSON.stringify(this.baseCtrls_Copy)) @@ -1117,7 +1120,7 @@ export default { // 重绘Peaks redrawPeaks(peakList) { - this.option.series = this.option.series.filter((item) => { + this.option.series = this.option.series.filter(item => { return !item.name.includes('Peak_') }) this.option.series.push(...this.buildPeaks(peakList)) @@ -1257,13 +1260,16 @@ export default { // 将原先的基线和控制点移动到新位置 async handleReplot() { + if (!this.replotNeeded) { + return + } try { const { inputFileName: fileName } = this.sampleData this.isReploting = true const { success, result, message } = await postAction('/gamma/replotBaseLine', { ...this.baseCtrls_Copy, fileName, - replotNeeded: true + replotNeeded: this.replotNeeded }) if (success) { const { chartData, peakSet, shapeData } = result @@ -1295,6 +1301,7 @@ export default { }) this.BaseCtrls = cloneDeep(this.baseCtrls_Copy) + this.replotNeeded = false } else { this.$message.error(message) } diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index e0a0afa..d1b5a9f 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -794,6 +794,7 @@ export default { key: 'all', }, ], + key: 'resultsToDB' }, { title: 'Save PHD to File', @@ -807,6 +808,7 @@ export default { key: 'all', }, ], + key: 'phdToFile' }, ], width: '170px', @@ -817,9 +819,9 @@ export default { this.saveSettingModalVisible = true }, submenuClick: ({ item, child }) => { - if (item.title == 'Save Results to DB') { + if (item.key == 'resultsToDB') { this.handleSaveResultsToDB(child.key) - } else if (item.title == 'Save PHD to File') { + } else if (item.key == 'phdToFile') { this.handleSavePHDToFile(child.key) } },