角色管理修改

master
Caps 6 years ago
parent 76ad77c587
commit 8f46003c1b

@ -69,7 +69,7 @@
threePermissionList: [],
}
},
mounted(){
mounted() {
let that = this;
this.bus.$on('callBack', function () {
that.callBack();
@ -97,6 +97,15 @@
},
methods: {
onSelectLister(val) {
let i;
this.onePermissionList.forEach(function (data) {
data.subMenuList.forEach(function (dta) {
if(dta.id === val){
i = dta;
}
})
});
sessionStorage.setItem("threeLevel",JSON.stringify(i.subMenuList));
for (let i = 0; i < this.onePermissionList.length; i++) {
let item = this.onePermissionList[i];
for (let k = 0; k < item.subMenuList.length; k++) {
@ -210,7 +219,7 @@
return data.pid === one.id
});
one.subMenuList = two;
})
});
//
that.menuInit();
}
@ -221,24 +230,25 @@
let that = this;
that.selectedItemName = that.onePermissionList[0].subMenuList[0].id;
that.openName = [that.onePermissionList[0].id];
this.$nextTick(()=>{
this.$nextTick(() => {
this.$refs.menu.updateOpened();
this.$refs.menu.updateActiveName();
})
});
this.selectedMenu = this.onePermissionList[0].name;
this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name;
this.$router.push({path:that.onePermissionList[0].subMenuList[0].resource});
sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList));
this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource});
},
//
callBack(){
callBack() {
let that = this;
this.selectedMenu = "设置管理";
this.selectedSubMenu = "账户管理";
this.selectedItemName = this.onePermissionList[0].subMenuList[0].id;
this.$nextTick(()=>{
this.$nextTick(() => {
that.$refs.menu.updateActiveName();
})
}
},
},
}

@ -1,13 +1,9 @@
<template>
<div>
<Menu mode="horizontal" active-name="1">
<MenuItem name="1" to="/shop/increase/configure/welcome">
<Icon type="ios-paper" />
欢迎语设置
</MenuItem>
<MenuItem name="2" to="/shop/increase/configure/group">
<Icon type="ios-people" />
群发消息
<Menu mode="horizontal" :active-name="selectedItemName">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id">
{{cItem.name}}
</MenuItem>
</Menu>
<div>
@ -18,7 +14,26 @@
<script>
export default {
name: "IncreaseConfigure"
name: "IncreaseConfigure",
data() {
return {
threeLevel: null,
selectedItemName: null,
}
},
mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
methods:{
menuInit(){
let that = this;
that.selectedItemName = [that.threeLevel[0].id];
this.$nextTick(() => {
this.$refs.menu.updateActiveName();
});
}
}
}
</script>

@ -1,19 +1,10 @@
<template>
<div>
<Menu mode="horizontal" active-name="1">
<MenuItem name="1" to="/shop/increase/data/region">
<Icon type="ios-paper" />
零售公司
<Menu mode="horizontal" :active-name="selectedItemName">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id">
{{cItem.name}}
</MenuItem>
<MenuItem name="2" to="/shop/increase/data/store">
<Icon type="ios-people" />
门店
</MenuItem>
<MenuItem name="4" to="/shop/increase/data/staff">
<Icon type="ios-construct" />
导购
</MenuItem>
</Menu>
<div>
<router-view/>
@ -24,9 +15,23 @@
<script>
export default {
name: "IncreaseData",
data() {
return {
threeLevel: null,
selectedItemName: null,
}
},
mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
methods:{
exportData () {
menuInit(){
let that = this;
that.selectedItemName = [that.threeLevel[0].id];
this.$nextTick(() => {
this.$refs.menu.updateActiveName();
});
}
}
}

@ -1,13 +1,9 @@
<template>
<div>
<Menu mode="horizontal" active-name="1">
<MenuItem name="1" to="/shop/increase/manager/store">
<Icon type="ios-paper" />
门店号管理
</MenuItem>
<MenuItem name="2" to="/shop/increase/manager/staff">
<Icon type="ios-people" />
推广人员管理
<Menu mode="horizontal" :active-name="selectedItemName" v-model="this.threeLevel[0].id">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id">
{{cItem.name}}
</MenuItem>
</Menu>
<div>
@ -18,7 +14,26 @@
<script>
export default {
name: "ShopIncrease"
name: "ShopIncrease",
data() {
return {
threeLevel: null,
selectedItemName: [],
}
},
mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
methods:{
menuInit(){
let that = this;
that.selectedItemName = [that.threeLevel[0].id];
this.$nextTick(() => {
this.$refs.menu.updateActiveName();
});
}
}
}
</script>

@ -0,0 +1,15 @@
<template>
<div>
<span>没有此页面的权限</span>
</div>
</template>
<script>
export default {
name: "NoPermission",
}
</script>
<style scoped>
</style>

@ -22,6 +22,7 @@ import IncreaseConfigure from '@/pages/shop/IncreaseConfigure';
import IncreaseGroupSendConfigure from '@/pages/shop/IncreaseGroupSendConfigure';
import IncreaseWelcomeConfigure from '@/pages/shop/IncreaseWelcomeConfigure';
import IncreaseGroupSendConfigureAdd from '@/pages/shop/IncreaseGroupSendConfigureAdd';
import NoPermission from '@/pages/shop/NoPermission';
Vue.use(Router);
@ -161,6 +162,11 @@ const router = new Router({
path: '/customer/data/detail',
name: 'CustomerDetail',
component: CustomerDetail,
},
{
path: '/no/permission',
name: 'NoPermission',
component: NoPermission,
}
]
}

Loading…
Cancel
Save