From 1a9927e60a5631dc3a626de7654ce92698d6c59b Mon Sep 17 00:00:00 2001 From: fyy <2717885210@qq.com> Date: Tue, 19 Aug 2025 11:15:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=9C=AA=E9=87=8D=E6=96=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workforceManagement/calendarView.vue | 43 +++---------------- .../workforceManagement/index.vue | 18 +++++++- .../workforceManagement/scheduleView.vue | 10 ++--- 3 files changed, 27 insertions(+), 44 deletions(-) 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, +});