Browse Source

Merge branch 'main' of http://git.cc-lotus.info/util/web-template-vue3-js

lrf 1 year ago
parent
commit
70161429c2

BIN
src/assets/images/login-bg-dark.jpg


+ 1 - 1
src/lang/package/en/menus.js

@@ -5,5 +5,5 @@ export default {
   system_role: 'system_role',
   system_parameter: 'system_parameter',
   system_dict: 'system_dict',
-  system_dict_data: 'system_dict_dat'
+  system_dict_data: 'system_dictData'
 }

+ 1 - 49
src/layout/parts/Tagsbar.vue

@@ -204,7 +204,7 @@ function toLastView(visitedViews, view) {
   if (latestView && latestView.fullPath) {
     router.push(latestView.fullPath)
   } else {
-    if (view?.name === 'Dashboard') {
+    if (view?.name === 'home') {
       router.replace({ path: '/redirect' + view.fullPath })
     } else {
       router.push('/')
@@ -288,54 +288,6 @@ function closeContentMenu() {
 function handleScroll() {
   closeContentMenu()
 }
-
-function findOutermostParent(tree, findName) {
-  let parentMap = {}
-
-  function buildParentMap(node, parent) {
-    parentMap[node.name] = parent
-
-    if (node.children) {
-      for (let i = 0; i < node.children.length; i++) {
-        buildParentMap(node.children[i], node)
-      }
-    }
-  }
-
-  for (let i = 0; i < tree.length; i++) {
-    buildParentMap(tree[i], null)
-  }
-
-  let currentNode = parentMap[findName]
-  while (currentNode) {
-    if (!parentMap[currentNode.name]) {
-      return currentNode
-    }
-    currentNode = parentMap[currentNode.name]
-  }
-
-  return null
-}
-
-const againActiveTop = (newVal) => {
-  if (layout.value !== 'mix') return
-  const parent = findOutermostParent(permissionStore.routes, newVal)
-  if (appStore.activeTopMenu !== parent.path) {
-    appStore.activeTopMenu(parent.path)
-  }
-}
-// 如果是混合模式,更改selectedTag,需要对应高亮的activeTop
-watch(
-  () => route.name,
-  (newVal) => {
-    if (newVal) {
-      againActiveTop(newVal)
-    }
-  },
-  {
-    deep: true
-  }
-)
 onMounted(() => {
   initTags()
 })

+ 2 - 2
src/router/guard.js

@@ -130,7 +130,7 @@ export const registerBeforeRouter = async (router) => {
       const menus = await getUserMeta(token)
       // 检查目的地路由是否注册
       const hasRoute = hasNecessaryRoute(to, router)
-      if (hasRoute) {
+      if (hasRoute || to.meta.hidden) {
         // 注册了直接进入
         next()
       } else {
@@ -148,10 +148,10 @@ export const registerBeforeRouter = async (router) => {
 
 export const registerAfterRouter = async (router) => {
   router.afterEach(async (to, form) => {
+    NProgress.done() //完成进度条
     if (to.path === '/login') {
       return
     }
     // 请求该页面的权限
-    NProgress.done() //完成进度条
   })
 }