From 42c3a604abe9130665e621fd472d32e78c3da51b Mon Sep 17 00:00:00 2001 From: wangdl Date: Mon, 15 Jun 2026 21:47:25 +0800 Subject: [PATCH] fix: implement session-to-events cross-page navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Session detail: add "查看关联事件" button linking to /learning/events - ReadingEventPage: read clientSessionId from URL search params on mount - ReadingEventPage: add Client Session ID filter input Co-Authored-By: Claude Opus 4.7 --- src/pages/learning/DataPages.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pages/learning/DataPages.tsx b/src/pages/learning/DataPages.tsx index 61712ef..5e17dc1 100644 --- a/src/pages/learning/DataPages.tsx +++ b/src/pages/learning/DataPages.tsx @@ -16,7 +16,13 @@ function PageWrapper({ title, children }: { title: string; children: React.React export function ReadingEventPage() { const [page, setPage] = useState(1); - const [filters, setFilters] = useState>({}); + const [filters, setFilters] = useState>(() => { + const params = new URLSearchParams(window.location.search); + const init: Record = {}; + const csid = params.get('clientSessionId'); + if (csid) init.clientSessionId = csid; + return init; + }); const [detailId, setDetailId] = useState(null); const { data, isLoading } = useQuery({ queryKey: ['admin-events', page, filters], @@ -46,6 +52,7 @@ export function ReadingEventPage() { setFilters(f => ({ ...f, userId: e.target.value }))} style={{ width: 140 }} /> setFilters(f => ({ ...f, materialId: e.target.value }))} style={{ width: 140 }} /> + setFilters(f => ({ ...f, clientSessionId: e.target.value }))} style={{ width: 170 }} /> setFilters(f => ({ ...f, status: v || '' }))} @@ -162,6 +169,11 @@ export function SessionPage() { {detail.durationBreakdown || '-'} )} + {detail?.clientSessionId && ( +
+ +
+ )} );