|
@ -24,7 +24,7 @@ NProgress.configure({ |
|
|
</div> |
|
|
</div> |
|
|
` |
|
|
` |
|
|
}); |
|
|
}); |
|
|
const headerHeight = 64 |
|
|
const headerHeight = 32 |
|
|
const footerHeight = 0 |
|
|
const footerHeight = 0 |
|
|
let scrollbar |
|
|
let scrollbar |
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ const LayoutContainer = props => { |
|
|
const { dispatch, msg, user, copyright, children, sections, clientWidth, clientHeight, |
|
|
const { dispatch, msg, user, copyright, children, sections, clientWidth, clientHeight, |
|
|
location, match, routes, history } = props |
|
|
location, match, routes, history } = props |
|
|
const [themeName, setThemeName] = useState(localStorage.getItem("theme-name") || 'light') |
|
|
const [themeName, setThemeName] = useState(localStorage.getItem("theme-name") || 'light') |
|
|
const [collapsed, setCollapsed] = useState(false) |
|
|
const [collapsed, setCollapsed] = useState(true) |
|
|
|
|
|
|
|
|
NProgress.start(); |
|
|
NProgress.start(); |
|
|
|
|
|
|
|
@ -77,9 +77,9 @@ const LayoutContainer = props => { |
|
|
|
|
|
|
|
|
let contentStyle = { |
|
|
let contentStyle = { |
|
|
position: 'relative', |
|
|
position: 'relative', |
|
|
margin: '12px 12px 0px', |
|
|
margin: '1px 1px 0px', |
|
|
padding: '8px', |
|
|
padding: '1px', |
|
|
height: clientHeight - 16 + 68, |
|
|
height: clientHeight + 68, |
|
|
} |
|
|
} |
|
|
if (themeName == 'light') { |
|
|
if (themeName == 'light') { |
|
|
contentStyle.background = '#fff'; |
|
|
contentStyle.background = '#fff'; |
|
@ -91,10 +91,10 @@ const LayoutContainer = props => { |
|
|
<Header |
|
|
<Header |
|
|
user={user} |
|
|
user={user} |
|
|
pathname={location.pathname} |
|
|
pathname={location.pathname} |
|
|
toggleCollapsed={() => { |
|
|
// toggleCollapsed={() => {
|
|
|
setCollapsed(!collapsed); |
|
|
// setCollapsed(!collapsed);
|
|
|
resize(!collapsed) |
|
|
// resize(!collapsed)
|
|
|
}} |
|
|
// }}
|
|
|
changeTheme={(themeName) => { |
|
|
changeTheme={(themeName) => { |
|
|
setThemeName(themeName) |
|
|
setThemeName(themeName) |
|
|
}} |
|
|
}} |
|
@ -103,29 +103,30 @@ const LayoutContainer = props => { |
|
|
/> |
|
|
/> |
|
|
</Layout.Header> |
|
|
</Layout.Header> |
|
|
<Layout> |
|
|
<Layout> |
|
|
<Layout.Sider trigger={null} collapsible collapsed={collapsed} theme={themeName}> |
|
|
{ |
|
|
{/* <div style={{ |
|
|
false ? ( |
|
|
|
|
|
<Layout.Sider trigger={null} collapsible collapsed={collapsed} theme={themeName}> |
|
|
|
|
|
{/* <div style={{ |
|
|
height: headerHeight, |
|
|
height: headerHeight, |
|
|
textAlign: 'center', |
|
|
textAlign: 'center', |
|
|
lineHeight: headerHeight + 'px' |
|
|
lineHeight: headerHeight + 'px' |
|
|
}}> |
|
|
}}> |
|
|
LOGO |
|
|
LOGO |
|
|
</div> */} |
|
|
</div> */} |
|
|
<Sider |
|
|
<Sider |
|
|
sections={sections} |
|
|
sections={sections} |
|
|
dispatch={dispatch} |
|
|
dispatch={dispatch} |
|
|
user={user} |
|
|
user={user} |
|
|
pathname={location.pathname} |
|
|
pathname={location.pathname} |
|
|
collapsed={collapsed} |
|
|
collapsed={collapsed} |
|
|
themeName={themeName} |
|
|
themeName={themeName} |
|
|
/> |
|
|
/> |
|
|
</Layout.Sider> |
|
|
</Layout.Sider> |
|
|
|
|
|
) : null |
|
|
|
|
|
} |
|
|
<Layout.Content id="page-content" style={contentStyle}> |
|
|
<Layout.Content id="page-content" style={contentStyle}> |
|
|
<div style={{ minWidth: 520 }}> |
|
|
<div style={{ minWidth: 520 }}> |
|
|
<div style={{ padding: '0px 16px 4px', borderBottom: '1px solid #e8e8e8' }}> |
|
|
<div style={{ paddingTop: 6 }}> |
|
|
<Breadcrumbs routes={routes} /> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style={{ paddingTop: 12 }}> |
|
|
|
|
|
{children} |
|
|
{children} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|