From b5bf65d96d78aa49ea1389df301ac31fc39ce6e6 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Mon, 28 Oct 2024 11:07:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/permission.js | 15 ++++++++++----- src/views/index.vue | 5 +---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index d80e855..322598f 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -116,11 +116,16 @@ function dealMenuText(num,data,list){ break; } } - for (const item of list) { - if ( parData.parentId == 0){ - parData = item - level++ - break; + if(parData.parentId!=0){ + for (const item of list) { + if (parData.parentId == item.id){ + if (item.parentId==0){ + level++ + }else { + level = level+2 + } + break; + } } } if (level==2){ diff --git a/src/views/index.vue b/src/views/index.vue index 672c5a2..b7b2da1 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -3,10 +3,7 @@
-
{{ item.name }}
From b1aa9c1e4ab09b29a78d6a33c216ec5a7ae16c38 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Mon, 28 Oct 2024 11:34:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index e8d7ec6..8e0ef1b 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,9 +1,9 @@