Merge pull request '处理模块之间跳转后,地址栏和二级路由选中的菜单不匹配的问题' (#11) from feature-custom-menus into feature-Alarm-renpy

This commit is contained in:
xiaoguangbin 2023-08-01 17:03:23 +08:00
commit d575368b48

View File

@ -41,7 +41,16 @@ export default {
methods: {
onMenuSelect({ key }) {
const childPath = this.getChildrenPath(this.menuItems.find(menu => menu.name === key))
this.$router.push(childPath)
if (key == "abnormal-alarm" || key == "istatistics") {
const selectedKeys = window.sessionStorage.getItem('currMenu')
if (selectedKeys) {
this.$router.push(selectedKeys)
} else {
this.$router.push(childPath)
}
} else {
this.$router.push(childPath)
}
},
getChildrenPath(menuItem) {
if (menuItem.children) {