| | |
| | | :default-active="activeIndex" |
| | | @select="handleSelect" |
| | | > |
| | | <el-menu-item index="guideIndex"> |
| | | <el-menu-item index="guideIndex" v-if="isAdmin"> |
| | | <i class="iconfont iconshouye"></i> |
| | | <span slot="title">首页</span> |
| | | </el-menu-item> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | type: Function |
| | | } |
| | | }, |
| | | 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' |
| | | activeIndex: this.isAdmin ? 'guideIndex' : 'searchForVideoAnalyze' |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | // if (this.isAdmin) { |
| | | // if (!!sessionStorage.getItem('leftNavAct')) { |
| | | // console.log("leftNavAct") |
| | | // this.activeIndex = sessionStorage.getItem('leftNavAct'); |
| | | // } |
| | | // } |
| | | |
| | | this.$emit('menuChange', this.activeIndex); |
| | | }, |
| | | methods: { |
| | | handleSelect(index, indePath) { |
| | | this.activeIndex = index; |
| | | sessionStorage.setItem('leftNavAct', this.activeIndex); |
| | | this.$emit('menuChange', index); |
| | | }, |
| | | handleOpen() { |