beta viewSpectrum 接口参数调整

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

View File

@ -37,25 +37,32 @@ export default {
detBg: [],
gasBg: [],
qc: [],
sample: []
sample: [],
},
isLoading: true,
fileName: '',
currTab: 1
currTab: 1,
}
},
methods: {
async getContent() {
try {
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', {
sampleId,
dbName,
sampleFileName,
gasFileName,
detFileName,
qcFileName
qcFileName,
})
if (success) {
if (result) {
@ -78,8 +85,8 @@ export default {
this.currTab = key
},
handleOk() {
this.fileName=""
let text = ""
this.fileName = ''
let text = ''
if (this.currTab == 1) {
text = this.content.sample.join('\n')
} else if (this.currTab == 2) {
@ -90,30 +97,30 @@ export default {
text = this.content.qc.join('\n')
}
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`)
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />,
content: (h) => <a-input v-model={_this.fileName} />,
okText: 'Cancle',
cancelText: 'Save',
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() {
console.log('Cancel');
console.log('Cancel')
},
onCancel() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
}
},
});
})
} else {
this.$message.warning("No data can be saved!")
}
}
this.$message.warning('No data can be saved!')
}
},
},
}
</script>