forked from zuiidea/antd-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {color} from '../src/utils/theme' | ||
import { color } from '../src/utils/theme' | ||
const Mock = require('mockjs') | ||
import mockStorge from '../src/utils/mockStorge' | ||
|
||
|
@@ -8,122 +8,122 @@ let dataKey = mockStorge('Dashboard', Mock.mock({ | |
'name|+1': 2008, | ||
'Clothes|200-500': 1, | ||
'Food|180-400': 1, | ||
'Electronics|300-550': 1 | ||
} | ||
'Electronics|300-550': 1, | ||
}, | ||
], | ||
'cpu': { | ||
cpu: { | ||
'usage|50-600': 1, | ||
space: 825, | ||
'cpu|40-90': 1, | ||
'data|20': [ | ||
{ | ||
'cpu|20-80': 1 | ||
} | ||
] | ||
'cpu|20-80': 1, | ||
}, | ||
], | ||
}, | ||
'browser': [ | ||
browser: [ | ||
{ | ||
name: 'Google Chrome', | ||
percent: 43.3, | ||
status: 1 | ||
status: 1, | ||
}, | ||
{ | ||
name: 'Mozilla Firefox', | ||
percent: 33.4, | ||
status: 2 | ||
status: 2, | ||
}, | ||
{ | ||
name: 'Apple Safari', | ||
percent: 34.6, | ||
status: 3 | ||
status: 3, | ||
}, | ||
{ | ||
name: 'Internet Explorer', | ||
percent: 12.3, | ||
status: 4 | ||
status: 4, | ||
}, | ||
{ | ||
name: 'Opera Mini', | ||
percent: 3.3, | ||
status: 1 | ||
status: 1, | ||
}, | ||
{ | ||
name: 'Chromium', | ||
percent: 2.53, | ||
status: 1 | ||
} | ||
status: 1, | ||
}, | ||
], | ||
user: { | ||
name: 'zuiidea', | ||
email: '[email protected]', | ||
sales: 3241, | ||
sold: 3556, | ||
avatar: 'http://tva4.sinaimg.cn/crop.0.0.996.996.180/6ee6a3a3jw8f0ks5pk7btj20ro0rodi0.jpg' | ||
avatar: 'http://tva4.sinaimg.cn/crop.0.0.996.996.180/6ee6a3a3jw8f0ks5pk7btj20ro0rodi0.jpg', | ||
}, | ||
'completed|12': [ | ||
{ | ||
'name|+1': 2008, | ||
'Task complete|200-1000': 1, | ||
'Cards Complete|200-1000': 1 | ||
} | ||
'Cards Complete|200-1000': 1, | ||
}, | ||
], | ||
'comments|5': [ | ||
{ | ||
name: '@last', | ||
'status|1-3': 1, | ||
content: '@sentence', | ||
avatar: function () { | ||
avatar () { | ||
return Mock.Random.image('48x48', Mock.Random.color(), '#757575', 'png', this.name.substr(0, 1)) | ||
}, | ||
date: function () { | ||
return '2016-' + Mock.Random.date('MM-dd') + ' ' + Mock.Random.time('HH:mm:ss') | ||
} | ||
} | ||
date () { | ||
return `2016-${Mock.Random.date('MM-dd')} ${Mock.Random.time('HH:mm:ss')}` | ||
}, | ||
}, | ||
], | ||
'recentSales|36': [ | ||
{ | ||
'id|+1': 1, | ||
name: '@last', | ||
'status|1-4': 1, | ||
date: function () { | ||
return Mock.Random.integer(2015, 2016) + '-' + Mock.Random.date('MM-dd') + ' ' + Mock.Random.time('HH:mm:ss') | ||
date () { | ||
return `${Mock.Random.integer(2015, 2016)}-${Mock.Random.date('MM-dd')} ${Mock.Random.time('HH:mm:ss')}` | ||
}, | ||
'price|10-200.1-2': 1 | ||
} | ||
'price|10-200.1-2': 1, | ||
}, | ||
], | ||
quote: { | ||
name: 'Joho Doe', | ||
title: 'Graphic Designer', | ||
content: `I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my best.`, | ||
avatar: 'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236' | ||
content: 'I\'m selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can\'t handle me at my worst, then you sure as hell don\'t deserve me at my best.', | ||
avatar: 'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236', | ||
}, | ||
numbers: [ | ||
{ | ||
icon: 'pay-circle-o', | ||
color: color.green, | ||
title: 'Online Review', | ||
number: 2781 | ||
number: 2781, | ||
}, { | ||
icon: 'team', | ||
color: color.blue, | ||
title: 'New Customers', | ||
number: 3241 | ||
number: 3241, | ||
}, { | ||
icon: 'message', | ||
color: color.purple, | ||
title: 'Active Projects', | ||
number: 253 | ||
number: 253, | ||
}, { | ||
icon: 'shopping-cart', | ||
color: color.red, | ||
title: 'Referrals', | ||
number: 4324 | ||
} | ||
] | ||
number: 4324, | ||
}, | ||
], | ||
})) | ||
|
||
module.exports = { | ||
'GET /api/dashboard' (req, res) { | ||
res.json(global[dataKey]) | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters