diff --git a/client/src/api/index.ts b/client/src/api/index.ts index 74549ec..1e1401c 100644 --- a/client/src/api/index.ts +++ b/client/src/api/index.ts @@ -29,6 +29,8 @@ type BodyOf

= paths[P][M] extends { // ---- 常用响应类型 ---- export type DashboardOverview = SuccessBody export type DashboardTrends = SuccessBody +export type DashboardMastery = SuccessBody +export type DashboardWeakPoints = SuccessBody export type PracticeModules = SuccessBody export type Profile = SuccessBody export type Settings = SuccessBody @@ -37,7 +39,9 @@ export type Settings = SuccessBody export const dashboardApi = { overview: () => unwrap(apiClient.GET('/api/dashboard/overview')), trends: (days?: number) => - unwrap(apiClient.GET('/api/dashboard/trends', { params: { query: { days } } })) + unwrap(apiClient.GET('/api/dashboard/trends', { params: { query: { days } } })), + mastery: () => unwrap(apiClient.GET('/api/dashboard/mastery')), + weakPoints: () => unwrap(apiClient.GET('/api/dashboard/weak-points')) } // ---- 刷题 ---- diff --git a/client/src/components/charts/AppLineChart.vue b/client/src/components/charts/AppLineChart.vue new file mode 100644 index 0000000..f3be920 --- /dev/null +++ b/client/src/components/charts/AppLineChart.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/client/src/components/charts/AppTrendChart.vue b/client/src/components/charts/AppTrendChart.vue new file mode 100644 index 0000000..bbd307b --- /dev/null +++ b/client/src/components/charts/AppTrendChart.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/client/src/components/dashboard/MasteryCard.vue b/client/src/components/dashboard/MasteryCard.vue new file mode 100644 index 0000000..7b36619 --- /dev/null +++ b/client/src/components/dashboard/MasteryCard.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/client/src/components/dashboard/MockTrendCard.vue b/client/src/components/dashboard/MockTrendCard.vue new file mode 100644 index 0000000..57e1a6c --- /dev/null +++ b/client/src/components/dashboard/MockTrendCard.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/client/src/components/dashboard/StatCard.vue b/client/src/components/dashboard/StatCard.vue new file mode 100644 index 0000000..ee1fc1d --- /dev/null +++ b/client/src/components/dashboard/StatCard.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/client/src/components/dashboard/TodayTasksCard.vue b/client/src/components/dashboard/TodayTasksCard.vue new file mode 100644 index 0000000..31230ea --- /dev/null +++ b/client/src/components/dashboard/TodayTasksCard.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/client/src/components/dashboard/WeakPointsCard.vue b/client/src/components/dashboard/WeakPointsCard.vue new file mode 100644 index 0000000..18b73c3 --- /dev/null +++ b/client/src/components/dashboard/WeakPointsCard.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/client/src/layouts/DesktopLayout.vue b/client/src/layouts/DesktopLayout.vue index 7c225be..5fefd52 100644 --- a/client/src/layouts/DesktopLayout.vue +++ b/client/src/layouts/DesktopLayout.vue @@ -14,16 +14,27 @@ const route = useRoute() 备考通

@@ -88,6 +99,19 @@ const route = useRoute() color: var(--on-accent); font-weight: var(--fw-card-title); } +.nav-item--child { + padding-left: 36px; + gap: var(--space-3); + height: 36px; +} +.nav-item__dot { + width: 4px; + height: 4px; + flex: none; + border-radius: 50%; + background: currentColor; + opacity: 0.6; +} .content { margin-left: var(--sidebar-width-desktop); padding: var(--padding-desktop); diff --git a/client/src/layouts/MobileLayout.vue b/client/src/layouts/MobileLayout.vue index 6ba82ef..ab14295 100644 --- a/client/src/layouts/MobileLayout.vue +++ b/client/src/layouts/MobileLayout.vue @@ -6,11 +6,13 @@ import { mobileNav } from '../router/nav' const route = useRoute() const title = computed(() => String(route.meta.title ?? '备考通')) +// 首页以自己的问候语作为页头,不再重复显示顶部栏标题 +const isHome = computed(() => route.path === '/')