<script setup lang="ts">
import { getStudentInfo } from '../api'
import type { StudentInfo } from '../types'

const route = useRoute()

let info = $ref<StudentInfo>()
onMounted(() => {
  getStudentInfo({ experiment_id: route.query.id as string, student_id: route.query.sid as string }).then(
    (res: { data: { detail: StudentInfo } }) => {
      info = res.data?.detail
    }
  )
})
</script>

<template>
  <el-form label-width="100px">
    <el-form-item label="姓名：">{{ info?.name }}</el-form-item>
    <el-form-item label="学号：">{{ info?.sno_number }}</el-form-item>
    <el-form-item label="所属班级：">{{ info?.class.name }}</el-form-item>
    <el-form-item label="所属专业：">{{ info?.specialty.name }}</el-form-item>
    <el-form-item label="实验名称：">{{ info?.experiment.name }}</el-form-item>
  </el-form>
</template>

<style lang="scss" scoped></style>
