|
@ -7,7 +7,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4" class="rightbar"> |
|
|
<el-col :span="4" class="rightbar"> |
|
|
<el-dropdown trigger="click"> |
|
|
<el-dropdown trigger="click"> |
|
|
<span class="el-dropdown-link" style="color:#c0ccda;cursor: pointer;"><img src="../assets/user.png" class="head"> 张某某 |
|
|
|
|
|
|
|
|
<span class="el-dropdown-link" style="color:#c0ccda;cursor: pointer;"><img :src="this.sysUserAvatar" class="head"> {{sysUserName}} |
|
|
</span> |
|
|
</span> |
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
<el-dropdown-item>我的消息</el-dropdown-item> |
|
|
<el-dropdown-item>我的消息</el-dropdown-item> |
|
@ -82,6 +82,8 @@ |
|
|
currentPath: '/table', |
|
|
currentPath: '/table', |
|
|
currentPathName: 'Table', |
|
|
currentPathName: 'Table', |
|
|
currentPathNameParent: '导航一', |
|
|
currentPathNameParent: '导航一', |
|
|
|
|
|
sysUserName: '', |
|
|
|
|
|
sysUserAvatar: '', |
|
|
form: { |
|
|
form: { |
|
|
name: '', |
|
|
name: '', |
|
|
region: '', |
|
|
region: '', |
|
@ -94,13 +96,13 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// watch: { |
|
|
|
|
|
// '$route'(to, from) {//监听路由改变 |
|
|
|
|
|
// this.currentPath = to.path; |
|
|
|
|
|
// this.currentPathName = to.name; |
|
|
|
|
|
// this.currentPathNameParent = to.matched[0].name; |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
'$route'(to, from) {//监听路由改变 |
|
|
|
|
|
this.currentPath = to.path; |
|
|
|
|
|
this.currentPathName = to.name; |
|
|
|
|
|
this.currentPathNameParent = to.matched[0].name; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
onSubmit() { |
|
|
onSubmit() { |
|
|
console.log('submit!'); |
|
|
console.log('submit!'); |
|
@ -119,7 +121,7 @@ |
|
|
this.$confirm('确认退出吗?', '提示', { |
|
|
this.$confirm('确认退出吗?', '提示', { |
|
|
//type: 'warning' |
|
|
//type: 'warning' |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
localStorage.removeItem('user'); |
|
|
|
|
|
|
|
|
sessionStorage.removeItem('user'); |
|
|
_this.$router.replace('/login'); |
|
|
_this.$router.replace('/login'); |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
|
|
|
|
|
@ -132,6 +134,13 @@ |
|
|
this.currentPath = this.$route.path; |
|
|
this.currentPath = this.$route.path; |
|
|
this.currentPathName = this.$route.name; |
|
|
this.currentPathName = this.$route.name; |
|
|
this.currentPathNameParent = this.$route.matched[0].name; |
|
|
this.currentPathNameParent = this.$route.matched[0].name; |
|
|
|
|
|
|
|
|
|
|
|
var user = sessionStorage.getItem('user'); |
|
|
|
|
|
if (user) { |
|
|
|
|
|
user = JSON.parse(user); |
|
|
|
|
|
this.sysUserName = user.name || ''; |
|
|
|
|
|
this.sysUserAvatar = user.avatar || ''; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|