fix: 自建台站分析时,在非sample类型下错误应用到右侧4个图表的问题

This commit is contained in:
Xu Zhimeng 2024-08-23 15:27:15 +08:00
parent 42dacfa6f0
commit 8798ac5b66

View File

@ -215,13 +215,9 @@ export default {
async handler(newVal, oldVal) { async handler(newVal, oldVal) {
const sampleData = getSampleData(newVal.inputFileName) const sampleData = getSampleData(newVal.inputFileName)
if (sampleData) { if (sampleData) {
const { data, from } = sampleData const { data } = sampleData
this.sampleDetail = data this.sampleDetail = data
this.changeChartByType('sample') this.changeChartByType('sample')
if (from == 'db') {
this.sampleDetail = data
}
this.ROIAnalyzeLists = data.ROIAnalyzeLists || []
} else { } else {
if (newVal.sampleId) { if (newVal.sampleId) {
this.getDetailFromDB() this.getDetailFromDB()
@ -272,7 +268,7 @@ export default {
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData) const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
if (success) { if (success) {
const analyseList = this.getROIAnalyzeListsFromResult(result) const analyseList = this.getROIAnalyzeListsFromResult(result)
this.ROIAnalyzeLists = analyseList this.ROIAnalyzeLists = this.spectraType == 'sample' ? analyseList : []
updateSampleData({ updateSampleData({
inputFileName, inputFileName,
key: 'ROIAnalyzeLists', key: 'ROIAnalyzeLists',
@ -409,7 +405,7 @@ export default {
} }
}, },
// //
async getDetailFromDB() { async getDetailFromDB() {
const { dbName, sampleId, analyst, inputFileName } = this.sample const { dbName, sampleId, analyst, inputFileName } = this.sample
try { try {
@ -434,7 +430,6 @@ export default {
}) })
const analyseList = this.getROIAnalyzeListsFromResult(result.sample) const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
this.ROIAnalyzeLists = analyseList
updateSampleData({ updateSampleData({
inputFileName, inputFileName,
key: 'ROIAnalyzeLists', key: 'ROIAnalyzeLists',