no message

Former-commit-id: 2ac08bdf73416d40f32a3f7965369cb28d4329d3 [formerly 2ac08bdf73416d40f32a3f7965369cb28d4329d3 [formerly 2ac08bdf73416d40f32a3f7965369cb28d4329d3 [formerly 2ac08bdf73416d40f32a3f7965369cb28d4329d3 [formerly 7edbaec35ed1435f9b321dc93a6fc638390e62c1 [formerly 2b79008703fe8c1f2dfc0e74d07589f55f68fa15]]]]]
Former-commit-id: 43f9f620117aa19760d79743b2358e02473f45e6
Former-commit-id: 447bd2d9ae835cc47ceab1283c3b24a5406a234e
Former-commit-id: 0d221eda984865e1d036159f6d92c2858634055c [formerly b6c26e2313ea3786c93d68c6394e4b2c59bdbe17]
Former-commit-id: 79fdc885d3dc2a91ec43a48a11242c8a9f3ffdb1
Former-commit-id: 0959cb5dcdfe874efcb14c4ad8ed2fd5a1886516
Former-commit-id: c7cee26e0b0a5dd22d724c43c0e92828d84fab99
Former-commit-id: f75348850386038a04efa082a8bf71d5d5663f6b
Former-commit-id: 65e82442f2b596e30e183f0522bb4e3a64408738
This commit is contained in:
liyang
2018-06-26 22:20:59 +08:00
parent 9832c730b6
commit 51186622f6
49 changed files with 150 additions and 1677 deletions

View File

@@ -1,24 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Area', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础折线图
case 'base': {
let last = 0
const data = ['3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'].map(x => ({
x,
y: 0
})).map(e => {
e.y = last + fn.r()
last = e.y
return e
})
last = 0
return fn.returnMaker(data)
}
default:
return {}
}
})

View File

@@ -1,14 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Bar', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础折线图
case 'base': {
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(x => ({x, y: fn.r()})).sort((a, b) => a.y - b.y))
}
default:
return {}
}
})

View File

@@ -1,14 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Column', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础折线图
case 'base': {
return fn.returnMaker(['3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'].map(x => ({x, y: fn.r()})))
}
default:
return {}
}
})

View File

@@ -1,28 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Line', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础折线图
case 'base': {
let last = 0
const data = ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018'].map(x => ({
x,
y: 0
})).map(e => {
e.y = last + fn.r()
last = e.y
return e
})
last = 0
return fn.returnMaker(data)
}
// 阶梯折线图
case 'step': {
return fn.returnMaker(['3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'].map(x => ({x, y: fn.r()})))
}
default:
return {}
}
})

View File

@@ -1,14 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2NightingaleRose', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础南丁格尔玫瑰图
case 'base': {
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(e => ({item: e, count: 100 + fn.r()})))
}
default:
return {}
}
})

View File

@@ -1,14 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Pie', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础饼图
case 'base': {
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(e => ({item: e, count: fn.r()})))
}
default:
return {}
}
})

View File

@@ -1,18 +0,0 @@
import Mock from 'mockjs'
import * as fn from './_fn'
Mock.mock('/api/chart/G2Radar', 'post', ({body, type, url}) => {
const _body = JSON.parse(body)
switch (_body.type) {
// 基础折线图
case 'base': {
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(e => ({
item: e,
a: fn.r(),
b: fn.r()
})))
}
default:
return {}
}
})

View File

@@ -1,11 +0,0 @@
export const r = (add = 0) => {
return Math.round(Math.random() * 100) + add
}
export const returnMaker = (data = []) => {
return {
code: 0,
msg: '请求成功',
data
}
}

View File

@@ -1,7 +0,0 @@
import './G2Area'
import './G2Bar'
import './G2Column'
import './G2Line'
import './G2NightingaleRose'
import './G2Pie'
import './G2Radar'

View File

@@ -4,8 +4,6 @@ import '@/mock/ajax-demo'
import '@/mock/login'
import '@/mock/chart/register.js'
// 设置全局延时 没有延时的话有时候会检测不到数据变化 建议保留
Mock.setup({
timeout: '300-600'