From d9c657aa78cf0ebe31933a87e63ca92edd8a8da3 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 11 六月 2026 09:57:50 +0800
Subject: [PATCH] 数据采集站
---
admin/src/store/index.js | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/admin/src/store/index.js b/admin/src/store/index.js
index f2fb2f1..5ab8182 100644
--- a/admin/src/store/index.js
+++ b/admin/src/store/index.js
@@ -31,7 +31,9 @@
// tagsview鏍囩鏄剧ず闅愯棌
isCollapse: false,
// 椤堕儴鑿滃崟绱㈠紩
- currentIndex: 0
+ currentIndex: 0,
+ // 璺敱鍚屾椤剁骇鑿滃崟鏃惰烦杩囬椤佃烦杞�
+ skipTopMenuNavigation: false
}
const mutations = {
@@ -74,16 +76,27 @@
// 璁剧疆棣栭〉璺敱淇℃伅
setTopMenuCurrent (state, current) {
console.log('setTopMenuCurrent', current)
+ state.skipTopMenuNavigation = false
if (current.id !== state.topMenuCurrent.id) {
- state.topMenuList.list.forEach(item => {
+ state.topMenuList.list.forEach((item, index) => {
console.log(item.id, item.id)
if (current.id == item.id) {
state.topMenuCurrent = current
state.menuData.list = item.children
+ state.currentIndex = index
}
})
}
},
+ syncTopMenuFromRoute (state, { topMenu, topIndex }) {
+ if (!topMenu || topMenu.id === state.topMenuCurrent.id) {
+ return
+ }
+ state.skipTopMenuNavigation = true
+ state.topMenuCurrent = topMenu
+ state.menuData.list = topMenu.children || []
+ state.currentIndex = topIndex
+ },
// 閲嶇疆鑿滃崟
resetMenus: (state) => {
state.topMenuId = null
--
Gitblit v1.9.3