beta viewSpectrum 接口参数调整

This commit is contained in:
任珮宇 2023-10-28 16:32:57 +08:00
parent 092da52363
commit 6609b7cb92

View File

@ -37,28 +37,35 @@ export default {
detBg: [], detBg: [],
gasBg: [], gasBg: [],
qc: [], qc: [],
sample: [] sample: [],
}, },
isLoading: true, isLoading: true,
fileName: '', fileName: '',
currTab: 1 currTab: 1,
} }
}, },
methods: { methods: {
async getContent() { async getContent() {
try { try {
this.isLoading = true this.isLoading = true
const { sampleId, dbName, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData const {
sampleId,
dbName,
inputFileName: sampleFileName,
gasFileName,
detFileName,
qcFileName,
} = this.newSampleData
const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', { const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', {
sampleId, sampleId,
dbName, dbName,
sampleFileName, sampleFileName,
gasFileName, gasFileName,
detFileName, detFileName,
qcFileName qcFileName,
}) })
if (success) { if (success) {
if(result) { if (result) {
this.content = result this.content = result
} }
} else { } else {
@ -78,42 +85,42 @@ export default {
this.currTab = key this.currTab = key
}, },
handleOk() { handleOk() {
this.fileName="" this.fileName = ''
let text = "" let text = ''
if (this.currTab == 1) { if (this.currTab == 1) {
text=this.content.sample.join('\n') text = this.content.sample.join('\n')
} else if (this.currTab == 2) { } else if (this.currTab == 2) {
text=this.content.gasBg.join('\n') text = this.content.gasBg.join('\n')
}else if (this.currTab == 3) { } else if (this.currTab == 3) {
text=this.content.detBg.join('\n') text = this.content.detBg.join('\n')
}else if (this.currTab == 4) { } else if (this.currTab == 4) {
text=this.content.qc.join('\n') text = this.content.qc.join('\n')
} }
if (text) { if (text) {
let strData = new Blob([text], { type: 'text/plain;charset=utf-8' }); let strData = new Blob([text], { type: 'text/plain;charset=utf-8' })
// saveAs(strData, `GammaViewer Log.txt`) // saveAs(strData, `GammaViewer Log.txt`)
let _this = this let _this = this
this.$confirm({ this.$confirm({
title: 'Please enter file name', title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />, content: (h) => <a-input v-model={_this.fileName} />,
okText: 'Cancle', okText: 'Cancle',
cancelText: 'Save', cancelText: 'Save',
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() { onOk() {
console.log('Cancel'); console.log('Cancel')
}, },
onCancel() { onCancel() {
if (_this.fileName) { if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`) saveAs(strData, `${_this.fileName}.txt`)
} }
}, },
}); })
} else { } else {
this.$message.warning("No data can be saved!") this.$message.warning('No data can be saved!')
}
}
} }
},
},
} }
</script> </script>