<template>
  <el-dialog 
    title="查看详情" 
    v-model="visible" 
    :close-on-click-modal="false" 
    draggable
    width="800px">
    <div v-loading="loading" class="detail-container" v-if="detailData">
      <el-descriptions :column="2" border>
        <el-descriptions-item label="免学费批次" :span="2">
          {{ detailData.termTitle || '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="学院">
          {{ detailData.deptName || '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="专业名称">
          {{ detailData.majorName || '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="班号">
          {{ detailData.classNo || '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="班主任">
          {{ detailData.teacherName || '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="人数" v-if="detailData.num !== undefined">
          {{ detailData.num !== null ? detailData.num : '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="申报班级数" v-if="detailData.classNum !== undefined">
          {{ detailData.classNum !== null ? detailData.classNum : '-' }}
        </el-descriptions-item>
        <el-descriptions-item label="申报人数" v-if="detailData.stuNum !== undefined">
          {{ detailData.stuNum !== null ? detailData.stuNum : '-' }}
        </el-descriptions-item>
      </el-descriptions>
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="visible = false">关 闭</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup lang="ts" name="TuitionFreeStuApproveDetailDialog">
import { ref } from 'vue'

// 定义变量内容
const visible = ref(false)
const loading = ref(false)
const detailData = ref<any>({})

// 打开弹窗
const openDialog = async (row: any) => {
  visible.value = true
  loading.value = false
  detailData.value = row || {}
}

// 暴露方法
defineExpose({
  openDialog
})
</script>

<style scoped lang="scss">
.detail-container {
  padding: 20px 0;
}
</style>

