fix: 某些弹窗中取值精度问题

This commit is contained in:
Xu Zhimeng 2023-12-29 09:54:31 +08:00
parent 102a4708e8
commit 3c825bb184
3 changed files with 4 additions and 37 deletions

View File

@ -63,58 +63,34 @@ const columns = [
{ {
title: 'Energy (keV)', title: 'Energy (keV)',
dataIndex: 'energy', dataIndex: 'energy',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'Yield (%)', title: 'Yield (%)',
dataIndex: 'yield', dataIndex: 'yield',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'Efficiency', title: 'Efficiency',
dataIndex: 'efficiency', dataIndex: 'efficiency',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'Activity (Bq)', title: 'Activity (Bq)',
dataIndex: 'activity', dataIndex: 'activity',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'Act Err (%)', title: 'Act Err (%)',
dataIndex: 'actErr', dataIndex: 'actErr',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'MDA (Bq)', title: 'MDA (Bq)',
dataIndex: 'mda', dataIndex: 'mda',
customRender: (text) => {
return text && text !== 'null' ? parseFloat(Number(text).toPrecision(6)) : text
},
}, },
{ {
title: 'Conc (uBq/m3)', title: 'Conc (uBq/m3)',
dataIndex: 'conc', dataIndex: 'conc',
customRender: (text) => {
return text
},
}, },
{ {
title: 'MDC (uBq/m3)', title: 'MDC (uBq/m3)',
dataIndex: 'mdc', dataIndex: 'mdc',
customRender: (text) => {
return text
},
}, },
] ]
export default { export default {

View File

@ -151,25 +151,25 @@ const mainColumns = [
title: 'Energy(keV)', title: 'Energy(keV)',
dataIndex: 'energy', dataIndex: 'energy',
width: 100, width: 100,
customRender: (text) => parseFloat(Number(text).toPrecision(6)), customRender: (text) => Number(text).toFixed(3),
}, },
{ {
title: 'Energy Uncert(%)', title: 'Energy Uncert(%)',
dataIndex: 'energyUncert', dataIndex: 'energyUncert',
width: 120, width: 120,
customRender: (text) => parseFloat(Number(text * 100).toPrecision(6)), customRender: (text) => Number(text).toFixed(6),
}, },
{ {
title: 'Yield', title: 'Yield',
dataIndex: 'yield', dataIndex: 'yield',
width: 80, width: 80,
customRender: (text) => parseFloat(Number(text).toPrecision(6)), customRender: (text) => Number(text).toFixed(3),
}, },
{ {
title: 'Yield Uncert(%)', title: 'Yield Uncert(%)',
dataIndex: 'yieldUncert', dataIndex: 'yieldUncert',
width: 120, width: 120,
customRender: (text) => parseFloat(Number(text).toPrecision(6)), customRender: (text) => Number(text).toFixed(3),
}, },
{ {
title: 'KeyLine', title: 'KeyLine',

View File

@ -47,12 +47,10 @@ const columns = [
{ {
title: 'Energy(keV)', title: 'Energy(keV)',
dataIndex: 'energy', dataIndex: 'energy',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
}, },
{ {
title: 'Centroid', title: 'Centroid',
dataIndex: 'centroid', dataIndex: 'centroid',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
}, },
{ {
title: 'Multiplet', title: 'Multiplet',
@ -61,31 +59,24 @@ const columns = [
{ {
title: 'Fwhm(keV)', title: 'Fwhm(keV)',
dataIndex: 'fwhm', dataIndex: 'fwhm',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
}, },
{ {
title: 'NetArea', title: 'NetArea',
dataIndex: 'netArea', dataIndex: 'netArea',
ellipsis: true, ellipsis: true,
// customRender: (text) => parseFloat(Number(text).toPrecision(6)),
customRender: (text) => text,
}, },
{ {
title: 'AreaErr(%)', title: 'AreaErr(%)',
dataIndex: 'areaErr', dataIndex: 'areaErr',
ellipsis: true, ellipsis: true,
// customRender: (text) => parseFloat(Number(text).toPrecision(6)),
customRender: (text) => text,
}, },
{ {
title: 'Significant', title: 'Significant',
dataIndex: 'significant', dataIndex: 'significant',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
}, },
{ {
title: 'Sensitivity', title: 'Sensitivity',
dataIndex: 'sensitivity', dataIndex: 'sensitivity',
customRender: (text) => parseFloat(Number(text).toPrecision(6)),
}, },
{ {
title: 'Indentify', title: 'Indentify',