角色管理修改

master
Caps 6 years ago
parent 76ad77c587
commit 8f46003c1b

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

@ -1,13 +1,9 @@
<template> <template>
<div> <div>
<Menu mode="horizontal" active-name="1"> <Menu mode="horizontal" :active-name="selectedItemName">
<MenuItem name="1" to="/shop/increase/configure/welcome"> <MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
<Icon type="ios-paper" /> :key="cItem.id">
欢迎语设置 {{cItem.name}}
</MenuItem>
<MenuItem name="2" to="/shop/increase/configure/group">
<Icon type="ios-people" />
群发消息
</MenuItem> </MenuItem>
</Menu> </Menu>
<div> <div>
@ -18,7 +14,26 @@
<script> <script>
export default { 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> </script>

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

@ -1,13 +1,9 @@
<template> <template>
<div> <div>
<Menu mode="horizontal" active-name="1"> <Menu mode="horizontal" :active-name="selectedItemName" v-model="this.threeLevel[0].id">
<MenuItem name="1" to="/shop/increase/manager/store"> <MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
<Icon type="ios-paper" /> :key="cItem.id">
门店号管理 {{cItem.name}}
</MenuItem>
<MenuItem name="2" to="/shop/increase/manager/staff">
<Icon type="ios-people" />
推广人员管理
</MenuItem> </MenuItem>
</Menu> </Menu>
<div> <div>
@ -18,7 +14,26 @@
<script> <script>
export default { 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> </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 IncreaseGroupSendConfigure from '@/pages/shop/IncreaseGroupSendConfigure';
import IncreaseWelcomeConfigure from '@/pages/shop/IncreaseWelcomeConfigure'; import IncreaseWelcomeConfigure from '@/pages/shop/IncreaseWelcomeConfigure';
import IncreaseGroupSendConfigureAdd from '@/pages/shop/IncreaseGroupSendConfigureAdd'; import IncreaseGroupSendConfigureAdd from '@/pages/shop/IncreaseGroupSendConfigureAdd';
import NoPermission from '@/pages/shop/NoPermission';
Vue.use(Router); Vue.use(Router);
@ -161,6 +162,11 @@ const router = new Router({
path: '/customer/data/detail', path: '/customer/data/detail',
name: 'CustomerDetail', name: 'CustomerDetail',
component: CustomerDetail, component: CustomerDetail,
},
{
path: '/no/permission',
name: 'NoPermission',
component: NoPermission,
} }
] ]
} }

Loading…
Cancel
Save