优化页面不显示小数
This commit is contained in:
@@ -60,7 +60,11 @@
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span>{{ formatInteger(row?.real_ev) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('page.weightShared.colUiText')"
|
||||
prop="ui_text"
|
||||
@@ -250,6 +254,13 @@
|
||||
import api from '../../../api/reward/index'
|
||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
function formatInteger(val: unknown): string {
|
||||
if (val === '' || val === null || val === undefined) return '-'
|
||||
const n = typeof val === 'number' ? val : Number(val)
|
||||
if (!Number.isFinite(n)) return '-'
|
||||
return String(Math.trunc(n))
|
||||
}
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
Reference in New Issue
Block a user