自建台站的load from db增加了分析后的数据

This commit is contained in:
Xu Zhimeng 2024-08-15 11:10:50 +08:00
parent d48f559dcc
commit 544f44066a

View File

@ -216,14 +216,13 @@ export default {
this.changeChartByType('sample')
if (from == 'db') {
this.sampleDetail = data
this.emitGetFiles(data)
}
this.ROIAnalyzeLists = data.ROIAnalyzeLists || []
} else {
if (newVal.sampleId) {
this.getSampleDetail()
this.getDetailFromDB()
} else {
this.getSelfStationSampleDetail()
this.getDetailFromFile()
}
this.ROIAnalyzeLists = []
}
@ -242,6 +241,16 @@ export default {
this.$bus.$off('selfAccept', this.handleAccept)
},
methods: {
// db
getROIAnalyzeListsFromResult(sampleData) {
const arr = []
for (let index = 1; index <= 4; index++) {
const k = `ROI${index}`
arr.push(sampleData[k])
}
return arr
},
async getAnalyzeCurrentSpectrum() {
if (this.isLoading) {
return
@ -257,16 +266,12 @@ export default {
formData.append('processKey', `${userId}_${this.timerStamp}`)
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
if (success) {
const _result = []
_result.push(result.ROI1)
_result.push(result.ROI2)
_result.push(result.ROI3)
_result.push(result.ROI4)
this.ROIAnalyzeLists = _result
const analyseList = this.getROIAnalyzeListsFromResult(result)
this.ROIAnalyzeLists = analyseList
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: _result,
data: analyseList,
})
} else {
const arr = message.split('\n')
@ -464,15 +469,13 @@ export default {
}
},
async getSelfStationSampleDetail() {
async getDetailFromFile() {
this.spectraType = this.SampleType[0].value
const { inputFileName, detFileName, qcFileName } = this.sample
let params = {
sampleFileName: inputFileName,
detFileName: detFileName,
qcFileName: qcFileName,
// sampleFileName: 'ABC01_001-20240108_1405_S_FULL_40186.0.PHD',
// detFileName: detFileName || 'ABC01_001-20240108_1327_D_FULL_381505.PHD',
}
try {
this.isLoading = true
@ -502,7 +505,7 @@ export default {
},
//
async getSampleDetail() {
async getDetailFromDB() {
const { dbName, sampleId, analyst, inputFileName } = this.sample
try {
this.cancelLastRequest()
@ -524,6 +527,15 @@ export default {
data: result,
from: 'db',
})
const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
this.ROIAnalyzeLists = analyseList
updateSampleData({
inputFileName,
key: 'ROIAnalyzeLists',
data: analyseList,
})
this.sampleDetail = result
this.changeChartByType('sample')
this.isLoading = false