From 5fb65ada8ccc28eabf823b284de70fbd3ca1f41e Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 28 九月 2021 18:29:36 +0800
Subject: [PATCH] 抓拍大图层级修复v1
---
src/pages/shuohuangMonitorAnalyze/components/leftNav.vue | 68 ++++++++++++++++++++--------------
1 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/src/pages/shuohuangMonitorAnalyze/components/leftNav.vue b/src/pages/shuohuangMonitorAnalyze/components/leftNav.vue
index 15ceb0c..2087052 100644
--- a/src/pages/shuohuangMonitorAnalyze/components/leftNav.vue
+++ b/src/pages/shuohuangMonitorAnalyze/components/leftNav.vue
@@ -12,7 +12,7 @@
:default-active="activeIndex"
@select="handleSelect"
>
- <el-menu-item index="guideIndex">
+ <el-menu-item index="guideIndex" v-show="isAdmin">
<i class="iconfont iconshouye"></i>
<span slot="title">棣栭〉</span>
</el-menu-item>
@@ -20,15 +20,15 @@
<i class="iconfont iconshipin2"></i>
<span slot="title">瑙嗛鍒嗘瀽妫�绱�</span>
</el-menu-item>
- <el-menu-item index="taskManage">
+ <el-menu-item index="taskManage" v-if="isAdmin">
<i class="iconfont iconrenwu1"></i>
<span slot="title">浠诲姟绠$悊</span>
</el-menu-item>
- <el-menu-item index="memberManage">
+ <el-menu-item index="memberManage" v-if="isAdmin">
<i class="iconfont iconrenyuanguanli"></i>
<span slot="title">浜哄憳绠$悊</span>
</el-menu-item>
- <el-menu-item index="configManage">
+ <el-menu-item index="configManage" v-if="isAdmin">
<i class="iconfont iconicon-test4"></i>
<span slot="title">閰嶇疆绠$悊</span>
</el-menu-item>
@@ -40,14 +40,15 @@
</template>
<el-menu-item index="transferMemo">瑙嗛杞偍璁板綍</el-menu-item>
<el-menu-item index="transferDeviceManage">杞偍璁惧绠$悊</el-menu-item>
+ <el-menu-item index="lkgManage">LKJ鏁版嵁绠$悊</el-menu-item>
</el-submenu>
- <el-submenu index="7">
+ <el-submenu index="7" v-if="isAdmin">
<template slot="title">
<i class="iconfont iconkeshihua"></i>
<span slot="title">鍙鍖栧ぇ灞�</span>
</template>
- <el-menu-item index="7-1">浠诲姟澶у睆</el-menu-item>
- <el-menu-item index="7-2">闅愭偅澶у睆</el-menu-item>
+ <el-menu-item index="taskscreen">浠诲姟澶у睆</el-menu-item>
+ <el-menu-item index="hiddendangerscreen">闅愭偅澶у睆</el-menu-item>
</el-submenu>
</el-menu>
</div>
@@ -66,33 +67,45 @@
type: Function
}
},
- data () {
+ computed: {
+ isAdmin() {
+ if (
+ sessionStorage.getItem("userInfo") &&
+ sessionStorage.getItem("userInfo") !== ""
+ ) {
+ let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
+ return loginName === "admin" || loginName === "basic";
+ }
+ return false;
+ },
+ },
+ data() {
return {
publicPath: process.env.BASE_URL,
activeIndex: 'guideIndex'
}
},
- mounted(){
- console.log('mounted')
- window.onbeforeunload = () => {
- debugger
- console.log('beforeunload')
- sessionStorage.setItem('leftNavAct', this.activeIndex);
- }
- if(!!sessionStorage.getItem('leftNavAct')){
- this.activeIndex = sessionStorage.getItem('leftNavAct');
- this.$emit('menuChange',this.activeIndex);
- }
+ mounted() {
+ // if (this.isAdmin) {
+ // if (!!sessionStorage.getItem('leftNavAct')) {
+ // console.log("leftNavAct")
+ // this.activeIndex = sessionStorage.getItem('leftNavAct');
+ // }
+ // }
+ this.activeIndex = this.isAdmin ? 'guideIndex' : 'searchForVideoAnalyze';
+
+ this.$emit('menuChange', this.activeIndex);
},
methods: {
- handleSelect(index,indePath){
+ handleSelect(index, indePath) {
this.activeIndex = index;
- this.$emit('menuChange',index);
+ sessionStorage.setItem('leftNavAct', this.activeIndex);
+ this.$emit('menuChange', index);
},
- handleOpen () {
+ handleOpen() {
},
- handleClose () {
+ handleClose() {
}
}
@@ -111,20 +124,19 @@
border-bottom: 1px solid #eee;
color: rgb(0, 150, 250);
}
- .iconfont{
+ .iconfont {
padding-right: 10px;
}
- .el-menu-vertical-demo:not(.el-menu--collapse){
+ .el-menu-vertical-demo:not(.el-menu--collapse) {
width: 250px;
}
.el-menu-item,
.el-submenu__title {
text-align: left;
}
- .el-menu-item.is-active{
- color:#409EFF;
+ .el-menu-item.is-active {
+ color: #409eff;
background-color: #ecf0fc;
}
-
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0