fix: 修复统计页面收支趋势在跨月/周/年时显示无数据的问题
趋势统计不再受月份筛选器影响,始终显示全部历史数据。 分类明细继续保持月份筛选功能。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
6c5e7dc811
commit
38b56f387c
@@ -42,7 +42,8 @@ export default function Stats() {
|
|||||||
const loadTrendData = useCallback(async () => {
|
const loadTrendData = useCallback(async () => {
|
||||||
setTrendLoading(true);
|
setTrendLoading(true);
|
||||||
try {
|
try {
|
||||||
const trend = await getTrendStats(period, getMonthStr(currentMonth));
|
// 趋势统计始终显示全部历史数据,不受月份筛选影响
|
||||||
|
const trend = await getTrendStats(period, null);
|
||||||
setTrendData(trend);
|
setTrendData(trend);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -50,7 +51,7 @@ export default function Stats() {
|
|||||||
} finally {
|
} finally {
|
||||||
setTrendLoading(false);
|
setTrendLoading(false);
|
||||||
}
|
}
|
||||||
}, [period, currentMonth, showToast]);
|
}, [period, showToast]);
|
||||||
|
|
||||||
const loadCategoryData = useCallback(async () => {
|
const loadCategoryData = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user