|
3 | 3 | <template #header>
|
4 | 4 | <slot name="header"></slot>
|
5 | 5 | </template>
|
6 |
| - <el-row> |
| 6 | + <el-row v-if="mode === 'member'"> |
7 | 7 | <el-col :span="4">
|
8 |
| - <ElAvatar shape="square" :size="140" :src="user.avatar || undefined" /> |
| 8 | + <ElAvatar :size="140" :src="user.avatar || undefined" shape="square" /> |
9 | 9 | </el-col>
|
10 | 10 | <el-col :span="20">
|
11 | 11 | <el-descriptions :column="2">
|
12 | 12 | <el-descriptions-item>
|
13 | 13 | <template #label>
|
14 |
| - <descriptions-item-label label="用户名" icon="ep:user" /> |
| 14 | + <descriptions-item-label icon="ep:user" label="用户名" /> |
15 | 15 | </template>
|
16 | 16 | {{ user.name || '空' }}
|
17 | 17 | </el-descriptions-item>
|
18 | 18 | <el-descriptions-item>
|
19 | 19 | <template #label>
|
20 |
| - <descriptions-item-label label="昵称" icon="ep:user" /> |
| 20 | + <descriptions-item-label icon="ep:user" label="昵称" /> |
21 | 21 | </template>
|
22 | 22 | {{ user.nickname }}
|
23 | 23 | </el-descriptions-item>
|
24 | 24 | <el-descriptions-item label="手机号">
|
25 | 25 | <template #label>
|
26 |
| - <descriptions-item-label label="手机号" icon="ep:phone" /> |
| 26 | + <descriptions-item-label icon="ep:phone" label="手机号" /> |
27 | 27 | </template>
|
28 | 28 | {{ user.mobile }}
|
29 | 29 | </el-descriptions-item>
|
30 | 30 | <el-descriptions-item>
|
31 | 31 | <template #label>
|
32 |
| - <descriptions-item-label label="性别" icon="fa:mars-double" /> |
| 32 | + <descriptions-item-label icon="fa:mars-double" label="性别" /> |
33 | 33 | </template>
|
34 | 34 | <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="user.sex" />
|
35 | 35 | </el-descriptions-item>
|
36 | 36 | <el-descriptions-item>
|
37 | 37 | <template #label>
|
38 |
| - <descriptions-item-label label="所在地" icon="ep:location" /> |
| 38 | + <descriptions-item-label icon="ep:location" label="所在地" /> |
39 | 39 | </template>
|
40 | 40 | {{ user.areaName }}
|
41 | 41 | </el-descriptions-item>
|
42 | 42 | <el-descriptions-item>
|
43 | 43 | <template #label>
|
44 |
| - <descriptions-item-label label="注册 IP" icon="ep:position" /> |
| 44 | + <descriptions-item-label icon="ep:position" label="注册 IP" /> |
45 | 45 | </template>
|
46 | 46 | {{ user.registerIp }}
|
47 | 47 | </el-descriptions-item>
|
48 | 48 | <el-descriptions-item>
|
49 | 49 | <template #label>
|
50 |
| - <descriptions-item-label label="生日" icon="fa:birthday-cake" /> |
| 50 | + <descriptions-item-label icon="fa:birthday-cake" label="生日" /> |
51 | 51 | </template>
|
52 |
| - {{ user.birthday ? formatDate(user.birthday) : '空' }} |
| 52 | + {{ user.birthday ? formatDate(user.birthday as any) : '空' }} |
53 | 53 | </el-descriptions-item>
|
54 | 54 | <el-descriptions-item>
|
55 | 55 | <template #label>
|
56 |
| - <descriptions-item-label label="注册时间" icon="ep:calendar" /> |
| 56 | + <descriptions-item-label icon="ep:calendar" label="注册时间" /> |
57 | 57 | </template>
|
58 |
| - {{ user.createTime ? formatDate(user.createTime) : '空' }} |
| 58 | + {{ user.createTime ? formatDate(user.createTime as any) : '空' }} |
59 | 59 | </el-descriptions-item>
|
60 | 60 | <el-descriptions-item>
|
61 | 61 | <template #label>
|
62 |
| - <descriptions-item-label label="最后登录时间" icon="ep:calendar" /> |
| 62 | + <descriptions-item-label icon="ep:calendar" label="最后登录时间" /> |
63 | 63 | </template>
|
64 |
| - {{ user.loginDate ? formatDate(user.loginDate) : '空' }} |
| 64 | + {{ user.loginDate ? formatDate(user.loginDate as any) : '空' }} |
65 | 65 | </el-descriptions-item>
|
66 | 66 | </el-descriptions>
|
67 | 67 | </el-col>
|
68 | 68 | </el-row>
|
| 69 | + <template v-if="mode === 'kefu'"> |
| 70 | + <ElAvatar :size="140" :src="user.avatar || undefined" shape="square" /> |
| 71 | + <el-descriptions :column="1"> |
| 72 | + <el-descriptions-item> |
| 73 | + <template #label> |
| 74 | + <descriptions-item-label icon="ep:user" label="用户名" /> |
| 75 | + </template> |
| 76 | + {{ user.name || '空' }} |
| 77 | + </el-descriptions-item> |
| 78 | + <el-descriptions-item> |
| 79 | + <template #label> |
| 80 | + <descriptions-item-label icon="ep:user" label="昵称" /> |
| 81 | + </template> |
| 82 | + {{ user.nickname }} |
| 83 | + </el-descriptions-item> |
| 84 | + <el-descriptions-item label="手机号"> |
| 85 | + <template #label> |
| 86 | + <descriptions-item-label icon="ep:phone" label="手机号" /> |
| 87 | + </template> |
| 88 | + {{ user.mobile }} |
| 89 | + </el-descriptions-item> |
| 90 | + <el-descriptions-item> |
| 91 | + <template #label> |
| 92 | + <descriptions-item-label icon="fa:mars-double" label="性别" /> |
| 93 | + </template> |
| 94 | + <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="user.sex" /> |
| 95 | + </el-descriptions-item> |
| 96 | + <el-descriptions-item> |
| 97 | + <template #label> |
| 98 | + <descriptions-item-label icon="ep:location" label="所在地" /> |
| 99 | + </template> |
| 100 | + {{ user.areaName }} |
| 101 | + </el-descriptions-item> |
| 102 | + <el-descriptions-item> |
| 103 | + <template #label> |
| 104 | + <descriptions-item-label icon="ep:position" label="注册 IP" /> |
| 105 | + </template> |
| 106 | + {{ user.registerIp }} |
| 107 | + </el-descriptions-item> |
| 108 | + <el-descriptions-item> |
| 109 | + <template #label> |
| 110 | + <descriptions-item-label icon="fa:birthday-cake" label="生日" /> |
| 111 | + </template> |
| 112 | + {{ user.birthday ? formatDate(user.birthday as any) : '空' }} |
| 113 | + </el-descriptions-item> |
| 114 | + <el-descriptions-item> |
| 115 | + <template #label> |
| 116 | + <descriptions-item-label icon="ep:calendar" label="注册时间" /> |
| 117 | + </template> |
| 118 | + {{ user.createTime ? formatDate(user.createTime as any) : '空' }} |
| 119 | + </el-descriptions-item> |
| 120 | + <el-descriptions-item> |
| 121 | + <template #label> |
| 122 | + <descriptions-item-label icon="ep:calendar" label="最后登录时间" /> |
| 123 | + </template> |
| 124 | + {{ user.loginDate ? formatDate(user.loginDate as any) : '空' }} |
| 125 | + </el-descriptions-item> |
| 126 | + </el-descriptions> |
| 127 | + </template> |
69 | 128 | </el-card>
|
70 | 129 | </template>
|
71 |
| -<script setup lang="ts"> |
| 130 | +<script lang="ts" setup> |
72 | 131 | import { DICT_TYPE } from '@/utils/dict'
|
73 | 132 | import { formatDate } from '@/utils/formatTime'
|
74 | 133 | import * as UserApi from '@/api/member/user'
|
75 | 134 | import { DescriptionsItemLabel } from '@/components/Descriptions/index'
|
76 | 135 |
|
77 |
| -const { user } = defineProps<{ user: UserApi.UserVO }>() |
| 136 | +withDefaults(defineProps<{ user: UserApi.UserVO; mode?: string }>(), { |
| 137 | + mode: 'member' |
| 138 | +}) |
78 | 139 | </script>
|
79 |
| -<style scoped lang="scss"> |
| 140 | +<style lang="scss" scoped> |
80 | 141 | .card-header {
|
81 | 142 | display: flex;
|
82 | 143 | justify-content: space-between;
|
|
0 commit comments