<!-- 考试 -->
<script setup lang="ts">
import type { PaperType } from '@/types'
import CourseViewExamItem from './CourseViewExamItem.vue'
import { getCourseExamList } from '../api'
const { query } = useRoute()
const courseId = $ref(query.course_id as string)
const semesterId = $ref(query.semester_id as string)
let list = $ref<PaperType[]>([])
function fetchList() {
  getCourseExamList({ course_id: courseId, semester_id: semesterId }).then(res => {
    list = res.data.items
  })
}
onMounted(() => {
  fetchList()
})
</script>
<template>
  <div class="course-exam">
    <template v-if="list.length">
      <CourseViewExamItem v-for="item in list" :data="item" :key="item.id"></CourseViewExamItem>
    </template>
    <el-empty description="暂无数据" v-else />
  </div>
</template>
