front/src/utils/menu-icon-catalog.ts
zzh eb12f9fb9e
Some checks failed
Build and Deploy Front / deploy (push) Has been cancelled
feat: 官网手机端适配、EventBus 菜单与图标扩展
同步 H5/登录回官网、仓库 PeekModal、运单状态展示与菜单图标目录。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-27 15:11:57 +08:00

476 lines
9.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ARCO_ICON_NAMES } from '@/utils/arco-icon-list'
export interface MenuIconCategory {
/** i18n key: system.menu.iconPicker.category.{key} */
key: string
icons: string[]
}
/**
* 菜单图标选择器分类(尽量多放业务可用的 Arco Icon;不存在的会自动过滤)。
*/
const RAW_CATEGORIES: MenuIconCategory[] = [
{
key: 'common',
icons: [
'IconHome',
'IconDashboard',
'IconApps',
'IconMenu',
'IconSettings',
'IconList',
'IconOrderedList',
'IconUnorderedList',
'IconFile',
'IconFolder',
'IconBook',
'IconBookmark',
'IconSearch',
'IconFilter',
'IconSort',
'IconPlus',
'IconPlusCircle',
'IconEdit',
'IconDelete',
'IconSave',
'IconCopy',
'IconPaste',
'IconRefresh',
'IconSync',
'IconLink',
'IconLaunch',
'IconShareInternal',
'IconShareExternal',
'IconEye',
'IconEyeInvisible',
'IconMore',
'IconMoreVertical',
'IconStar',
'IconHeart',
'IconFire',
'IconBulb',
'IconThunderbolt',
'IconGift',
'IconTrophy',
'IconPushpin',
'IconTag',
'IconTags',
'IconCalendar',
'IconSchedule',
'IconClockCircle',
'IconHistory',
'IconNotification',
'IconMessage',
'IconUser',
'IconUserGroup',
'IconSafe',
'IconLock',
'IconComputer',
'IconStorage',
'IconCloud',
'IconSend',
'IconDownload',
'IconUpload',
'IconPrinter',
'IconScan',
'IconQrcode',
'IconLocation',
'IconCompass',
'IconPublic',
'IconBarChart',
'IconMindMapping',
'IconRelation',
'IconRobot',
'IconTool',
'IconCode',
'IconBug',
'IconExperiment',
],
},
{
key: 'nav',
icons: [
'IconDashboard',
'IconHome',
'IconApps',
'IconMenu',
'IconMenuFold',
'IconMenuUnfold',
'IconNav',
'IconLayout',
'IconLayers',
'IconCommon',
'IconMindMapping',
'IconRelation',
'IconBranch',
'IconSubscribe',
'IconSubscribeAdd',
'IconSubscribed',
'IconPushpin',
'IconBookmark',
'IconCompass',
'IconLocation',
'IconPublic',
'IconTranslate',
'IconLanguage',
'IconMoon',
'IconSun',
'IconSkin',
'IconExpand',
'IconShrink',
'IconFullscreen',
'IconFullscreenExit',
'IconToTop',
'IconToBottom',
'IconToLeft',
'IconToRight',
'IconUp',
'IconDown',
'IconLeft',
'IconRight',
'IconArrowUp',
'IconArrowDown',
'IconArrowLeft',
'IconArrowRight',
'IconArrowRise',
'IconArrowFall',
'IconDoubleUp',
'IconDoubleDown',
'IconDoubleLeft',
'IconDoubleRight',
'IconCaretUp',
'IconCaretDown',
'IconCaretLeft',
'IconCaretRight',
'IconSwap',
'IconLoop',
'IconDragArrow',
'IconDragDot',
'IconDragDotVertical',
],
},
{
key: 'user',
icons: [
'IconUser',
'IconUserGroup',
'IconUserAdd',
'IconIdcard',
'IconMan',
'IconWoman',
'IconSafe',
'IconLock',
'IconUnlock',
'IconEmail',
'IconAt',
'IconPhone',
'IconMobile',
'IconMessage',
'IconMessageBanned',
'IconNotification',
'IconNotificationClose',
'IconCustomerService',
'IconVoice',
'IconRobot',
'IconRobotAdd',
'IconTrophy',
'IconGift',
'IconStamp',
'IconHeart',
'IconStar',
'IconThumbUp',
'IconThumbDown',
'IconReply',
'IconShareInternal',
'IconShareExternal',
'IconShareAlt',
'IconShake',
'IconEar',
'IconDice',
],
},
{
key: 'order',
icons: [
'IconFile',
'IconDriveFile',
'IconFileImage',
'IconFilePdf',
'IconFileAudio',
'IconFileVideo',
'IconArchive',
'IconFolder',
'IconFolderAdd',
'IconFolderDelete',
'IconStorage',
'IconTags',
'IconTag',
'IconQrcode',
'IconScan',
'IconPrinter',
'IconImport',
'IconExport',
'IconSend',
'IconInteraction',
'IconSwap',
'IconSelectAll',
'IconCheckSquare',
'IconCheck',
'IconCalendar',
'IconCalendarClock',
'IconSchedule',
'IconClockCircle',
'IconHistory',
'IconAttachment',
'IconCopy',
'IconPaste',
'IconSave',
'IconScissor',
'IconFilter',
'IconFindReplace',
'IconSort',
'IconSortAscending',
'IconSortDescending',
'IconList',
'IconOrderedList',
'IconUnorderedList',
'IconEmpty',
'IconOriginalSize',
'IconZoomIn',
'IconZoomOut',
'IconRotateLeft',
'IconRotateRight',
'IconImage',
'IconImageClose',
'IconCamera',
'IconVideoCamera',
'IconMusic',
'IconRecord',
'IconRecordStop',
],
},
{
key: 'finance',
icons: [
'IconStorage',
'IconGift',
'IconTrophy',
'IconStamp',
'IconStar',
'IconHeart',
'IconFire',
'IconBulb',
'IconThunderbolt',
'IconBarChart',
'IconDashboard',
'IconWechatpay',
'IconAlipayCircle',
'IconSwap',
'IconList',
'IconFile',
'IconSafe',
'IconLock',
'IconUnlock',
'IconIdcard',
'IconCalendar',
'IconSchedule',
'IconHistory',
'IconTag',
'IconTags',
'IconBookmark',
'IconPushpin',
'IconSubscribe',
'IconSubscribed',
'IconThumbUp',
'IconThumbDown',
'IconCopyright',
],
},
{
key: 'track',
icons: [
'IconComputer',
'IconLiveBroadcast',
'IconSend',
'IconCompass',
'IconLocation',
'IconPublic',
'IconBookmark',
'IconPushpin',
'IconCheckCircle',
'IconExclamationCircle',
'IconCloseCircle',
'IconInfoCircle',
'IconQuestionCircle',
'IconMessage',
'IconNotification',
'IconDownload',
'IconUpload',
'IconCloud',
'IconCloudDownload',
'IconSync',
'IconRefresh',
'IconLoop',
'IconHistory',
'IconSchedule',
'IconCalendarClock',
'IconClockCircle',
'IconThunderbolt',
'IconMindMapping',
'IconRelation',
'IconBranch',
'IconInteraction',
'IconLaunch',
'IconShareExternal',
'IconWifi',
'IconMobile',
'IconPhone',
'IconScan',
'IconQrcode',
'IconPrinter',
'IconImport',
'IconExport',
'IconLoading',
'IconEmpty',
],
},
{
key: 'system',
icons: [
'IconSettings',
'IconTool',
'IconCode',
'IconCodeBlock',
'IconCodeSquare',
'IconCodeSandbox',
'IconCodepen',
'IconBug',
'IconExperiment',
'IconCommand',
'IconDesktop',
'IconComputer',
'IconCloud',
'IconCloudDownload',
'IconApps',
'IconCommon',
'IconStorage',
'IconDriveFile',
'IconWifi',
'IconPoweroff',
'IconPen',
'IconBrush',
'IconEraser',
'IconPalette',
'IconBgColors',
'IconFontColors',
'IconHighlight',
'IconCamera',
'IconVideoCamera',
'IconImage',
'IconMusic',
'IconPlayArrow',
'IconPlayCircle',
'IconPause',
'IconPauseCircle',
'IconStop',
'IconSkipNext',
'IconSkipPrevious',
'IconForward',
'IconBackward',
'IconMute',
'IconSound',
'IconRobot',
'IconRobotAdd',
'IconFormula',
'IconQuote',
'IconUndo',
'IconRedo',
'IconMosaic',
'IconScissor',
'IconBold',
'IconItalic',
'IconUnderline',
'IconStrikethrough',
'IconAlignLeft',
'IconAlignCenter',
'IconAlignRight',
'IconLineHeight',
'IconH1',
'IconH2',
'IconH3',
],
},
{
key: 'status',
icons: [
'IconCheck',
'IconCheckCircle',
'IconCheckSquare',
'IconClose',
'IconCloseCircle',
'IconExclamation',
'IconExclamationCircle',
'IconInfo',
'IconInfoCircle',
'IconQuestion',
'IconQuestionCircle',
'IconPlus',
'IconPlusCircle',
'IconMinus',
'IconMinusCircle',
'IconClockCircle',
'IconStop',
'IconPause',
'IconPauseCircle',
'IconPlayArrow',
'IconPlayCircle',
'IconLoading',
'IconSync',
'IconRefresh',
'IconLoop',
'IconObliqueLine',
'IconEmpty',
'IconEye',
'IconEyeInvisible',
'IconLock',
'IconUnlock',
'IconSafe',
'IconFire',
'IconThunderbolt',
'IconBulb',
'IconStar',
'IconHeart',
'IconThumbUp',
'IconThumbDown',
'IconUpCircle',
'IconDownCircle',
'IconLeftCircle',
'IconRightCircle',
'IconArrowRise',
'IconArrowFall',
],
},
]
function keepExisting(icons: string[]): string[] {
const available = new Set(ARCO_ICON_NAMES)
const seen = new Set<string>()
const result: string[] = []
for (const name of icons) {
if (!available.has(name) || seen.has(name)) continue
seen.add(name)
result.push(name)
}
return result
}
export const MENU_ICON_CATEGORIES: MenuIconCategory[] = RAW_CATEGORIES.map((cat) => ({
key: cat.key,
icons: keepExisting(cat.icons),
})).filter((cat) => cat.icons.length > 0)
/** 扁平常用图标(用于兼容旧逻辑) */
export const MENU_COMMON_ICONS: string[] = keepExisting(
MENU_ICON_CATEGORIES.flatMap((cat) => cat.icons),
)