| | |
| | | const handleMonthChange = val => { |
| | | const selectedMonth = new Date(val); |
| | | currentMonth.value = selectedMonth; |
| | | |
| | | |
| | | // 如果是当前月份,则选中当天;否则不选中 |
| | | if (isCurrentMonth(selectedMonth)) { |
| | | selectedDate.value = new Date(); |
| | | } else { |
| | | selectedDate.value = null; |
| | | } |
| | | |
| | | |
| | | // 强制更新日历视图 |
| | | nextTick(() => { |
| | | updateCalendarSelection(); |
| | |
| | | if (isCurrentMonth(currentMonth.value) && selectedDate.value) { |
| | | const currentDay = dayjs(selectedDate.value).date(); |
| | | const calendarCells = document.querySelectorAll('.el-calendar-table td'); |
| | | |
| | | |
| | | calendarCells.forEach(cell => { |
| | | const day = parseInt(cell.querySelector('.date-number').textContent); |
| | | if (day === currentDay) { |
| | |
| | | nextTick(() => { |
| | | updateCalendarSelection(); |
| | | }); |
| | | |
| | | |
| | | getJobEventBar(); |
| | | }, |
| | | { deep: true, immediate: true } |
| | |
| | | } else { |
| | | selectedDate.value = null; |
| | | } |
| | | |
| | | |
| | | nextTick(() => { |
| | | updateCalendarSelection(); |
| | | }); |
| | | |
| | | |
| | | getJobEventBar(); |
| | | }); |
| | | </script> |
| | |
| | | font-size: 14px; |
| | | color: #363636; |
| | | } |
| | | |
| | | |
| | | &.five-rows .el-calendar-table .el-calendar-day { |
| | | height: pxToVh(92) !important; |
| | | } |
| | | |
| | | |
| | | &.six-rows .el-calendar-table .el-calendar-day { |
| | | height: pxToVh(78) !important; |
| | | } |
| | | // 选中日期样式 |
| | | .el-calendar-table td.is-selected { |
| | | .el-calendar-table td.is-selected.is-today { |
| | | .el-calendar-day { |
| | | outline: 2px solid #409eff; |
| | | outline-offset: -2px; |
| | |
| | | .el-calendar-table td.is-selected { |
| | | background-color: transparent; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | .event-item { |