2023-02-11 00:44:00 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="text-center">
|
|
|
|
<UserAvatar :img="userInfo?.avatar" />
|
|
|
|
</div>
|
|
|
|
<ul class="list-group list-group-striped">
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="ep:user" />
|
|
|
|
{{ t('profile.user.username') }}
|
2023-02-11 00:44:00 +08:00
|
|
|
<div class="pull-right">{{ userInfo?.username }}</div>
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="ep:phone" />
|
|
|
|
{{ t('profile.user.mobile') }}
|
2023-02-11 00:44:00 +08:00
|
|
|
<div class="pull-right">{{ userInfo?.mobile }}</div>
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="fontisto:email" />
|
|
|
|
{{ t('profile.user.email') }}
|
2023-02-11 00:44:00 +08:00
|
|
|
<div class="pull-right">{{ userInfo?.email }}</div>
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="carbon:tree-view-alt" />
|
|
|
|
{{ t('profile.user.dept') }}
|
|
|
|
<div v-if="userInfo?.dept" class="pull-right">{{ userInfo?.dept.name }}</div>
|
2023-02-11 00:44:00 +08:00
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="ep:suitcase" />
|
|
|
|
{{ t('profile.user.posts') }}
|
|
|
|
<div v-if="userInfo?.posts" class="pull-right">
|
2023-02-11 00:44:00 +08:00
|
|
|
{{ userInfo?.posts.map((post) => post.name).join(',') }}
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="icon-park-outline:peoples" />
|
|
|
|
{{ t('profile.user.roles') }}
|
|
|
|
<div v-if="userInfo?.roles" class="pull-right">
|
2023-02-11 00:44:00 +08:00
|
|
|
{{ userInfo?.roles.map((role) => role.name).join(',') }}
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2023-04-14 21:32:11 +08:00
|
|
|
<Icon class="mr-5px" icon="ep:calendar" />
|
|
|
|
{{ t('profile.user.createTime') }}
|
2023-04-04 11:19:58 +08:00
|
|
|
<div class="pull-right">{{ formatDate(userInfo?.createTime) }}</div>
|
2023-02-11 00:44:00 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</template>
|
2023-06-21 19:14:34 +08:00
|
|
|
<script lang="ts" setup>
|
2023-04-04 11:19:58 +08:00
|
|
|
import { formatDate } from '@/utils/formatTime'
|
2023-02-11 00:44:00 +08:00
|
|
|
import UserAvatar from './UserAvatar.vue'
|
|
|
|
|
2023-04-05 20:13:35 +08:00
|
|
|
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-06-21 19:14:34 +08:00
|
|
|
defineOptions({ name: 'ProfileUser' })
|
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
const { t } = useI18n()
|
|
|
|
const userInfo = ref<ProfileVO>()
|
|
|
|
const getUserInfo = async () => {
|
2023-04-05 20:13:35 +08:00
|
|
|
const users = await getUserProfile()
|
2023-02-11 00:44:00 +08:00
|
|
|
userInfo.value = users
|
|
|
|
}
|
|
|
|
onMounted(async () => {
|
|
|
|
await getUserInfo()
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.text-center {
|
|
|
|
position: relative;
|
|
|
|
height: 120px;
|
2023-08-04 21:33:00 +08:00
|
|
|
text-align: center;
|
2023-02-11 00:44:00 +08:00
|
|
|
}
|
2023-04-14 21:32:11 +08:00
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
.list-group-striped > .list-group-item {
|
2023-08-04 21:33:00 +08:00
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
2023-02-11 00:44:00 +08:00
|
|
|
border-right: 0;
|
2023-08-04 21:33:00 +08:00
|
|
|
border-left: 0;
|
2023-02-11 00:44:00 +08:00
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list-group {
|
2023-06-21 19:14:34 +08:00
|
|
|
padding-left: 0;
|
2023-02-11 00:44:00 +08:00
|
|
|
list-style: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list-group-item {
|
2023-06-21 19:14:34 +08:00
|
|
|
padding: 11px 0;
|
2023-08-04 21:33:00 +08:00
|
|
|
margin-bottom: -1px;
|
2023-02-11 00:44:00 +08:00
|
|
|
font-size: 13px;
|
2023-08-04 21:33:00 +08:00
|
|
|
border-top: 1px solid #e7eaec;
|
|
|
|
border-bottom: 1px solid #e7eaec;
|
2023-02-11 00:44:00 +08:00
|
|
|
}
|
2023-04-14 21:32:11 +08:00
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
.pull-right {
|
|
|
|
float: right !important;
|
|
|
|
}
|
|
|
|
</style>
|