成绩分析报告

This commit is contained in:
2026-08-09 11:45:06 +08:00 Unverified
parent ca8232ad5e
commit 1229f3163d
6 changed files with 639 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "web",
"private": true,
"version": "2.3.1-beta.1",
"version": "2.3.2-beta.1",
"type": "module",
"scripts": {
"dev": "vite",
+29 -2
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { Refresh, Search } from '@element-plus/icons-vue'
import { Download, Refresh, Search } from '@element-plus/icons-vue'
import * as echarts from 'echarts'
import http, { apiErrorMessage } from '../api/http'
import { downloadApiFile } from '../api/excel'
import { academicTermLabel, defaultAcademicTermId } from '../utils/academicTerms'
interface TeachingClassItem {
@@ -34,6 +35,7 @@ const total = ref(0)
const pageSize = 12
const loading = ref(false)
const reportLoading = ref(false)
const exporting = ref(false)
const historyMetric = ref<'average' | 'passRate' | 'excellentRate'>('average')
const distributionElement = ref<HTMLElement>()
@@ -132,6 +134,22 @@ async function refreshStatistics() {
}
}
async function exportWordReport() {
if (!selected.value) return
exporting.value = true
try {
await downloadApiFile(
`/grade-analytics/teaching-classes/${selected.value.gradeSheetId}/report.docx`,
`${selected.value.courseCode}-${selected.value.taskNumber}-成绩分析报告.docx`,
)
ElMessage.success('成绩分析报告已导出。')
} catch (error) {
ElMessage.error(apiErrorMessage(error))
} finally {
exporting.value = false
}
}
function baseGrid(left = 48, right = 24) {
return { left, right, top: 42, bottom: 44, containLabel: true }
}
@@ -288,7 +306,16 @@ onBeforeUnmount(() => {
<h2>教学班成绩分析</h2>
<p>对比当前教学班同课程教学班学生来源范围与历年成绩统计仅使用已正式发布成绩</p>
</div>
<el-button :icon="Refresh" @click="refreshStatistics">重新计算当前教学班</el-button>
<div class="intro-actions">
<el-button
type="primary"
:icon="Download"
:loading="exporting"
:disabled="!selected || !summary"
@click="exportWordReport"
>导出 Word 报告</el-button>
<el-button :icon="Refresh" @click="refreshStatistics">重新计算当前教学班</el-button>
</div>
</section>
<section class="filter-bar">