工作日历bug修复
This commit is contained in:
parent
3d5e5aa6e4
commit
3551640057
@ -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();
|
||||
}
|
||||
|
||||
//字典数据
|
||||
|
Loading…
Reference in New Issue
Block a user