feat: 新增Excel内容提取支持 & 修复成绩查询课程筛选
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- 后端 knowledge_analysis_v2.py: 新增 _extract_excel_content 方法支持xlsx/xls文件 - 前端 student-scores.vue: 课程筛选改为动态加载,修复筛选参数传递
This commit is contained in:
@@ -62,12 +62,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程">
|
||||
<el-select v-model="filterForm.course" placeholder="请选择" clearable>
|
||||
<el-option label="全部课程" value="" />
|
||||
<el-option label="皮肤管理基础" value="skin_management" />
|
||||
<el-option label="美容产品知识" value="beauty_products" />
|
||||
<el-option label="客户沟通技巧" value="communication" />
|
||||
<el-option label="轻医美项目" value="light_medical" />
|
||||
<el-select v-model="filterForm.courseId" placeholder="请选择课程" clearable style="width: 200px">
|
||||
<el-option label="全部课程" :value="null" />
|
||||
<el-option
|
||||
v-for="course in courseList"
|
||||
:key="course.id"
|
||||
:label="course.name"
|
||||
:value="course.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="成绩范围">
|
||||
@@ -323,6 +325,7 @@
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getStudentScores, getStudentScoresStatistics, getExamMistakes, deleteExamRecord, type StudentScoreRecord, type MistakeRecord } from '@/api/manager/scores'
|
||||
import { getManagerCourses } from '@/api/manager'
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false)
|
||||
@@ -350,10 +353,30 @@ const mistakesList = ref<MistakeRecord[]>([])
|
||||
const filterForm = reactive({
|
||||
studentName: '',
|
||||
position: '',
|
||||
course: '',
|
||||
courseId: null as number | null,
|
||||
scoreRange: ''
|
||||
})
|
||||
|
||||
// 课程列表
|
||||
const courseList = ref<Array<{id: number, name: string}>>([])
|
||||
|
||||
/**
|
||||
* 加载课程列表
|
||||
*/
|
||||
const loadCourseList = async () => {
|
||||
try {
|
||||
const res = await getManagerCourses({ page: 1, size: 100, status: 'published' })
|
||||
if (res.code === 200 && res.data) {
|
||||
courseList.value = res.data.items.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name || item.title
|
||||
}))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载课程列表失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 成绩统计数据
|
||||
const scoreStats = ref([
|
||||
{
|
||||
@@ -498,6 +521,9 @@ const loadScoresList = async () => {
|
||||
if (filterForm.position) {
|
||||
params.position = getPositionText(filterForm.position)
|
||||
}
|
||||
if (filterForm.courseId) {
|
||||
params.course_id = filterForm.courseId
|
||||
}
|
||||
if (filterForm.scoreRange) {
|
||||
params.score_range = filterForm.scoreRange
|
||||
}
|
||||
@@ -568,7 +594,7 @@ const handleSearch = () => {
|
||||
const handleReset = () => {
|
||||
filterForm.studentName = ''
|
||||
filterForm.position = ''
|
||||
filterForm.course = ''
|
||||
filterForm.courseId = null
|
||||
filterForm.scoreRange = ''
|
||||
dateRange.value = [
|
||||
new Date(new Date().setDate(new Date().getDate() - 30)),
|
||||
@@ -700,6 +726,7 @@ const handleDeleteRecord = async (record: StudentScoreRecord) => {
|
||||
|
||||
// 组件挂载时初始化数据
|
||||
onMounted(() => {
|
||||
loadCourseList()
|
||||
loadScoresList()
|
||||
loadStatistics()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user