@@ -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();
@@ -144,12 +144,10 @@ const state = reactive({
- // 默认查询上月数据
+ // 同步月份默认上月
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');