fix: 增加initValue的调用,增加gamma下的save phd to file的save all

This commit is contained in:
Xu Zhimeng 2023-11-06 15:36:02 +08:00
parent 4303ec5fa1
commit f072b2d40b

View File

@ -477,6 +477,7 @@ export default {
handleLoadSampleFromDB(sampleList) {
const ids = this.sampleList.map((item) => item.sampleId) // Sampleid
const willAddList = sampleList.filter((item) => !ids.includes(item.sampleId))
this.callInitValue(willAddList)
this.sampleList = this.sampleList.concat(willAddList)
},
handleLoadSampleFromFile(sampleList) {
@ -497,9 +498,29 @@ export default {
})
const names = this.sampleList.map((item) => item.inputFileName) // Sampleid
const willAddList = arr.filter((item) => !names.includes(item.inputFileName))
this.callInitValue(willAddList)
this.sampleList = this.sampleList.concat(willAddList)
},
/**
* gamma谱调用initValue先初始化数据
* @param {Array<any>} willAddList
*/
callInitValue(willAddList) {
willAddList
.filter(
({ sampleType, inputFileName }) => sampleType !== 'B' && inputFileName !== this.sampleData.inputFileName
)
.forEach(({ inputFileName: fileName, dbName, sampleId }) => {
const params = {
sampleId,
dbName,
fileName,
}
getAction('/gamma/initValue', params)
})
},
//
async loadSelectedSample(sample) {
console.log('%c [ sample ]-381', 'font-size:13px; background:pink; color:#bf2c9f;', sample)
@ -665,11 +686,21 @@ export default {
handleSavePHDToFile(type) {
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
if (this.isGamma) {
const url = '/gamma/saveToPHD'
let params = {
fileName: this.newSampleData.inputFileName,
if (type == 'current') {
let params = {
fileName: this.newSampleData.inputFileName,
}
fetchAndDownload('/gamma/saveToPHD', params, 'get')
} else {
this.sampleList
.filter(({ sampleType }) => sampleType !== 'B')
.forEach(({ inputFileName: fileName }) => {
const params = {
fileName,
}
fetchAndDownload('/gamma/saveToPHD', params, 'get')
})
}
fetchAndDownload(url, params, 'get')
}
},