|
|
|
@ -18,14 +18,17 @@
|
|
|
|
|
|
|
|
|
|
<Menu ref="menu" :active-name="selectedItemName" :open-names="openName" theme="dark" width="auto"
|
|
|
|
|
@on-select="onSelectLister" :accordion="true">
|
|
|
|
|
|
|
|
|
|
<MenuItem v-if="roleCode === 'GLY-ADMIN' || roleCode === 'DG-YUNYING' || roleCode === 'GL-YUNYING'" :name="0" to="/customer/view">
|
|
|
|
|
<Icon type="ios-paper"/>
|
|
|
|
|
<span style="margin-left: 7px">首页</span>
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<Submenu :name="item.id" v-for="item in onePermissionList" :key="item.id">
|
|
|
|
|
<template slot="title">
|
|
|
|
|
<Icon type="ios-paper"/>
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in item.subMenuList"
|
|
|
|
|
:key="cItem.id" :target="cItem.name === '大屏' ? '_blank' : '_self'">
|
|
|
|
|
:key="cItem.id">
|
|
|
|
|
{{cItem.name}}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
</Submenu>
|
|
|
|
@ -61,6 +64,7 @@
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
roleCode: JSON.parse(sessionStorage.getItem("loginInfo")).roleCode,
|
|
|
|
|
mainUrl: "/customer/view",
|
|
|
|
|
isCollapsed: false,
|
|
|
|
|
mHeight: 600,
|
|
|
|
|
selectedItemName: "",
|
|
|
|
@ -111,25 +115,34 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 菜单选中事件
|
|
|
|
|
onSelectLister(val) {
|
|
|
|
|
let i;
|
|
|
|
|
this.onePermissionList.forEach(function (data) {
|
|
|
|
|
data.subMenuList.forEach(function (dta) {
|
|
|
|
|
if(dta.id === val){
|
|
|
|
|
i = dta;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
if(i){
|
|
|
|
|
sessionStorage.setItem("threeLevel",JSON.stringify(i.subMenuList));
|
|
|
|
|
}
|
|
|
|
|
//首页
|
|
|
|
|
if(val === 0){
|
|
|
|
|
this.selectedMenu = "首页";
|
|
|
|
|
this.selectedSubMenu = "";
|
|
|
|
|
this.breadcrumbUrl = this.mainUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.onePermissionList.length; i++) {
|
|
|
|
|
let item = this.onePermissionList[i];
|
|
|
|
|
for (let k = 0; k < item.subMenuList.length; k++) {
|
|
|
|
|
let cItem = item.subMenuList[k];
|
|
|
|
|
if (cItem.id === val) {
|
|
|
|
|
|
|
|
|
|
if(cItem.name === '大屏'){
|
|
|
|
|
this.$router.push("")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.selectedMenu = item.name;
|
|
|
|
|
this.selectedSubMenu = cItem.name;
|
|
|
|
|
this.selectedItemName = cItem.id;
|
|
|
|
|
this.breadcrumbUrl = cItem.resource;
|
|
|
|
|
// 3级菜单
|
|
|
|
|
sessionStorage.setItem("threeLevel",JSON.stringify(cItem.subMenuList));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -245,18 +258,25 @@
|
|
|
|
|
//导航栏初始化
|
|
|
|
|
menuInit: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
if(this.roleCode === 'GLY-ADMIN' || this.roleCode === 'DG-YUNYING' || this.roleCode === 'GL-YUNYING'){
|
|
|
|
|
//默认首页
|
|
|
|
|
that.selectedItemName = 0;
|
|
|
|
|
this.$router.push({path: that.mainUrl});
|
|
|
|
|
this.selectedMenu = "首页";
|
|
|
|
|
this.breadcrumbUrl = this.mainUrl;
|
|
|
|
|
}else{
|
|
|
|
|
that.selectedItemName = that.onePermissionList[0].subMenuList[0].id;
|
|
|
|
|
that.openName = [that.onePermissionList[0].id];
|
|
|
|
|
|
|
|
|
|
that.selectedItemName = that.onePermissionList[0].subMenuList[0].id;
|
|
|
|
|
that.openName = [that.onePermissionList[0].id];
|
|
|
|
|
|
|
|
|
|
this.selectedMenu = this.onePermissionList[0].name;
|
|
|
|
|
this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name;
|
|
|
|
|
sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList));
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.menu.updateOpened();
|
|
|
|
|
// this.$refs.menu.updateActiveName();
|
|
|
|
|
});
|
|
|
|
|
this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource});
|
|
|
|
|
this.selectedMenu = this.onePermissionList[0].name;
|
|
|
|
|
this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name;
|
|
|
|
|
sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList));
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
// this.$refs.menu.updateOpened();
|
|
|
|
|
// this.$refs.menu.updateActiveName();
|
|
|
|
|
// });
|
|
|
|
|
this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//账户管理页面回调方法
|
|
|
|
|