jiangping
2024-05-31 7b3b1cb76452258c3b554b6364ef5d50ed34542c
admin/src/components/common/Menu.vue
@@ -33,11 +33,11 @@
      if (path.endsWith('/')) {
        path = path.substring(0, path.length - 1)
      }
      const menuConfig = this.__getMenuConfig(path, 'url', this.menuData.list)
      const menuConfig = this.__getMenuConfig(path, 'index', this.menuData.list)
      if (menuConfig == null) {
        return null
      } else {
        this.$store.commit("pushtags", menuConfig)
        this.$store.commit('pushtags', menuConfig)
      }
      // console.log(menuConfig.index);
      return menuConfig.index
@@ -58,17 +58,21 @@
        require('@/views' + menuConfig.url)
      } catch (e) {
        this.$tip.error('未找到页面文件@/views' + menuConfig.url + '.vue,请检查菜单路径是否正确')
        return
      }
      // 点击当前菜单不做处理
      if (menuConfig.url === this.$route.path) {
      if (menuConfig.url === this.$route.path && menuConfig.params === this.$route.query.param) {
        return
      }
      if (menuConfig.url == null || menuConfig.url.trim().length === 0) {
        return
      }
      if(menuConfig.params!=null && menuConfig.params!=''){
        this.$router.push({path:menuConfig.url,query:{index:menuConfig.index,param:menuConfig.params}})
      }else{
      this.$router.push(menuConfig.url)
      this.$store.commit("pushtags", menuConfig)
      }
      this.$store.commit('pushtags', menuConfig)
    },
    // 获取菜单配置
    __getMenuConfig (value, key, menus) {