feat: formatFraction ==> formatAmount2

pull/134/head
xingyu4j 2025-06-08 18:22:55 +08:00
parent 5fb652f2b3
commit a8f7b925ca
8 changed files with 14 additions and 15 deletions

View File

@ -326,8 +326,7 @@ setupVbenVxeTable({
}, },
}); });
// TODO @xingyu这个要不叫 formatAmount2 这种?虽然不直观,但是容易看出来是金额; vxeUI.formats.add('formatAmount2', {
vxeUI.formats.add('formatFraction', {
tableCellFormatMethod({ cellValue }) { tableCellFormatMethod({ cellValue }) {
if (cellValue === null || cellValue === undefined) { if (cellValue === null || cellValue === undefined) {
return '0.00'; return '0.00';

View File

@ -74,7 +74,7 @@ export function useGridColumns<T = MallSpuApi.Spu>(
{ {
field: 'price', field: 'price',
title: '价格', title: '价格',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'salesCount', field: 'salesCount',

View File

@ -99,7 +99,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
field: 'refundPrice', field: 'refundPrice',
title: '订单金额', title: '订单金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'user.nickname', field: 'user.nickname',

View File

@ -170,7 +170,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
field: 'payPrice', field: 'payPrice',
title: '实际支付', title: '实际支付',
formatter: 'formatFraction', formatter: 'formatAmount2',
minWidth: 180, minWidth: 180,
}, },
{ {

View File

@ -23,12 +23,12 @@ const [Grid] = useVbenVxeGrid({
{ {
field: 'price', field: 'price',
title: '交易金额', title: '交易金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'balance', field: 'balance',
title: '钱包余额', title: '钱包余额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -96,12 +96,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{ {
field: 'payPrice', field: 'payPrice',
title: '支付金额', title: '支付金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'refundPrice', field: 'refundPrice',
title: '退款金额', title: '退款金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'status', field: 'status',

View File

@ -54,22 +54,22 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{ {
title: '余额', title: '余额',
field: 'balance', field: 'balance',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
title: '累计支出', title: '累计支出',
field: 'totalExpense', field: 'totalExpense',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
title: '累计充值', title: '累计充值',
field: 'totalRecharge', field: 'totalRecharge',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
title: '冻结金额', title: '冻结金额',
field: 'freezePrice', field: 'freezePrice',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
title: '创建时间', title: '创建时间',

View File

@ -89,12 +89,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{ {
field: 'payPrice', field: 'payPrice',
title: '支付金额', title: '支付金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'bonusPrice', field: 'bonusPrice',
title: '赠送金额', title: '赠送金额',
formatter: 'formatFraction', formatter: 'formatAmount2',
}, },
{ {
field: 'status', field: 'status',