From 083f3042f0a1bc628adfd9c91a7756af9cb0709c Mon Sep 17 00:00:00 2001 From: ludc Date: 星期一, 08 四月 2024 10:27:20 +0800 Subject: [PATCH] getDataForTree接口修改 --- 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