|
@@ -4,9 +4,10 @@
|
|
|
* https://github.com/ant-design/ant-design-pro-layout
|
|
* https://github.com/ant-design/ant-design-pro-layout
|
|
|
*/
|
|
*/
|
|
|
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout'
|
|
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout'
|
|
|
|
|
+import zhCN from 'antd/lib/locale/zh_CN'
|
|
|
import React, { useEffect, useMemo, useRef } from 'react'
|
|
import React, { useEffect, useMemo, useRef } from 'react'
|
|
|
import { Link, useIntl, connect, history } from 'umi'
|
|
import { Link, useIntl, connect, history } from 'umi'
|
|
|
-import { Result, Button, message } from 'antd'
|
|
|
|
|
|
|
+import { Result, Button, message, ConfigProvider } from 'antd'
|
|
|
import Authorized from '@/utils/Authorized'
|
|
import Authorized from '@/utils/Authorized'
|
|
|
import RightContent from '@/components/GlobalHeader/RightContent'
|
|
import RightContent from '@/components/GlobalHeader/RightContent'
|
|
|
import { getMatchMenu } from '@umijs/route-utils'
|
|
import { getMatchMenu } from '@umijs/route-utils'
|
|
@@ -31,8 +32,8 @@ const noMatch = (
|
|
|
/**
|
|
/**
|
|
|
* use Authorized check all menu item
|
|
* use Authorized check all menu item
|
|
|
*/
|
|
*/
|
|
|
-const menuDataRender = (menuList) =>
|
|
|
|
|
- menuList.map((item) => {
|
|
|
|
|
|
|
+const menuDataRender = menuList =>
|
|
|
|
|
+ menuList.map(item => {
|
|
|
const localItem = {
|
|
const localItem = {
|
|
|
...item,
|
|
...item,
|
|
|
children: item.children ? menuDataRender(item.children) : undefined
|
|
children: item.children ? menuDataRender(item.children) : undefined
|
|
@@ -66,7 +67,7 @@ const menuDataRender = (menuList) =>
|
|
|
// />
|
|
// />
|
|
|
// );
|
|
// );
|
|
|
|
|
|
|
|
-const BasicLayout = (props) => {
|
|
|
|
|
|
|
+const BasicLayout = props => {
|
|
|
const {
|
|
const {
|
|
|
dispatch,
|
|
dispatch,
|
|
|
children,
|
|
children,
|
|
@@ -88,7 +89,7 @@ const BasicLayout = (props) => {
|
|
|
* init variables
|
|
* init variables
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- const handleMenuCollapse = (payload) => {
|
|
|
|
|
|
|
+ const handleMenuCollapse = payload => {
|
|
|
if (dispatch) {
|
|
if (dispatch) {
|
|
|
dispatch({
|
|
dispatch({
|
|
|
type: 'global/changeLayoutCollapsed',
|
|
type: 'global/changeLayoutCollapsed',
|
|
@@ -135,24 +136,19 @@ const BasicLayout = (props) => {
|
|
|
return first ? (
|
|
return first ? (
|
|
|
<Link to={paths.join('/')}>{route.breadcrumbName}</Link>
|
|
<Link to={paths.join('/')}>{route.breadcrumbName}</Link>
|
|
|
) : (
|
|
) : (
|
|
|
- <span>{route.breadcrumbName}</span>
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ <span>{route.breadcrumbName}</span>
|
|
|
|
|
+ )
|
|
|
}}
|
|
}}
|
|
|
// footerRender={() => defaultFooterDom}
|
|
// footerRender={() => defaultFooterDom}
|
|
|
menuDataRender={menuDataRender}
|
|
menuDataRender={menuDataRender}
|
|
|
rightContentRender={() => <RightContent />}
|
|
rightContentRender={() => <RightContent />}
|
|
|
- postMenuData={(menuData) => {
|
|
|
|
|
|
|
+ postMenuData={menuData => {
|
|
|
menuDataRef.current = menuData || []
|
|
menuDataRef.current = menuData || []
|
|
|
return menuData || []
|
|
return menuData || []
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ }}>
|
|
|
<TransitionGroup className="wrap-container">
|
|
<TransitionGroup className="wrap-container">
|
|
|
- <CSSTransition
|
|
|
|
|
- key={location.pathname}
|
|
|
|
|
- timeout={250}
|
|
|
|
|
- classNames="fade"
|
|
|
|
|
- >
|
|
|
|
|
- {children}
|
|
|
|
|
|
|
+ <CSSTransition key={location.pathname} timeout={250} classNames="fade">
|
|
|
|
|
+ <ConfigProvider locale={zhCN}>{children}</ConfigProvider>
|
|
|
</CSSTransition>
|
|
</CSSTransition>
|
|
|
</TransitionGroup>
|
|
</TransitionGroup>
|
|
|
{/* <Authorized authority={authorized.authority} noMatch={noMatch}> */}
|
|
{/* <Authorized authority={authorized.authority} noMatch={noMatch}> */}
|