This commit is contained in:
ygx
2026-03-28 15:44:57 +08:00
parent 1020699b8c
commit 877e3115c4
11 changed files with 497 additions and 167 deletions

View File

@@ -81,7 +81,7 @@
</a-button>
</a-tooltip>
</li>
<li>
<!-- <li>
<a-tooltip :content="t('settings.title')">
<a-button class="nav-btn" type="outline" :shape="'circle'" @click="setVisible">
<template #icon>
@@ -89,13 +89,25 @@
</template>
</a-button>
</a-tooltip>
</li>
</li> -->
<li>
<a-dropdown trigger="click">
<a-avatar :size="32" :style="{ marginRight: '8px' }">
<img alt="avatar" :src="avatar" />
</a-avatar>
<template #content>
<a-doption>
<a-space @click="handleOpenProfileChange">
<icon-user />
<span>个人资料</span>
</a-space>
</a-doption>
<a-doption>
<a-space @click="handleOpenPasswordChange">
<icon-lock />
<span>修改密码</span>
</a-space>
</a-doption>
<a-doption>
<a-space @click="handleLogout">
<icon-export />
@@ -108,6 +120,8 @@
</a-dropdown>
</li>
</ul>
<PasswordChange v-model:open="passwordChangeVisible" />
<ProfileChange v-model:open="profileChangeVisible" />
</div>
</template>
@@ -121,6 +135,8 @@ import { useDark, useFullscreen, useToggle } from '@vueuse/core'
import { computed, inject, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import MessageBox from '../message-box/index.vue'
import PasswordChange from '../password-change/index.vue'
import ProfileChange from '../profile-change/index.vue'
const { t } = useI18n()
@@ -157,6 +173,8 @@ const setVisible = () => {
}
const refBtn = ref()
const triggerBtn = ref()
const passwordChangeVisible = ref(false)
const profileChangeVisible = ref(false)
const setPopoverVisible = () => {
const event = new MouseEvent('click', {
view: window,
@@ -168,6 +186,12 @@ const setPopoverVisible = () => {
const handleLogout = () => {
logout()
}
const handleOpenPasswordChange = () => {
passwordChangeVisible.value = true
}
const handleOpenProfileChange = () => {
profileChangeVisible.value = true
}
const setDropDownVisible = () => {
const event = new MouseEvent('click', {
view: window,