成绩统计图
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import {
|
||||
Check,
|
||||
ArrowRight,
|
||||
Delete,
|
||||
DocumentChecked,
|
||||
Download,
|
||||
@@ -15,9 +16,11 @@ import {
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile, importExcel } from '../api/excel'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const router = useRouter()
|
||||
const isStudent = computed(() => auth.user?.roles.includes('Student') &&
|
||||
!auth.user.roles.some((role) =>
|
||||
['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Teacher'].includes(role)))
|
||||
@@ -127,6 +130,10 @@ function removeItem(index: number) {
|
||||
createForm.items.splice(index, 1)
|
||||
}
|
||||
|
||||
function openStatistics(record: any) {
|
||||
router.push({ name: 'course-grade-statistics', params: { sheetId: record.gradeSheetId } })
|
||||
}
|
||||
|
||||
async function load(resetPage = false) {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -463,7 +470,17 @@ onMounted(async () => {
|
||||
</section>
|
||||
|
||||
<section class="transcript-list" v-loading="loading">
|
||||
<article v-for="record in transcript.records" :key="record.id">
|
||||
<article
|
||||
v-for="record in transcript.records"
|
||||
:key="record.id"
|
||||
class="transcript-course-card"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
:aria-label="`查看${record.courseName}成绩分析`"
|
||||
@click="openStatistics(record)"
|
||||
@keydown.enter="openStatistics(record)"
|
||||
@keydown.space.prevent="openStatistics(record)"
|
||||
>
|
||||
<div class="transcript-course">
|
||||
<span>{{ record.termName }}</span>
|
||||
<h3>{{ record.courseName }}</h3>
|
||||
@@ -482,6 +499,7 @@ onMounted(async () => {
|
||||
<b v-if="record.totalScore != null">{{ record.totalScore }}</b>
|
||||
<b v-else>—</b>
|
||||
<small>绩点 {{ record.gradePoint ?? '—' }}</small>
|
||||
<span class="card-entry">查看成绩分析 <el-icon><ArrowRight /></el-icon></span>
|
||||
</div>
|
||||
</article>
|
||||
<el-empty v-if="!transcript.records.length" description="当前范围内暂无已发布成绩" />
|
||||
@@ -835,6 +853,10 @@ onMounted(async () => {
|
||||
padding: 8px;
|
||||
}
|
||||
.transcript-result.is-failed b { color: #b42318; }
|
||||
.transcript-course-card { cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
|
||||
.transcript-course-card:hover { transform: translateY(-2px); border-color: #91a8c8; box-shadow: 0 10px 24px rgb(31 66 112 / 9%); }
|
||||
.transcript-course-card:focus-visible { outline: 2px solid #315a9b; outline-offset: 3px; }
|
||||
.card-entry { display: inline-flex !important; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; color: #315a9b !important; font-size: 10px !important; font-weight: 700; }
|
||||
|
||||
/* Preview total score */
|
||||
.total-score.preview {
|
||||
|
||||
Reference in New Issue
Block a user