From 197a03ea2d5e38496d5495ee8bc0d4e127f233cf Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 08 四月 2024 11:31:43 +0800
Subject: [PATCH] 工具类添加
---
Source/ProjectWeb/src/store/modules/user.js | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/Source/ProjectWeb/src/store/modules/user.js b/Source/ProjectWeb/src/store/modules/user.js
index 1a65fee..3878f5f 100644
--- a/Source/ProjectWeb/src/store/modules/user.js
+++ b/Source/ProjectWeb/src/store/modules/user.js
@@ -27,10 +27,22 @@
} else {
ele[propsDefault.children].forEach(child => {
addPath(child);
- })
- }
+ });
+ }
}
+
+function updateCode(items) {
+ items.forEach(item => {
+ item.pathValue = item.path;
+ item.path = '/' + item.code;
+ if (item.children && item.children.length > 0) {
+ updateCode(item.children);
+ }
+ });
+}
+
+
const user = {
state: {
@@ -208,10 +220,12 @@
let menu = deepClone(data);
menu.forEach(ele => {
addPath(ele, true);
+ updateCode([ele]);
});
+
commit('SET_MENU_ALL', menu)
commit('SET_MENU', menu)
- //dispatch('GetButtons');
+ //dispatch('GetButtons');s
resolve(menu)
})
})
--
Gitblit v1.9.3