fix(projects): 修复混合左侧混合-顶部优先布局下固定问题
This commit is contained in:
@@ -97,18 +97,16 @@ function useMixMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getActiveSecondLevelMenuKey() {
|
function getActiveSecondLevelMenuKey() {
|
||||||
const keys = selectedKey.value.split('_');
|
const currentKey = selectedKey.value;
|
||||||
|
|
||||||
if (keys.length < 2) {
|
const found = secondLevelMenus.value.find(menu => {
|
||||||
setActiveSecondLevelMenuKey('');
|
if (menu.key === currentKey) return true;
|
||||||
return;
|
return menu.children && findMenuByKey(menu.children, currentKey);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
setActiveSecondLevelMenuKey(found.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const [firstLevelRouteName, level2SuffixName] = keys;
|
|
||||||
|
|
||||||
const secondLevelRouteName = `${firstLevelRouteName}_${level2SuffixName}`;
|
|
||||||
|
|
||||||
setActiveSecondLevelMenuKey(secondLevelRouteName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const isActiveSecondLevelMenuHasChildren = computed(() => {
|
const isActiveSecondLevelMenuHasChildren = computed(() => {
|
||||||
@@ -122,9 +120,12 @@ function useMixMenu() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handleSelectSecondLevelMenu(key: RouteKey) {
|
function handleSelectSecondLevelMenu(key: RouteKey) {
|
||||||
setActiveSecondLevelMenuKey(key);
|
const findItem = secondLevelMenus.value.find(item => item.key === key);
|
||||||
|
const itemHasChildren = Boolean(findItem?.children?.length);
|
||||||
|
|
||||||
if (!isActiveSecondLevelMenuHasChildren.value) {
|
if (itemHasChildren) {
|
||||||
|
setActiveSecondLevelMenuKey(key);
|
||||||
|
} else {
|
||||||
routerPushByKeyWithMetaQuery(key);
|
routerPushByKeyWithMetaQuery(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"collapsedWidth": 64,
|
"collapsedWidth": 64,
|
||||||
"mixWidth": 90,
|
"mixWidth": 90,
|
||||||
"mixCollapsedWidth": 64,
|
"mixCollapsedWidth": 64,
|
||||||
"mixChildMenuWidth": 200
|
"mixChildMenuWidth": 230
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"visible": true,
|
"visible": true,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"collapsedWidth": 64,
|
"collapsedWidth": 64,
|
||||||
"mixWidth": 90,
|
"mixWidth": 90,
|
||||||
"mixCollapsedWidth": 64,
|
"mixCollapsedWidth": 64,
|
||||||
"mixChildMenuWidth": 200
|
"mixChildMenuWidth": 230
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"visible": true,
|
"visible": true,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
"collapsedWidth": 64,
|
"collapsedWidth": 64,
|
||||||
"mixWidth": 90,
|
"mixWidth": 90,
|
||||||
"mixCollapsedWidth": 64,
|
"mixCollapsedWidth": 64,
|
||||||
"mixChildMenuWidth": 200
|
"mixChildMenuWidth": 230
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"visible": true,
|
"visible": true,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
|||||||
collapsedWidth: 64,
|
collapsedWidth: 64,
|
||||||
mixWidth: 90,
|
mixWidth: 90,
|
||||||
mixCollapsedWidth: 64,
|
mixCollapsedWidth: 64,
|
||||||
mixChildMenuWidth: 200,
|
mixChildMenuWidth: 230,
|
||||||
autoSelectFirstMenu: false
|
autoSelectFirstMenu: false
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
|||||||
Reference in New Issue
Block a user