From ab84bec1b4fe245d5f4d4ad4659df0823d697293 Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Mon, 17 Aug 2026 16:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E9=95=BF=E7=AB=AF=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=A7=BB=E9=99=A4=E8=B7=9F=E8=AF=BB=E5=BD=95?= =?UTF-8?q?=E9=9F=B3=E3=80=81=E8=AF=AD=E6=B3=95=E6=A3=80=E6=B5=8B=E5=88=86?= =?UTF-8?q?=E6=95=B0=E3=80=81=E5=AD=A9=E5=AD=90=E9=94=99=E9=A2=98=E6=9C=AC?= =?UTF-8?q?=E5=8D=A1=E7=89=87,=E5=8F=AA=E4=BF=9D=E7=95=99=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=BC=96=E8=BE=91=E4=B8=8E=E6=AF=8F=E5=91=A8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- src/app/parent/dashboard.tsx | 56 -------------------------- src/app/parent/page.tsx | 78 ------------------------------------ 2 files changed, 134 deletions(-) diff --git a/src/app/parent/dashboard.tsx b/src/app/parent/dashboard.tsx index 98e99a0..e43a19b 100644 --- a/src/app/parent/dashboard.tsx +++ b/src/app/parent/dashboard.tsx @@ -9,7 +9,6 @@ import { ChildManage } from "./child-manage"; import { DevicesTab } from "./devices-tab"; import { OverviewTab } from "./overview-tab"; import { TemplatesTab } from "./templates-tab"; -import { PlayBtn } from "@/components/play-audio"; export type DayCell = { done: number; @@ -57,16 +56,6 @@ export type DevicesData = { }[]; }; export type WeeklyRow = { childName: string; weekKey: string; score: number; passed: boolean }; -export type RecordingRow = { childName: string; word: string; url: string; at: string }; -export type GrammarTestRow = { childName: string; title: string; score: number; passed: boolean; at: string }; -export type WrongItemRow = { - childName: string; - stem: string; - userAnswer: string; - correctAnswer: string; - sourceTitle: string; - mastered: boolean; -}; const tabCls = "data-[state=active]:bg-white data-[state=active]:text-indigo-600 data-[state=active]:shadow-soft"; @@ -85,17 +74,11 @@ export function ParentDashboard({ templates, devices, weekly, - recordings, - grammarTests, - wrongItems, }: { overview: OverviewData; templates: TemplatesData; devices: DevicesData; weekly: WeeklyRow[]; - recordings: RecordingRow[]; - grammarTests: GrammarTestRow[]; - wrongItems: WrongItemRow[]; }) { return (
@@ -149,45 +132,6 @@ export function ParentDashboard({ ))} -
-

🎙️ 单词跟读录音

-
- {recordings.length === 0 &&

暂无跟读录音

} - {recordings.map((r, i) => ( -
- {r.childName} - {r.word} - -
- ))} -
-
-
-

📘 英语语法检测

-
- {grammarTests.length === 0 &&

暂无检测记录

} - {grammarTests.map((g, i) => ( -

- {g.childName} · {g.title} · {g.score} 分 {g.passed ? "✅" : "❌"} -

- ))} -
-
-
-

📒 孩子错题本

-
- {wrongItems.length === 0 &&

暂无错题

} - {wrongItems.map((w, i) => ( -
-

- {w.childName} · {w.stem} -

-

答:{w.userAnswer || "未作答"}

-

正:{w.correctAnswer}

-
- ))} -
-
diff --git a/src/app/parent/page.tsx b/src/app/parent/page.tsx index d0327b7..0359192 100644 --- a/src/app/parent/page.tsx +++ b/src/app/parent/page.tsx @@ -191,90 +191,12 @@ export default async function ParentPage() { passed: w.passed, })); - // ===== 单词跟读录音(课程管理回放) ===== - const recRows = await db - .select({ - childName: users.displayName, - word: wordRecording.word, - ossKey: wordRecording.ossKey, - createdAt: wordRecording.createdAt, - }) - .from(wordRecording) - .innerJoin(users, eq(users.id, wordRecording.childUserId)) - .where(eq(users.familyId, parent.familyId)) - .orderBy(desc(wordRecording.createdAt)) - .limit(20); - const recordings = recRows.map((r) => ({ - childName: r.childName, - word: r.word, - url: viewUrl(r.ossKey), - at: dstr(r.createdAt), - })); - - // ===== 英语语法检测明细 ===== - const grammarRows = await db - .select({ - childName: users.displayName, - title: grammarPoints.title, - score: grammarProgress.score, - passed: grammarProgress.passed, - completedAt: grammarProgress.completedAt, - }) - .from(grammarProgress) - .innerJoin(users, eq(users.id, grammarProgress.childUserId)) - .innerJoin(grammarPoints, eq(grammarPoints.pointId, grammarProgress.pointId)) - .where(eq(users.familyId, parent.familyId)) - .orderBy(desc(grammarProgress.completedAt)) - .limit(20); - const grammarTests = grammarRows.map((g) => ({ - childName: g.childName, - title: g.title, - score: g.score ?? 0, - passed: g.passed, - at: g.completedAt ? dstr(g.completedAt) : "", - })); - - // ===== 孩子错题数据 ===== - const wrongRows = await db - .select({ - childName: users.displayName, - question: wrongBook.question, - userAnswer: wrongBook.userAnswer, - correctAnswer: wrongBook.correctAnswer, - sourceTitle: wrongBook.sourceTitle, - mastered: wrongBook.mastered, - }) - .from(wrongBook) - .innerJoin(users, eq(users.id, wrongBook.childUserId)) - .where(eq(users.familyId, parent.familyId)) - .orderBy(desc(wrongBook.createdAt)) - .limit(30); - const wrongItems = wrongRows.map((w) => { - let stem = ""; - try { - stem = (JSON.parse(w.question) as { stem?: string }).stem ?? ""; - } catch { - stem = ""; - } - return { - childName: w.childName, - stem, - userAnswer: w.userAnswer ?? "", - correctAnswer: w.correctAnswer ?? "", - sourceTitle: w.sourceTitle ?? "", - mastered: w.mastered, - }; - }); - return ( ); }