This commit is contained in:
Teo
2025-09-09 09:08:34 +08:00
parent 4a9a0c4214
commit 0c3ea8fe73
13 changed files with 189 additions and 155 deletions

View File

@ -85,7 +85,7 @@ const handleQuery = () => {
/** 重置按钮操作 */
const resetQuery = () => {
queryParams.value.month = '';
resetMonth();
handleQuery();
};
// 获取列表
@ -102,14 +102,17 @@ const getList = async () => {
total.value = res.total;
}
};
onMounted(() => {
const currentDate = new Date();
const resetMonth=()=>{
const currentDate = new Date();
const year = currentDate.getFullYear();
const month = currentDate.getMonth() + 1; // 月份从0开始所以需要加1
// 形成"YYYY-M"格式
const formattedDate = `${year}-${String(month).padStart(2, '0')}`;
queryParams.value.month = formattedDate;
}
onMounted(() => {
resetMonth();
getList();
});