mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-28 03:04:48 +00:00
sorry,rebuild folder structure,cry..
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Antd Admin
|
||||
|
||||
[](https://github.com/facebook/react)
|
||||
[](https://github.com/ant-design/ant-design)
|
||||
[](https://github.com/ant-design/ant-design)
|
||||
[](https://github.com/dvajs/dva)
|
||||
|
||||
[](https://github.com/zuiidea/antd-admin)
|
||||
@@ -30,10 +30,11 @@
|
||||
- [x] 增删改查
|
||||
- [x] 交互动效
|
||||
- [x] 扩展UI组件
|
||||
- [x] Ico
|
||||
- [x] Search
|
||||
- [x] dropOption
|
||||
- [x] 基于Modal封装的layer
|
||||
- [x] IconFont
|
||||
- [x] DataTable
|
||||
- [x] Search
|
||||
- [x] DropOption
|
||||
- [x] 基于Modal封装的layer方法
|
||||
- [x] 加入dva-loading
|
||||
- [x] 规范代码: EsLint; 自用[开发配置](assets/standard.md)
|
||||
- [ ] 数据可视化页面
|
||||
@@ -48,11 +49,20 @@
|
||||
├── /mock/ # 数据mock的接口文件
|
||||
├── /dist/ # 项目输出目录
|
||||
├── /src/ # 项目源码目录
|
||||
│ ├── /components/ # 项目组件
|
||||
│ ├── /components/ # UI组件及UI相关方法
|
||||
│ │ ├── skin.less # 全局样式
|
||||
│ │ └── vars.less # 全局样式变量
|
||||
│ ├── /routes/ # 路由组件
|
||||
│ │ └── app.js # 路由入口
|
||||
│ ├── /models/ # 数据模型
|
||||
│ ├── /services/ # 数据接口
|
||||
│ ├── /utils/ # 工具函数
|
||||
│ │ ├── config.js # 项目常规配置
|
||||
│ │ ├── menu.js # 侧边菜单配置
|
||||
│ │ ├── mock.js # 数据拦截配置
|
||||
│ │ ├── config.js # 项目常规配置
|
||||
│ │ ├── request.js # 异步请求函数
|
||||
│ │ └── theme.js # 项目需要在js中使用到样式变量
|
||||
│ ├── route.js # 路由配置
|
||||
│ ├── index.js # 入口文件
|
||||
│ └── index.html
|
||||
@@ -60,14 +70,16 @@
|
||||
└── proxy.config.js # 数据mock配置
|
||||
```
|
||||
|
||||
文件夹命名说明:
|
||||
|
||||
- components:组件(方法)为单位以文件夹保存,文件夹名组件首字母大写(如`DataTable`),方法首字母小写(如`layer`),文件夹内主文件与文件夹同名,多文件以`index.js`导出对象(如`./src/components/Layout`)
|
||||
- routes:页面为单位以文件夹保存,文件夹名首字母小写(特殊除外,如`UIElement`),文件夹内主文件以`index.js`导出,多文件时可建立`components`文件夹(如`./src/routes/dashboard`),如果有子路由,依次按照路由层次建立文件夹(如`./src/routes/UIElement`)
|
||||
|
||||
### 快速开始
|
||||
|
||||
克隆项目文件:
|
||||
|
||||
|
||||
```
|
||||
git clone https://github.com/zuiidea/antd-admin.git
|
||||
```
|
||||
git clone https://github.com/zuiidea/antd-admin.git
|
||||
|
||||
进入目录安装依赖:
|
||||
|
||||
|
||||
+3
-4
@@ -39,8 +39,7 @@ const leaveAnim = [
|
||||
},
|
||||
]
|
||||
|
||||
const TableBodyWrapper = ({ body, page = 1, current }) => {
|
||||
// 切换分页去除动画;
|
||||
const AnimTableBody = ({ body, page = 1, current }) => {
|
||||
if (current !== +page) {
|
||||
return body
|
||||
}
|
||||
@@ -58,10 +57,10 @@ const TableBodyWrapper = ({ body, page = 1, current }) => {
|
||||
)
|
||||
}
|
||||
|
||||
TableBodyWrapper.propTypes = {
|
||||
AnimTableBody.propTypes = {
|
||||
body: PropTypes.element,
|
||||
page: PropTypes.any,
|
||||
current: PropTypes.number.isRequired,
|
||||
}
|
||||
|
||||
export default TableBodyWrapper
|
||||
export default AnimTableBody
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "table",
|
||||
"name": "DataTable",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./DataTable.js"
|
||||
|
||||
@@ -4,7 +4,8 @@ import { Dropdown, Button, Icon, Menu } from 'antd'
|
||||
const DropOption = ({ onMenuClick, menuOptions = [], buttonStyle, dropdownProps }) => {
|
||||
const menu = menuOptions.map(item => <Menu.Item key={item.key}>{item.name}</Menu.Item>)
|
||||
return (<Dropdown
|
||||
overlay={<Menu onClick={onMenuClick} {...dropdownProps}>{menu}</Menu>}
|
||||
overlay={<Menu onClick={onMenuClick}>{menu}</Menu>}
|
||||
{...dropdownProps}
|
||||
>
|
||||
<Button style={{ border: 'none', ...buttonStyle }}>
|
||||
<Icon style={{ marginRight: 2 }} type="bars" />
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "DropOption",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./DropOption.js"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import './iconfont.less'
|
||||
|
||||
const Iconfont = ({ type }) => <span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `<svg class="iconfont" aria-hidden="true"><use xlink:href="#anticon-${type}"></use></svg>`,
|
||||
}}
|
||||
/>
|
||||
|
||||
Iconfont.propTypes = {
|
||||
type: PropTypes.string,
|
||||
}
|
||||
|
||||
export default Iconfont
|
||||
@@ -1,4 +1,4 @@
|
||||
:global .ico {
|
||||
:global .iconfont {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Iconfont",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./Iconfont.js"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import Header from './Header'
|
||||
import Menu from './Menu'
|
||||
import Bread from './Bread'
|
||||
import Sider from './Sider'
|
||||
import Footer from './Footer'
|
||||
import styles from './Layout.less'
|
||||
|
||||
export { Header, Menu, Bread, Sider, Footer, styles }
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import styles from './search.less'
|
||||
import styles from './Search.less'
|
||||
import { Input, Select, Button, Icon } from 'antd'
|
||||
|
||||
class Search extends React.Component {
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Search",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./Search.js"
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
import DataTable from './DataTable'
|
||||
import DropOption from './DropOption'
|
||||
import Iconfont from './Iconfont'
|
||||
import Search from './Search'
|
||||
import * as Layout from './Layout/index.js'
|
||||
|
||||
export { DataTable }
|
||||
import layer from './layer'
|
||||
|
||||
export { Layout, DataTable, DropOption, Iconfont, Search, layer }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "layer",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./layer.js"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Breadcrumb, Icon } from 'antd'
|
||||
import styles from './main.less'
|
||||
import styles from './Layout.less'
|
||||
import { menu } from '../../utils'
|
||||
|
||||
let pathSet = []
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
body {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
// scrollbar
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
:global .ant-breadcrumb {
|
||||
& > span {
|
||||
&:last-child {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:global .ant-breadcrumb-link {
|
||||
.anticon + span {
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
:global .ant-table {
|
||||
.ant-table-thead > tr > th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr > td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&.ant-table-small {
|
||||
.ant-table-thead > tr > th {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.ant-table-body > table {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:global .ant-table-pagination {
|
||||
float: none!important;
|
||||
display: table;
|
||||
margin: 16px auto !important;
|
||||
}
|
||||
|
||||
:global .ant-popover-inner {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 0 20px rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
|
||||
:global .ant-form-item-control {
|
||||
vertical-align: middle;
|
||||
}
|
||||
@import "../skin.less";
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import styles from './main.less'
|
||||
import styles from './Layout.less'
|
||||
import { config } from '../../utils'
|
||||
|
||||
const Footer = () => <div className={styles.footer}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Menu, Icon, Popover } from 'antd'
|
||||
import styles from './main.less'
|
||||
import Menus from './menu'
|
||||
import styles from './Layout.less'
|
||||
import Menus from './Menu'
|
||||
|
||||
const SubMenu = Menu.SubMenu
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Icon, Switch } from 'antd'
|
||||
import styles from './main.less'
|
||||
import styles from './Layout.less'
|
||||
import { config } from '../../utils'
|
||||
import Menus from './menu'
|
||||
import Menus from './Menu'
|
||||
|
||||
function Sider ({ siderFold, darkTheme, location, changeTheme, navOpenKeys, changeOpenKeys }) {
|
||||
const menusProps = {
|
||||
|
||||
@@ -1,6 +1,72 @@
|
||||
@import "./vars.less";
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
:global {
|
||||
.ant-breadcrumb {
|
||||
& > span {
|
||||
&:last-child {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-breadcrumb-link {
|
||||
.anticon + span {
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table {
|
||||
.ant-table-thead > tr > th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr > td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&.ant-table-small {
|
||||
.ant-table-thead > tr > th {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.ant-table-body > table {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-pagination {
|
||||
float: none!important;
|
||||
display: table;
|
||||
margin: 16px auto !important;
|
||||
}
|
||||
|
||||
.ant-popover-inner {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 0 20px rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
|
||||
.ant-form-item-control {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ant-modal-mask {
|
||||
background-color: rgba(55, 55, 55, 0.2);
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import './ico.less'
|
||||
|
||||
const Ico = ({ type }) => <span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `<svg class="ico" aria-hidden="true"><use xlink:href="#anticon-${type}"></use></svg>`,
|
||||
}}
|
||||
/>
|
||||
|
||||
Ico.propTypes = {
|
||||
type: PropTypes.string,
|
||||
}
|
||||
|
||||
export default Ico
|
||||
@@ -1,7 +0,0 @@
|
||||
import Ico from './ico.js'
|
||||
import Search from './search.js'
|
||||
import DropOption from './dropOption.js'
|
||||
|
||||
import layer from './layer.js'
|
||||
|
||||
export { Ico, Search, DropOption, layer }
|
||||
@@ -1 +0,0 @@
|
||||
Error: Source sample is missing.
|
||||
+24
-24
@@ -18,7 +18,7 @@ const Routers = function ({ history, app }) {
|
||||
getIndexRoute (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
registerModel(app, require('./models/dashboard'))
|
||||
cb(null, { component: require('./routes/dashboard') })
|
||||
cb(null, { component: require('./routes/dashboard/') })
|
||||
}, 'dashboard')
|
||||
},
|
||||
childRoutes: [
|
||||
@@ -28,7 +28,7 @@ const Routers = function ({ history, app }) {
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
registerModel(app, require('./models/dashboard'))
|
||||
cb(null, require('./routes/dashboard'))
|
||||
cb(null, require('./routes/dashboard/'))
|
||||
}, 'dashboard')
|
||||
},
|
||||
}, {
|
||||
@@ -37,55 +37,55 @@ const Routers = function ({ history, app }) {
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
registerModel(app, require('./models/users'))
|
||||
cb(null, require('./routes/users'))
|
||||
cb(null, require('./routes/users/'))
|
||||
}, 'users')
|
||||
},
|
||||
}, {
|
||||
path: 'ui/ico',
|
||||
name: 'ui/ico',
|
||||
path: 'UIElement/iconfont',
|
||||
name: 'UIElement/iconfont',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/ui/ico'))
|
||||
}, 'ui-ico')
|
||||
cb(null, require('./routes/UIElement/iconfont/'))
|
||||
}, 'UIElement-iconfont')
|
||||
},
|
||||
}, {
|
||||
path: 'ui/search',
|
||||
name: 'ui/search',
|
||||
path: 'UIElement/search',
|
||||
name: 'UIElement/search',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/ui/search'))
|
||||
}, 'ui-search')
|
||||
cb(null, require('./routes/UIElement/search/'))
|
||||
}, 'UIElement-search')
|
||||
},
|
||||
}, {
|
||||
path: 'ui/dropOption',
|
||||
name: 'ui/dropOption',
|
||||
path: 'UIElement/dropOption',
|
||||
name: 'UIElement/dropOption',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/ui/dropOption'))
|
||||
}, 'ui-dropOption')
|
||||
cb(null, require('./routes/UIElement/dropOption/'))
|
||||
}, 'UIElement-dropOption')
|
||||
},
|
||||
}, {
|
||||
path: 'ui/layer',
|
||||
name: 'ui/layer',
|
||||
path: 'UIElement/layer',
|
||||
name: 'UIElement/layer',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/ui/layer'))
|
||||
}, 'ui-layer')
|
||||
cb(null, require('./routes/UIElement/layer/'))
|
||||
}, 'UIElement-layer')
|
||||
},
|
||||
}, {
|
||||
path: 'ui/dataTable',
|
||||
name: 'ui/dataTable',
|
||||
path: 'UIElement/dataTable',
|
||||
name: 'UIElement/dataTable',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/ui/dataTable'))
|
||||
}, 'ui-dataTable')
|
||||
cb(null, require('./routes/UIElement/dataTable/'))
|
||||
}, 'UIElement-dataTable')
|
||||
},
|
||||
}, {
|
||||
path: '*',
|
||||
name: 'error',
|
||||
getComponent (nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
cb(null, require('./routes/error'))
|
||||
cb(null, require('./routes/error/'))
|
||||
}, 'error')
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { DataTable } from '../../components'
|
||||
import { DataTable } from '../../../components'
|
||||
import { Table, Row, Col, Card, Select } from 'antd'
|
||||
|
||||
class DataTablePage extends React.Component {
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { DropOption } from '../../components/ui'
|
||||
import { DropOption } from '../../../components'
|
||||
import { Table, Row, Col, Card, message } from 'antd'
|
||||
|
||||
const DropOptionPage = () => <div className="content-inner">
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from 'react'
|
||||
import { Ico } from '../../components/ui'
|
||||
import { Iconfont } from '../../../components'
|
||||
import { Table, Row, Col } from 'antd'
|
||||
import styles from './ico.less'
|
||||
import styles from './index.less'
|
||||
|
||||
const iconlist = ['Cherry', 'Cheese', 'Bread', 'Beer', 'Beet', 'Bacon', 'Banana', 'Asparagus', 'Apple']
|
||||
|
||||
const IcoPage = () => <div className="content-inner">
|
||||
<ul className={styles.list}>
|
||||
{iconlist.map(item => <li key={item}><Ico className={styles.icon} type={item} /><span className={styles.name}>{item}</span></li>)}
|
||||
{iconlist.map(item => <li key={item}><Iconfont className={styles.icon} type={item} /><span className={styles.name}>{item}</span></li>)}
|
||||
</ul>
|
||||
<h2 style={{ margin: '16px 0' }}>Props</h2>
|
||||
<Row>
|
||||
@@ -18,7 +18,7 @@
|
||||
box-sizing: border-box;
|
||||
border: solid 1px transparent;
|
||||
|
||||
&:hover{
|
||||
&:hover {
|
||||
border: solid 1px #f5f5f5;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
:global .ico {
|
||||
:global .iconfont {
|
||||
font-size: 48px;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react'
|
||||
import { layer } from '../../components/ui'
|
||||
import { layer } from '../../../components'
|
||||
import { Table, Row, Col, Button, Card } from 'antd'
|
||||
import './ico.less'
|
||||
|
||||
let Enum = {
|
||||
default: 1,
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { Search } from '../../components/ui'
|
||||
import { Search } from '../../../components'
|
||||
import { Table, Row, Col, Card } from 'antd'
|
||||
|
||||
const SearchPage = () => <div className="content-inner">
|
||||
+4
-6
@@ -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
|
||||
|
||||
@@ -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: {
|
||||
@@ -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: {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.comments {
|
||||
:global .ant-table-thead > tr > th {
|
||||
+1
-1
@@ -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 }) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.sales {
|
||||
.title {
|
||||
@@ -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'
|
||||
|
||||
@@ -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 }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.numberCard {
|
||||
padding: 32px;
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.quote {
|
||||
color: #fff;
|
||||
+1
-1
@@ -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: {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.recentsales {
|
||||
:global .ant-table-thead > tr > th {
|
||||
@@ -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 }) {
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.sales {
|
||||
.title {
|
||||
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
@@ -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,
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.user {
|
||||
.header {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../vars.less";
|
||||
@import "../../../components/vars.less";
|
||||
|
||||
.weather {
|
||||
color: #fff;
|
||||
@@ -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: {
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Icon } from 'antd'
|
||||
import styles from './error.less'
|
||||
import styles from './index.less'
|
||||
|
||||
const Error = () => <div className="content-inner">
|
||||
<div className={styles.error}>
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
<Row gutter={24}>
|
||||
<Col lg={8} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
|
||||
<SearchGroup {...searchGroupProps} />
|
||||
<Search {...searchGroupProps} />
|
||||
</Col>
|
||||
<Col lg={{ offset: 8, span: 8 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
|
||||
<Switch style={{ marginRight: 16 }} defaultChecked={isMotion} onChange={switchIsMotion} checkedChildren={'动画开'} unCheckedChildren={'动画关'} />
|
||||
@@ -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)
|
||||
@@ -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 ? <TableBodyWrapper {...getBodyWrapperProps} body={body} /> : body }
|
||||
const getBodyWrapper = body => { return isMotion ? <AnimTableBody {...getBodyWrapperProps} body={body} /> : body }
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -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 (
|
||||
<div className="content-inner">
|
||||
<UserSearch {...userSearchProps} />
|
||||
<UserFilter {...userFilterProps} />
|
||||
<UserList {...userListProps} />
|
||||
<UserModalGen />
|
||||
</div>
|
||||
@@ -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)
|
||||
+9
-9
@@ -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 弹层【方法】',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user