Browse Source

feat: 调整内容区

pull/286/head
zhaowei 10 months ago
parent
commit
26674b220f
4 changed files with 32 additions and 14 deletions
  1. +2
    -6
      react-ui/src/app.tsx
  2. +14
    -0
      react-ui/src/components/PageContainer/index.less
  3. +16
    -0
      react-ui/src/components/PageContainer/index.tsx
  4. +0
    -8
      react-ui/src/global.less

+ 2
- 6
react-ui/src/app.tsx View File

@@ -10,6 +10,7 @@ import defaultSettings from '../config/defaultSettings';
import '../public/fonts/font.css';
import { getAccessToken } from './access';
import ErrorBoundary from './components/ErrorBoundary';
import PageContainer from './components/PageContainer';
import './dayjsConfig';
import { removeAllPageCacheState } from './hooks/useCacheState';
import { globalGetSeverTime } from './hooks/useServerTime';
@@ -87,12 +88,7 @@ export const layout: RuntimeConfig['layout'] = ({ initialState }) => {
childrenRender: (children) => {
// 增加一个 loading 的状态
// if (initialState?.loading) return <PageLoading />;
return (
<div className="kf-page-container">
{/* <RightContent></RightContent> */}
<div className="kf-page-container__content">{children}</div>
</div>
);
return <PageContainer>{children}</PageContainer>;
},
collapsedButtonRender: false,
collapsed: initialState?.collapsed,


+ 14
- 0
react-ui/src/components/PageContainer/index.less View File

@@ -0,0 +1,14 @@
.kf-page-container {
height: 100%;

&__breadcrumb {
display: flex;
align-items: center;
height: 70px;
padding-left: 30px;
}

&__content {
height: calc(100% - 70px);
}
}

+ 16
- 0
react-ui/src/components/PageContainer/index.tsx View File

@@ -0,0 +1,16 @@
import { ProBreadcrumb } from '@ant-design/pro-components';
import React from 'react';
import './index.less';

function PageContainer({ children }: { children: React.ReactNode }) {
return (
<div className="kf-page-container">
<div className="kf-page-container__breadcrumb">
<ProBreadcrumb></ProBreadcrumb>
</div>
<div className="kf-page-container__content">{children}</div>
</div>
);
}

export default PageContainer;

+ 0
- 8
react-ui/src/global.less View File

@@ -137,14 +137,6 @@ ol {
}
}

.kf-page-container {
height: 100%;

&__content {
height: calc(100% - 55px);
}
}

.kf-menu-collapsed {
position: fixed;
top: 0;


Loading…
Cancel
Save