edu.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <el-table v-loading="loading" :data="tableData" :stripe="true" class="m-t-20px">
  3. <el-table-column label="学校名称" align="center" prop="schoolName" />
  4. <el-table-column label="专业名称" align="center" prop="major" />
  5. <el-table-column label="学历" align="center" prop="educationType">
  6. <template #default="scope">
  7. <dict-tag :type="DICT_TYPE.MENDUNER_EDUCATION_TYPE" :value="scope.row.educationType" />
  8. </template>
  9. </el-table-column>
  10. <el-table-column label="学制类型" align="center" prop="educationSystemType">
  11. <template #default="scope">
  12. <dict-tag :type="DICT_TYPE.MENDUNER_EDUCATION_SYSTEM_TYPE" :value="scope.row.educationSystemType" />
  13. </template>
  14. </el-table-column>
  15. <el-table-column label="在校开始日期" align="center" prop="startTime" :formatter="dateFormatter2" width="180px" />
  16. <el-table-column label="在校结束日期" align="center" prop="endTime" :formatter="dateFormatter2" width="180px" />
  17. <el-table-column label="在校经历" align="center" prop="content" :show-overflow-tooltip="true" />
  18. </el-table>
  19. <Pagination
  20. :total="total"
  21. v-model:page="queryParams.pageNo"
  22. v-model:limit="queryParams.pageSize"
  23. @pagination="getList"
  24. />
  25. </template>
  26. <script setup>
  27. defineOptions({ name: 'PersonEduList'})
  28. import { PersonInfoApi } from '@/api/menduner/system/person'
  29. import { DICT_TYPE } from '@/utils/dict'
  30. import { dateFormatter2 } from '@/utils/formatTime'
  31. import { formatName } from '@/utils'
  32. const props = defineProps({
  33. userId: String
  34. })
  35. const loading = ref(false)
  36. const tableData = ref([])
  37. const total = ref(0)
  38. const queryParams = reactive({
  39. pageNo: 1,
  40. pageSize: 10,
  41. userId: props.userId
  42. })
  43. const getList = async () => {
  44. loading.value = true
  45. try {
  46. const data = await PersonInfoApi.getPersonEduPage(queryParams)
  47. tableData.value = data.list ? data.list.map(e => {
  48. return { ...e, schoolName: formatName(e.schoolName), major: formatName(e.major), content: formatName(e.content) }
  49. }) : []
  50. total.value = data.total
  51. } finally {
  52. loading.value = false
  53. }
  54. }
  55. getList()
  56. </script>