<template>
|
<div class="left-slide">
|
<el-menu
|
default-active="2"
|
class="el-menu-vertical-demo"
|
@open="handleOpen"
|
@close="handleClose"
|
:router="true"
|
background-color="#545c64"
|
text-color="#fff"
|
style="height:100%;text-align:left"
|
active-text-color="#ffd04b">
|
<el-menu-item index="Home">
|
<i class="el-icon-document"></i>
|
<span slot="title">首页</span>
|
</el-menu-item>
|
<el-menu-item index="ProductCenter">
|
<i class="el-icon-menu"></i>
|
<span slot="title">产品中心</span>
|
</el-menu-item>
|
<el-submenu index="API">
|
<template slot="title">
|
<i class="el-icon-location"></i>
|
<span>API</span>
|
</template>
|
<el-menu-item-group>
|
<el-menu-item index="1-1">选项1</el-menu-item>
|
<el-menu-item index="1-2">选项2</el-menu-item>
|
</el-menu-item-group>
|
</el-submenu>
|
|
<el-submenu index="Manage">
|
<template slot="title">
|
<i class="el-icon-location"></i>
|
<span>管理</span>
|
</template>
|
<el-menu-item-group>
|
<el-menu-item index="Manage-order">我的订单</el-menu-item>
|
<el-menu-item index="Manage-device">我的设备</el-menu-item>
|
<el-menu-item index="Manage-invoice">发票管理</el-menu-item>
|
</el-menu-item-group>
|
</el-submenu>
|
</el-menu>
|
</div>
|
</template>
|
|
<script>
|
|
|
import bus from "../main";
|
|
export default {
|
components: {
|
|
},
|
props: {
|
height: {
|
type: Number,
|
default: 0
|
}
|
},
|
|
computed: {
|
|
isAdmin() {
|
if (
|
sessionStorage.getItem("userInfo") &&
|
sessionStorage.getItem("userInfo") !== ""
|
) {
|
let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
|
return loginName === "superadmin" || loginName === "basic";
|
}
|
return false;
|
}
|
},
|
data() {
|
return {
|
}
|
},
|
watch: {
|
$route(to, from) {
|
switch (to.name) {
|
case "Searching":
|
this.cameraAuth = "videoSearch:camera"
|
this.dataStack = "videoSearch:dataStack"
|
break
|
case "VideoManage":
|
this.cameraAuth = "VIDEOCAMERA:camera"
|
this.dataStack = "VIDEOCAMERA:video"
|
break
|
default:
|
this.cameraAuth = "videoMonitor:camera"
|
this.dataStack = "videoMonitor:dataStack"
|
}
|
console.log("路由变化:", to, from)
|
}
|
},
|
created() {
|
if (this.isShow('VIDEOCAMERA:camera')) {
|
this.TreeDataPool.treeActiveName = "camera"
|
} else if (this.isShow('VIDEOCAMERA:video')) {
|
this.TreeDataPool.treeActiveName = "localVedio"
|
} else if (this.isShow('VIDEOCAMERA:image')) {
|
this.TreeDataPool.treeActiveName = "localPic"
|
} else if (this.isShow('VIDEOCAMERA:audio')) {
|
this.TreeDataPool.treeActiveName = "localAudio"
|
}
|
this.TreeDataPool.fetchTreeData().then(_ => {
|
if (this.$route.path == '/Layout/Searching') {
|
this.TreeDataPool.filterLocalVideoWell()
|
}
|
});
|
},
|
mounted() {
|
this.$nextTick(() => {
|
bus.$on("slideLeft", () => {
|
this.TreeDataPool.showTreeBox = !this.TreeDataPool.showTreeBox;
|
});
|
});
|
},
|
methods: {
|
handleOpen(key, keyPath) {
|
console.log(key, keyPath);
|
},
|
handleClose(key, keyPath) {
|
console.log(key, keyPath);
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
.left-slide {
|
width: 300px;
|
height: 700px;
|
|
}
|
</style>
|