import store from '@/store/index.js';
const jumpPage = (name) => {
  const menuList = store.getters.getMenuList
  let menuId = ''
  const loop = (name, menuList) => {
    for (let index = 0; index < menuList.length; index++) {
      const item = menuList[index]
      if (item.formRouterName === name) {
        menuId = item.menuId
        break
      } else {
        if (item.children) {
          loop(name, item.children)
        }
      }
    }
  }
  loop(name, menuList)
  store.commit('setCurrentMenuId', menuId)
}
export default jumpPage
