merge store overview and home for wide mode
This commit is contained in:
@@ -78,8 +78,15 @@ const tabList: TabItem[] = [
|
||||
{ value: "/store", icon: "shop-3", text: "门店", permission: permissionCodes.stat.read },
|
||||
{ value: "/management", icon: "setting-1", text: "管理" }
|
||||
];
|
||||
/**
|
||||
* 横屏平板(出现左侧导航栏)把门店并进客户页:左门店、右操作入口,
|
||||
* 导航里不再单独保留门店入口。
|
||||
*/
|
||||
const mergedIntoCustomer = computed(() => railVisible.value);
|
||||
|
||||
const list = computed(() => tabList.filter(item => (
|
||||
(!item.permission || userStore.hasPermissions(item.permission, item.permissionMode))
|
||||
(!mergedIntoCustomer.value || item.value !== "/store")
|
||||
&& (!item.permission || userStore.hasPermissions(item.permission, item.permissionMode))
|
||||
&& (!item.role || userStore.hasRoles(item.role, item.roleMode))
|
||||
)));
|
||||
|
||||
@@ -99,7 +106,10 @@ async function syncVisibleTab(): Promise<void> {
|
||||
tabVal.value = visiblePath;
|
||||
}
|
||||
|
||||
if (route.path === "/customers" && visiblePath !== "/customers") {
|
||||
// 停在已隐藏的 tab 根路径上(如横屏下的 /store)时,回到第一个可见 tab;
|
||||
// 只处理 tab 根路径,详情页不在这里跳转
|
||||
const tabPath = resolveTabValue(route.path);
|
||||
if (route.path === tabPath && (tabPath === "/customers" || tabPath === "/store") && visiblePath !== tabPath) {
|
||||
await router.replace(visiblePath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user