From e6ec0f465d26c1228e96365e3d29f04e4661c457 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 12 十一月 2025 09:14:10 +0800
Subject: [PATCH] 简道云对接
---
admin/src/store/index.js | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/admin/src/store/index.js b/admin/src/store/index.js
index 4af82fa..65559a6 100644
--- a/admin/src/store/index.js
+++ b/admin/src/store/index.js
@@ -1,5 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
+import router from '../router'
Vue.use(Vuex)
const state = {
@@ -16,13 +17,28 @@
// 鏄惁鏀惰捣
collapse: false
},
+ topMenuCurrent: {
+ },
+ topMenuList: {
+ // 鑿滃崟鍒楄〃
+ list: [],
+ // 鏄惁鏀惰捣
+ collapse: false
+ },
// tags鏁扮粍
tags: [],
// tagsview鏍囩鏄剧ず闅愯棌
- isCollapse: false
+ isCollapse: false,
+ // 椤堕儴鑿滃崟绱㈠紩
+ currentIndex: 0
}
const mutations = {
+ // 璁剧疆椤堕儴鑿滃崟绱㈠紩
+ setCurrentIndex(state, index) {
+ console.log('璁剧疆椤堕儴鑿滃崟绱㈠紩', index)
+ state.currentIndex = index
+ },
// 鍒囨崲鑿滃崟鐘舵��
switchCollapseMenu (state, value) {
if (value != null) {
@@ -50,8 +66,22 @@
setHomePage (state, homePage) {
state.homePage = homePage
},
+ // 璁剧疆棣栭〉璺敱淇℃伅
+ setTopMenuCurrent (state, current) {
+ console.log("setTopMenuCurrent",current)
+ if(current.id !== state.topMenuCurrent.id){
+ state.topMenuList.list.forEach(item => {
+ console.log(item.id, item.id)
+ if (current.id == item.id) {
+ state.topMenuCurrent = current
+ state.menuData.list = item.children
+ }
+ })
+ }
+ },
// 閲嶇疆鑿滃崟
resetMenus: (state) => {
+ state.topMenuId=null
state.menuData.list = []
},
// tags
--
Gitblit v1.9.3