From ea77f8a73fea90ef9958e54da371744441de0a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=9E=97=E9=93=96?= Date: Wed, 29 Jul 2026 13:44:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=BE=E7=AE=80=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9C=88=E4=BB=BD=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PerformanceSurveyAdminConfig.test.tsx | 13 ++++++++++++ .../PerformanceSurveyAdminConfig.tsx | 20 ++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/performance-survey/PerformanceSurveyAdminConfig.test.tsx b/app/performance-survey/PerformanceSurveyAdminConfig.test.tsx index e228150..6ad1692 100644 --- a/app/performance-survey/PerformanceSurveyAdminConfig.test.tsx +++ b/app/performance-survey/PerformanceSurveyAdminConfig.test.tsx @@ -214,6 +214,19 @@ describe('PerformanceSurveyAdminConfig', () => { await waitFor(() => expect(onMonthChange).toHaveBeenCalledWith('2026-09')) }) + test.each([ + ['positions', '岗位管理'], + ['people', '人员分配'], + ['templates', '模板管理'], + ] as const)('%s 管理页面不显示月份查看入口', async (mode, heading) => { + const request = createRequest() + render() + + await waitFor(() => expect(screen.getByRole('heading', { name: heading })).toBeInTheDocument()) + expect(screen.queryByLabelText('查看月份')).not.toBeInTheDocument() + expect(request).toHaveBeenCalledWith(`/admin/config?month=2026-07&scope=${mode}`) + }) + test('岗位编辑产生 dirty 状态并保护岗位切换', async () => { const request = createRequest() const onDirtyChange = jest.fn() diff --git a/app/performance-survey/PerformanceSurveyAdminConfig.tsx b/app/performance-survey/PerformanceSurveyAdminConfig.tsx index c55d55b..a15637d 100644 --- a/app/performance-survey/PerformanceSurveyAdminConfig.tsx +++ b/app/performance-survey/PerformanceSurveyAdminConfig.tsx @@ -549,15 +549,17 @@ export function PerformanceSurveyAdminConfig({ {dirty && } - + {mode === 'overview' && ( + + )} {notice && (