<template>
  <el-card shadow="never">
    <template #header>
      <CardTitle title="学生信息" />
    </template>
    <el-descriptions class="margin-top" :column="3" border>
      <el-descriptions-item label="就读学校">{{ info.schoolInfo?.name }}</el-descriptions-item>
      <el-descriptions-item label="所在院系">{{ info.schoolDept?.name }}</el-descriptions-item>
      <el-descriptions-item label="所属专业">{{ info.major?.nameCn }}</el-descriptions-item>
      <el-descriptions-item label="所在班级">{{ info.schoolClass?.name }}</el-descriptions-item>
      <el-descriptions-item label="学号">{{ info?.studentNo }}</el-descriptions-item>
      <el-descriptions-item label="紧急联系人">{{ info?.emergencyContactName }}</el-descriptions-item>
      <el-descriptions-item label="紧急联系人电话">{{ info?.emergencyContactPhone }}</el-descriptions-item>
    </el-descriptions>
  </el-card>
</template>

<script setup>
defineOptions({ name: 'EnterpriseDetailsInfo'})
import { PersonInfoApi } from '@/api/menduner/system/person'

const props = defineProps({
  userId: String
})

// 获取学生信息
const info = ref({})
const getInfo = async () => {
  const data = await PersonInfoApi.getStudentInfo(props.userId)
  info.value = data
}
if (props.userId) getInfo()
</script>
