浏览代码

Refactor currency formatting in StatsDashboardPage to remove currency symbol for improved data clarity

- Updated formatting functions to display amounts without the "¥" symbol, enhancing the readability of financial data.
- Adjusted axis titles and label formats in charts to reflect the change, ensuring consistency across the dashboard.
0es 3 周之前
父节点
当前提交
d2c82540f9
共有 1 个文件被更改,包括 9 次插入9 次删除
  1. 9 9
      src/app/(dashboard)/statistics/dashboard/page.tsx

+ 9 - 9
src/app/(dashboard)/statistics/dashboard/page.tsx

@@ -207,7 +207,7 @@ function fmtPct(val: number | undefined | null): string {
 
 function fmtAmt(val: number | undefined | null): string {
   if (val == null) return "-";
-  return `¥${val.toFixed(2)}`;
+  return `${val.toFixed(2)}`;
 }
 
 const StatsDashboardPage: React.FC = () => {
@@ -581,13 +581,13 @@ const StatsDashboardPage: React.FC = () => {
         yField: "totalAmount",
         axis: {
           y: {
-            title: "订单金额 (¥)",
-            labelFormatter: (v: number) => `¥${v}`,
+            title: "订单金额",
+            labelFormatter: (v: number) => `${v}`,
             position: "left",
           },
         },
         label: {
-          text: (d: { totalAmount: number }) => `¥${d.totalAmount.toFixed(0)}`,
+          text: (d: { totalAmount: number }) => `${d.totalAmount.toFixed(0)}`,
           position: "top",
           style: { fontSize: 10 },
         },
@@ -596,7 +596,7 @@ const StatsDashboardPage: React.FC = () => {
           items: [
             (d: { totalAmount: number }) => ({
               name: "订单金额",
-              value: `¥${d.totalAmount.toFixed(2)}`,
+              value: `${d.totalAmount.toFixed(2)}`,
             }),
           ],
         },
@@ -606,14 +606,14 @@ const StatsDashboardPage: React.FC = () => {
         yField: "avgAmountPerBuyer",
         axis: {
           y: {
-            title: "人均下单金额 (¥)",
-            labelFormatter: (v: number) => `¥${v}`,
+            title: "人均下单金额",
+            labelFormatter: (v: number) => `${v}`,
             position: "right",
           },
         },
         label: {
           text: (d: { avgAmountPerBuyer: number }) =>
-            `¥${d.avgAmountPerBuyer.toFixed(0)}`,
+            `${d.avgAmountPerBuyer.toFixed(0)}`,
           position: "top",
           style: { fontSize: 10 },
         },
@@ -622,7 +622,7 @@ const StatsDashboardPage: React.FC = () => {
           items: [
             (d: { avgAmountPerBuyer: number }) => ({
               name: "人均下单金额",
-              value: `¥${d.avgAmountPerBuyer.toFixed(2)}`,
+              value: `${d.avgAmountPerBuyer.toFixed(2)}`,
             }),
           ],
         },