工作日历bug修复
This commit is contained in:
parent
3d5e5aa6e4
commit
3551640057
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<template #date-cell="{ data }">
|
<template #date-cell="{ data }">
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="isCurrentMonth(data,index)"
|
v-if="isCurrentMonth(data,index,holidayDate[data.day])"
|
||||||
:visible="holidayDate[data.day]?.visible"
|
:visible="holidayDate[data.day]?.visible"
|
||||||
placement="right"
|
placement="right"
|
||||||
:width="240"
|
:width="240"
|
||||||
@ -155,15 +155,20 @@ const formDataCaln = ref({
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
//判断是否渲染当前日期更改组件
|
//判断是否渲染当前日期更改组件
|
||||||
const isCurrentMonth = (date:any,index:number) => {
|
const isCurrentMonth = (date:any,index:number,holidayDate:any) => {
|
||||||
const SelectDate = date.date;
|
if (!holidayDate) {
|
||||||
return SelectDate.getMonth() === index;
|
return false;
|
||||||
|
}else {
|
||||||
|
const SelectDate = date.date;
|
||||||
|
return SelectDate.getMonth() === index;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getListDate = async () => {
|
const getListDate = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
try {
|
try {
|
||||||
|
queryParamsDate.date = [currentYear.value+"-01-01",currentYear.value+"-12-31"];
|
||||||
const data = await CalendarApi.getCalendarPage(queryParamsDate);
|
const data = await CalendarApi.getCalendarPage(queryParamsDate);
|
||||||
list.value = data.list;
|
list.value = data.list;
|
||||||
mapDate();
|
mapDate();
|
||||||
@ -274,11 +279,13 @@ const selectDate = (val:number) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
currentYear.value += val
|
currentYear.value += val
|
||||||
|
getListDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//toYear Button change data go to year
|
//toYear Button change data go to year
|
||||||
const toYear = () => {
|
const toYear = () => {
|
||||||
currentYear.value = new Date().getFullYear()
|
currentYear.value = new Date().getFullYear()
|
||||||
|
getListDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//字典数据
|
//字典数据
|
||||||
|
Loading…
Reference in New Issue
Block a user