|
@@ -5,6 +5,7 @@ import '@fullcalendar/core/vdom'; // solve problem with Vite
|
|
|
import FullCalendar from "@fullcalendar/vue3";
|
|
|
import dayGridPlugin from '@fullcalendar/daygrid'
|
|
|
import interactionPlugin from '@fullcalendar/interaction'
|
|
|
+import moment from 'moment';
|
|
|
|
|
|
const props = defineProps({
|
|
|
showMark:{
|
|
@@ -14,7 +15,7 @@ const props = defineProps({
|
|
|
markText:{
|
|
|
type:Object,
|
|
|
default:{
|
|
|
- date:'当前日期',
|
|
|
+ date:'2024-04-16',
|
|
|
type:'当前品种'
|
|
|
}
|
|
|
},
|
|
@@ -33,6 +34,8 @@ let calendarOptions = ref({
|
|
|
dayHeaderFormat:{ //https://fullcalendar.io/docs/v5/date-formatting
|
|
|
weekday:'narrow', //头部星期显示为一 二 三...
|
|
|
},
|
|
|
+ dayMaxEventRows:6,//一天最多展示6条
|
|
|
+ moreLinkClick:(info)=>{handleDateClick({dateStr:moment(info.date).format('YYYY-MM-DD')})},//点击more时触发
|
|
|
dayCellContent:function(arg){ //单元格日期显示为 1 2 3...
|
|
|
return arg.date.getDate()
|
|
|
},
|
|
@@ -40,6 +43,7 @@ let calendarOptions = ref({
|
|
|
eventClick:handleEventClick
|
|
|
})
|
|
|
function handleDateClick(info){
|
|
|
+ console.log('info',info)
|
|
|
emit("dateClick",info)
|
|
|
}
|
|
|
function handleEventClick(info){
|
|
@@ -47,7 +51,6 @@ function handleEventClick(info){
|
|
|
}
|
|
|
onMounted(()=>{
|
|
|
calendarApi.value = FullCalendarRef.value.getApi()
|
|
|
- console.log('FullCalendarRef',FullCalendarRef.value)
|
|
|
|
|
|
})
|
|
|
defineExpose({ calendarApi });
|
|
@@ -82,6 +85,8 @@ defineExpose({ calendarApi });
|
|
|
flex:1;
|
|
|
.popper-content{
|
|
|
cursor: pointer;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
|
:deep(.fc-daygrid-day-top){ //日期偏左显示
|
|
|
flex-direction: row;
|
|
@@ -107,6 +112,9 @@ defineExpose({ calendarApi });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ :deep(.fc-more-popover){
|
|
|
+ display:none !important;
|
|
|
+ }
|
|
|
}
|
|
|
.water-mark{
|
|
|
position: absolute;
|