处理 View Spectrum 弹窗中下载当前tab页中的文档出错的问题
This commit is contained in:
parent
9c755377a4
commit
bcaaf9d280
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1000" title="View Spectrum" destroyOnClose>
|
||||
<custom-modal v-model="visible" :width="1000" title="View Spectrum" destroyOnClose @cancel="handleCancel">
|
||||
<a-spin :spinning="isLoading">
|
||||
<a-tabs :animated="false" @change="handleTabChange">
|
||||
<a-tab-pane tab="Sample Spectrum" :key="1">
|
||||
|
@ -19,7 +19,7 @@
|
|||
<div slot="custom-footer">
|
||||
<a-space :size="20">
|
||||
<a-button type="primary" @click="handleOk">Save Text</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
<a-button @click="handleCancel">Cancel</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</custom-modal>
|
||||
|
@ -89,7 +89,6 @@ export default {
|
|||
this.currTab = key
|
||||
},
|
||||
handleOk() {
|
||||
console.log(this.sampleData)
|
||||
this.fileName = ''
|
||||
let text = ''
|
||||
if (this.currTab == 1) {
|
||||
|
@ -104,7 +103,6 @@ export default {
|
|||
if (text) {
|
||||
let name = this.newSampleData.inputFileName.split('.')[0]
|
||||
let strData = new Blob([text], { type: 'text/plain;charset=utf-8' })
|
||||
// saveAs(strData, `GammaViewer Log.txt`)
|
||||
if (this.currTab == 1) {
|
||||
saveAs(strData, `${name}_Sample Spectrum.txt`)
|
||||
} else if (this.currTab == 2) {
|
||||
|
@ -114,27 +112,14 @@ export default {
|
|||
} else if (this.currTab == 4) {
|
||||
saveAs(strData, `${name}_QC Spectrum.txt`)
|
||||
}
|
||||
// let _this = this
|
||||
// this.$confirm({
|
||||
// title: 'Please enter file name',
|
||||
// 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' } },
|
||||
// onOk() {
|
||||
// console.log('Cancel')
|
||||
// },
|
||||
// onCancel() {
|
||||
// if (_this.fileName) {
|
||||
// saveAs(strData, `${_this.fileName}.txt`)
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
} else {
|
||||
this.$message.warning('No data can be saved!')
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.currTab = 1
|
||||
this.visible = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user