家长中心重组:学习概览+功能管理;孩子可增删;详情页头部加间距
- 顶部两标签:学习概览(合并查看已完成/需完成任务,日历点某天看明细) 与功能管理 - 功能管理含:任务管理(原任务模板日历)、课程管理(语法编辑+周测)、 孩子管理(增/删孩子)、设备管理(新设备激活+当前登录设备) - 孩子端英语知识点详情页头部增加元素间距,不再拥挤 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
053f818158
commit
bd04401b12
@@ -5,6 +5,7 @@ import { logout } from "@/app/login/actions";
|
||||
import { BackgroundBlobs } from "@/components/background-blobs";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { ChildManage } from "./child-manage";
|
||||
import { DevicesTab } from "./devices-tab";
|
||||
import { OverviewTab } from "./overview-tab";
|
||||
import { TemplatesTab } from "./templates-tab";
|
||||
@@ -26,7 +27,6 @@ export type OverviewData = {
|
||||
days: Record<string, DayCell>;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type TemplatesData = {
|
||||
kids: {
|
||||
id: number;
|
||||
@@ -43,7 +43,6 @@ export type TemplatesData = {
|
||||
}[];
|
||||
}[];
|
||||
};
|
||||
|
||||
export type DevicesData = {
|
||||
rows: {
|
||||
id: number;
|
||||
@@ -54,11 +53,20 @@ export type DevicesData = {
|
||||
isCurrent: boolean;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type WeeklyRow = { childName: string; weekKey: string; score: number; passed: boolean };
|
||||
|
||||
const tabCls = "data-[state=active]:bg-white data-[state=active]:text-indigo-600 data-[state=active]:shadow-soft";
|
||||
|
||||
function Section({ title, desc, children }: { title: string; desc?: string; children: React.ReactNode }) {
|
||||
return (
|
||||
<section className="rounded-xl border border-slate-100 bg-white p-4 shadow-soft">
|
||||
<h3 className="font-extrabold text-slate-900">{title}</h3>
|
||||
{desc && <p className="mt-0.5 text-xs text-muted-foreground">{desc}</p>}
|
||||
<div className="mt-3">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function ParentDashboard({
|
||||
overview,
|
||||
templates,
|
||||
@@ -85,26 +93,25 @@ export function ParentDashboard({
|
||||
</header>
|
||||
|
||||
<Tabs defaultValue="overview">
|
||||
<TabsList className="grid w-full grid-cols-3 bg-slate-100/80">
|
||||
<TabsList className="grid w-full grid-cols-2 bg-slate-100/80">
|
||||
<TabsTrigger value="overview" className={tabCls}>
|
||||
学习概览
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="templates" className={tabCls}>
|
||||
任务模板
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="courses" className={tabCls}>
|
||||
课程管理
|
||||
<TabsTrigger value="feature" className={tabCls}>
|
||||
功能管理
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="overview" className="mt-4">
|
||||
<OverviewTab data={overview} />
|
||||
</TabsContent>
|
||||
<TabsContent value="templates" className="mt-4">
|
||||
<TemplatesTab data={templates} />
|
||||
</TabsContent>
|
||||
<TabsContent value="courses" className="mt-4">
|
||||
<div className="space-y-4">
|
||||
|
||||
<TabsContent value="feature" className="mt-4 space-y-4">
|
||||
<Section title="任务管理" desc="配置孩子每天的任务内容,支持某一天/每周X/某一周/日期区间">
|
||||
<TemplatesTab data={templates} />
|
||||
</Section>
|
||||
|
||||
<Section title="课程管理" desc="英语语法课程编辑与每周检测成绩">
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
<Link href="/parent/grammar" className="block">
|
||||
<div className="rounded-xl border border-slate-100 bg-white p-4 shadow-soft transition-transform duration-200 hover:-translate-y-0.5">
|
||||
@@ -124,8 +131,15 @@ export function ParentDashboard({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section title="孩子管理" desc="增加或删除孩子,删除会连同其记录一起删除">
|
||||
<ChildManage kids={overview.kids.map((k) => ({ id: k.id, name: k.name }))} />
|
||||
</Section>
|
||||
|
||||
<Section title="设备管理" desc="新设备激活与当前登录设备">
|
||||
<DevicesTab data={devices} kids={overview.kids.map((k) => ({ id: k.id, name: k.name }))} />
|
||||
</div>
|
||||
</Section>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user