11<script lang="ts" setup>
22import { ref } from ' vue'
3- import Default_avatar from ' @/assets/svg/icon-member-default.svg '
3+ import Default_avatar from ' @/assets/workspace/default_avatar.png '
44import icon_admin_outlined from ' @/assets/svg/icon_admin_outlined.svg'
55import icon_maybe_outlined from ' @/assets/svg/icon-maybe_outlined.svg'
66import icon_key_outlined from ' @/assets/svg/icon-key_outlined.svg'
77import icon_translate_outlined from ' @/assets/svg/icon_translate_outlined.svg'
88import icon_logout_outlined from ' @/assets/svg/icon_logout_outlined.svg'
99import icon_right_outlined from ' @/assets/svg/icon_right_outlined.svg'
1010import icon_done_outlined from ' @/assets/svg/icon_done_outlined.svg'
11+ import { useI18n } from ' vue-i18n'
1112
1213defineProps ({
1314 collapse: { type: [Boolean ], required: true },
1415})
1516
17+ const { t } = useI18n ()
1618const name = ref (' 飞小致' )
1719const currentLanguage = ref (' zh-CN' )
1820const emit = defineEmits ([' selectPerson' ])
@@ -22,11 +24,11 @@ const languageList = [
2224 value: ' en' ,
2325 },
2426 {
25- name: ' 简体中文 ' ,
27+ name: t ( ' common.simplified_chinese ' ) ,
2628 value: ' zh-CN' ,
2729 },
2830 {
29- name: ' 繁體中文 ' ,
31+ name: t ( ' common.traditional_chinese ' ) ,
3032 value: ' zh-CN' ,
3133 },
3234]
@@ -43,40 +45,36 @@ const handleDefaultLanguageChange = (item: any) => {
4345 <el-popover popper-class =" system-person" :placement =" collapse ? 'right' : 'top'" >
4446 <template #reference >
4547 <button class =" person" :class =" collapse && 'collapse'" >
46- <el-icon size =" 32" class =" default-avatar" >
47- <Default _avatar ></Default _avatar >
48- </el-icon >
48+ <img class =" default-avatar" :src =" Default_avatar" width =" 32px" height =" 32px" />
4949 <span v-if =" !collapse" class =" name" >{{ name }}</span >
5050 </button ></template
5151 >
5252 <div class =" popover" >
5353 <div class =" popover-content" >
5454 <div class =" info" >
55- <el-icon style =" transform : scale (1.25 )" size =" 32" >
56- <Default _avatar ></Default _avatar >
57- </el-icon >
55+ <img :src =" Default_avatar" width =" 40px" height =" 40px" />
5856 <div class =" top" >{{ name }}</div >
5957 <div class =" bottom" >feixaozhi</div >
6058 </div >
6159 <div class =" popover-item" @click =" handlePersonChange" >
6260 <el-icon size =" 16" >
6361 <icon _admin_outlined ></icon _admin_outlined >
6462 </el-icon >
65- <div class =" datasource-name" >系统管理 </div >
63+ <div class =" datasource-name" >{{ $t('common.system_manage') }} </div >
6664 </div >
6765 <div class =" popover-item" >
6866 <el-icon size =" 16" >
6967 <icon _key_outlined ></icon _key_outlined >
7068 </el-icon >
71- <div class =" datasource-name" >修改密码 </div >
69+ <div class =" datasource-name" >{{ $t('user.change_password') }} </div >
7270 </div >
7371 <el-popover :teleported =" false" popper-class =" system-language" placement =" right" >
7472 <template #reference >
7573 <div class =" popover-item" >
7674 <el-icon size =" 16" >
7775 <icon _translate_outlined ></icon _translate_outlined >
7876 </el-icon >
79- <div class =" datasource-name" >语言 </div >
77+ <div class =" datasource-name" >{{ $t('common.language') }} </div >
8078 <el-icon style =" transform : scale (1.33 )" class =" right" size =" 16" >
8179 <icon _right_outlined ></icon _right_outlined >
8280 </el-icon >
@@ -102,13 +100,13 @@ const handleDefaultLanguageChange = (item: any) => {
102100 <el-icon size =" 16" >
103101 <icon _maybe_outlined ></icon _maybe_outlined >
104102 </el-icon >
105- <div class =" datasource-name" >帮助 </div >
103+ <div class =" datasource-name" >{{ $t('common.help') }} </div >
106104 </div >
107105 <div class =" popover-item mr4" >
108106 <el-icon size =" 16" >
109107 <icon _logout_outlined ></icon _logout_outlined >
110108 </el-icon >
111- <div class =" datasource-name" >退出登录 </div >
109+ <div class =" datasource-name" >{{ $t('common.logout') }} </div >
112110 </div >
113111 </div >
114112 </div >
@@ -117,7 +115,6 @@ const handleDefaultLanguageChange = (item: any) => {
117115
118116<style lang="less" scoped>
119117.person {
120- border-radius : 6px ;
121118 padding : 0 8px ;
122119 display : flex ;
123120 align-items : center ;
@@ -126,6 +123,7 @@ const handleDefaultLanguageChange = (item: any) => {
126123 height : 40px ;
127124 border : none ;
128125 background-color : transparent ;
126+ position : relative ;
129127
130128 & .collapse {
131129 min-width : 48px ;
@@ -149,15 +147,28 @@ const handleDefaultLanguageChange = (item: any) => {
149147 margin-left : 8px ;
150148 }
151149
150+ & ::after {
151+ content : ' ' ;
152+ position : absolute ;
153+ top : 50% ;
154+ left : 50% ;
155+ transform : translate (-50% , -50% );
156+ width : 100% ;
157+ height : 100% ;
158+ border-radius : 6px ;
159+ }
160+
152161 & :hover ,
153- & :active {
154- background : #1f23291a ;
155- border : 1px solid #1f23291a ;
162+ & :focus {
163+ & ::after {
164+ background : #1f23291a ;
165+ }
156166 }
157167
158168 & :active {
159- background : #1f232926 ;
160- border : 1px solid #1f23291a ;
169+ & ::after {
170+ background : #1f232926 ;
171+ }
161172 }
162173}
163174 </style >
@@ -195,9 +206,9 @@ const handleDefaultLanguageChange = (item: any) => {
195206 height : 62px ;
196207 padding : 8px ;
197208
198- .ed-icon {
199- margin : 6px 8px 0 7px ;
209+ img {
200210 float : left ;
211+ margin : 3px 8px 0 7px ;
201212 }
202213
203214 .top {
0 commit comments