From fa79d05f37a6144b2becfd595cf556914a7e13ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 5 Jan 2018 18:38:17 +0800 Subject: [PATCH] fix 578 (#581) --- package.json | 25 ++++++++++++------------- src/components/HeaderSearch/index.js | 3 ++- src/components/SiderMenu/SiderMenu.js | 17 +++++++++-------- src/components/StandardTable/index.js | 6 +++--- src/routes/Dashboard/Monitor.js | 5 +++-- 5 files changed, 29 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index dd2eba3a..94a5900d 100755 --- a/package.json +++ b/package.json @@ -45,25 +45,25 @@ "react-fittext": "^1.0.0" }, "devDependencies": { - "babel-eslint": "^8.0.1", + "babel-eslint": "^8.1.2", "babel-jest": "^22.0.4", "babel-plugin-dva-hmr": "^0.4.1", - "babel-plugin-import": "^1.2.1", + "babel-plugin-import": "^1.6.3", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-plugin-transform-runtime": "^6.9.0", + "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", "enzyme": "^3.1.0", "enzyme-adapter-react-16": "^1.0.2", - "eslint": "^4.8.0", + "eslint": "^4.14.0", "eslint-config-airbnb": "^16.0.0", "eslint-plugin-babel": "^4.0.0", "eslint-plugin-compat": "^2.1.0", - "eslint-plugin-import": "^2.2.0", - "eslint-plugin-jsx-a11y": "^6.0.0", + "eslint-plugin-import": "^2.8.0", + "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-markdown": "^1.0.0-beta.6", "eslint-plugin-react": "^7.0.1", "gh-pages": "^1.0.0", @@ -72,14 +72,13 @@ "jsdom": "^11.5.1", "lint-staged": "^6.0.0", "mockjs": "^1.0.1-beta3", - "prettier": "^1.9.0", - "pro-download": "^1.0.0", - "react-test-renderer": "^16.0.0", - "redbox-react": "^1.3.2", - "roadhog": "^2.0.0-0", + "pro-download": "^1.0.1", + "react-test-renderer": "^16.2.0", + "redbox-react": "^1.5.0", + "roadhog": "^2.0.3", "roadhog-api-doc": "^0.3.3", - "rollbar": "^2.3.1", - "stylelint": "^8.1.0", + "rollbar": "^2.3.4", + "stylelint": "^8.4.0", "stylelint-config-standard": "^18.0.0" }, "optionalDependencies": { diff --git a/src/components/HeaderSearch/index.js b/src/components/HeaderSearch/index.js index 5fd3f5f5..85c990ef 100644 --- a/src/components/HeaderSearch/index.js +++ b/src/components/HeaderSearch/index.js @@ -64,8 +64,9 @@ export default class HeaderSearch extends PureComponent { className={classNames(className, styles.headerSearch)} onClick={this.enterSearchMode} > - + { - if (!item.name || item.hideInMenu) { - return null; - } - const ItemDom = this.getSubMenuOrItem(item); - return this.checkPermissionItem(item.authority, ItemDom); - }); + return menusData + .filter(item => item.name && !item.hideInMenu) + .map((item) => { + const ItemDom = this.getSubMenuOrItem(item); + return this.checkPermissionItem(item.authority, ItemDom); + }) + .filter(item => !!item); } // conversion Path // 转化路径 @@ -200,13 +200,14 @@ export default class SiderMenu extends PureComponent { width={256} className={styles.sider} > -
+
logo

Ant Design Pro

( - + ), }, ]; diff --git a/src/routes/Dashboard/Monitor.js b/src/routes/Dashboard/Monitor.js index 2d65bfb4..75fdfa76 100644 --- a/src/routes/Dashboard/Monitor.js +++ b/src/routes/Dashboard/Monitor.js @@ -2,14 +2,15 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Row, Col, Card, Tooltip } from 'antd'; import numeral from 'numeral'; -import { Secured } from '../../utils/Authorized'; +import Authorized from '../../utils/Authorized'; import { Pie, WaterWave, Gauge, TagCloud } from '../../components/Charts'; import NumberInfo from '../../components/NumberInfo'; import CountDown from '../../components/CountDown'; import ActiveChart from '../../components/ActiveChart'; - import styles from './Monitor.less'; +const { Secured } = Authorized; + const targetTime = new Date().getTime() + 3900000; @Secured('admin') -- GitLab