Commit 8423817b by 姜雷

修改顶部菜单子系统为动态配置

parent 836ac266
...@@ -12,88 +12,17 @@ ...@@ -12,88 +12,17 @@
class="IconMenus-list" class="IconMenus-list"
v-else v-else
> >
<MenuItem
v-if="customerManage && customerManage.length"
menuName="会员管理"
:menuList="customerManage[0].children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/icon_huiyuanguanli@2x.png"
/>
</MenuItem>
<!-- <MenuItem menuName="自助运营">
<img
slot="icon"
src="@/assets/images/layout/icon_zizhuyunying@2x.png"
/>
</MenuItem> -->
<MenuItem
v-if="baseManage && baseManage.length"
menuName="基础数据"
:menuList="baseManage[0].children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/icon_jichu@2x.png"
/>
</MenuItem>
<MenuItem <MenuItem
v-if="systemManage && systemManage.length" v-for="(route) in formatRoute"
menuName="系统管理" :key="route.name"
:menuList="systemManage[0].children" :menuName="route.meta.title"
:selectRouteMenu="selectRouteMenu" :menuList="route.children"
>
<img
slot="icon"
src="@/assets/images/layout/icon_xitong@2x.png"
/>
</MenuItem>
<MenuItem
v-if="statisticsManage && statisticsManage.length"
menuName="统计系统"
:menuList="statisticsManage[0].children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/icon_baobiao.png"
/>
</MenuItem>
<MenuItem
v-if="deviceManage && deviceManage.length"
menuName="设备系统"
:menuList="deviceManage[0].children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/icon_shebei.png"
/>
</MenuItem>
<MenuItem
v-if="customerOperate && customerOperate.length"
menuName="运营管理"
:menuList="customerOperate[0].children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/icon_yunying.png"
/>
</MenuItem>
<MenuItem
v-if="smapreManage && smapreManage.length"
menuName="微信端"
:menuList="smapreManage[0].children"
:selectRouteMenu="selectRouteMenu" :selectRouteMenu="selectRouteMenu"
> >
<img <img
slot="icon" slot="icon"
src="@/assets/images/layout/wechat.png" :src="route.meta.icon"
/> />
</MenuItem> </MenuItem>
<!-- <div @click="() => toggleFastLink(false)"> <!-- <div @click="() => toggleFastLink(false)">
...@@ -167,23 +96,11 @@ export default { ...@@ -167,23 +96,11 @@ export default {
computed: { computed: {
...mapGetters('Dashboard', ['titleData']), ...mapGetters('Dashboard', ['titleData']),
...mapGetters(['collectList', 'dashboardBackPage']), ...mapGetters(['collectList', 'dashboardBackPage']),
customerManage() { formatRoute() {
let item = this.routers.find( let routeList = this.routers.filter(
menu => menu.menuCode === process.env.VUE_APP_CUSTOMER_MENU_CODE menu => menu.menuCode !== process.env.VUE_APP_DASHBOARD_CODE
);
return item ? formatRouteLink([item]) : null;
},
baseManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_BASE_MENU_CODE
);
return item ? formatRouteLink([item]) : null;
},
systemManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_SYSTEM_MENU_CODE
); );
return item ? formatRouteLink([item]) : null; return formatRouteLink(routeList);
}, },
dashboardButtonVisiable() { dashboardButtonVisiable() {
let item = this.routers.find( let item = this.routers.find(
...@@ -191,30 +108,6 @@ export default { ...@@ -191,30 +108,6 @@ export default {
); );
return item ? true : false; return item ? true : false;
}, },
statisticsManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_STATISTICS_MENU_CODE
);
return item ? formatRouteLink([item]) : null;
},
deviceManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_DEVICE_MENU_CODE
);
return item ? formatRouteLink([item]) : null;
},
customerOperate() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_CUSTOMER_OPERATE_CODE
);
return item ? formatRouteLink([item]) : null;
},
smapreManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_SMAPRO_CODE
);
return item ? formatRouteLink([item]) : null;
},
}, },
watch: { watch: {
collectList(val) { collectList(val) {
......
...@@ -4,7 +4,11 @@ export const formatRouteLink = (addRoute, path = '/') => { ...@@ -4,7 +4,11 @@ export const formatRouteLink = (addRoute, path = '/') => {
return { return {
path: path + route.menuLink, path: path + route.menuLink,
name: route.id.toString(), name: route.id.toString(),
meta: { title: route.menuName, icon: route.menuPicSmall }, meta: {
title: route.menuName,
icon: route.menuPicSmall,
bicon: route.menuPicBig,
},
children: formatRouteLink(route.childs, path + route.menuLink + '/'), children: formatRouteLink(route.childs, path + route.menuLink + '/'),
}; };
} else { } else {
...@@ -12,7 +16,11 @@ export const formatRouteLink = (addRoute, path = '/') => { ...@@ -12,7 +16,11 @@ export const formatRouteLink = (addRoute, path = '/') => {
path: path + route.menuLink, path: path + route.menuLink,
name: route.id.toString(), name: route.id.toString(),
menuCode: route.menuCode, menuCode: route.menuCode,
meta: { title: route.menuName, icon: route.menuPicSmall }, meta: {
title: route.menuName,
icon: route.menuPicSmall,
bicon: route.menuPicBig,
},
}; };
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment