diff --git a/src/routes/app.js b/src/routes/app.js
index f37b075..6103abc 100644
--- a/src/routes/app.js
+++ b/src/routes/app.js
@@ -1,14 +1,12 @@
import React, { PropTypes } from 'react'
import { connect } from 'dva'
import Login from './login'
-import Header from '../components/layout/header'
-import Bread from '../components/layout/bread'
-import Footer from '../components/layout/footer'
-import Sider from '../components/layout/sider'
-import styles from '../components/layout/main.less'
+import { Layout } from '../components'
import { Spin } from 'antd'
import { classnames } from '../utils'
-import '../components/layout/common.less'
+import '../components/skin.less'
+
+const { Header, Bread, Footer, Sider, styles } = Layout
function App ({ children, location, dispatch, app, loading }) {
const { login, loginButtonLoading, user, siderFold, darkTheme, isNavbar, menuPopoverVisible, navOpenKeys } = app
diff --git a/src/components/dashboard/browser.js b/src/routes/dashboard/components/browser.js
similarity index 95%
rename from src/components/dashboard/browser.js
rename to src/routes/dashboard/components/browser.js
index 1e81858..fa5b794 100644
--- a/src/components/dashboard/browser.js
+++ b/src/routes/dashboard/components/browser.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import { Table, Tag } from 'antd'
import styles from './browser.less'
-import { color } from '../../utils'
+import { color } from '../../../utils'
const status = {
1: {
diff --git a/src/components/dashboard/browser.less b/src/routes/dashboard/components/browser.less
similarity index 100%
rename from src/components/dashboard/browser.less
rename to src/routes/dashboard/components/browser.less
diff --git a/src/components/dashboard/comments.js b/src/routes/dashboard/components/comments.js
similarity index 97%
rename from src/components/dashboard/comments.js
rename to src/routes/dashboard/components/comments.js
index 55f3721..b8c71f8 100644
--- a/src/components/dashboard/comments.js
+++ b/src/routes/dashboard/components/comments.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import { Table, Tag } from 'antd'
import styles from './comments.less'
-import { color } from '../../utils'
+import { color } from '../../../utils'
const status = {
1: {
diff --git a/src/components/dashboard/comments.less b/src/routes/dashboard/components/comments.less
similarity index 93%
rename from src/components/dashboard/comments.less
rename to src/routes/dashboard/components/comments.less
index 0d29e1f..d204f1f 100644
--- a/src/components/dashboard/comments.less
+++ b/src/routes/dashboard/components/comments.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.comments {
:global .ant-table-thead > tr > th {
diff --git a/src/components/dashboard/completed.js b/src/routes/dashboard/components/completed.js
similarity index 98%
rename from src/components/dashboard/completed.js
rename to src/routes/dashboard/components/completed.js
index 2477d8a..b2ac636 100644
--- a/src/components/dashboard/completed.js
+++ b/src/routes/dashboard/components/completed.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import styles from './completed.less'
import classnames from 'classnames'
-import { color } from '../../utils'
+import { color } from '../../../utils'
import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'
function Completed ({ data }) {
diff --git a/src/components/dashboard/completed.less b/src/routes/dashboard/components/completed.less
similarity index 93%
rename from src/components/dashboard/completed.less
rename to src/routes/dashboard/components/completed.less
index 468713b..d04f80f 100644
--- a/src/components/dashboard/completed.less
+++ b/src/routes/dashboard/components/completed.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.sales {
.title {
diff --git a/src/components/dashboard/cpu.js b/src/routes/dashboard/components/cpu.js
similarity index 97%
rename from src/components/dashboard/cpu.js
rename to src/routes/dashboard/components/cpu.js
index c51f0f9..860d79c 100644
--- a/src/components/dashboard/cpu.js
+++ b/src/routes/dashboard/components/cpu.js
@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react'
import styles from './cpu.less'
-import { color } from '../../utils'
+import { color } from '../../../utils'
import CountUp from 'react-countup'
import { LineChart, Line, XAxis, YAxis, CartesianGrid, ResponsiveContainer } from 'recharts'
diff --git a/src/components/dashboard/cpu.less b/src/routes/dashboard/components/cpu.less
similarity index 100%
rename from src/components/dashboard/cpu.less
rename to src/routes/dashboard/components/cpu.less
diff --git a/src/routes/dashboard/components/index.js b/src/routes/dashboard/components/index.js
new file mode 100644
index 0000000..8d5b7c8
--- /dev/null
+++ b/src/routes/dashboard/components/index.js
@@ -0,0 +1,12 @@
+import NumberCard from './numberCard'
+import Quote from './quote'
+import Sales from './sales'
+import Weather from './weather'
+import RecentSales from './recentSales'
+import Comments from './comments'
+import Completed from './completed'
+import Browser from './browser'
+import Cpu from './cpu'
+import User from './user'
+
+export { NumberCard, Quote, Sales, Weather, RecentSales, Comments, Completed, Browser, Cpu, User }
diff --git a/src/components/dashboard/numberCard.js b/src/routes/dashboard/components/numberCard.js
similarity index 100%
rename from src/components/dashboard/numberCard.js
rename to src/routes/dashboard/components/numberCard.js
diff --git a/src/components/dashboard/numberCard.less b/src/routes/dashboard/components/numberCard.less
similarity index 91%
rename from src/components/dashboard/numberCard.less
rename to src/routes/dashboard/components/numberCard.less
index ada66a2..eaae27c 100644
--- a/src/components/dashboard/numberCard.less
+++ b/src/routes/dashboard/components/numberCard.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.numberCard {
padding: 32px;
diff --git a/src/components/dashboard/quote.js b/src/routes/dashboard/components/quote.js
similarity index 100%
rename from src/components/dashboard/quote.js
rename to src/routes/dashboard/components/quote.js
diff --git a/src/components/dashboard/quote.less b/src/routes/dashboard/components/quote.less
similarity index 95%
rename from src/components/dashboard/quote.less
rename to src/routes/dashboard/components/quote.less
index 9c3c952..36de0af 100644
--- a/src/components/dashboard/quote.less
+++ b/src/routes/dashboard/components/quote.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.quote {
color: #fff;
diff --git a/src/components/dashboard/recentSales.js b/src/routes/dashboard/components/recentSales.js
similarity index 96%
rename from src/components/dashboard/recentSales.js
rename to src/routes/dashboard/components/recentSales.js
index 6315f81..af1e9c3 100644
--- a/src/components/dashboard/recentSales.js
+++ b/src/routes/dashboard/components/recentSales.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import { Table, Tag } from 'antd'
import styles from './recentSales.less'
-import { color } from '../../utils'
+import { color } from '../../../utils'
const status = {
1: {
diff --git a/src/components/dashboard/recentSales.less b/src/routes/dashboard/components/recentSales.less
similarity index 76%
rename from src/components/dashboard/recentSales.less
rename to src/routes/dashboard/components/recentSales.less
index 65e4572..987226c 100644
--- a/src/components/dashboard/recentSales.less
+++ b/src/routes/dashboard/components/recentSales.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.recentsales {
:global .ant-table-thead > tr > th {
diff --git a/src/components/dashboard/sales.js b/src/routes/dashboard/components/sales.js
similarity index 98%
rename from src/components/dashboard/sales.js
rename to src/routes/dashboard/components/sales.js
index a9d48b2..1c73623 100644
--- a/src/components/dashboard/sales.js
+++ b/src/routes/dashboard/components/sales.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import styles from './sales.less'
import classnames from 'classnames'
-import { color } from '../../utils'
+import { color } from '../../../utils'
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'
function Sales ({ data }) {
diff --git a/src/components/dashboard/sales.less b/src/routes/dashboard/components/sales.less
similarity index 93%
rename from src/components/dashboard/sales.less
rename to src/routes/dashboard/components/sales.less
index 468713b..d04f80f 100644
--- a/src/components/dashboard/sales.less
+++ b/src/routes/dashboard/components/sales.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.sales {
.title {
diff --git a/src/components/dashboard/user-background.png b/src/routes/dashboard/components/user-background.png
similarity index 100%
rename from src/components/dashboard/user-background.png
rename to src/routes/dashboard/components/user-background.png
diff --git a/src/components/dashboard/user.js b/src/routes/dashboard/components/user.js
similarity index 97%
rename from src/components/dashboard/user.js
rename to src/routes/dashboard/components/user.js
index faf8918..68cc411 100644
--- a/src/components/dashboard/user.js
+++ b/src/routes/dashboard/components/user.js
@@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'
import { Button } from 'antd'
import styles from './user.less'
import CountUp from 'react-countup'
-import { color } from '../../utils'
+import { color } from '../../../utils'
const countUpProps = {
start: 0,
duration: 2.75,
diff --git a/src/components/dashboard/user.less b/src/routes/dashboard/components/user.less
similarity index 97%
rename from src/components/dashboard/user.less
rename to src/routes/dashboard/components/user.less
index bb21205..39220b0 100644
--- a/src/components/dashboard/user.less
+++ b/src/routes/dashboard/components/user.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.user {
.header {
diff --git a/src/components/dashboard/weather.js b/src/routes/dashboard/components/weather.js
similarity index 100%
rename from src/components/dashboard/weather.js
rename to src/routes/dashboard/components/weather.js
diff --git a/src/components/dashboard/weather.less b/src/routes/dashboard/components/weather.less
similarity index 94%
rename from src/components/dashboard/weather.less
rename to src/routes/dashboard/components/weather.less
index 3710354..938e0df 100644
--- a/src/components/dashboard/weather.less
+++ b/src/routes/dashboard/components/weather.less
@@ -1,4 +1,4 @@
-@import "../vars.less";
+@import "../../../components/vars.less";
.weather {
color: #fff;
diff --git a/src/routes/dashboard.js b/src/routes/dashboard/index.js
similarity index 79%
rename from src/routes/dashboard.js
rename to src/routes/dashboard/index.js
index fb104f4..e71958b 100644
--- a/src/routes/dashboard.js
+++ b/src/routes/dashboard/index.js
@@ -1,18 +1,9 @@
import React, { PropTypes } from 'react'
import { connect } from 'dva'
import { Row, Col, Card } from 'antd'
-import NumberCard from '../components/dashboard/numberCard'
-import Quote from '../components/dashboard/quote'
-import Sales from '../components/dashboard/sales'
-import Weather from '../components/dashboard/weather'
-import RecentSales from '../components/dashboard/recentSales'
-import Comments from '../components/dashboard/comments'
-import Completed from '../components/dashboard/completed'
-import Browser from '../components/dashboard/browser'
-import Cpu from '../components/dashboard/cpu'
-import User from '../components/dashboard/user'
-import styles from './dashboard.less'
-import { color } from '../utils'
+import { NumberCard, Quote, Sales, Weather, RecentSales, Comments, Completed, Browser, Cpu, User } from './components'
+import styles from './index.less'
+import { color } from '../../utils'
const bodyStyle = {
bodyStyle: {
diff --git a/src/routes/dashboard.less b/src/routes/dashboard/index.less
similarity index 100%
rename from src/routes/dashboard.less
rename to src/routes/dashboard/index.less
diff --git a/src/routes/error.js b/src/routes/error/index.js
similarity index 87%
rename from src/routes/error.js
rename to src/routes/error/index.js
index 7c4b8cb..70f341a 100644
--- a/src/routes/error.js
+++ b/src/routes/error/index.js
@@ -1,6 +1,6 @@
import React from 'react'
import { Icon } from 'antd'
-import styles from './error.less'
+import styles from './index.less'
const Error = () =>
diff --git a/src/routes/error.less b/src/routes/error/index.less
similarity index 100%
rename from src/routes/error.less
rename to src/routes/error/index.less
diff --git a/src/routes/login.js b/src/routes/login/index.js
similarity index 95%
rename from src/routes/login.js
rename to src/routes/login/index.js
index cf5d2b6..4875ebc 100644
--- a/src/routes/login.js
+++ b/src/routes/login/index.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import { Button, Row, Form, Input } from 'antd'
-import { config } from '../utils'
-import styles from './login.less'
+import { config } from '../../utils'
+import styles from './index.less'
const FormItem = Form.Item
diff --git a/src/routes/login.less b/src/routes/login/index.less
similarity index 100%
rename from src/routes/login.less
rename to src/routes/login/index.less
diff --git a/src/components/users/search.js b/src/routes/users/UserFilter.js
similarity index 87%
rename from src/components/users/search.js
rename to src/routes/users/UserFilter.js
index 96c49d0..5ab4f6b 100644
--- a/src/components/users/search.js
+++ b/src/routes/users/UserFilter.js
@@ -1,8 +1,8 @@
import React, { PropTypes } from 'react'
import { Form, Button, Row, Col, Switch } from 'antd'
-import SearchGroup from '../ui/search'
+import { Search } from '../../components'
-const search = ({
+const UserFilter = ({
field,
keyword,
onSearch,
@@ -23,11 +23,10 @@ const search = ({
onSearch(value)
},
}
-
return (
-
+
@@ -37,7 +36,7 @@ const search = ({
)
}
-search.propTypes = {
+UserFilter.propTypes = {
form: PropTypes.object.isRequired,
onSearch: PropTypes.func,
onAdd: PropTypes.func,
@@ -47,4 +46,4 @@ search.propTypes = {
switchIsMotion: PropTypes.func,
}
-export default Form.create()(search)
+export default Form.create()(UserFilter)
diff --git a/src/components/users/list.js b/src/routes/users/UserList.js
similarity index 90%
rename from src/components/users/list.js
rename to src/routes/users/UserList.js
index e39332c..2817109 100644
--- a/src/components/users/list.js
+++ b/src/routes/users/UserList.js
@@ -1,9 +1,10 @@
import React, { PropTypes } from 'react'
import { Table, Modal } from 'antd'
-import styles from './list.less'
+import styles from './UserList.less'
import classnames from 'classnames'
-import TableBodyWrapper from '../common/TableBodyWrapper'
-import { DropOption } from '../ui/index'
+import AnimTableBody from '../../components/DataTable/AnimTableBody'
+import { DropOption } from '../../components'
+
const confirm = Modal.confirm
@@ -80,7 +81,7 @@ function list ({ loading, dataSource, pagination, onPageChange, onDeleteItem, on
current: pagination.current,
}
- const getBodyWrapper = body => { return isMotion ? : body }
+ const getBodyWrapper = body => { return isMotion ? : body }
return (
diff --git a/src/components/users/list.less b/src/routes/users/UserList.less
similarity index 100%
rename from src/components/users/list.less
rename to src/routes/users/UserList.less
diff --git a/src/components/users/modal.js b/src/routes/users/UserModal.js
similarity index 100%
rename from src/components/users/modal.js
rename to src/routes/users/UserModal.js
diff --git a/src/routes/users.js b/src/routes/users/index.js
similarity index 89%
rename from src/routes/users.js
rename to src/routes/users/index.js
index bd1ad14..494f47d 100644
--- a/src/routes/users.js
+++ b/src/routes/users/index.js
@@ -1,9 +1,9 @@
import React, { PropTypes } from 'react'
import { routerRedux } from 'dva/router'
import { connect } from 'dva'
-import UserList from '../components/users/list'
-import UserSearch from '../components/users/search'
-import UserModal from '../components/users/modal'
+import UserList from './UserList'
+import UserFilter from './UserFilter'
+import UserModal from './UserModal'
function Users ({ location, dispatch, users, loading }) {
const { list, pagination, currentItem, modalVisible, modalType, isMotion } = users
@@ -60,7 +60,7 @@ function Users ({ location, dispatch, users, loading }) {
},
}
- const userSearchProps = {
+ const userFilterProps = {
field,
keyword,
isMotion,
@@ -93,7 +93,7 @@ function Users ({ location, dispatch, users, loading }) {
return (
-
+
@@ -107,4 +107,4 @@ Users.propTypes = {
loading: PropTypes.bool,
}
-export default connect(({ users, loading }) => ({ users, loading: loading.models.user }))(Users)
+export default connect(({ users, loading }) => ({ users, loading: loading.models.users }))(Users)
diff --git a/src/utils/menu.js b/src/utils/menu.js
index 6d12eaf..f4325d1 100644
--- a/src/utils/menu.js
+++ b/src/utils/menu.js
@@ -10,30 +10,30 @@ module.exports = [
icon: 'user',
},
{
- key: 'ui',
+ key: 'UIElement',
name: 'UI组件',
icon: 'camera-o',
clickable: false,
child: [
{
- key: 'ico',
- name: 'Ico 图标',
+ key: 'iconfont',
+ name: 'IconFont 字体图标',
},
{
- key: 'search',
- name: 'Search 搜索',
+ key: 'dataTable',
+ name: 'DataTable 数据表格',
},
{
key: 'dropOption',
name: 'DropOption 下拉操作',
},
{
- key: 'layer',
- name: 'Layer 弹层',
+ key: 'search',
+ name: 'Search 搜索',
},
{
- key: 'DataTable',
- name: 'DataTable 数据表格',
+ key: 'layer',
+ name: 'layer 弹层【方法】',
},
],
},