Преглед изворни кода

fix: 统计页面查询日期/月份移除默认值,仅同步框保留默认值

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline пре 1 дан
родитељ
комит
98d39c533a

+ 2 - 5
admin-web/src/views/admin/statistics/daily-stat.vue

@@ -155,13 +155,10 @@ const state = reactive({
 })
 
 onMounted(() => {
-  // 默认查询昨天数据
+  // 同步日期默认昨天
   const yesterday = new Date();
   yesterday.setDate(yesterday.getDate() - 1);
-  const yesterdayStr = yesterday.toISOString().split('T')[0];
-  state.formQuery.startDate = yesterdayStr;
-  state.formQuery.endDate = yesterdayStr;
-  state.syncDate = yesterdayStr;
+  state.syncDate = yesterday.toISOString().split('T')[0];
 
   loadData();
 

+ 2 - 4
admin-web/src/views/admin/statistics/month-stat.vue

@@ -144,12 +144,10 @@ const state = reactive({
 })
 
 onMounted(() => {
-  // 默认查询上月数据
+  // 同步月份默认上月
   const now = new Date();
   const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
-  const lastMonthStr = lastMonth.getFullYear() + '-' + String(lastMonth.getMonth() + 1).padStart(2, '0');
-  state.formQuery.statMonth = lastMonthStr;
-  state.syncMonth = lastMonthStr;
+  state.syncMonth = lastMonth.getFullYear() + '-' + String(lastMonth.getMonth() + 1).padStart(2, '0');
 
   loadData();