Commit 8423817b by 姜雷

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

parent 836ac266
......@@ -12,88 +12,17 @@
class="IconMenus-list"
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
v-if="systemManage && systemManage.length"
menuName="系统管理"
:menuList="systemManage[0].children"
:selectRouteMenu="selectRouteMenu"
>
<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"
v-for="(route) in formatRoute"
:key="route.name"
:menuName="route.meta.title"
:menuList="route.children"
:selectRouteMenu="selectRouteMenu"
>
<img
slot="icon"
src="@/assets/images/layout/wechat.png"
:src="route.meta.icon"
/>
</MenuItem>
<!-- <div @click="() => toggleFastLink(false)">
......@@ -167,23 +96,11 @@ export default {
computed: {
...mapGetters('Dashboard', ['titleData']),
...mapGetters(['collectList', 'dashboardBackPage']),
customerManage() {
let item = this.routers.find(
menu => menu.menuCode === process.env.VUE_APP_CUSTOMER_MENU_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
formatRoute() {
let routeList = this.routers.filter(
menu => menu.menuCode !== process.env.VUE_APP_DASHBOARD_CODE
);
return item ? formatRouteLink([item]) : null;
return formatRouteLink(routeList);
},
dashboardButtonVisiable() {
let item = this.routers.find(
......@@ -191,30 +108,6 @@ export default {
);
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: {
collectList(val) {
......
......@@ -4,7 +4,11 @@ export const formatRouteLink = (addRoute, path = '/') => {
return {
path: path + route.menuLink,
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 + '/'),
};
} else {
......@@ -12,7 +16,11 @@ export const formatRouteLink = (addRoute, path = '/') => {
path: path + route.menuLink,
name: route.id.toString(),
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