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