duy 3 месяцев назад
Родитель
Сommit
2819ace797
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      src/layout/index.vue

+ 12 - 1
src/layout/index.vue

@@ -159,7 +159,18 @@ const topMenuChange = (data) => {
 //菜单被点击
 const menuBarChange = ({ code }) => {
     menuBarKey.value = code
-    router.push({ name: code })
+    if (code === 'statistics-datav') {
+        // 如果跳转到数据看板,记录当前路由作为来源路径
+        const currentRoute = router.currentRoute.value
+        router.push({ 
+            name: code,
+            query: {
+                from: currentRoute.fullPath,
+            },
+        })
+    } else {
+        router.push({ name: code })
+    }
 }
 
 //消息数量