提交
This commit is contained in:
@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user