From 967d14efa2efde5d4e5fe484d682899cc8767b17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=93=B2=E9=93=9C?=
<9490856+zhangzhetong@user.noreply.gitee.com>
Date: Fri, 10 Oct 2025 00:12:59 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=88=90=E7=BB=A9=E6=8A=A5?=
=?UTF-8?q?=E5=91=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../student/AdvantageAnalysisChart.vue | 198 +++++++++++++
.../student/AverageComparisonChart.vue | 235 +++++++++++++++
.../student/ScoreDistributionChart.vue | 191 ++++++++++++
src/components/student/ScoreTrendChart.vue | 122 ++++++++
src/pages/index/score-list.vue | 11 +-
src/pages/student/detail.vue | 276 ++++++++++--------
src/pages/student/list.vue | 2 +-
src/service/types.ts | 15 +-
8 files changed, 908 insertions(+), 142 deletions(-)
create mode 100644 src/components/student/AdvantageAnalysisChart.vue
create mode 100644 src/components/student/AverageComparisonChart.vue
create mode 100644 src/components/student/ScoreDistributionChart.vue
create mode 100644 src/components/student/ScoreTrendChart.vue
diff --git a/src/components/student/AdvantageAnalysisChart.vue b/src/components/student/AdvantageAnalysisChart.vue
new file mode 100644
index 0000000..69dc3cc
--- /dev/null
+++ b/src/components/student/AdvantageAnalysisChart.vue
@@ -0,0 +1,198 @@
+
+
+
+
+
+
+ {{ chartTitle }}
+
+
+
+
+
+ 同分数段
+
+
+ 班级
+
+
+ 年级
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
diff --git a/src/components/student/AverageComparisonChart.vue b/src/components/student/AverageComparisonChart.vue
new file mode 100644
index 0000000..45df985
--- /dev/null
+++ b/src/components/student/AverageComparisonChart.vue
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+ {{ chartTitle }}
+
+
+
+
+
+ 班级平均分
+
+
+ 年级平均分
+
+
+ 年级前{{ topN }}名
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
+
+ 设置年级前N名
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+
diff --git a/src/components/student/ScoreDistributionChart.vue b/src/components/student/ScoreDistributionChart.vue
new file mode 100644
index 0000000..d92ba0d
--- /dev/null
+++ b/src/components/student/ScoreDistributionChart.vue
@@ -0,0 +1,191 @@
+
+
+
+
+
+ 成绩分布图
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
+
+
+ 本人所在分数段:{{ scoreRangeInfo.range }}
+
+
+
+
+
+ 本分数段年级学生数:{{ scoreRangeInfo.gradeCount }}人,其中本班占{{ scoreRangeInfo.classCount }}人
+
+
+
+
+
+
+
diff --git a/src/components/student/ScoreTrendChart.vue b/src/components/student/ScoreTrendChart.vue
new file mode 100644
index 0000000..b70d8d0
--- /dev/null
+++ b/src/components/student/ScoreTrendChart.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
+ 成绩趋势
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
diff --git a/src/pages/index/score-list.vue b/src/pages/index/score-list.vue
index 584d6d2..b2f08c1 100644
--- a/src/pages/index/score-list.vue
+++ b/src/pages/index/score-list.vue
@@ -108,18 +108,13 @@ async function fetchScoreList() {
// 跳转到学生成绩报告
function viewStudentReport(student: ScoreSheetItemExtended) {
- // TODO: 跳转到学生成绩报告页面
- console.log('查看学生成绩报告:', student)
- uni.showToast({
- title: '功能开发中',
- icon: 'none',
+ uni.navigateTo({
+ url: `/pages/student/detail?student_number=${student.student_exam_number}&student_name=${student.student_name}`,
})
}
// 跳转到科目答题卡
-function viewSubjectAnswerSheet(student: ScoreSheetItemExtended, subjectId: number) {
- // TODO: 跳转到科目答题卡页面
- console.log('查看科目答题卡:', student, subjectId)
+function viewSubjectAnswerSheet(student: ScoreSheetItemExtended, subjectId: number = 0) {
uni.showToast({
title: '功能开发中',
icon: 'none',
diff --git a/src/pages/student/detail.vue b/src/pages/student/detail.vue
index ac5554d..f08483c 100644
--- a/src/pages/student/detail.vue
+++ b/src/pages/student/detail.vue
@@ -1,25 +1,75 @@
-
+
@@ -91,121 +140,110 @@ onMounted(async () => {
- {{ studentInfo.name }}成绩报告
+ {{ studentName }}成绩报告
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
- {{ studentInfo.name }}
-
- {{ studentInfo.totalScore }}分
-
+
+
+
+
+
+
-
-
-
-
-
- {{ studentInfo.classRank }}
- /{{ studentInfo.classTotal }}
-
- 年级排名
-
-
-
-
-
- {{ studentInfo.gradeRank }}
- /{{ studentInfo.gradeTotal }}
-
- 班级排名
-
-
-
-
- {{ studentInfo.gradeAverage }}
- 年级平均分
-
-
-
-
- {{ studentInfo.classAverage }}
- 班级平均分
-
-
-
-
-
-
-
- 成绩分布图
-
-
-
-
- 成绩分布图表(待实现)
-
-
-
-
-
-
-
-
- 优劣势分析
-
-
-
-
-
- 优势学科
-
- 数学、物理等学科表现优秀...
+
+
+
+
+
+
+
+ 总分
+
+ {{ studentInfo.totalScore }}
+ /{{ studentInfo.fullScore }}
+
+ 学号: {{ studentNumber }}
+
+
-
- 待提升学科
-
- 语文、英语等学科有提升空间...
+
+
+
+
+
+ {{ studentInfo.classRank }}
+ /{{ studentInfo.classTotal }}
+ 班级排名
+
+
+
+
+
+ {{ studentInfo.gradeRank }}
+ /{{ studentInfo.gradeTotal }}
+
+ 年级排名
+
+
+
+
+ {{ studentInfo.classAverage.toFixed(1) }}
+ 班级平均分
+
+
+
+
+ {{ studentInfo.gradeAverage.toFixed(1) }}
+ 年级平均分
-
-
-
- 各科均分对比
-
+
+
-
-
- 各科均分对比图表(待实现)
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
diff --git a/src/pages/student/list.vue b/src/pages/student/list.vue
index 8a59dce..dde3e53 100644
--- a/src/pages/student/list.vue
+++ b/src/pages/student/list.vue
@@ -54,7 +54,7 @@ const otherStudents = computed(() => studentsData.value?.other_students || [])
// 跳转到学生详情
function goToStudentDetail(student: StudentInfo) {
uni.navigateTo({
- url: `/pages/student/detail?info_id=${student.info_id}`,
+ url: `/pages/student/detail?info_id=${student.info_id}&student_number=${student.student_number}&student_name=${student.student_name}`,
})
}
diff --git a/src/service/types.ts b/src/service/types.ts
index 5e95bef..5d871b0 100644
--- a/src/service/types.ts
+++ b/src/service/types.ts
@@ -3407,19 +3407,6 @@ export type TotalScoreInfo = {
score_line?: number;
};
-export type TrendDataItem = {
- /** 班级key */
- class_key?: number;
- /** 班级名称 */
- class_name?: string;
- /** 班级平均分 */
- class_avg_score?: number;
- /** 班级排名 */
- class_rank?: number;
- /** 班级前N名人数 */
- class_top_count?: number;
-};
-
export type TrendInfo = {
/** 考试日期 */
exam_date?: string;
@@ -3428,7 +3415,7 @@ export type TrendInfo = {
/** 考试名称 */
exam_name?: string;
/** 年级走势数据 */
- trend_data?: TrendDataItem[];
+ trend_data?: unknown[];
};
export type UnifiedConfigData = {