Skip to content

Commit

Permalink
Merge pull request #711 from zuiidea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zuiidea authored Dec 27, 2017
2 parents 6ba75de + cea60c5 commit 2de1e81
Show file tree
Hide file tree
Showing 63 changed files with 1,823 additions and 1,894 deletions.
40 changes: 22 additions & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@
{
"extends": "airbnb",
"rules": {
"semi": [2, "never"],
"no-console": 0,
"arrow-body-style": [0, "never"],
"comma-dangle": [2, "always-multiline"],
"global-require": 0,
"func-names": 0,
"prefer-const": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"max-len": 0,
"react/jsx-first-prop-new-line": 0,
"react/jsx-filename-extension": 0,
"space-before-function-paren": [2, "always"],
"no-unused-expressions": [0, {
"allowShortCircuit": true,
"allowTernary": true
}],
"arrow-body-style": [0, "never"],
"func-names": 0,
"prefer-const": 0,
"no-console": 0,
"no-extend-native": 0,
"no-param-reassign": 0,
"no-restricted-syntax": 0,
"no-eval": 0,
"no-continue": 0,
"react/jsx-no-bind": 0,
"no-mixed-operators": 0,
"no-plusplus": 0,
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
"no-underscore-dangle": 0,
"global-require": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"space-before-function-paren": [2, "always"],
"semi": [2, "never"],
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/href-no-hash": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/label-has-for": 0,
"react/no-array-index-key": 0,
"react/require-default-props": 0,
"react/forbid-prop-types": 0,
"react/no-string-refs": 0,
"react/no-find-dom-node": 0,
"react/prefer-stateless-function": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"react/jsx-closing-tag-location": 0,
"react/sort-comp": 0,
"react/jsx-no-bind": 0,
"react/no-danger": 0,
"jsx-a11y/no-static-element-interactions": 0,
"no-mixed-operators": 0,
"jsx-a11y/label-has-for": 0,
"no-plusplus": 0
"react/jsx-first-prop-new-line": 0,
"react/jsx-filename-extension": 0
},
"parser": "babel-eslint",
"parserOptions": {
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Antd Admin

[![React](https://img.shields.io/badge/react-^15.6.1-brightgreen.svg?style=flat-square)](https://github.com/facebook/react)
[![Ant Design](https://img.shields.io/badge/ant--design-^2.11.2-yellowgreen.svg?style=flat-square)](https://github.com/ant-design/ant-design)
[![dva](https://img.shields.io/badge/dva-^2.0.1-orange.svg?style=flat-square)](https://github.com/dvajs/dva)
[![React](https://img.shields.io/badge/react-^16.2.0-brightgreen.svg?style=flat-square)](https://github.com/facebook/react)
[![Ant Design](https://img.shields.io/badge/ant--design-^3.0.3-yellowgreen.svg?style=flat-square)](https://github.com/ant-design/ant-design)
[![dva](https://img.shields.io/badge/dva-^2.1.0-orange.svg?style=flat-square)](https://github.com/dvajs/dva)

[![GitHub issues](https://img.shields.io/github/issues/zuiidea/antd-admin.svg?style=flat-square)](https://github.com/zuiidea/antd-admin)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/zuiidea/antd-admin/pulls)
Expand All @@ -21,6 +21,13 @@

## 更新日志

### 4.3.9

`2017-12-27`

-   更新`antd``3.0.3`,以及其它主要库,并解决升级带来的兼容问题。
- 尽可能的保持`antd`的设计语言。

### 4.3.7

`2017-10-30`
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"private": true,
"name": "antd-admin",
"version": "4.3.7",
"version": "4.3.9",
"dependencies": {
"antd": "^2.13.8",
"axios": "^0.16.2",
"antd": "3.0.3",
"axios": "^0.17.1",
"babel-polyfill": "^6.23.0",
"classnames": "^2.2.5",
"cross-env": "^5.0.5",
"d3-shape": "^1.2.0",
"draftjs-to-markdown": "^0.4.0",
"dva": "^2.0.1",
"dva-loading": "^0.2.0",
"draftjs-to-markdown": "^0.5.0",
"dva": "2.1.0",
"dva-loading": "^1.0.4",
"echarts": "^3.7.2",
"echarts-for-react": "^2.0.0",
"echarts-gl": "^1.0.0-beta.5",
Expand All @@ -26,39 +26,39 @@
"lodash": "^4.17.4",
"mockjs": "^1.0.1-beta3",
"nprogress": "^0.2.0",
"path-to-regexp": "^1.7.0",
"path-to-regexp": "^2.1.0",
"prop-types": "^15.5.10",
"qs": "^6.5.0",
"query-string": "^5.0.0",
"rc-tween-one": "^1.3.1",
"react": "^15.6.1",
"react-countup": "^2.1.1",
"react-dom": "^15.6.1",
"react": "^16.2.0",
"react-countup": "^3.0.2",
"react-dom": "^16.2.0",
"react-draft-wysiwyg": "^1.10.0",
"react-helmet": "^5.1.3",
"react-highcharts": "^13.0.0",
"react-highcharts": "^15.0.0",
"recharts": "^1.0.0-beta.0"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"babel-eslint": "^8.1.0",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-dva-hmr": "^0.3.2",
"babel-plugin-dva-hmr": "^0.4.0",
"babel-plugin-import": "^1.1.1",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-runtime": "^6.9.2",
"copy-webpack-plugin": "^4.0.1",
"draftjs-to-html": "^0.7.0",
"draftjs-to-html": "^0.8.1",
"dva-model-extend": "^0.1.1",
"eslint": "^4.1.1",
"eslint-config-airbnb": "^15.0.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-import-resolver-node": "^0.3.1",
"eslint-loader": "^1.9.0",
"eslint-plugin-import": "^2.6.1",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0",
"html-webpack-plugin": "^2.29.0",
"redbox-react": "^1.2.10",
"roadhog": "^1.2.2"
"roadhog": "1.3.1"
},
"pre-commit": ["lint"],
"scripts": {
Expand All @@ -69,4 +69,4 @@
"build:dll": "roadhog buildDll",
"build:new": "node version && roadhog build"
}
}
}
21 changes: 11 additions & 10 deletions src/components/DataTable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import './DataTable.less'
class DataTable extends React.Component {
constructor (props) {
super(props)
const { dataSource, pagination = {
showSizeChanger: true,
showQuickJumper: true,
showTotal: total => `共 ${total} 条`,
current: 1,
total: 100 },
const {
dataSource, pagination = {
showSizeChanger: true,
showQuickJumper: true,
showTotal: total => `共 ${total} 条`,
current: 1,
total: 100,
},
} = props
this.state = {
loading: false,
Expand Down Expand Up @@ -97,13 +99,12 @@ class DataTable extends React.Component {
}
}


DataTable.propTypes = {
fetch: PropTypes.object,
rowKey: PropTypes.string,
pagination: React.PropTypes.oneOfType([
React.PropTypes.bool,
React.PropTypes.object,
pagination: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.object,
]),
columns: PropTypes.array,
dataSource: PropTypes.array,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Bread.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Breadcrumb, Icon } from 'antd'
import { Link } from 'react-router-dom'
import pathToRegexp from 'path-to-regexp'
import { queryArray } from 'utils'
import styles from './Bread.less'
import styles from './Layout.less'

const Bread = ({ menu, location }) => {
// 匹配当前路由
Expand Down
8 changes: 0 additions & 8 deletions src/components/Layout/Bread.less

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/Layout/Footer.js

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/Layout/Footer.less

This file was deleted.

12 changes: 7 additions & 5 deletions src/components/Layout/Header.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Menu, Icon, Popover } from 'antd'
import { Menu, Icon, Popover, Layout } from 'antd'
import classnames from 'classnames'
import styles from './Header.less'
import Menus from './Menu'

const SubMenu = Menu.SubMenu
const { SubMenu } = Menu

const Header = ({ user, logout, switchSider, siderFold, isNavbar, menuPopoverVisible, location, switchMenuPopover, navOpenKeys, changeOpenKeys, menu }) => {
const Header = ({
user, logout, switchSider, siderFold, isNavbar, menuPopoverVisible, location, switchMenuPopover, navOpenKeys, changeOpenKeys, menu,
}) => {
let handleClickMenu = e => e.key === 'logout' && logout()
const menusProps = {
menu,
Expand All @@ -20,7 +22,7 @@ const Header = ({ user, logout, switchSider, siderFold, isNavbar, menuPopoverVis
changeOpenKeys,
}
return (
<div className={styles.header}>
<Layout.Header className={styles.header}>
{isNavbar
? <Popover placement="bottomLeft" onVisibleChange={switchMenuPopover} visible={menuPopoverVisible} overlayClassName={styles.popovermenu} trigger="click" content={<Menus {...menusProps} />}>
<div className={styles.button}>
Expand Down Expand Up @@ -53,7 +55,7 @@ const Header = ({ user, logout, switchSider, siderFold, isNavbar, menuPopoverVis
</SubMenu>
</Menu>
</div>
</div>
</Layout.Header>
)
}

Expand Down
57 changes: 45 additions & 12 deletions src/components/Layout/Header.less
Original file line number Diff line number Diff line change
@@ -1,30 +1,65 @@
@import "~themes/vars";

.header {
:global .ant-menu-horizontal {
& > .ant-menu-submenu {
float: right;
:global {
.ant-menu-submenu-title {
height: 56px;
}

.ant-menu-horizontal {
line-height: 56px;

& > .ant-menu-submenu:hover {
color: #1890ff;
background-color: rgba(24, 144, 255, 0.15);
}
}

.ant-menu {
border-bottom: none;
height: 56px;
}

.ant-menu-horizontal > .ant-menu-submenu {
top: 0;
margin-top: 0;
}

.ant-menu-horizontal > .ant-menu-item,
.ant-menu-horizontal > .ant-menu-submenu {
border-bottom: none;
}

.ant-menu-horizontal > .ant-menu-item-active,
.ant-menu-horizontal > .ant-menu-item-open,
.ant-menu-horizontal > .ant-menu-item-selected,
.ant-menu-horizontal > .ant-menu-item:hover,
.ant-menu-horizontal > .ant-menu-submenu-active,
.ant-menu-horizontal > .ant-menu-submenu-open,
.ant-menu-horizontal > .ant-menu-submenu-selected,
.ant-menu-horizontal > .ant-menu-submenu:hover {
border-bottom: none;
}
border: none;
display: inline-block;
}
box-shadow: @shadow-2;
position: relative;
display: flex;
justify-content: space-between;
height: 47px;
height: 56px;
z-index: 9;
display: flex;
align-items: center;
background-color: #fff;
z-index: 999;

.rightWarpper {
display: flex;
padding-right: 16px;
}

.button {
width: 47px;
height: 47px;
line-height: 47px;
width: 56px;
height: 56px;
line-height: 56px;
text-align: center;
font-size: 18px;
cursor: pointer;
Expand All @@ -47,8 +82,6 @@
.ant-menu-inline .ant-menu-item,
.ant-menu-vertical .ant-menu-item {
border-right: 0;
height: 48px;
line-height: 48px;
}

.ant-menu-inline .ant-menu-item-selected,
Expand Down
Loading

0 comments on commit 2de1e81

Please sign in to comment.