2024-03-31 15:51:00 +08:00
|
|
|
<template>
|
2024-04-06 00:24:57 +08:00
|
|
|
<a-layout-header class="header">
|
|
|
|
|
<div class="header_crumb">
|
2024-04-06 15:43:15 +08:00
|
|
|
<div class="menu_fold">
|
|
|
|
|
<a-button size="mini" type="text" class="menu_fold_icon">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-menu-fold :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
2024-04-06 00:24:57 +08:00
|
|
|
<div class="breadcrumb">
|
|
|
|
|
<a-space direction="vertical">
|
|
|
|
|
<a-breadcrumb>
|
|
|
|
|
<a-breadcrumb-item>
|
|
|
|
|
<icon-home />
|
|
|
|
|
首页
|
|
|
|
|
</a-breadcrumb-item>
|
|
|
|
|
<a-breadcrumb-item>
|
|
|
|
|
<icon-at />
|
|
|
|
|
常用组件
|
|
|
|
|
</a-breadcrumb-item>
|
|
|
|
|
<a-breadcrumb-item>
|
|
|
|
|
<icon-at />
|
|
|
|
|
文件上传
|
|
|
|
|
</a-breadcrumb-item>
|
|
|
|
|
</a-breadcrumb>
|
|
|
|
|
</a-space>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="header_setting">
|
|
|
|
|
<a-tooltip content="语言">
|
2024-04-06 15:43:15 +08:00
|
|
|
<a-button size="mini" type="text" class="icon_btn">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-language :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-06 00:24:57 +08:00
|
|
|
</a-tooltip>
|
|
|
|
|
<a-tooltip content="切换黑夜模式">
|
2024-04-06 15:43:15 +08:00
|
|
|
<a-button size="mini" type="text" class="icon_btn">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-sun-fill :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-06 00:24:57 +08:00
|
|
|
</a-tooltip>
|
2024-04-07 00:06:15 +08:00
|
|
|
<a-popover position="bottom" trigger="click">
|
|
|
|
|
<a-button size="mini" type="text" class="icon_btn notice">
|
2024-04-06 15:43:15 +08:00
|
|
|
<template #icon>
|
|
|
|
|
<icon-notification :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-07 00:06:15 +08:00
|
|
|
<template #content><Notice /></template>
|
|
|
|
|
</a-popover>
|
2024-04-06 00:24:57 +08:00
|
|
|
<a-tooltip content="全屏">
|
2024-04-06 15:43:15 +08:00
|
|
|
<a-button size="mini" type="text" class="icon_btn">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-fullscreen :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-06 00:24:57 +08:00
|
|
|
</a-tooltip>
|
|
|
|
|
<a-tooltip content="系统设置">
|
2024-04-06 15:43:15 +08:00
|
|
|
<a-button size="mini" type="text" class="icon_btn">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-settings :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-06 00:24:57 +08:00
|
|
|
</a-tooltip>
|
|
|
|
|
<a-tooltip content="主题设置">
|
2024-04-06 15:43:15 +08:00
|
|
|
<a-button size="mini" type="text" class="icon_btn">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-skin :size="18" />
|
|
|
|
|
</template>
|
|
|
|
|
</a-button>
|
2024-04-06 00:24:57 +08:00
|
|
|
</a-tooltip>
|
2024-04-06 18:45:01 +08:00
|
|
|
<!-- 我的 -->
|
|
|
|
|
<a-dropdown trigger="hover">
|
|
|
|
|
<div class="my_setting">
|
2024-04-08 00:13:27 +08:00
|
|
|
<a-image width="32" height="32" fit="cover" :src="myImage" class="my_image" />
|
2024-04-06 18:45:01 +08:00
|
|
|
<span>admin</span>
|
|
|
|
|
<div class="icon_down">
|
|
|
|
|
<icon-down style="stroke-width: 3" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<template #content>
|
|
|
|
|
<a-doption>
|
2024-04-07 00:06:15 +08:00
|
|
|
<template #default>
|
|
|
|
|
<SvgIcon :name="'user'" :size="18" />
|
|
|
|
|
<span class="margin-left-text">个人信息</span>
|
2024-04-06 18:45:01 +08:00
|
|
|
</template>
|
|
|
|
|
</a-doption>
|
|
|
|
|
<a-doption>
|
2024-04-07 00:06:15 +08:00
|
|
|
<template #default>
|
|
|
|
|
<SvgIcon :name="'lock-pwd'" :size="18" />
|
|
|
|
|
<span class="margin-left-text">修改密码</span>
|
2024-04-06 18:45:01 +08:00
|
|
|
</template>
|
|
|
|
|
</a-doption>
|
|
|
|
|
<a-doption>
|
2024-04-07 00:06:15 +08:00
|
|
|
<template #default>
|
|
|
|
|
<SvgIcon :name="'gitee'" :size="18" />
|
|
|
|
|
<span class="margin-left-text">项目地址</span>
|
2024-04-06 18:45:01 +08:00
|
|
|
</template>
|
|
|
|
|
</a-doption>
|
|
|
|
|
<a-divider margin="0" />
|
2024-04-10 00:20:31 +08:00
|
|
|
<a-doption @click="logOut">
|
2024-04-07 00:06:15 +08:00
|
|
|
<template #default>
|
|
|
|
|
<SvgIcon :name="'exit'" :size="18" />
|
|
|
|
|
<span class="margin-left-text">退出登录</span>
|
2024-04-06 18:45:01 +08:00
|
|
|
</template>
|
|
|
|
|
</a-doption>
|
|
|
|
|
</template>
|
|
|
|
|
</a-dropdown>
|
2024-04-06 00:24:57 +08:00
|
|
|
</div>
|
|
|
|
|
</a-layout-header>
|
2024-03-31 15:51:00 +08:00
|
|
|
</template>
|
2024-04-06 00:24:57 +08:00
|
|
|
<script setup lang="ts">
|
2024-04-07 00:06:15 +08:00
|
|
|
import Notice from "@/layout/components/Header/components/Notice/index.vue";
|
2024-04-08 00:13:27 +08:00
|
|
|
import myImage from "@/assets/img/my-image.jpg";
|
2024-04-10 00:20:31 +08:00
|
|
|
import { Modal } from "@arco-design/web-vue";
|
|
|
|
|
import { useRouter } from "vue-router";
|
2024-04-11 13:07:43 +08:00
|
|
|
import pinia from "@/store/index";
|
|
|
|
|
import { useUserInfoStore } from "@/store/user-info";
|
2024-04-10 00:20:31 +08:00
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const logOut = () => {
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: "提示",
|
|
|
|
|
content: "确定退出登录?",
|
|
|
|
|
hideCancel: false,
|
|
|
|
|
closable: true,
|
2024-04-11 13:07:43 +08:00
|
|
|
onBeforeOk: async () => {
|
2024-04-10 00:20:31 +08:00
|
|
|
try {
|
2024-04-11 13:07:43 +08:00
|
|
|
const store = useUserInfoStore(pinia);
|
|
|
|
|
await store.logOut();
|
2024-04-10 00:20:31 +08:00
|
|
|
router.replace("/login");
|
|
|
|
|
return true;
|
|
|
|
|
} catch {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2024-04-06 00:24:57 +08:00
|
|
|
</script>
|
2024-03-31 15:51:00 +08:00
|
|
|
|
2024-04-02 21:00:21 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.header {
|
|
|
|
|
height: 60px;
|
2024-04-06 00:24:57 +08:00
|
|
|
padding: 0 $padding;
|
2024-04-02 21:00:21 +08:00
|
|
|
box-sizing: border-box;
|
2024-04-06 00:24:57 +08:00
|
|
|
border-bottom: $border-1 solid $color-border-2;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.header_crumb {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.menu_fold {
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
align-items: center;
|
2024-04-06 15:43:15 +08:00
|
|
|
.menu_fold_icon {
|
|
|
|
|
color: $color-text-1;
|
|
|
|
|
border-radius: $radius-box;
|
|
|
|
|
}
|
2024-04-06 00:24:57 +08:00
|
|
|
}
|
|
|
|
|
.breadcrumb {
|
|
|
|
|
margin-left: $margin;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.header_setting {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
2024-04-06 15:43:15 +08:00
|
|
|
> .icon_btn {
|
|
|
|
|
width: $icon-box;
|
|
|
|
|
height: $icon-box;
|
|
|
|
|
border-radius: $radius-box;
|
2024-04-06 00:24:57 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
|
margin-left: $margin;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
align-items: center;
|
2024-04-06 15:43:15 +08:00
|
|
|
color: $color-text-1;
|
2024-04-06 00:24:57 +08:00
|
|
|
}
|
2024-04-06 15:43:15 +08:00
|
|
|
|
2024-04-06 18:45:01 +08:00
|
|
|
.my_setting {
|
2024-04-06 00:24:57 +08:00
|
|
|
height: 32px;
|
2024-04-06 15:43:15 +08:00
|
|
|
margin-left: $margin;
|
2024-04-06 00:24:57 +08:00
|
|
|
overflow: hidden;
|
2024-04-06 18:45:01 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.my_image {
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
.icon_down {
|
|
|
|
|
transform: rotate(0deg);
|
|
|
|
|
margin: 0 0 0 5px;
|
|
|
|
|
transition: transform 0.2s;
|
|
|
|
|
}
|
2024-04-06 00:24:57 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-04-02 21:00:21 +08:00
|
|
|
}
|
2024-04-07 00:06:15 +08:00
|
|
|
.notice {
|
|
|
|
|
position: relative;
|
|
|
|
|
&::before {
|
|
|
|
|
content: "";
|
|
|
|
|
width: 6px;
|
|
|
|
|
height: 6px;
|
|
|
|
|
border: 2px solid #fff;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: -2px;
|
|
|
|
|
top: -4px;
|
|
|
|
|
background: $color-danger;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-06 18:45:01 +08:00
|
|
|
:deep(.arco-dropdown-open) {
|
|
|
|
|
.icon_down {
|
|
|
|
|
transform: rotate(180deg) !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-02 21:00:21 +08:00
|
|
|
</style>
|