From 5b976ae793a2a068427fdb9c7d80fdf4ea6a96a5 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 22 八月 2025 15:12:14 +0800
Subject: [PATCH] 盘点功能优化,bug修复
---
rsf-admin/src/page/dashboard/NbChart.jsx | 42 +++++++++++++++++++++---------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/rsf-admin/src/page/dashboard/NbChart.jsx b/rsf-admin/src/page/dashboard/NbChart.jsx
index a154760..5b4fce4 100644
--- a/rsf-admin/src/page/dashboard/NbChart.jsx
+++ b/rsf-admin/src/page/dashboard/NbChart.jsx
@@ -19,28 +19,28 @@
const dateFormatter = (date) =>
new Date(date).toLocaleDateString();
-const aggregateOrdersByDay = (orders) =>
- orders
- .filter((order) => order.status !== 'cancelled')
- .reduce(
- (acc, curr) => {
- const day = format(curr.date, 'yyyy-MM-dd');
- if (!acc[day]) {
- acc[day] = 0;
- }
- acc[day] += curr.total;
- return acc;
- },
- {}
- );
+// const aggregateOrdersByDay = (orders) =>
+// orders
+// .filter((order) => order.status !== 'cancelled')
+// .reduce(
+// (acc, curr) => {
+// const day = format(curr.date, 'yyyy-MM-dd');
+// if (!acc[day]) {
+// acc[day] = 0;
+// }
+// acc[day] += curr.total;
+// return acc;
+// },
+// {}
+// );
-const getRevenuePerDay = (orders) => {
- const daysWithRevenue = aggregateOrdersByDay(orders);
- return lastMonthDays.map(date => ({
- date: date.getTime(),
- total: daysWithRevenue[format(date, 'yyyy-MM-dd')] || 0,
- }));
-};
+// const getRevenuePerDay = (orders) => {
+// const daysWithRevenue = aggregateOrdersByDay(orders);
+// return lastMonthDays.map(date => ({
+// date: date.getTime(),
+// total: daysWithRevenue[format(date, 'yyyy-MM-dd')] || 0,
+// }));
+// };
const NbChart = (props) => {
const { orders } = props;
--
Gitblit v1.9.1