gamma 添加功能 触发result save all 功能,没有请求接口

This commit is contained in:
任珮宇 2023-11-24 17:05:50 +08:00
parent 4a59c95cbb
commit b94b11aa9a

View File

@ -429,6 +429,7 @@ export default {
percentBar: 0,
analysedFileName: '', //
currSampleDet: [], // DetailedInformation
allSampleDet: {}, // DetailedInformation all
}
},
created() {
@ -533,7 +534,6 @@ export default {
* @param {Array<any>} 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)
// Bbeta-gamma P Ggamma
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')