浏览代码

超过六个事项省略

cxmo 11 月之前
父节点
当前提交
60f61a6526
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 1 1
      src/views/forexCalendar/Index.vue
  2. 10 2
      src/views/forexCalendar/components/BaseCalendar.vue

+ 1 - 1
src/views/forexCalendar/Index.vue

@@ -125,7 +125,7 @@ async function getPermissionNewestMonth(){
         chart_permission_id:Number(permissionValue.value)
     }).then(res=>{
         if(res.code!==200) return 
-        monthValue.value = res.data||new Date()
+        monthValue.value = res.data||moment(new Date()).format('YYYY-MM')
         changeMonth(monthValue.value)
     })
 }

+ 10 - 2
src/views/forexCalendar/components/BaseCalendar.vue

@@ -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;