AnalysisSystemForRadionucli.../src/views/spectrumAnalysis/components/Modals/SpectrumModal.vue

61 lines
1.1 KiB
Vue
Raw Normal View History

<template>
<custom-modal v-model="visible" :width="800" title="Spectrum" :footer="null">
<a-spin :spinning="isLoading">
<pre>
{{ content }}
</pre>
</a-spin>
</custom-modal>
</template>
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
export default {
mixins: [ModalMixin],
props: {
sampleId: {
type: Number
}
},
data() {
return {
content: '',
isLoading: true
}
},
methods: {
async getContent() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/Spectrum', {
sampleId: this.sampleId
})
if (success) {
this.content = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getContent()
}
}
}
</script>
<style lang="less" scoped>
pre {
height: 450px;
padding: 5px;
overflow: auto;
background-color: #285367;
}
</style>