2023-07-06 14:05:43 +08:00
|
|
|
<template>
|
2023-08-30 13:36:53 +08:00
|
|
|
<custom-modal v-model="visible" title="Peak Infomation" :width="1231" :footer="null" class="peak-infomation">
|
|
|
|
<a-spin :spinning="isLoading">
|
|
|
|
<div v-if="compareVisible" class="comparison-list">
|
|
|
|
<div class="comparison-list-item">
|
|
|
|
<div class="comparison-list-item-title">ARMD</div>
|
|
|
|
<custom-table :list="list" :scroll="{ y: 230 }" :columns="columns"></custom-table>
|
|
|
|
</div>
|
|
|
|
<div class="comparison-list-item">
|
|
|
|
<div class="comparison-list-item-title">IDC</div>
|
|
|
|
<custom-table :list="compareList" :scroll="{ y: 230 }" :columns="columns"></custom-table>
|
|
|
|
</div>
|
2023-07-06 14:05:43 +08:00
|
|
|
</div>
|
2023-08-30 13:36:53 +08:00
|
|
|
<custom-table v-else :columns="columns" :list="list" :scroll="{ y: 460 }" :canSelect="false"></custom-table>
|
|
|
|
</a-spin>
|
2023-07-06 14:05:43 +08:00
|
|
|
<!-- 底部按钮 -->
|
|
|
|
<div class="peak-infomation-footer">
|
|
|
|
<a-space :size="20">
|
|
|
|
<a-button :type="compareVisible ? 'grey' : 'primary'" @click="handleComparision">
|
|
|
|
<img src="@/assets/images/spectrum/comparation.png" />
|
|
|
|
{{ compareVisible ? 'Cancel comparison' : 'Comparison' }}
|
|
|
|
</a-button>
|
|
|
|
<a-button type="primary" @click="handleExportToExcel">
|
|
|
|
<img src="@/assets/images/spectrum/download.png" />
|
|
|
|
Export to Excel
|
|
|
|
</a-button>
|
|
|
|
</a-space>
|
|
|
|
</div>
|
2023-08-30 13:36:53 +08:00
|
|
|
</custom-modal>
|
2023-07-06 14:05:43 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-08-30 13:36:53 +08:00
|
|
|
import ModalMixin from '@/mixins/ModalMixin'
|
|
|
|
import { getAction } from '@/api/manage'
|
2023-09-05 19:06:19 +08:00
|
|
|
import SampleDataMixin from '../SampleDataMixin'
|
2023-08-30 13:36:53 +08:00
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
const columns = [
|
|
|
|
{
|
|
|
|
title: 'Index',
|
|
|
|
dataIndex: 'index',
|
|
|
|
align: 'center',
|
|
|
|
customRender: (_, __, index) => {
|
|
|
|
return index + 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Energy(keV)',
|
|
|
|
dataIndex: 'energy'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Centroid',
|
|
|
|
dataIndex: 'centroid'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Multiplet',
|
|
|
|
dataIndex: 'multiplet'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Fwhm(keV)',
|
|
|
|
dataIndex: 'fwhm'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'NetArea',
|
|
|
|
dataIndex: 'netArea'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'AreaErr(%)',
|
|
|
|
dataIndex: 'areaErr'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Significant',
|
|
|
|
dataIndex: 'significant'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Sensitivity',
|
|
|
|
dataIndex: 'sensitivity'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Indentify',
|
|
|
|
dataIndex: 'indentify'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
export default {
|
2023-09-05 19:06:19 +08:00
|
|
|
mixins: [ModalMixin, SampleDataMixin],
|
2023-07-06 14:05:43 +08:00
|
|
|
data() {
|
|
|
|
this.columns = columns
|
|
|
|
return {
|
2023-08-30 13:36:53 +08:00
|
|
|
list: [],
|
|
|
|
compareList: [],
|
|
|
|
compareVisible: false, // 是否显示比较
|
|
|
|
isLoading: false
|
2023-07-06 14:05:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 切换比较
|
|
|
|
handleComparision() {
|
|
|
|
this.compareVisible = !this.compareVisible
|
|
|
|
},
|
|
|
|
|
2023-08-30 13:36:53 +08:00
|
|
|
async getInfo() {
|
|
|
|
try {
|
|
|
|
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/peakInformation', {
|
2023-09-05 19:06:19 +08:00
|
|
|
sampleId,
|
|
|
|
fileName
|
2023-08-30 13:36:53 +08:00
|
|
|
})
|
|
|
|
if (success) {
|
|
|
|
this.list = result
|
|
|
|
} else {
|
|
|
|
this.$message.error(message)
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
} finally {
|
|
|
|
this.isLoading = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeModalOpen() {
|
|
|
|
this.compareVisible = false
|
|
|
|
this.getInfo()
|
|
|
|
},
|
|
|
|
|
2023-07-06 14:05:43 +08:00
|
|
|
// 导出到Excel
|
|
|
|
handleExportToExcel() {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.peak-infomation {
|
|
|
|
::v-deep {
|
|
|
|
.ant-modal-body {
|
|
|
|
padding: 20px 16px 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-footer {
|
|
|
|
margin-top: 10px;
|
|
|
|
text-align: right;
|
|
|
|
|
|
|
|
.ant-btn {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
img {
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.comparison-list {
|
|
|
|
&-item {
|
|
|
|
&-title {
|
|
|
|
color: #0cebc9;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
margin-top: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|