提交 | 用户 | 时间
|
e7c126
|
1 |
<template> |
H |
2 |
<!-- 列表 --> |
|
3 |
<ContentWrap> |
|
4 |
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
5 |
<el-table-column label="编号" align="center" prop="id" /> |
|
6 |
<el-table-column label="名字" align="center" prop="name" /> |
|
7 |
<el-table-column label="简介" align="center" prop="description" /> |
|
8 |
<el-table-column |
|
9 |
label="出生日期" |
|
10 |
align="center" |
|
11 |
prop="birthday" |
|
12 |
:formatter="dateFormatter" |
|
13 |
width="180px" |
|
14 |
/> |
|
15 |
<el-table-column label="性别" align="center" prop="sex"> |
|
16 |
<template #default="scope"> |
|
17 |
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" /> |
|
18 |
</template> |
|
19 |
</el-table-column> |
|
20 |
<el-table-column label="是否有效" align="center" prop="enabled"> |
|
21 |
<template #default="scope"> |
|
22 |
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.enabled" /> |
|
23 |
</template> |
|
24 |
</el-table-column> |
|
25 |
<el-table-column label="头像" align="center" prop="avatar" /> |
|
26 |
<el-table-column label="附件" align="center" prop="video" /> |
|
27 |
<el-table-column label="备注" align="center" prop="memo" /> |
|
28 |
<el-table-column |
|
29 |
label="创建时间" |
|
30 |
align="center" |
|
31 |
prop="createTime" |
|
32 |
:formatter="dateFormatter" |
|
33 |
width="180px" |
|
34 |
/> |
|
35 |
</el-table> |
|
36 |
</ContentWrap> |
|
37 |
</template> |
|
38 |
<script setup lang="ts"> |
|
39 |
import { DICT_TYPE } from '@/utils/dict' |
|
40 |
import { dateFormatter } from '@/utils/formatTime' |
|
41 |
import * as StudentApi from '@/api/infra/demo' |
|
42 |
|
|
43 |
const { t } = useI18n() // 国际化 |
|
44 |
const message = useMessage() // 消息弹窗 |
|
45 |
|
|
46 |
const props = defineProps<{ |
|
47 |
studentId: undefined // 学生编号(主表的关联字段) |
|
48 |
}>() |
|
49 |
const loading = ref(false) // 列表的加载中 |
|
50 |
const list = ref([]) // 列表的数据 |
|
51 |
|
|
52 |
/** 查询列表 */ |
|
53 |
const getList = async () => { |
|
54 |
loading.value = true |
|
55 |
try { |
|
56 |
list.value = await StudentApi.getStudentContactListByStudentId(props.studentId) |
|
57 |
} finally { |
|
58 |
loading.value = false |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
/** 搜索按钮操作 */ |
|
63 |
const handleQuery = () => { |
|
64 |
queryParams.pageNo = 1 |
|
65 |
getList() |
|
66 |
} |
|
67 |
|
|
68 |
/** 初始化 **/ |
|
69 |
onMounted(() => { |
|
70 |
getList() |
|
71 |
}) |
|
72 |
</script> |