fix: 部分弹窗中数据展示优化
This commit is contained in:
parent
3c900440e6
commit
102a4708e8
|
@ -4,7 +4,7 @@
|
|||
<a-input ref="myInput" :value="value" @change="handleChange" @blur="handleBlur" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper" @dblclick="handleCellClick">
|
||||
{{ value || ' ' }}
|
||||
{{ value || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null">
|
||||
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null" destroy-on-close>
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="energy-calibration">
|
||||
<div class="left">
|
||||
|
@ -116,26 +116,31 @@ import { buildLineSeries } from '@/utils/chartHelper'
|
|||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num? '-': '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Efficiency',
|
||||
dataIndex: 'efficiency',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
|
|
|
@ -111,26 +111,31 @@ import { buildLineSeries } from '@/utils/chartHelper'
|
|||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num? '-': '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Channel',
|
||||
dataIndex: 'channel',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
|
|
|
@ -77,16 +77,16 @@
|
|||
:pagination="false"
|
||||
>
|
||||
<template slot="energy" slot-scope="text, record">
|
||||
<a-input-number v-model="record.energy"></a-input-number>
|
||||
<a-input v-model="record.energy"></a-input>
|
||||
</template>
|
||||
<template slot="totalEffi" slot-scope="text, record">
|
||||
<a-input-number v-model="record.totalEffi"></a-input-number>
|
||||
<a-input v-model="record.totalEffi"></a-input>
|
||||
</template>
|
||||
<template slot="peakEffi" slot-scope="text, record">
|
||||
<a-input-number v-model="record.peakEffi"></a-input-number>
|
||||
<a-input v-model="record.peakEffi"></a-input>
|
||||
</template>
|
||||
<template slot="uncertain" slot-scope="text, record">
|
||||
<a-input-number v-model="record.uncertain"></a-input-number>
|
||||
<a-input v-model="record.uncertain"></a-input>
|
||||
</template>
|
||||
</a-table>
|
||||
<!-- 表格结束 -->
|
||||
|
@ -238,6 +238,11 @@ export default {
|
|||
this.isLoading = false
|
||||
if (success) {
|
||||
const { Energy, Nuclide } = result
|
||||
Energy.forEach(item => {
|
||||
item.totalEffi = Number(item.totalEffi).toPrecision(4)
|
||||
item.peakEffi = Number(item.peakEffi).toPrecision(4)
|
||||
item.uncertain = Number(item.uncertain).toFixed(1)
|
||||
})
|
||||
this.list = Energy
|
||||
this.nuclideList = Nuclide
|
||||
} else {
|
||||
|
|
|
@ -111,26 +111,31 @@ import { buildLineSeries } from '@/utils/chartHelper'
|
|||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num? '-': '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'FWHM(keV)',
|
||||
dataIndex: 'fwhm',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -158,7 +163,7 @@ const initialOption = {
|
|||
const energy = parseInt(x)
|
||||
const fwhm = y.toFixed(3)
|
||||
return `<div class="channel">Energy: ${energy}</div>
|
||||
<div class="energy">Efficiency : ${efficiency}</div>`
|
||||
<div class="energy">Efficiency : ${fwhm}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user