loulijun2021
2023-04-28 5f1f3d58caf61d6d27a916d5ef244ac7725c3b19
src/layout/components/Sidebar/index.vue
@@ -59,6 +59,7 @@
    routes() {
      return this.$router.options.routes
    },
    activeMenu() {
      const route = this.$route
      const { meta, path } = route
@@ -68,8 +69,36 @@
      if (meta.activeMenu) {
        return meta.activeMenu
      }
      if (path.indexOf('kanbanManager') !== -1) { // 当点击智慧看板的时候
        const url = this.$router.resolve({
          path
          // query: { id: 123 }
        })
        const t = url.href.split('/')
        if (t[2] === 'xljgcj') {
          window.open('#/zhkbc?code=21', '_blank')
        } else if (t[2] === 'zpcj') {
          window.open('#/zhkbc?code=25', '_blank')
        } else {
          window.open('#/' + t[2], '_blank')
        }
      }
      return path
    },
    // activeMenu() {
    //   const route = this.$route
    //   const { meta, path } = route
    //   // if set path, the sidebar will highlight the path you set
    //   removeCookie('ruleCode')
    //   setCookie('ruleCode', meta.code)// 将编码规则code存到cookie里面
    //   if (meta.activeMenu) {
    //     return meta.activeMenu
    //   }
    //   return path
    // },
    showLogo() {
      return this.$store.state.settings.sidebarLogo
    },
@@ -152,4 +181,7 @@
  color: #ffffff;
  cursor: default;
}
.el-menu{
  background-color: #213145 !important;
}
</style>