自建台站的load from db增加了分析后的数据
This commit is contained in:
parent
d48f559dcc
commit
544f44066a
|
@ -216,14 +216,13 @@ export default {
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
if (from == 'db') {
|
if (from == 'db') {
|
||||||
this.sampleDetail = data
|
this.sampleDetail = data
|
||||||
this.emitGetFiles(data)
|
|
||||||
}
|
}
|
||||||
this.ROIAnalyzeLists = data.ROIAnalyzeLists || []
|
this.ROIAnalyzeLists = data.ROIAnalyzeLists || []
|
||||||
} else {
|
} else {
|
||||||
if (newVal.sampleId) {
|
if (newVal.sampleId) {
|
||||||
this.getSampleDetail()
|
this.getDetailFromDB()
|
||||||
} else {
|
} else {
|
||||||
this.getSelfStationSampleDetail()
|
this.getDetailFromFile()
|
||||||
}
|
}
|
||||||
this.ROIAnalyzeLists = []
|
this.ROIAnalyzeLists = []
|
||||||
}
|
}
|
||||||
|
@ -242,6 +241,16 @@ export default {
|
||||||
this.$bus.$off('selfAccept', this.handleAccept)
|
this.$bus.$off('selfAccept', this.handleAccept)
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
async getAnalyzeCurrentSpectrum() {
|
||||||
if (this.isLoading) {
|
if (this.isLoading) {
|
||||||
return
|
return
|
||||||
|
@ -257,16 +266,12 @@ export default {
|
||||||
formData.append('processKey', `${userId}_${this.timerStamp}`)
|
formData.append('processKey', `${userId}_${this.timerStamp}`)
|
||||||
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
||||||
if (success) {
|
if (success) {
|
||||||
const _result = []
|
const analyseList = this.getROIAnalyzeListsFromResult(result)
|
||||||
_result.push(result.ROI1)
|
this.ROIAnalyzeLists = analyseList
|
||||||
_result.push(result.ROI2)
|
|
||||||
_result.push(result.ROI3)
|
|
||||||
_result.push(result.ROI4)
|
|
||||||
this.ROIAnalyzeLists = _result
|
|
||||||
updateSampleData({
|
updateSampleData({
|
||||||
inputFileName,
|
inputFileName,
|
||||||
key: 'ROIAnalyzeLists',
|
key: 'ROIAnalyzeLists',
|
||||||
data: _result,
|
data: analyseList,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const arr = message.split('\n')
|
const arr = message.split('\n')
|
||||||
|
@ -464,15 +469,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async getSelfStationSampleDetail() {
|
async getDetailFromFile() {
|
||||||
this.spectraType = this.SampleType[0].value
|
this.spectraType = this.SampleType[0].value
|
||||||
const { inputFileName, detFileName, qcFileName } = this.sample
|
const { inputFileName, detFileName, qcFileName } = this.sample
|
||||||
let params = {
|
let params = {
|
||||||
sampleFileName: inputFileName,
|
sampleFileName: inputFileName,
|
||||||
detFileName: detFileName,
|
detFileName: detFileName,
|
||||||
qcFileName: qcFileName,
|
qcFileName: qcFileName,
|
||||||
// sampleFileName: 'ABC01_001-20240108_1405_S_FULL_40186.0.PHD',
|
|
||||||
// detFileName: detFileName || 'ABC01_001-20240108_1327_D_FULL_381505.PHD',
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
@ -502,7 +505,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取样品详情
|
// 获取样品详情
|
||||||
async getSampleDetail() {
|
async getDetailFromDB() {
|
||||||
const { dbName, sampleId, analyst, inputFileName } = this.sample
|
const { dbName, sampleId, analyst, inputFileName } = this.sample
|
||||||
try {
|
try {
|
||||||
this.cancelLastRequest()
|
this.cancelLastRequest()
|
||||||
|
@ -524,6 +527,15 @@ export default {
|
||||||
data: result,
|
data: result,
|
||||||
from: 'db',
|
from: 'db',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
|
||||||
|
this.ROIAnalyzeLists = analyseList
|
||||||
|
updateSampleData({
|
||||||
|
inputFileName,
|
||||||
|
key: 'ROIAnalyzeLists',
|
||||||
|
data: analyseList,
|
||||||
|
})
|
||||||
|
|
||||||
this.sampleDetail = result
|
this.sampleDetail = result
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user