From ba90bf9bfbcddc10f543bcb63f0e07f84ca393ec Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Mon, 19 Oct 2026 12:00:21 +0800 Subject: [PATCH] =?UTF-8?q?style(web):=20=E7=BB=9F=E4=B8=80=E8=BE=A3?= =?UTF-8?q?=E6=A4=92=E7=BA=A2=E4=B8=BB=E8=89=B2=E4=B8=8E=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Menu/src/components/useRenderMenuItem.tsx | 9 +- .../src/components/useRenderMenuTitle.tsx | 4 +- src/components/Setting/src/Setting.vue | 2 +- src/store/modules/app.ts | 6 +- src/styles/business/dark.css | 16 +-- src/styles/business/index.css | 1 + src/styles/business/menu.css | 131 ++++++++++++++++++ src/styles/business/theme.css | 48 ++++--- src/views/Login/Login.vue | 2 +- src/views/permission/MenuManagementView.vue | 2 +- .../composables/useMenuManagement.js | 4 +- 11 files changed, 185 insertions(+), 40 deletions(-) create mode 100644 src/styles/business/menu.css diff --git a/src/components/Menu/src/components/useRenderMenuItem.tsx b/src/components/Menu/src/components/useRenderMenuItem.tsx index 301313f..0132652 100644 --- a/src/components/Menu/src/components/useRenderMenuItem.tsx +++ b/src/components/Menu/src/components/useRenderMenuItem.tsx @@ -9,7 +9,7 @@ const { renderMenuTitle } = useRenderMenuTitle() export const useRenderMenuItem = () => // allRouters: AppRouteRecordRaw[] = [], { - const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => { + const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/', nested = false) => { return routers .filter((v) => !v.meta?.hidden) .map((v) => { @@ -27,7 +27,8 @@ export const useRenderMenuItem = () => index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath} > {{ - default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) + default: () => + renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta, !nested) }} ) @@ -35,8 +36,8 @@ export const useRenderMenuItem = () => return ( {{ - title: () => renderMenuTitle(meta), - default: () => renderMenuItem(v.children!, fullPath) + title: () => renderMenuTitle(meta, !nested), + default: () => renderMenuItem(v.children!, fullPath, true) }} ) diff --git a/src/components/Menu/src/components/useRenderMenuTitle.tsx b/src/components/Menu/src/components/useRenderMenuTitle.tsx index 5c3dde8..838423e 100644 --- a/src/components/Menu/src/components/useRenderMenuTitle.tsx +++ b/src/components/Menu/src/components/useRenderMenuTitle.tsx @@ -5,11 +5,11 @@ import { AppIcon } from '@/components/AppIcon' import { useI18n } from '@/hooks/web/useI18n' export const useRenderMenuTitle = () => { - const renderMenuTitle = (meta: RouteMeta) => { + const renderMenuTitle = (meta: RouteMeta, showIcon = true) => { const { t } = useI18n() const { title = 'Please set title', icon } = meta - return icon ? ( + return icon && showIcon ? ( <> diff --git a/src/components/Setting/src/Setting.vue b/src/components/Setting/src/Setting.vue index 6f25ee1..e60cf2d 100644 --- a/src/components/Setting/src/Setting.vue +++ b/src/components/Setting/src/Setting.vue @@ -195,7 +195,7 @@ const themeChange = () => { - + diff --git a/src/views/permission/composables/useMenuManagement.js b/src/views/permission/composables/useMenuManagement.js index 0d91b28..a5d8156 100644 --- a/src/views/permission/composables/useMenuManagement.js +++ b/src/views/permission/composables/useMenuManagement.js @@ -93,7 +93,7 @@ export function useMenuManagement() { routePath: raw.path || '', routeName: raw.name || '', component: raw.component === '#' ? '' : raw.component || '', - icon: normalizeAppIcon(raw.icon), + icon: raw.type === 'CATALOG' ? normalizeAppIcon(raw.icon) : '', permissionCode: raw.permissionCode || '', type: raw.type || 'MENU', sort: raw.sort ?? 1, @@ -113,7 +113,7 @@ export function useMenuManagement() { routePath: form.routePath.trim(), routeName: form.routeName.trim(), component: form.type === 'CATALOG' ? '#' : form.component.trim(), - icon: form.type === 'BUTTON' ? '' : normalizeAppIcon(form.icon), + icon: form.type === 'CATALOG' ? normalizeAppIcon(form.icon) : '', permissionCode: form.permissionCode.trim(), type: form.type, sort: Number(form.sort) || 1,