2024-10-23 09:55:22 +00:00
|
|
|
<!--<template>-->
|
|
|
|
<!-- <div style=" height: 70px; width: 1248px; display: flex;-->
|
|
|
|
<!-- justify-content: space-between; align-items: center;">-->
|
|
|
|
<!-- <div style=" display: flex; justify-content: center;-->
|
|
|
|
<!-- align-items: center; margin-left: 10px">-->
|
|
|
|
<!-- <el-icon @click="changeState" v-show="showLog" size="20px" style="margin-right: 10px"><Expand/></el-icon>-->
|
|
|
|
<!-- <el-icon @click="changeState" v-show="!showLog" size="20px" style="margin-right: 10px"><Fold /></el-icon>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-breadcrumb separator="/">-->
|
|
|
|
<!-- <el-breadcrumb-item :to="{ path: currentPath}">{{ strArr[0] }}</el-breadcrumb-item>-->
|
|
|
|
<!-- <el-breadcrumb-item><a :href="currentPath">{{ strArr[1] }}</a></el-breadcrumb-item>-->
|
|
|
|
<!-- </el-breadcrumb>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
<!-- <div :style="{display: 'flex', justifyContent:'center', alignItems: 'center', marginRight: offset + 'px'}">-->
|
|
|
|
<!-- <el-avatar style="margin-right: 10px">-->
|
|
|
|
<!-- <img src="../assets/admin.jpg" alt="">-->
|
|
|
|
<!-- </el-avatar>-->
|
|
|
|
|
|
|
|
<!-- <el-dropdown style="cursor: pointer;" size="default">-->
|
|
|
|
<!-- <span class="el-dropdown-link" style="font-size: 16px; font-weight: bold;">-->
|
|
|
|
<!-- <span>{{ currentUser.username }}</span><el-icon class="el-icon--right"><arrow-down /></el-icon>-->
|
|
|
|
<!-- </span>-->
|
|
|
|
<!-- <template #dropdown>-->
|
|
|
|
<!-- <el-dropdown-menu>-->
|
|
|
|
<!-- <el-dropdown-item @click="$router.push('/manage/person')">个人信息</el-dropdown-item>-->
|
|
|
|
<!-- <el-dropdown-item @click="logout">退出登录</el-dropdown-item>-->
|
|
|
|
<!-- </el-dropdown-menu>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </el-dropdown>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!--</template>-->
|
|
|
|
|
|
|
|
<!--<script setup lang="ts">-->
|
|
|
|
<!--import {computed, onMounted, ref} from 'vue'-->
|
|
|
|
<!--import emitter from '@/utils/emitter'-->
|
|
|
|
<!--import { useRouter} from 'vue-router';-->
|
|
|
|
<!--import { ElMessage } from 'element-plus';-->
|
|
|
|
<!--import { pathInfo } from '@/store/pathInfo'-->
|
|
|
|
<!--const pathStore = pathInfo()-->
|
|
|
|
<!--const strArr = computed(() => pathStore.currentPathName.split('/'))-->
|
|
|
|
<!--const currentPath = computed(() => pathStore.currentPath)-->
|
|
|
|
|
|
|
|
<!--const router = useRouter()-->
|
|
|
|
<!--const offset = ref(20)-->
|
|
|
|
<!--const showLog = ref(false)-->
|
|
|
|
<!--const currentUser = ref('')-->
|
|
|
|
|
|
|
|
<!--onMounted(() => {-->
|
|
|
|
<!-- currentUser.value = JSON.parse(localStorage.getItem('user'))-->
|
|
|
|
<!--})-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--const changeState = () => {-->
|
|
|
|
<!-- showLog.value = !showLog.value-->
|
|
|
|
<!-- emitter.emit('Aside', showLog.value)-->
|
|
|
|
<!-- if(showLog.value){-->
|
|
|
|
<!-- offset.value = -116-->
|
|
|
|
<!-- }else{-->
|
|
|
|
<!-- offset.value = 20-->
|
|
|
|
<!-- }-->
|
|
|
|
<!--}-->
|
|
|
|
|
|
|
|
<!--const logout = () => {-->
|
|
|
|
<!-- ElMessage({-->
|
|
|
|
<!-- message: '退出成功',-->
|
|
|
|
<!-- type: 'success'-->
|
|
|
|
<!-- })-->
|
|
|
|
<!-- router.push('/login')-->
|
|
|
|
<!-- localStorage.removeItem('user')-->
|
|
|
|
<!--}-->
|
|
|
|
|
|
|
|
<!--</script>-->
|
|
|
|
|
|
|
|
<!--<style scoped>-->
|
|
|
|
<!--:deep(.el-tooltip__trigger:focus-visible) {-->
|
|
|
|
<!-- outline: unset;-->
|
|
|
|
<!--}-->
|
|
|
|
|
|
|
|
<!--</style>-->
|
|
|
|
<template>
|
2024-10-29 02:51:27 +00:00
|
|
|
<div style=" height: 70px; width: 1248px; display: flex;
|
2024-10-23 09:55:22 +00:00
|
|
|
justify-content: space-between; align-items: center;">
|
2024-10-29 02:51:27 +00:00
|
|
|
<div style=" display: flex; justify-content: center;
|
2024-10-23 09:55:22 +00:00
|
|
|
align-items: center; margin-left: 10px">
|
2024-10-29 02:51:27 +00:00
|
|
|
<el-icon @click="changeState" v-show="showLog" size="20px" style="margin-right: 10px">
|
|
|
|
<Expand />
|
|
|
|
</el-icon>
|
|
|
|
<el-icon @click="changeState" v-show="!showLog" size="20px" style="margin-right: 10px">
|
|
|
|
<Fold />
|
|
|
|
</el-icon>
|
|
|
|
|
|
|
|
|
|
|
|
<el-breadcrumb separator="/">
|
|
|
|
<a-breadcrumb-item>{{ route.name }}</a-breadcrumb-item>
|
|
|
|
</el-breadcrumb>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div :style="{ display: 'flex', justifyContent: 'center', alignItems: 'center', marginRight: offset + 'px' }">
|
|
|
|
<el-avatar style="margin-right: 10px">
|
|
|
|
<img :src="store.loginUser.userAvatar" alt="">
|
|
|
|
</el-avatar>
|
|
|
|
|
|
|
|
<el-dropdown style="cursor: pointer;" size="default">
|
|
|
|
<span class="el-dropdown-link" style="font-size: 16px; font-weight: bold;">
|
|
|
|
<span>{{ store.loginUser.userName }}</span><el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
|
|
</span>
|
|
|
|
<template #dropdown>
|
|
|
|
<el-dropdown-menu>
|
|
|
|
<el-dropdown-item @click="$router.push('/PersonalCenter')">个人信息</el-dropdown-item>
|
|
|
|
<el-dropdown-item @click="logout">退出登录</el-dropdown-item>
|
|
|
|
</el-dropdown-menu>
|
|
|
|
</template>
|
|
|
|
</el-dropdown>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-10-23 09:55:22 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-10-29 02:51:27 +00:00
|
|
|
import { ref } from 'vue'
|
|
|
|
import emitter from '@/utils/emitter'
|
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
|
import myAxios from '@/api/myAxios';
|
|
|
|
import { userStore } from '@/store/userStore';
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
const route = useRoute();
|
|
|
|
const offset = ref(20)
|
|
|
|
const showLog = ref(false)
|
|
|
|
const store = userStore()
|
|
|
|
|
|
|
|
|
|
|
|
const logout = async () => {
|
|
|
|
const res: any = await myAxios.post("/user/logout", {})
|
|
|
|
if (res.data.code == 1 && res.data) {
|
|
|
|
store.$reset()
|
|
|
|
await router.replace('/')
|
|
|
|
ElMessage({
|
|
|
|
type: 'info',
|
|
|
|
message: '登出成功',
|
|
|
|
})
|
2024-10-23 09:55:22 +00:00
|
|
|
}
|
2024-10-29 02:51:27 +00:00
|
|
|
}
|
|
|
|
const changeState = () => {
|
|
|
|
showLog.value = !showLog.value
|
|
|
|
emitter.emit('Aside', showLog.value)
|
|
|
|
if (showLog.value) {
|
|
|
|
offset.value = -116
|
|
|
|
} else {
|
|
|
|
offset.value = 20
|
2024-10-23 09:55:22 +00:00
|
|
|
}
|
2024-10-29 02:51:27 +00:00
|
|
|
}
|
2024-10-23 09:55:22 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2024-10-29 02:51:27 +00:00
|
|
|
:deep(.el-tooltip__trigger:focus-visible) {
|
|
|
|
outline: unset;
|
|
|
|
}
|
2024-10-23 09:55:22 +00:00
|
|
|
</style>
|