
let startDate = $ref('')
let endDate = $ref('')
const getCurrentMonthRange = () => {
const today = new Date()
let currentDate = today.toISOString().split('T')[0] // 格式化当前日期
// 计算往前推一个月的日期
const previousMonth = new Date(today)
previousMonth.setMonth(today.getMonth() - 1) // 将月份减 1
startDate = previousMonth.toISOString().split('T')[0] + ' ' + '00:00:00'
endDate = today.toISOString().split('T')[0] + ' ' + '23:59:59'
}

setTimes() {
// 获取今天的日期
const today = new Date();
today.setDate(today.getDate());
today.setHours(23, 59, 59, 0); //
// 获取七天前的日期
const sevenDaysAgo = new Date(today);
sevenDaysAgo.setDate(today.getDate() - 6);
sevenDaysAgo.setHours(0, 0, 0, 0); // 将时分秒设置为 00:00:00
// 将日期格式化为字符串(可选)
this.searchForm.endTime = today.toISOString().split('T')[0]+' '+ '23:59:59';
this.searchForm.startTime = sevenDaysAgo.toISOString().split('T')[0]+ ' '+ '00:00:00';
},