|
|
|
@ -1,6 +1,6 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="test-report app-container">
|
|
|
|
<div class="test-report app-container">
|
|
|
|
<h2>实验报告</h2>
|
|
|
|
<h2 class="report-title">实验报告</h2>
|
|
|
|
<el-row class="student-info"><el-col :span="6">姓名:{{ userInfo.name }}</el-col><el-col :span="6">学号:{{ userInfo.username }}</el-col><el-col :span="8">班级:{{ report.teachingClassName || userInfo.className }}</el-col></el-row>
|
|
|
|
<el-row class="student-info"><el-col :span="6">姓名:{{ userInfo.name }}</el-col><el-col :span="6">学号:{{ userInfo.username }}</el-col><el-col :span="8">班级:{{ report.teachingClassName || userInfo.className }}</el-col></el-row>
|
|
|
|
<el-card><template #header><span>实训总成绩:{{ report.totalScore || 0 }} 分</span><span class="rank">班级排名:{{ report.rank || '-' }}</span></template>
|
|
|
|
<el-card><template #header><span>实训总成绩:{{ report.totalScore || 0 }} 分</span><span class="rank">班级排名:{{ report.rank || '-' }}</span></template>
|
|
|
|
<el-table :data="report.modules || []" border><el-table-column prop="moduleName" label="实训模块"/><el-table-column label="权重"><template #default="{row}">{{ percent(row.weight) }}</template></el-table-column><el-table-column prop="score" label="模块成绩"/><el-table-column label="任务完成"><template #default="{row}">{{ row.completedTaskCount }} / {{ row.totalTaskCount }}</template></el-table-column></el-table>
|
|
|
|
<el-table :data="report.modules || []" border><el-table-column prop="moduleName" label="实训模块"/><el-table-column label="权重"><template #default="{row}">{{ percent(row.weight) }}</template></el-table-column><el-table-column prop="score" label="模块成绩"/><el-table-column label="任务完成"><template #default="{row}">{{ row.completedTaskCount }} / {{ row.totalTaskCount }}</template></el-table-column></el-table>
|
|
|
|
@ -17,4 +17,9 @@ const userInfo=useUserStore().userInfo; const report=ref({modules:[],tasks:[]});
|
|
|
|
const percent=(weight)=>weight==null?'-':`${Number(weight)*100}%`;
|
|
|
|
const percent=(weight)=>weight==null?'-':`${Number(weight)*100}%`;
|
|
|
|
onMounted(async()=>{const res=await getCurrentExperimentReport(); report.value=res?.data||{modules:[],tasks:[]};});
|
|
|
|
onMounted(async()=>{const res=await getCurrentExperimentReport(); report.value=res?.data||{modules:[],tasks:[]};});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>.student-info{margin:20px 0}.rank{margin-left:24px}.tasks{margin-top:20px}</style>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
.report-title { margin: 0; color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0, 88, 166, 0.55); }
|
|
|
|
|
|
|
|
.student-info { margin: 20px 0; color: #d9ecff; }
|
|
|
|
|
|
|
|
.rank { margin-left: 24px; }
|
|
|
|
|
|
|
|
.tasks { margin-top: 20px; }
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|