From 993a92dd3fd589cdecdcae855d95234abcea7d95 Mon Sep 17 00:00:00 2001 From: chenpei Date: Fri, 10 Jul 2026 17:15:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=84=E8=8C=83=E6=9C=88=E5=BA=A6?= =?UTF-8?q?=E8=B0=83=E7=A0=94=E5=91=BD=E5=90=8D=E4=B8=8E=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/performance-survey/[[...path]]/page.tsx | 232 +++++++++---- lib/__tests__/dingtalk-client.test.ts | 35 ++ .../performance-survey-notifications.test.ts | 40 ++- .../performance-survey-period.test.ts | 49 +++ lib/dingtalk-client.ts | 55 +++ lib/performance-survey-notifications.ts | 94 ++++- lib/performance-survey-service.ts | 327 +++++++++++++++--- .../migration.sql | 40 +++ prisma/schema.prisma | 8 + 9 files changed, 760 insertions(+), 120 deletions(-) create mode 100644 lib/__tests__/performance-survey-period.test.ts create mode 100644 prisma/migrations/20260710_add_performance_survey_month_and_notice_read_status/migration.sql diff --git a/app/performance-survey/[[...path]]/page.tsx b/app/performance-survey/[[...path]]/page.tsx index 8cfd593..fbc325d 100644 --- a/app/performance-survey/[[...path]]/page.tsx +++ b/app/performance-survey/[[...path]]/page.tsx @@ -518,7 +518,7 @@ export default function PerformanceSurveyPage() { const isSurveySubmitPage = path[0] === 'survey' && Boolean(path[1]) const isResultsPage = path[0] === 'results' && Boolean(path[1]) - let content = + let content = if (isSurveySubmitPage && path[1]) { content = } @@ -583,16 +583,15 @@ function PerformanceSurveyMobileHeader({ session }: { session: any }) { ) } -function Dashboard() { +function Dashboard({ me }: { me: any | null }) { const router = useRouter() const searchParams = useSearchParams() const requestedTabRaw = searchParams.get('tab') || 'personal' const requestedTab = normalizePerformanceSurveyDashboardTab(requestedTabRaw) const searchParamsKey = searchParams.toString() const [tab, setTab] = useState(requestedTab) - const me = useApi('/me', []) - const displayName = me.data?.employee?.displayName || me.data?.employee?.flowerName || me.data?.user?.name || '当前用户' - const avatar = me.data?.user?.avatar || me.data?.user?.image || '' + const displayName = me?.employee?.displayName || me?.employee?.flowerName || me?.user?.name || '当前用户' + const avatar = me?.user?.avatar || me?.user?.image || '' const availableTabIds = useMemo( () => ['personal', 'public', 'manage'], [], @@ -650,7 +649,7 @@ function Dashboard() { )} {tab === 'manage' && ( - + )}