管理后台初始化,登录,团队管理,报价单管理 完成

This commit is contained in:
‘Liammcl’
2024-12-15 17:39:58 +08:00
commit 5882bf9548
91 changed files with 16260 additions and 0 deletions

34
src/utils/menuUtils.jsx Normal file
View File

@@ -0,0 +1,34 @@
import React from 'react';
import { routes } from '@/config/routes';
import * as AntIcons from '@ant-design/icons';
import { ColorIcon } from '@/components/common/ColorIcon';
const getAntIcon = (iconName) => {
const iconKey = `${iconName.charAt(0).toUpperCase()}${iconName.slice(
1
)}Outlined`;
return AntIcons[iconKey] ? React.createElement(AntIcons[iconKey]) : null;
};
const generateMenuItems = (routes, parentPath = '') => {
return routes.map((route) => {
const fullPath = `${parentPath}/${route.path}`.replace(/\/+/g, '/');
const icon = route.icon && <ColorIcon icon={getAntIcon(route.icon)} />;
const menuItem = {
key: fullPath,
icon,
label: route.name,
};
if (route.children) {
menuItem.children = generateMenuItems(route.children, fullPath);
}
return menuItem;
});
};
export const getMenuItems = () => generateMenuItems(routes);