diff --git a/src/components/common/PermissionMenuPage.vue b/src/components/common/PermissionMenuPage.vue
index ec80f2d..48c5ce4 100644
--- a/src/components/common/PermissionMenuPage.vue
+++ b/src/components/common/PermissionMenuPage.vue
@@ -40,39 +40,29 @@
{{ module.name }}
-
-
-
@@ -138,17 +128,12 @@ const filteredModules = computed(() => {
return modules.value
.map((module) => ({
...module,
- groups: module.groups
- .map((group) => ({
- ...group,
- children: group.children.filter((entry) => {
- const target = `${module.name}|${group.name}|${entry.name}`.toLowerCase()
- return target.includes(keyword)
- })
- }))
- .filter((group) => group.children.length > 0 || `${module.name}|${group.name}`.toLowerCase().includes(keyword))
+ children: (module.children || []).filter((entry) => {
+ const target = `${module.name}|${entry.name}`.toLowerCase()
+ return target.includes(keyword)
+ })
}))
- .filter((module) => module.groups.length > 0 || String(module.name || '').toLowerCase().includes(keyword))
+ .filter((module) => (module.children || []).length > 0 || String(module.name || '').toLowerCase().includes(keyword))
})
const hasMenuPermission = computed(() => modules.value.length > 0)
@@ -163,7 +148,7 @@ const emptyStateTitle = computed(() => {
const emptyStateDesc = computed(() => {
return isSearchEmpty.value
- ? `未搜索到与“${menuSearchKeyword.value.trim()}”相关的菜单项,请调整关键词后重试`
+ ? `未搜索到与"${menuSearchKeyword.value.trim()}"相关的菜单项,请调整关键词后重试`
: `当前账号还未配置${props.title}相关菜单权限,请联系管理员完成配置`
})
@@ -352,31 +337,11 @@ function handleClick(menu) {
color: #1a3a5c;
}
-.submodule-list {
- padding: 0 24rpx 24rpx;
-}
-
-.submodule-group {
- padding-top: 24rpx;
-}
-
-.submodule-header {
- padding: 0 8rpx 18rpx;
-}
-
-.submodule-name {
- display: inline-block;
- padding-left: 16rpx;
- border-left: 6rpx solid #1a3a5c;
- font-size: 30rpx;
- font-weight: 600;
- color: #435466;
-}
-
.function-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 14rpx;
+ padding: 24rpx;
}
.function-item {
@@ -417,12 +382,6 @@ function handleClick(menu) {
word-break: break-all;
}
-.divider {
- height: 1rpx;
- background: #eef1f5;
- margin: 24rpx 0 0;
-}
-
.go-top-btn {
position: fixed;
bottom: 140rpx;
diff --git a/src/utils/permissionMenu.js b/src/utils/permissionMenu.js
index df99ce5..446c023 100644
--- a/src/utils/permissionMenu.js
+++ b/src/utils/permissionMenu.js
@@ -178,11 +178,21 @@ export function findTabMenuByPage(menus, pagePath) {
export function buildPageModules(tabMenu) {
return toArray(tabMenu?.children)
- .map((module) => ({
- ...module,
- groups: wrapGroupEntries(module)
- }))
- .filter((module) => module.groups.length > 0)
+ .map((module) => {
+ const directChildren = toArray(module.children)
+ const hasNestedEntries = directChildren.some((child) => toArray(child.children).length > 0)
+ if (hasNestedEntries) {
+ return {
+ ...module,
+ children: directChildren.flatMap((child) => toArray(child.children))
+ }
+ }
+ return {
+ ...module,
+ children: directChildren
+ }
+ })
+ .filter((module) => (module.children || []).length > 0)
}
export function resolveMenuUrl(menu) {
@@ -222,4 +232,4 @@ export function syncTabBarMenus(menus, options = {}) {
dynamicMenus[1]?.name || dynamicMenus[0]?.name || options.workFallback || '管理',
options.mineText || '我的'
]
-}
\ No newline at end of file
+}