修复文件问题 修改bug
This commit is contained in:
@@ -262,13 +262,25 @@
|
||||
<template #default="scope" v-if="col.prop === 'gender'">
|
||||
<GenderTag :gender="scope.row.gender" />
|
||||
</template>
|
||||
<template #default="scope" v-else-if="col.prop === 'education'">
|
||||
<el-tag v-if="getEducationLabel(scope.row.education)" size="small" type="info" effect="plain">
|
||||
{{ getEducationLabel(scope.row.education) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #default="scope" v-else-if="col.prop === 'isDorm'">
|
||||
<el-tag v-if="scope.row.isDorm === 1 || scope.row.isDorm === '1'" size="small" type="success" effect="plain">是</el-tag>
|
||||
<el-tag v-else-if="scope.row.isDorm === 0 || scope.row.isDorm === '0'" size="small" type="info" effect="plain">否</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #default="scope" v-else-if="col.prop === 'enrollStatus'">
|
||||
<el-tag v-if="scope.row.enrollStatus" size="small" type="info" effect="plain">{{ scope.row.enrollStatus }}</el-tag>
|
||||
<el-tag
|
||||
v-if="getEnrollStatusLabel(scope.row.enrollStatus)"
|
||||
size="small"
|
||||
type="info"
|
||||
effect="plain">
|
||||
{{ getEnrollStatusLabel(scope.row.enrollStatus) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #default="scope" v-else-if="col.prop === 'stuStatus'">
|
||||
@@ -427,7 +439,6 @@ import {
|
||||
editIsleader,
|
||||
updateInout,
|
||||
updateStuSimpleInfo,
|
||||
getStuStatus,
|
||||
prePrint
|
||||
} from "/@/api/basic/basicstudent";
|
||||
import { getDeptList, getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -456,6 +467,7 @@ const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const statusList = ref<any[]>([])
|
||||
const stuStatusList = ref<any[]>([])
|
||||
const educationList = ref<any[]>([])
|
||||
const selectedRows = ref<any[]>([])
|
||||
const importCertificateDialogVisible = ref(false)
|
||||
const uploadLoading = ref(false)
|
||||
@@ -781,9 +793,17 @@ const getClassListData = async () => {
|
||||
// 获取学籍状态列表
|
||||
const getStatusListData = async () => {
|
||||
try {
|
||||
const res = await getStuStatus()
|
||||
const res = await getDicts('enroll_status')
|
||||
if (res.data) {
|
||||
statusList.value = Array.isArray(res.data) ? res.data : []
|
||||
if (Array.isArray(res.data)) {
|
||||
// 确保数据格式统一为 {label, value}
|
||||
statusList.value = res.data.map((item: any) => ({
|
||||
label: item.label || item.name || item.dictLabel || item.text || '',
|
||||
value: String(item.value || item.code || item.dictValue || item.id || '')
|
||||
})).filter((item: any) => item.label && item.value !== undefined && item.value !== null && item.value !== '')
|
||||
} else {
|
||||
statusList.value = []
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取学籍状态列表失败', err)
|
||||
@@ -791,6 +811,24 @@ const getStatusListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取文化程度字典
|
||||
const getEducationListData = async () => {
|
||||
try {
|
||||
const res = await getDicts('pre_school_education')
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
educationList.value = res.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}))
|
||||
} else {
|
||||
educationList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取文化程度字典失败', err)
|
||||
educationList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学生状态列表
|
||||
const getStuStatusListData = async () => {
|
||||
try {
|
||||
@@ -813,6 +851,20 @@ const getStuStatusListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 根据学籍状态值获取标签
|
||||
const getEnrollStatusLabel = (value: any) => {
|
||||
if (value === undefined || value === null || value === '') return ''
|
||||
const status = statusList.value.find(item => String(item.value) === String(value))
|
||||
return status ? status.label : ''
|
||||
}
|
||||
|
||||
// 根据文化程度值获取标签
|
||||
const getEducationLabel = (value: any) => {
|
||||
if (value === undefined || value === null || value === '') return ''
|
||||
const item = educationList.value.find(i => String(i.value) === String(value))
|
||||
return item ? item.label : ''
|
||||
}
|
||||
|
||||
// 根据学生状态值获取标签
|
||||
const getStuStatusLabel = (value: any) => {
|
||||
if (value === undefined || value === null || value === '') return ''
|
||||
@@ -833,6 +885,7 @@ onMounted(() => {
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
getStatusListData()
|
||||
getEducationListData()
|
||||
getStuStatusListData()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user