fix: 修复统计页面收支趋势在跨月/周/年时显示无数据的问题

趋势统计不再受月份筛选器影响,始终显示全部历史数据。
分类明细继续保持月份筛选功能。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Developer
2026-04-01 10:52:14 +08:00
co-authored by Claude Opus 4.6
parent 6c5e7dc811
commit 38b56f387c
+3 -2
View File
@@ -42,7 +42,8 @@ export default function Stats() {
const loadTrendData = useCallback(async () => {
setTrendLoading(true);
try {
const trend = await getTrendStats(period, getMonthStr(currentMonth));
// 趋势统计始终显示全部历史数据,不受月份筛选影响
const trend = await getTrendStats(period, null);
setTrendData(trend);
} catch (err) {
console.error(err);
@@ -50,7 +51,7 @@ export default function Stats() {
} finally {
setTrendLoading(false);
}
}, [period, currentMonth, showToast]);
}, [period, showToast]);
const loadCategoryData = useCallback(async () => {
try {