工作日历bug修复

This commit is contained in:
XaoLi717 2024-12-26 10:18:17 +08:00
parent 3d5e5aa6e4
commit 3551640057

View File

@ -37,7 +37,7 @@
<template #date-cell="{ data }">
<el-popover
v-if="isCurrentMonth(data,index)"
v-if="isCurrentMonth(data,index,holidayDate[data.day])"
:visible="holidayDate[data.day]?.visible"
placement="right"
:width="240"
@ -155,15 +155,20 @@ const formDataCaln = ref({
// }
//
const isCurrentMonth = (date:any,index:number) => {
const SelectDate = date.date;
return SelectDate.getMonth() === index;
const isCurrentMonth = (date:any,index:number,holidayDate:any) => {
if (!holidayDate) {
return false;
}else {
const SelectDate = date.date;
return SelectDate.getMonth() === index;
}
};
/** 查询列表 */
const getListDate = async () => {
loading.value = false;
try {
queryParamsDate.date = [currentYear.value+"-01-01",currentYear.value+"-12-31"];
const data = await CalendarApi.getCalendarPage(queryParamsDate);
list.value = data.list;
mapDate();
@ -274,11 +279,13 @@ const selectDate = (val:number) => {
return
}
currentYear.value += val
getListDate();
}
//toYear Button change data go to year
const toYear = () => {
currentYear.value = new Date().getFullYear()
getListDate();
}
//