2023-07-17 19:37:46 +08:00
|
|
|
<template>
|
2023-08-30 13:36:53 +08:00
|
|
|
<custom-modal v-model="visible" :width="800" title="Spectrum" :footer="null">
|
|
|
|
|
<a-spin :spinning="isLoading">
|
2024-02-20 10:41:45 +08:00
|
|
|
<a-tabs :animated="false">
|
|
|
|
|
<a-tab-pane tab="phd" key="1">
|
|
|
|
|
<pre key="1">{{ spectrum }}</pre>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane tab="phd:raw" key="2">
|
|
|
|
|
<pre key="2">{{ phdSpectrum }}</pre>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
2023-08-30 13:36:53 +08:00
|
|
|
</a-spin>
|
2023-07-17 19:37:46 +08:00
|
|
|
</custom-modal>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import ModalMixin from '@/mixins/ModalMixin'
|
2023-08-30 13:36:53 +08:00
|
|
|
import { getAction } from '@/api/manage'
|
2023-09-05 19:06:19 +08:00
|
|
|
import SampleDataMixin from '../../SampleDataMixin'
|
2023-07-17 19:37:46 +08:00
|
|
|
export default {
|
2023-09-05 19:06:19 +08:00
|
|
|
mixins: [ModalMixin, SampleDataMixin],
|
2023-07-17 19:37:46 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2024-02-20 10:41:45 +08:00
|
|
|
spectrum: '',
|
|
|
|
|
phdSpectrum: '',
|
|
|
|
|
isLoading: true,
|
2023-07-17 19:37:46 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getContent() {
|
|
|
|
|
try {
|
2023-08-30 13:36:53 +08:00
|
|
|
this.isLoading = true
|
2023-09-05 19:06:19 +08:00
|
|
|
const { sampleId, inputFileName: fileName } = this.sampleData
|
2023-08-30 13:36:53 +08:00
|
|
|
const { success, result, message } = await getAction('/gamma/Spectrum', {
|
2023-09-05 19:06:19 +08:00
|
|
|
sampleId,
|
2024-02-20 10:41:45 +08:00
|
|
|
fileName,
|
2023-08-30 13:36:53 +08:00
|
|
|
})
|
|
|
|
|
if (success) {
|
2024-02-20 10:41:45 +08:00
|
|
|
const { Spectrum, phdSpectrum } = result
|
|
|
|
|
this.spectrum = Spectrum
|
|
|
|
|
this.phdSpectrum = (phdSpectrum || []).join('\r\n')
|
2023-08-30 13:36:53 +08:00
|
|
|
} else {
|
|
|
|
|
this.$message.error(message)
|
|
|
|
|
}
|
2023-07-17 19:37:46 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
console.error(error)
|
2023-08-30 13:36:53 +08:00
|
|
|
} finally {
|
|
|
|
|
this.isLoading = false
|
2023-07-17 19:37:46 +08:00
|
|
|
}
|
2023-08-30 13:36:53 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
beforeModalOpen() {
|
|
|
|
|
this.getContent()
|
2024-02-20 10:41:45 +08:00
|
|
|
},
|
|
|
|
|
},
|
2023-07-17 19:37:46 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
pre {
|
2023-08-30 13:36:53 +08:00
|
|
|
height: 450px;
|
2023-07-17 19:37:46 +08:00
|
|
|
padding: 5px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
background-color: #285367;
|
|
|
|
|
}
|
|
|
|
|
</style>
|