diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue index a91c95b9..6f33ca09 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue @@ -160,9 +160,7 @@ const scheduleData: { date: string; list: { type: BadgeProps['status']; content: string }[]; }[] = [ - { date: '2025-07-08', list: [{ type: 'warning', content: '7月8日事件' }] }, - { date: '2025-07-06', list: [{ type: 'success', content: '8月8日事件' }] }, - // ... + //组件需要数据结构 { date: '2025-07-08', list: [{ type: 'warning', content: '7月8日事件' }] }, ]; // 切换视图模式 function handleViewModeChange(e: RadioChangeEvent): void { @@ -180,45 +178,11 @@ const getListData2 = ( if (found) { return found.list; } - } // 如果没有找到数据,返回空数组 return []; }; -const getListData = ( - value: Dayjs, -): { type: BadgeProps['status']; content: string }[] => { - let listData: { type: BadgeProps['status']; content: string }[] | undefined; - switch (value.date()) { - case 8: - listData = [ - { type: 'warning', content: 'This is warning event.' }, - { type: 'success', content: 'This is usual event.' }, - ]; - break; - case 10: - listData = [ - { type: 'warning', content: 'This is warning event.' }, - { type: 'success', content: 'This is usual event.' }, - { type: 'error', content: 'This is error event.' }, - ]; - break; - case 15: - listData = [ - { type: 'warning', content: 'This is warning event' }, - { type: 'success', content: 'This is very long usual event。。....' }, - { type: 'error', content: 'This is error event 1.' }, - { type: 'error', content: 'This is error event 2.' }, - { type: 'error', content: 'This is error event 3.' }, - { type: 'error', content: 'This is error event 4.' }, - ]; - break; - default: - } - return listData || []; -}; - function customHeader() { // 返回想要的VNode或null return null; // 什么都不显示 @@ -284,6 +248,11 @@ function handleViewDateDetails(date: string) { onMounted(() => { fetchCalendarData(); }); + +// 暴露方法给父组件调用 +defineExpose({ + fetchCalendarData, +});