Commit d0a92eae authored by alwayOnlie's avatar alwayOnlie

多级菜单修改

parent e27b5bd6
......@@ -41,30 +41,30 @@ import platformCouponManageRoute from './platformCouponManageRoute'; // 平台
import asyncRoutes from '../router.config.json';
const routeList = [
// pageCustomized,
// calssPropertyRoute,
// trademarkRoute,
// commodity,
// rfqRoute,
// rfqOfferRoute,
// logisticsRoutes,
// memberAbility,
// ruleSettingRoutes,
// authConfig,
// commentRoutes,
// contentRoute,
// balancedRoute,
// demandRoute,
// procurementRoute,
// demandQuoteOrderRoute,
// capitalAccount,
// messageRoute,
// systemManageRoute,
// orderSystemRoutes,
// productionNoticeRoutes,
// exchangeManageRoutes,
// returnManageRoute,
// repairManageRoute,
// pageCustomized,
// calssPropertyRoute,
// trademarkRoute,
// commodity,
// rfqRoute,
// rfqOfferRoute,
// logisticsRoutes,
// memberAbility,
// ruleSettingRoutes,
// authConfig,
// commentRoutes,
// contentRoute,
// balancedRoute,
// demandRoute,
// procurementRoute,
// demandQuoteOrderRoute,
// capitalAccount,
// messageRoute,
// systemManageRoute,
// orderSystemRoutes,
// productionNoticeRoutes,
// exchangeManageRoutes,
// returnManageRoute,
// repairManageRoute,
];
const router = [
......
......@@ -16,7 +16,6 @@ import { ReactComponent as transcation } from '../../asserts/menuIcon/transcatio
import { ReactComponent as home } from '../../asserts/menuIcon/home.svg'
import { ReactComponent as commodity } from '../../asserts/menuIcon/commodity.svg'
import Icon from '@ant-design/icons'
import { IconComponentProps } from '@ant-design/icons/lib/components/Icon'
const iconMap = {
afterSale,
......@@ -38,17 +37,12 @@ const iconMap = {
function RenderComponent({ type, ...props }: { type: keyof typeof iconMap }) {
const Component = iconMap[type]
// console.log(Component, 'Component')
return <Component {...props} />
}
const CustomIcon: FC<any> = ({ type, ...props }: { type: keyof typeof iconMap }) => {
// console.log(type, props)
// return <Icon component={() => <RenderComponent type={type} {...props}/>}/>
// @处理未配置icon报错
return <Icon component={channel} />
// return <><span>66</span></>
// return type ? <Icon component={() => <RenderComponent type={type} {...props} />} /> : null
return type ? <Icon component={() => <RenderComponent type={type} {...props} />} /> : null
}
export default CustomIcon
......@@ -6,11 +6,9 @@ import {
BorderOutlined,
} from '@ant-design/icons'
import OuterSider from './OuterSide'
import { GlobalConfig } from '@/global/config'
import styles from '../styles/MenuSlider.less'
import { getRouters } from '@/utils/auth';
import { isDev } from '@/constants';
const { Sider } = Layout
const { SubMenu } = Menu;
......@@ -26,7 +24,6 @@ export interface MenuSliderProps {
const MenuSlider: React.FC<MenuSliderProps> = (props) => {
const { menuData, pathname, currentSelectKey = [], openKeys = [], changeOpenKeys } = props
console.log(menuData)
const [innerCollapsed, setInnerCollapsed] = useState(false)
let menuItemsCache = null
......@@ -86,7 +83,8 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
}
const clearHeightSearchParams = () => {
const currentState = JSON.parse(sessionStorage.getItem("currentState"))
let current: any = sessionStorage.getItem("currentState")
const currentState = JSON.parse(current)
const result = { ...currentState, queryParams: {}, current: 1 }
sessionStorage.setItem("currentState", JSON.stringify(result))
}
......
......@@ -20,7 +20,7 @@ export interface OuterSiderProps {
const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
const { menuData, pathname = "/", currentRouter } = props
console.log(menuData, currentRouter)
console.log(props, 'props')
const authRouters = getRouters()
let defaultSelectedKeys = ""
......@@ -54,17 +54,17 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
return subHeadMenus
}
const siderMenu = getSubMenu()
console.log(siderMenu, 'siderMenu')
// console.log(siderMenu, 'siderMenu')
return <>
<Sider collapsed={true} collapsedWidth={64} className={styles.wrapperSilder}>
<div className={styles.userPic}>
{/* <Link to="/memberCenter/home">
<Link to="/home">
{
props.UserStore.avatar
? <img src={props.UserStore.avatar} className={styles.avatar} />
: <Icon component={() => <DefaultAvatar className={styles.logo} />} />
}
</Link> */}
</Link>
</div>
<ul className={styles.menuBox}>
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment