|
|
|
@ -25,6 +25,7 @@ import { GlobalState } from '@/store';
|
|
|
|
import getUrlParams from '@/utils/getUrlParams';
|
|
|
|
import getUrlParams from '@/utils/getUrlParams';
|
|
|
|
import styles from '@/style/layout.module.less';
|
|
|
|
import styles from '@/style/layout.module.less';
|
|
|
|
import NoAccess from '@/pages/exception/403';
|
|
|
|
import NoAccess from '@/pages/exception/403';
|
|
|
|
|
|
|
|
import { openWindow, OpenWindowOptions } from '@/utils/common';
|
|
|
|
|
|
|
|
|
|
|
|
const MenuItem = Menu.Item;
|
|
|
|
const MenuItem = Menu.Item;
|
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
|
@ -91,8 +92,17 @@ function PageLayout({ children }: { children: ReactNode }) {
|
|
|
|
|
|
|
|
|
|
|
|
const [breadcrumb, setBreadCrumb] = useState([]);
|
|
|
|
const [breadcrumb, setBreadCrumb] = useState([]);
|
|
|
|
|
|
|
|
|
|
|
|
function onClickMenuItem(key) {
|
|
|
|
function onClickMenuItem(key: string) {
|
|
|
|
setSelectedKeys([key]);
|
|
|
|
if (key === 'componentDevelopment') {
|
|
|
|
|
|
|
|
const url = `/ideContainer`;
|
|
|
|
|
|
|
|
const params: OpenWindowOptions = {
|
|
|
|
|
|
|
|
target: '_blank',
|
|
|
|
|
|
|
|
menu: false,
|
|
|
|
|
|
|
|
identity: key
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
openWindow(url, params);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else setSelectedKeys([key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function toggleCollapse() {
|
|
|
|
function toggleCollapse() {
|
|
|
|
@ -138,6 +148,7 @@ function PageLayout({ children }: { children: ReactNode }) {
|
|
|
|
function renderRoutes(locale) {
|
|
|
|
function renderRoutes(locale) {
|
|
|
|
return function travel(_routes: IRoute[], level, parentNode = []) {
|
|
|
|
return function travel(_routes: IRoute[], level, parentNode = []) {
|
|
|
|
return _routes.map((route) => {
|
|
|
|
return _routes.map((route) => {
|
|
|
|
|
|
|
|
console.log('route:', route);
|
|
|
|
const { ignore } = route;
|
|
|
|
const { ignore } = route;
|
|
|
|
const iconDom = getIconFromKey(route.key);
|
|
|
|
const iconDom = getIconFromKey(route.key);
|
|
|
|
const titleDom = (
|
|
|
|
const titleDom = (
|
|
|
|
@ -164,13 +175,23 @@ function PageLayout({ children }: { children: ReactNode }) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
menuMap.current.set(route.key, { menuItem: true });
|
|
|
|
menuMap.current.set(route.key, { menuItem: true });
|
|
|
|
return (
|
|
|
|
|
|
|
|
<MenuItem key={route.key}>
|
|
|
|
if (route?.openWindow) {
|
|
|
|
<Link href={`/${route.key}`} passHref>
|
|
|
|
return (
|
|
|
|
|
|
|
|
<MenuItem key={route.key}>
|
|
|
|
<a suppressHydrationWarning>{titleDom}</a>
|
|
|
|
<a suppressHydrationWarning>{titleDom}</a>
|
|
|
|
</Link>
|
|
|
|
</MenuItem>
|
|
|
|
</MenuItem>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<MenuItem key={route.key}>
|
|
|
|
|
|
|
|
<Link href={`/${route.key}`} passHref>
|
|
|
|
|
|
|
|
<a suppressHydrationWarning>{titleDom}</a>
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
</MenuItem>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|