|
|
@@ -43,7 +43,7 @@ export const useAuthStore = defineStore({
|
|
|
const businessSection = Number(userInfo.businessSection || localGet("businessSection") || 0);
|
|
|
const mealsFlag = Number(userInfo.mealsFlag || localGet("mealsFlag") || 0);
|
|
|
const storeId = userInfo.storeId ?? localGet("createdId");
|
|
|
- const storeTickets = Number(userInfo.storeTickets ?? localGet("storeTickets") ?? 0);
|
|
|
+ const storeTickets = Number(localGet("storeTickets") || 0);
|
|
|
|
|
|
// 递归处理菜单的显示/隐藏状态
|
|
|
const processMenus = (menuList: any[]) => {
|
|
|
@@ -116,7 +116,10 @@ export const useAuthStore = defineStore({
|
|
|
menu.meta.isHide = !storeId || businessSection !== 2;
|
|
|
break;
|
|
|
case "门店装修":
|
|
|
- menu.meta.isHide = !storeId;
|
|
|
+ // 仅父级:子项 decorationManagement 同 title,若在此处理会覆盖 storeTickets 下的 isHide
|
|
|
+ if (menu.name === "storeDecorationManagement") {
|
|
|
+ menu.meta.isHide = !storeId;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -125,6 +128,7 @@ export const useAuthStore = defineStore({
|
|
|
if (menu.name === "storeDecorationManagement" && menu.children?.length) {
|
|
|
if (storeTickets != 0 && storeTickets != 1) {
|
|
|
menu.meta.isHide = true;
|
|
|
+ menu.meta.flattenSingleChild = false;
|
|
|
} else {
|
|
|
menu.children.forEach((child: any) => {
|
|
|
if (child.name === "decorationManagement") {
|
|
|
@@ -133,6 +137,16 @@ export const useAuthStore = defineStore({
|
|
|
child.meta.isHide = storeTickets !== 1;
|
|
|
}
|
|
|
});
|
|
|
+ // 仅装修公司模式:侧栏只出现一项「装修公司」,并重定向到装修公司页
|
|
|
+ if (storeTickets === 1) {
|
|
|
+ menu.meta.title = "装修公司";
|
|
|
+ menu.meta.flattenSingleChild = true;
|
|
|
+ menu.redirect = "/storeDecorationManagement/decorationCompany";
|
|
|
+ } else if (storeTickets === 0) {
|
|
|
+ menu.meta.title = "门店装修";
|
|
|
+ menu.meta.flattenSingleChild = false;
|
|
|
+ menu.redirect = "/storeDecorationManagement/decorationManagement";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|