From dbb87e385038eacfa3b4a2ce7dd6f9c42dbb0c6f Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 8 Sep 2023 23:58:45 +0800 Subject: [PATCH] =?UTF-8?q?trade:=20=E5=88=86=E9=94=80=E5=91=98=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=BD=A3=E9=87=91=E5=AD=97=E6=AE=B5=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/formatter.ts | 12 ++++++++++++ src/views/mall/trade/brokerage/user/index.vue | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/utils/formatter.ts diff --git a/src/utils/formatter.ts b/src/utils/formatter.ts new file mode 100644 index 00000000..7c6e39ff --- /dev/null +++ b/src/utils/formatter.ts @@ -0,0 +1,12 @@ +import { fenToYuan } from '@/utils' +import { TableColumnCtx } from 'element-plus' + +// 格式化金额【分转元】 +export const fenToYuanFormat = ( + row: any, + column: TableColumnCtx, + cellValue: any, + index: number +) => { + return `¥${fenToYuan(cellValue)}` +} diff --git a/src/views/mall/trade/brokerage/user/index.vue b/src/views/mall/trade/brokerage/user/index.vue index f2459e64..db59c52d 100644 --- a/src/views/mall/trade/brokerage/user/index.vue +++ b/src/views/mall/trade/brokerage/user/index.vue @@ -73,15 +73,29 @@ align="center" prop="brokerageOrderPrice" min-width="110px" + :formatter="fenToYuanFormat" + /> + - - +