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() { handleOk() {
this.$emit('save', this.saveFormat) this.$emit('save', this.saveFormat, this.saveAll)
}, },
}, },
computed: { computed: {

View File

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

View File

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