Skip to content

Commit

Permalink
Merge pull request #48 from veops/dev_ui_241022
Browse files Browse the repository at this point in the history
feat(ui): add userPanel component
  • Loading branch information
LHRUN authored Oct 22, 2024
2 parents 643de23 + 53cc3b3 commit b7d791f
Show file tree
Hide file tree
Showing 9 changed files with 547 additions and 48 deletions.
31 changes: 3 additions & 28 deletions oneterm-ui/src/components/tools/UserMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,11 @@
<span class="common-settings-btn-text">{{ $t('settings') }}</span>
</span>
<a-popover
overlayClassName="lang-popover-wrap"
placement="bottomRight"
:getPopupContainer="(trigger) => trigger.parentNode"
>
<span class="locale">{{ languageList.find((lang) => lang.key === locale).title }}</span>
<div class="lang-menu" slot="content">
<a
v-for="(lang) in languageList"
:key="lang.key"
:class="['lang-menu-item', lang.key === locale ? 'lang-menu-item_active' : '']"
@click="changeLang(lang.key)"
>
{{ lang.title }}
</a>
</div>
</a-popover>
<a-popover
:overlayStyle="{ width: '130px' }"
placement="bottomRight"
overlayClassName="custom-user"
>
<template slot="content">
<router-link :to="{ name: 'setting_person' }" :style="{ color: '#000000a6' }">
<div class="custom-user-item">
<a-icon type="user" :style="{ marginRight: '10px' }" />
<span>{{ $t('topMenu.personalCenter') }}</span>
</div>
</router-link>
<div @click="handleLogout" class="custom-user-item">
<a-icon type="logout" :style="{ marginRight: '10px' }" />
<span>{{ $t('topMenu.logout') }}</span>
</div>
<UserPanel />
</template>
<span class="action ant-dropdown-link user-dropdown-menu user-info-wrap">
<a-avatar
Expand All @@ -63,11 +36,13 @@
import { mapState, mapActions, mapGetters, mapMutations } from 'vuex'
import DocumentLink from './DocumentLink.vue'
import { setDocumentTitle, domTitle } from '@/utils/domUtil'
import UserPanel from './userPanel.vue'

export default {
name: 'UserMenu',
components: {
DocumentLink,
UserPanel
},
data() {
return {
Expand Down
Loading

0 comments on commit b7d791f

Please sign in to comment.