项目演示微调 - 展示前端class——name
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
# 学生管理系统 — 项目总览
|
||||
# 教育培训管理系统 — 项目总览
|
||||
|
||||
> 本文档汇总学生管理系统的架构、业务、数据库及运维部署设计,作为项目开发和维护的参考基准。
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "student-manage-system"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
description = "教培系统架构设计与开发"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
|
||||
@@ -44,12 +44,16 @@ def score_stats(class_id: Optional[int] = None, score_num: Optional[str] = None,
|
||||
db.query(
|
||||
Score.num.label("score_num"),
|
||||
Student.class_id,
|
||||
Class.num.label("class_num"),
|
||||
Class.name.label("class_name"),
|
||||
func.avg(Score.score).label("avg_score"),
|
||||
func.max(Score.score).label("max_score"),
|
||||
func.min(Score.score).label("min_score"),
|
||||
func.count(Score.id).label("count"),
|
||||
)
|
||||
.join(Student, Score.sid == Student.id)
|
||||
# 添加班级名称
|
||||
.join(Class, Student.class_id == Class.id)
|
||||
.filter(Student.is_deleted == False, Score.is_deleted == False)
|
||||
.group_by(Score.num, Student.class_id)
|
||||
)
|
||||
@@ -62,6 +66,8 @@ def score_stats(class_id: Optional[int] = None, score_num: Optional[str] = None,
|
||||
{
|
||||
"score_num": r.score_num,
|
||||
"class_id": r.class_id,
|
||||
"class_num": r.class_num,
|
||||
"class_name": r.class_name,
|
||||
"avg_score": float(r.avg_score),
|
||||
"max_score": float(r.max_score),
|
||||
"min_score": float(r.min_score),
|
||||
|
||||
+5
-4
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>学生管理系统</title>
|
||||
<title>教育培训管理系统</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; }
|
||||
@@ -56,7 +56,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>📚 学生管理系统</h1>
|
||||
<h1>📚 教育培训管理系统</h1>
|
||||
<h3>贡献人员:元堡,牧遥,Agent</h3>
|
||||
<div class="nav">
|
||||
<button class="nav-btn active" onclick="showSection('dashboard')">概览</button>
|
||||
<button class="nav-btn" onclick="showSection('students')">学生</button>
|
||||
@@ -91,7 +92,7 @@
|
||||
<div class="card">
|
||||
<h2>成绩统计</h2>
|
||||
<table>
|
||||
<thead><tr><th>考核</th><th>平均分</th><th>最高分</th><th>最低分</th><th>人数</th></tr></thead>
|
||||
<thead><tr><th>班级</th><th>考核</th><th>平均分</th><th>最高分</th><th>最低分</th><th>人数</th></tr></thead>
|
||||
<tbody id="score-stats-body"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -342,7 +343,7 @@
|
||||
// Score stats
|
||||
const scoreStats = await fetchAPI('/stats/scores');
|
||||
const tbody = document.getElementById('score-stats-body');
|
||||
tbody.innerHTML = scoreStats.map(s => `<tr><td>${s.score_num}</td><td>${s.avg_score.toFixed(2)}</td><td>${s.max_score}</td><td>${s.min_score}</td><td>${s.count}</td></tr>`).join('');
|
||||
tbody.innerHTML = scoreStats.map(s => `<tr><td>${s.class_name}</td><td>${s.score_num}</td><td>${s.avg_score.toFixed(2)}</td><td>${s.max_score}</td><td>${s.min_score}</td><td>${s.count}</td></tr>`).join('');
|
||||
|
||||
// Employment stats
|
||||
const empStats = await fetchAPI('/stats/employment');
|
||||
|
||||
Reference in New Issue
Block a user