mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-17 08:15:05 +00:00
rencentsales
This commit is contained in:
+13
-1
@@ -7,12 +7,23 @@ import {color} from '../src/utils/theme'
|
||||
let dataKey = mockStorge('Dashboard', Mock.mock({
|
||||
'sales|12': [
|
||||
{
|
||||
'name|+1': 01,
|
||||
'name|+1': 1,
|
||||
'Clothes|200-500': 1,
|
||||
'Food|180-700': 1,
|
||||
'Electronics|300-850': 1
|
||||
}
|
||||
],
|
||||
'recentSales|36':[
|
||||
{
|
||||
'id|+1': 1,
|
||||
name: '@last',
|
||||
'status|1-5': 1,
|
||||
date:function(){
|
||||
return Mock.Random.integer(2015, 2016)+'-'+Mock.Random.date('MM-dd')+' '+Mock.Random.time('HH:mm:ss')
|
||||
},
|
||||
'price|10-200.1-2':1
|
||||
}
|
||||
],
|
||||
quote: {
|
||||
name: 'Joho Doe',
|
||||
title: 'Graphic Designer',
|
||||
@@ -46,6 +57,7 @@ let dataKey = mockStorge('Dashboard', Mock.mock({
|
||||
|
||||
module.exports = {
|
||||
'GET /api/dashboard' (req, res) {
|
||||
console.log(global[dataKey].recentSales);
|
||||
res.json(global[dataKey])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import React, {PropTypes} from 'react'
|
||||
import {Icon,Table} from 'antd'
|
||||
import styles from './recentSales.less'
|
||||
import {classnames} from '../../utils'
|
||||
|
||||
function recentSales(props) {
|
||||
const columns = [
|
||||
{
|
||||
title: 'NAME',
|
||||
dataIndex: 'name',
|
||||
}, {
|
||||
title: 'STATUS',
|
||||
dataIndex: 'status',
|
||||
}, {
|
||||
title: 'DATE',
|
||||
dataIndex: 'date',
|
||||
}, {
|
||||
title: 'PRICE',
|
||||
dataIndex: 'price',
|
||||
}
|
||||
]
|
||||
return (
|
||||
<div className={styles.recentsales}>
|
||||
<Table columns={columns} key={(record,key)=>key} dataSource={props.data}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default recentSales
|
||||
@@ -0,0 +1 @@
|
||||
@import "../vars.less";
|
||||
@@ -178,6 +178,7 @@ export default {
|
||||
avatar: 'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236'
|
||||
},
|
||||
numbers:[],
|
||||
recentSales:[]
|
||||
},
|
||||
subscriptions : {
|
||||
setup({dispatch}) {
|
||||
|
||||
@@ -6,11 +6,12 @@ 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 styles from './dashboard.less'
|
||||
import {color} from '../utils'
|
||||
|
||||
function Dashboard({dashboard}) {
|
||||
const {weather, sales, quote, numbers} = dashboard
|
||||
const {weather, sales, quote, numbers, recentSales} = dashboard
|
||||
const numberCards = numbers.map((item, key) => <Col key={key} lg={6} md={12}>
|
||||
<NumberCard {...item}/>
|
||||
</Col>)
|
||||
@@ -52,7 +53,9 @@ function Dashboard({dashboard}) {
|
||||
padding: 0,
|
||||
height: 432,
|
||||
background: '#fff'
|
||||
}}></Card>
|
||||
}}>
|
||||
<RecentSales data={recentSales}/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col lg={12} md={24}>
|
||||
<Card bordered={false} bodyStyle={{
|
||||
|
||||
Reference in New Issue
Block a user