|
|
@@ -65,7 +65,6 @@ export const useAuthStore = defineStore({
|
|
|
|
|
|
// 根据 businessSection 判断菜单显示
|
|
|
if (menu.meta && menu.meta.title) {
|
|
|
- console.log(businessSection);
|
|
|
switch (menu.meta.title) {
|
|
|
case "菜单管理":
|
|
|
// 只在特色美食(1) 时显示菜单管理
|
|
|
@@ -76,8 +75,8 @@ export const useAuthStore = defineStore({
|
|
|
menu.meta.isHide = businessSection !== 2;
|
|
|
break;
|
|
|
case "设施与服务":
|
|
|
- // 只在洗浴汗蒸(4) 和 运动健身(7) 时显示设施与服务
|
|
|
- menu.meta.isHide = ![4, 7, 1].includes(businessSection);
|
|
|
+ // 特色美食(1) 不显示设施与服务
|
|
|
+ menu.meta.isHide = businessSection !== 1;
|
|
|
break;
|
|
|
case "门店基础信息":
|
|
|
case "门店头图":
|
|
|
@@ -137,24 +136,10 @@ export const useAuthStore = defineStore({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 处理子菜单
|
|
|
- // if (menu.children && menu.children.length > 0) {
|
|
|
- // // 检查子菜单中是否有需要显示的菜单项
|
|
|
- // let hasVisibleChild = false;
|
|
|
- // menu.children.forEach((child: any) => {
|
|
|
- // if (!child.meta?.isHide) {
|
|
|
- // hasVisibleChild = true;
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
- // // 如果父菜单基础信息、头图、相册本身被隐藏,但有可见子菜单,则显示父菜单
|
|
|
- // if (menu.meta?.isHide && hasVisibleChild) {
|
|
|
- // menu.meta.isHide = false;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 递归处理子菜单
|
|
|
- // processMenus(menu.children);
|
|
|
- // }
|
|
|
+ // 递归处理子菜单:switch 按 meta.title 匹配,子级(如「设施与服务」在「基础设施服务」下)否则永远走不到
|
|
|
+ if (menu.children?.length) {
|
|
|
+ processMenus(menu.children);
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
|