gamma 的 Save Results to File save All 功能对接

This commit is contained in:
任珮宇 2023-10-30 19:53:55 +08:00
parent 4c84da88ea
commit 1a849ec336
3 changed files with 31 additions and 19 deletions

View File

@ -39,7 +39,7 @@ export default {
},
handleOk() {
this.$emit('save', this.saveFormat)
this.$emit('save', this.saveFormat, this.saveAll)
},
},
computed: {

View File

@ -413,7 +413,6 @@ export default {
},
initWebSocket: function () {
console.log('qweqwerq')
// WebSocketwshttpwsshttps
var userId = store.getters.userInfo.id
var url =

View File

@ -419,7 +419,6 @@ export default {
this.isReAnalyed_gamma = val
},
getUpdateFlag(val) {
console.log('qerq', val)
this.updateFlag = val
},
getcommentsInfo(val) {
@ -502,19 +501,38 @@ export default {
},
//
async handleSaveResultsToFile(saveFormat) {
async handleSaveResultsToFile(saveFormat, isSaveAll = false) {
this.isSaving = true
if (this.isGamma) {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: this.newSampleData.inputFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
if (!isSaveAll) {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: this.newSampleData.inputFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
}
} else {
let list = this.sampleList.filter((item) => item.sampleType !== 'B')
if (list.length > 0) {
list.forEach(async (item) => {
const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
let params = {
fileName: item.inputFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
} finally {
this.isSaving = false
}
})
}
}
}
if (this.isBetaGamma) {
@ -722,7 +740,6 @@ export default {
}
postAction('/spectrumAnalysis/analyseAllSpectrum', params).then((res) => {
if (res.success) {
console.log(res)
this.analyseCurrentSpectrumData = res.result
this.resultDisplayFlag = res.result.XeData
this.resultDisplayFlag.forEach((item) => {
@ -886,14 +903,11 @@ export default {
},
on: {
menuClick: () => {
console.log(this.isBetaGamma, this.isGamma)
if (this.isGamma) {
this.saveSettingModalVisible = true
}
},
submenuClick: ({ item, child }) => {
console.log('item, child', item, child)
debugger
if (item.key == 'resultsToDB') {
this.handleSaveResultsToDB(child.key)
} else if (item.key == 'phdToFile') {
@ -1099,7 +1113,6 @@ export default {
type: 'a-menu-item',
title: 'ARR',
handler: () => {
console.log(this.newSampleData)
if (this.newSampleData.sampleId) {
this.arrOrRRRModalVisible = true
this.arrOrRRRModalExtraData = {}