|
@@ -59,13 +59,11 @@
|
|
|
import user from './parts/user.vue'
|
|
|
// API 引用
|
|
|
import { TeacherStore } from '@/store/api/user/teacher'
|
|
|
-import { RoleStore } from '@/store/api/system/role'
|
|
|
import { DictDataStore } from '@/store/api/system/dictData'
|
|
|
import { cloneDeep, get } from 'lodash-es'
|
|
|
const $checkRes = inject('$checkRes')
|
|
|
const store = TeacherStore()
|
|
|
const dictDataStore = DictDataStore()
|
|
|
-const roleStore = RoleStore()
|
|
|
const { t } = useI18n()
|
|
|
const loading = ref(false)
|
|
|
let skip = 0
|
|
@@ -79,12 +77,23 @@ onMounted(async () => {
|
|
|
loading.value = false
|
|
|
})
|
|
|
const fields = [
|
|
|
+ { label: t('pages.teacher.openid'), model: 'openid' },
|
|
|
{ label: t('pages.teacher.nick_name'), model: 'nick_name', filter: true },
|
|
|
- { label: t('pages.teacher.gender'), model: 'gender', filter: true },
|
|
|
- { label: t('pages.teacher.education'), model: 'education' },
|
|
|
+ { label: t('pages.teacher.gender'), model: 'gender', format: (i) => getDict(i, 'gender') },
|
|
|
+ { label: t('pages.teacher.card'), model: 'card' },
|
|
|
{ label: t('pages.teacher.phone'), model: 'phone', filter: true },
|
|
|
- { label: t('pages.teacher.role'), model: 'role', custom: true },
|
|
|
- { label: t('pages.teacher.status'), model: 'status', format: (i) => getDict(i) }
|
|
|
+ {
|
|
|
+ label: t('pages.teacher.education'),
|
|
|
+ model: 'education',
|
|
|
+ format: (i) => getDict(i, 'education')
|
|
|
+ },
|
|
|
+ { label: t('pages.teacher.college'), model: 'college', filter: true },
|
|
|
+ {
|
|
|
+ label: t('pages.teacher.learnStatus'),
|
|
|
+ model: 'learnStatus',
|
|
|
+ format: (i) => getDict(i, 'learnStatus')
|
|
|
+ },
|
|
|
+ { label: t('pages.teacher.status'), model: 'status', format: (i) => getDict(i, 'status') }
|
|
|
]
|
|
|
const opera = [
|
|
|
{ label: t('common.view'), method: 'view' },
|
|
@@ -118,8 +127,12 @@ const examRules = reactive({
|
|
|
const examForm = ref({})
|
|
|
// 字典表
|
|
|
const statusList = ref([])
|
|
|
-const roleList = ref([])
|
|
|
const genderList = ref([])
|
|
|
+const educationList = ref([])
|
|
|
+const learnStatusList = ref([])
|
|
|
+const gradeList = ref([])
|
|
|
+const cardTypeList = ref([])
|
|
|
+
|
|
|
const searchOther = async () => {
|
|
|
let result
|
|
|
// 状态
|
|
@@ -128,9 +141,18 @@ const searchOther = async () => {
|
|
|
// 性别
|
|
|
result = await dictDataStore.query({ code: 'gender', is_use: '0' })
|
|
|
if ($checkRes(result)) genderList.value = result.data
|
|
|
- // 角色
|
|
|
- result = await roleStore.query({ is_use: '0' })
|
|
|
- if ($checkRes(result)) roleList.value = result.data
|
|
|
+ // 学历
|
|
|
+ result = await dictDataStore.query({ code: 'education', is_use: '0' })
|
|
|
+ if ($checkRes(result)) educationList.value = result.data
|
|
|
+ // 学业状态
|
|
|
+ result = await dictDataStore.query({ code: 'learnStatus', is_use: '0' })
|
|
|
+ if ($checkRes(result)) learnStatusList.value = result.data
|
|
|
+ // 年级
|
|
|
+ result = await dictDataStore.query({ code: 'grade', is_use: '0' })
|
|
|
+ if ($checkRes(result)) gradeList.value = result.data
|
|
|
+ // 身份证类型
|
|
|
+ result = await dictDataStore.query({ code: 'cardType', is_use: '0' })
|
|
|
+ if ($checkRes(result)) cardTypeList.value = result.data
|
|
|
}
|
|
|
|
|
|
const toDelete = async (data) => {
|
|
@@ -139,12 +161,12 @@ const toDelete = async (data) => {
|
|
|
search({ skip: 0, limit })
|
|
|
}
|
|
|
}
|
|
|
-const getRole = (data) => {
|
|
|
- const res = roleList.value.find((f) => f.code === data)
|
|
|
- return get(res, 'name')
|
|
|
-}
|
|
|
-const getDict = (data) => {
|
|
|
- const res = statusList.value.find((f) => f.value == data)
|
|
|
+const getDict = (data, model) => {
|
|
|
+ let res
|
|
|
+ if (model == 'status') res = statusList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'gender') res = genderList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'education') res = educationList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'learnStatus') res = learnStatusList.value.find((f) => f.value == data)
|
|
|
return get(res, 'label')
|
|
|
}
|
|
|
// 查看
|
|
@@ -182,8 +204,10 @@ provide('form', form)
|
|
|
// 字典
|
|
|
provide('statusList', statusList)
|
|
|
provide('genderList', genderList)
|
|
|
-// 方法
|
|
|
-provide('getRole', getRole)
|
|
|
+provide('gradeList', gradeList)
|
|
|
+provide('learnStatusList', learnStatusList)
|
|
|
+provide('cardTypeList', cardTypeList)
|
|
|
+provide('educationList', educationList)
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.tags {
|