|
|
@@ -6,13 +6,14 @@
|
|
|
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout'
|
|
|
import React, { useEffect, useMemo, useRef } from 'react'
|
|
|
import { Link, useIntl, connect, history } from 'umi'
|
|
|
-import { GithubOutlined } from '@ant-design/icons'
|
|
|
-import { Result, Button } from 'antd'
|
|
|
+import { Result, Button, message } from 'antd'
|
|
|
import Authorized from '@/utils/Authorized'
|
|
|
import RightContent from '@/components/GlobalHeader/RightContent'
|
|
|
import { getMatchMenu } from '@umijs/route-utils'
|
|
|
import logo from '../assets/logo.svg'
|
|
|
import styles from './BasicLayout.less'
|
|
|
+import { CSSTransition, TransitionGroup } from 'react-transition-group'
|
|
|
+import './amimate.scss'
|
|
|
|
|
|
const noMatch = (
|
|
|
<Result
|
|
|
@@ -71,7 +72,8 @@ const BasicLayout = (props) => {
|
|
|
children,
|
|
|
settings,
|
|
|
location = {
|
|
|
- pathname: '/'
|
|
|
+ pathname: '/',
|
|
|
+ key: ''
|
|
|
}
|
|
|
} = props
|
|
|
const menuDataRef = useRef([])
|
|
|
@@ -100,7 +102,7 @@ const BasicLayout = (props) => {
|
|
|
getMatchMenu(location.pathname || '/', menuDataRef.current).pop() || {
|
|
|
authority: undefined
|
|
|
},
|
|
|
- [ location.pathname ]
|
|
|
+ [location.pathname]
|
|
|
)
|
|
|
const { formatMessage } = useIntl()
|
|
|
return (
|
|
|
@@ -133,8 +135,8 @@ const BasicLayout = (props) => {
|
|
|
return first ? (
|
|
|
<Link to={paths.join('/')}>{route.breadcrumbName}</Link>
|
|
|
) : (
|
|
|
- <span>{route.breadcrumbName}</span>
|
|
|
- )
|
|
|
+ <span>{route.breadcrumbName}</span>
|
|
|
+ )
|
|
|
}}
|
|
|
// footerRender={() => defaultFooterDom}
|
|
|
menuDataRender={menuDataRender}
|
|
|
@@ -144,9 +146,17 @@ const BasicLayout = (props) => {
|
|
|
return menuData || []
|
|
|
}}
|
|
|
>
|
|
|
- <Authorized authority={authorized.authority} noMatch={noMatch}>
|
|
|
- {children}
|
|
|
- </Authorized>
|
|
|
+ <TransitionGroup className="wrap-container">
|
|
|
+ <CSSTransition
|
|
|
+ key={location.pathname}
|
|
|
+ timeout={250}
|
|
|
+ classNames="fade"
|
|
|
+ >
|
|
|
+ {children}
|
|
|
+ </CSSTransition>
|
|
|
+ </TransitionGroup>
|
|
|
+ {/* <Authorized authority={authorized.authority} noMatch={noMatch}> */}
|
|
|
+ {/* </Authorized> */}
|
|
|
</ProLayout>
|
|
|
)
|
|
|
}
|