|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="navbar">
|
|
|
- <div class="pageTitle">{{this.$route.meta.title}}</div>
|
|
|
+ <div class="pageTitle">{{ this.$route.meta.title }}</div>
|
|
|
<!--收缩左侧菜单按钮-->
|
|
|
<!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
|
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
|
|
@@ -16,12 +16,45 @@
|
|
|
</el-tooltip>
|
|
|
<lang-select class="right-menu-item hover-effect" />
|
|
|
</template> -->
|
|
|
+ <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
+ <div class="avatar-wrapper">
|
|
|
+
|
|
|
+ <!-- <img src="@/assets/public/nav/notice.png" class="user-notice"></img> -->
|
|
|
+ <span
|
|
|
+ style="display: inline-block; width: 40px; height: 40px; border-radius: 50%; background-color: red; color: white; text-align: center; line-height: 40px; font-size: 12px;">{{
|
|
|
+ msg.count }}</span>
|
|
|
+ <img src="@/assets/public/nav/arrowDown.png" class="arrowDown">
|
|
|
+ <!--向下按钮-->
|
|
|
+ <!-- <i class="el-icon-caret-bottom" /> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dropdown-menu slot="dropdown" style="width: 200px;">
|
|
|
+ <router-link to="/examine">
|
|
|
+ <div class="userMenuDownItem">
|
|
|
+ <el-dropdown-item>
|
|
|
+ <span style="display:block;">审核列表</span>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </div>
|
|
|
+ </router-link>
|
|
|
+ <router-link :to="`/creatNews?id=${item.id}`" v-for="item in msg.apply_articale" :key="item.id">
|
|
|
+ <div class="userMenuDownItem" style="width: 200px;">
|
|
|
+ <el-dropdown-item divided style="width: 200px;">
|
|
|
+ <el-tooltip :content="item.title" effect="dark" placement="top">
|
|
|
+ <span style="display:block;width: 150px;" :alt="item.title">{{ item.title.substring(0, 10) }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </div>
|
|
|
+ </router-link>
|
|
|
+
|
|
|
+
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
<div class="avatar-wrapper">
|
|
|
<!-- <img src="@/assets/public/nav/notice.png" class="user-notice"> -->
|
|
|
- <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar" v-if="avatar!=''">
|
|
|
+ <img :src="avatar + '?imageView2/1/w/80/h/80'" class="user-avatar" v-if="avatar != ''">
|
|
|
<img src="@/assets/login/userDefault.png" class="user-avatar" v-else>
|
|
|
- <span class="userName">{{this.$store.state.user.name}}</span>
|
|
|
+ <span class="userName">{{ this.$store.state.user.name }}</span>
|
|
|
<img src="@/assets/public/nav/arrowDown.png" class="arrowDown">
|
|
|
<!--向下按钮-->
|
|
|
<!-- <i class="el-icon-caret-bottom" /> -->
|
|
@@ -49,7 +82,7 @@
|
|
|
</a> -->
|
|
|
<el-dropdown-item divided @click.native="logout">
|
|
|
<div class="userMenuDownItem">
|
|
|
- <span style="display:block;">{{$t('navbar.logOut')}}</span>
|
|
|
+ <span style="display:block;">{{ $t('navbar.logOut') }}</span>
|
|
|
<img src="@/assets/public/nav/Logout.png">
|
|
|
</div>
|
|
|
</el-dropdown-item>
|
|
@@ -82,6 +115,11 @@ export default {
|
|
|
LangSelect,
|
|
|
Search
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ msg: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters([
|
|
|
'sidebar',
|
|
@@ -89,7 +127,19 @@ export default {
|
|
|
'device'
|
|
|
]),
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getMsg();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getMsg() {
|
|
|
+ this.$store.dispatch('news/getMSG').then(response => {
|
|
|
+ console.log(response);
|
|
|
+ this.msg = response.data;
|
|
|
+ console.log(this.msg);
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
toggleSideBar() {
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
},
|
|
@@ -114,7 +164,7 @@ export default {
|
|
|
// this.$router.push(`/login`);
|
|
|
// });
|
|
|
|
|
|
- axios.get(BASEURL.WebCLogoutUrl, {params:{token:token} }).then(response => {
|
|
|
+ axios.get(BASEURL.WebCLogoutUrl, { params: { token: token } }).then(response => {
|
|
|
console.log(response);
|
|
|
this.$store.commit("user/LOGOUT");
|
|
|
this.$router.push(`/login`);
|
|
@@ -123,7 +173,7 @@ export default {
|
|
|
this.$store.commit("user/LOGOUT");
|
|
|
this.$router.push(`/login`);
|
|
|
this.$message.error(response.message);
|
|
|
- });
|
|
|
+ });
|
|
|
},
|
|
|
getTokenFromCookie() {
|
|
|
const name = "Admin-Token=";
|
|
@@ -146,12 +196,12 @@ export default {
|
|
|
height: 60px;
|
|
|
overflow: hidden;
|
|
|
position: relative;
|
|
|
- display:flex;
|
|
|
+ display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
background: #fff;
|
|
|
// box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
|
|
- border-bottom:1px solid #E9EDF7;
|
|
|
+ border-bottom: 1px solid #E9EDF7;
|
|
|
|
|
|
.pageTitle {
|
|
|
font-size: 20px;
|
|
@@ -162,7 +212,7 @@ export default {
|
|
|
|
|
|
.userName {
|
|
|
font-size: 14px;
|
|
|
- color:#1C1D22;
|
|
|
+ color: #1C1D22;
|
|
|
margin-left: 10px;
|
|
|
font-weight: bold;
|
|
|
}
|
|
@@ -174,7 +224,7 @@ export default {
|
|
|
float: left;
|
|
|
cursor: pointer;
|
|
|
transition: background .3s;
|
|
|
- -webkit-tap-highlight-color:transparent;
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
|
|
|
&:hover {
|
|
|
background: rgba(0, 0, 0, .025)
|
|
@@ -232,15 +282,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
.arrowDown {
|
|
|
- width:12px;
|
|
|
- height:8px;
|
|
|
- margin-left:10px;
|
|
|
+ width: 12px;
|
|
|
+ height: 8px;
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
|
|
|
.user-notice {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
- margin-right:20px;
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
|
|
|
|
.el-icon-caret-bottom {
|
|
@@ -254,15 +304,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.userMenuDownItem {
|
|
|
width: 100px;
|
|
|
- display:flex;
|
|
|
+ display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
+
|
|
|
.el-dropdown-menu__item:not(.is-disabled):hover {
|
|
|
background: none;
|
|
|
- color:#606266;
|
|
|
+ color: #606266;
|
|
|
}
|
|
|
-
|
|
|
</style>
|