Skip to content

Commit

Permalink
feat: tabs layout
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Mar 13, 2020
1 parent 9b1a24d commit c75e3a6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
5 changes: 3 additions & 2 deletions config/config.js
Expand Up @@ -9,8 +9,9 @@ const { pwa, primaryColor } = defaultSettings;
const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION, TEST } = process.env;

export default {
// add for transfer to umi
plugins: ['@alitajs/routes', '@alitajs/router'],
history: { type: 'hash' },
plugins: ['@alitajs/routes', '@alitajs/router', '@alitajs/tabs-layout'],
tabsLayout: [/./],
authorize: [
{
guard: ['@/pages/Auth'],
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -53,6 +53,7 @@
"dependencies": {
"@alitajs/router": "^2.1.7",
"@alitajs/routes": "^2.1.7",
"@alitajs/tabs-layout": "^2.0.0",
"@antv/data-set": "^0.10.2",
"@umijs/preset-react": "^1.4.2",
"antd": "^3.26.0",
Expand Down Expand Up @@ -83,7 +84,7 @@
"react-fittext": "^1.0.0",
"react-media": "^1.9.2",
"umi": "^3.0.6",
"umi-plugin-authorize": "^2.0.0",
"umi-plugin-authorize": "^2.0.1",
"umi-request": "^1.2.11"
},
"devDependencies": {
Expand Down Expand Up @@ -126,8 +127,7 @@
"stylelint-order": "^2.0.0",
"tslint": "^5.12.1",
"tslint-config-prettier": "^1.17.0",
"tslint-react": "^3.6.0",
"umi-plugin-ga": "^1.1.3"
"tslint-react": "^3.6.0"
},
"optionalDependencies": {
"puppeteer": "^1.12.1"
Expand Down
10 changes: 9 additions & 1 deletion src/global.less
Expand Up @@ -17,7 +17,15 @@ body,
canvas {
display: block;
}

.rumtime-tabs-layout {
margin: -24px -24px 0;
.ant-tabs-bar {
margin-bottom: 24px;
}
.ant-tabs-tabpane {
margin: 0 24px;
}
}
body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/BasicLayout.js
Expand Up @@ -5,6 +5,7 @@ import { connect } from 'dva';
import { ContainerQuery } from 'react-container-query';
import classNames from 'classnames';
import Media from 'react-media';
import { TabsLayout } from 'umi';
import logo from '../assets/logo.svg';
import Footer from './Footer';
import Header from './Header';
Expand Down Expand Up @@ -100,7 +101,6 @@ class BasicLayout extends React.Component {
const {
navTheme,
layout: PropsLayout,
children,
location: { pathname },
isMobile,
menuData,
Expand Down Expand Up @@ -136,7 +136,7 @@ class BasicLayout extends React.Component {
{...this.props}
/>
<Content className={styles.content} style={contentStyle}>
{children}
<TabsLayout {...this.props} />
</Content>
<Footer />
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Dashboard/Analysis.js
Expand Up @@ -180,5 +180,5 @@ class Analysis extends Component {
);
}
}

Analysis.title = '分析页';
export default Analysis;
2 changes: 2 additions & 0 deletions src/pages/Dashboard/Monitor.js
Expand Up @@ -241,4 +241,6 @@ class Monitor extends Component {
}
}

Monitor.title = '监控页';

export default Monitor;
2 changes: 2 additions & 0 deletions src/pages/Dashboard/Workplace.js
Expand Up @@ -252,4 +252,6 @@ class Workplace extends PureComponent {
}
}

Workplace.title = '工作台';

export default Workplace;

0 comments on commit c75e3a6

Please sign in to comment.