|
|
@ -22,17 +22,17 @@ import {useMessageStore} from '@/store/index.js' |
|
|
const icons = import.meta.glob('@/assets/SvgIcons/*.svg', {eager: true}) |
|
|
const icons = import.meta.glob('@/assets/SvgIcons/*.svg', {eager: true}) |
|
|
|
|
|
|
|
|
const menuNameMap = { |
|
|
const menuNameMap = { |
|
|
'工作台': 'workbench', |
|
|
|
|
|
'金币管理': 'gold-management', |
|
|
|
|
|
'现金管理': 'cash-management', |
|
|
|
|
|
'活动管理': 'activity-management', |
|
|
|
|
|
'频道管理': 'channel-management', |
|
|
|
|
|
'权限管理': 'permission-management', |
|
|
|
|
|
'多语言配置': 'mutiple-language', |
|
|
|
|
|
|
|
|
'2': 'workbench', // 工作台 |
|
|
|
|
|
'3': 'gold-management', //金币管理 |
|
|
|
|
|
'58': 'cash-management', //现金管理 |
|
|
|
|
|
'119': 'activity-management', //活动管理 |
|
|
|
|
|
'124': 'channel-management', //频道管理 |
|
|
|
|
|
'128': 'permission-management', //权限管理 |
|
|
|
|
|
'146': 'mutiple-language', //多语言配置 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getIconPath = (menuName) => { |
|
|
|
|
|
const englishName = menuNameMap[menuName] || menuName; |
|
|
|
|
|
|
|
|
const getIconPath = (menuNameId) => { |
|
|
|
|
|
const englishName = menuNameMap[menuNameId] || menuNameId; |
|
|
|
|
|
|
|
|
const possibleKeys = [ |
|
|
const possibleKeys = [ |
|
|
`@/assets/SvgIcons/${englishName}.svg`, |
|
|
`@/assets/SvgIcons/${englishName}.svg`, |
|
|
@ -314,7 +314,7 @@ onMounted(() => getMessage()) |
|
|
<el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.id.toString()"> |
|
|
<el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.id.toString()"> |
|
|
<template #title> |
|
|
<template #title> |
|
|
<img |
|
|
<img |
|
|
:src="getIconPath(menu.menuName)" |
|
|
|
|
|
|
|
|
:src="getIconPath(menu.id)" |
|
|
:alt="`${menu.menuName}图标`" |
|
|
:alt="`${menu.menuName}图标`" |
|
|
style="width: 4vh; height: 4vh; margin-right: 4px;" |
|
|
style="width: 4vh; height: 4vh; margin-right: 4px;" |
|
|
> |
|
|
> |
|
|
@ -355,7 +355,7 @@ onMounted(() => getMessage()) |
|
|
<!-- 无子菜单的一级菜单 --> |
|
|
<!-- 无子菜单的一级菜单 --> |
|
|
<el-menu-item v-else :index="getRoutePath(menu)"> |
|
|
<el-menu-item v-else :index="getRoutePath(menu)"> |
|
|
<img |
|
|
<img |
|
|
:src="getIconPath(menu.menuName)" |
|
|
|
|
|
|
|
|
:src="getIconPath(menu.id)" |
|
|
:alt="`${menu.menuName}图标`" |
|
|
:alt="`${menu.menuName}图标`" |
|
|
style="width: 4vh; height: 4vh; margin-right: 4px;" |
|
|
style="width: 4vh; height: 4vh; margin-right: 4px;" |
|
|
> |
|
|
> |
|
|
|