Commit 9854debaff1cdbf4afabd2012ea3a74b29225200

Authored by fengwotao
1 parent 3731f6aa

perf(src/components): 优化个人头像展示

1 1 <template>
2 2 <n-dropdown trigger="hover" @select="handleSelect" :show-arrow="true" :options="options">
3 3 <div class="user-info-box">
4   - <person-icon v-if="fallback"></person-icon>
  4 + <person-icon v-if="!avatarLogo"></person-icon>
5 5 <n-avatar
6   - v-if="!fallback"
  6 + v-else
7 7 round
8 8 object-fit="cover"
9 9 size="medium"
... ... @@ -20,24 +20,26 @@
20 20 </template>
21 21
22 22 <script lang="ts" setup>
23   -import { h, ref, computed } from 'vue'
  23 +import { h, ref, onMounted } from 'vue'
24 24 import { NAvatar, NText } from 'naive-ui'
25 25 import { renderIcon } from '@/utils'
26   -import { logout, renderLang } from '@/utils'
  26 +import { renderLang } from '@/utils'
27 27 import { GoSystemSet } from '@/components/GoSystemSet/index'
28 28 import { GoSystemInfo } from '@/components/GoSystemInfo/index'
29 29 import Person from './person.png'
30 30 import { icon } from '@/plugins'
31 31 import { useUserStore } from '@/store/external/modules/user'
32 32 import { useSyncRemote } from '@/views/chart/hooks/external/useRemote.hook'
33   -const { ChatboxEllipsesIcon, PersonIcon, LogOutOutlineIcon, SettingsSharpIcon } = icon.ionicons5
  33 +const { PersonIcon, LogOutOutlineIcon, SettingsSharpIcon } = icon.ionicons5
34 34
35 35 const t = window['$t']
36 36
37 37 const { dataSyncUpdate } = useSyncRemote()
38 38
39 39 const modelShowInfo = ref(false)
  40 +
40 41 const modelShow = ref(false)
  42 +
41 43 const avatarLogo = ref('')
42 44
43 45 // 是否失败
... ... @@ -69,6 +71,11 @@ const renderUserInfo = () => {
69 71 ]
70 72 )
71 73 }
  74 +
  75 +onMounted(() => {
  76 + renderUserInfo()
  77 +})
  78 +
72 79 const options = ref([
73 80 {
74 81 label: '我的信息',
... ... @@ -124,6 +131,7 @@ const sysInfoHandle = () => {
124 131
125 132 // THINGS_KIT 修改退出登录
126 133 const userStore = useUserStore()
  134 +
127 135 const handleSelect = (key: string) => {
128 136 switch (key) {
129 137 case 'contact':
... ...