remove unused
This commit is contained in:
1 parent
301dab1ca5
commit
ea1c3413a5
88 files changed
+29
-5766
No files matched your search
@@ -1,163 +0,0 @@
|
||||
<template>
|
||||
<el-row class="header">
|
||||
<el-col :md="4" :xs="24">
|
||||
<img src="@/assets/images/logo.svg" class="logo" @click="onHome" />
|
||||
</el-col>
|
||||
<el-col :md="16" :xs="12">
|
||||
<el-menu :default-active="active" class="el-menu-demo" mode="horizontal" @select="onSelect">
|
||||
<el-menu-item v-t="'common.nav.service'" index="/services"></el-menu-item>
|
||||
<el-menu-item v-t="'common.nav.document'" index="/documents"></el-menu-item>
|
||||
</el-menu>
|
||||
</el-col>
|
||||
<el-col :md="4" :xs="12">
|
||||
<div v-if="!$store.getters.authenticated" class="mt-4 pr-10">
|
||||
<el-button type="primary" class="float-right" size="small" round @click="onLogin">{{
|
||||
$t('common.button.login')
|
||||
}}</el-button>
|
||||
</div>
|
||||
<div v-else class="float-right">
|
||||
<div class="console" @click="onConsole">
|
||||
{{ $t('common.button.console') }}
|
||||
</div>
|
||||
<el-dropdown trigger="click">
|
||||
<img :src="user?.avatar || defaultAvatar" class="avatar" />
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="onProfile">{{ $t('common.button.profile') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click="onVerify">{{ $t('common.button.verify') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import defaultAvatar from '@/assets/images/avatar.png';
|
||||
import { getAuthBaseUrl } from '@/utils';
|
||||
import { ROUTE_AUTH_LOGIN, ROUTE_CONSOLE_ROOT, ROUTE_INDEX } from '@/router';
|
||||
import {
|
||||
ElContainer,
|
||||
ElAside,
|
||||
ElMain,
|
||||
ElCol,
|
||||
ElRow,
|
||||
ElDropdown,
|
||||
ElMenu,
|
||||
ElMenuItem,
|
||||
ElDropdownItem,
|
||||
ElButton
|
||||
} from 'element-plus';
|
||||
export default defineComponent({
|
||||
name: 'TopHeader',
|
||||
components: {
|
||||
ElCol,
|
||||
ElRow,
|
||||
ElDropdown,
|
||||
ElMenu,
|
||||
ElMenuItem,
|
||||
ElDropdownItem,
|
||||
ElButton
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultAvatar
|
||||
// defaultAvatar: new URL('@/assets/images/avatar.png', import.meta.url).href
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
active() {
|
||||
return this.$route.matched[0].path;
|
||||
},
|
||||
user() {
|
||||
return this.$store.getters.user;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelect(val: string) {
|
||||
this.$router.push(val);
|
||||
},
|
||||
onHome() {
|
||||
this.$router.push({
|
||||
name: ROUTE_INDEX
|
||||
});
|
||||
},
|
||||
onLogin() {
|
||||
this.$router.push({
|
||||
name: ROUTE_AUTH_LOGIN
|
||||
});
|
||||
},
|
||||
onProfile() {
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
window.open(`${authBaseUrl}/user/profile`, '_blank');
|
||||
},
|
||||
onVerify() {
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
window.open(`${authBaseUrl}/user/verify`, '_blank');
|
||||
},
|
||||
onConsole() {
|
||||
this.$router.push({
|
||||
name: ROUTE_CONSOLE_ROOT
|
||||
});
|
||||
},
|
||||
onLogout() {
|
||||
this.$store.dispatch('resetAuth');
|
||||
this.$router.push({
|
||||
name: ROUTE_INDEX
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
$height: 60px;
|
||||
.header {
|
||||
z-index: 999;
|
||||
width: 100%;
|
||||
background: radial-gradient(circle at 0 2%, #111827, #1a125d 99%);
|
||||
.logo {
|
||||
height: $height - 5px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
--el-menu-hover-bg-color: rgba(255, 255, 255, 0);
|
||||
--el-menu-active-color: white;
|
||||
background: none;
|
||||
border: none;
|
||||
.el-menu-item {
|
||||
height: $height;
|
||||
color: white;
|
||||
&.is-active {
|
||||
border-bottom: 3px solid var(--el-menu-active-color);
|
||||
}
|
||||
&:hover {
|
||||
border-bottom: 3px solid var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.avatar {
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
margin-right: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.console {
|
||||
color: white;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
margin: 0 10px;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user