no message

Former-commit-id: 1ec246744a653ec6359b0070410e2cadb34b1665
Former-commit-id: b32f6520504d85ab2188914922c07c1d0e3dec32
Former-commit-id: dfbc0be8d5128ef0cef1db9f32b4e56f59941c9d
This commit is contained in:
李杨
2018-02-18 22:21:12 +08:00
parent ff19ab33ba
commit 754d580a2f
5 changed files with 27 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ export default {
},
// 初始化图表
init () {
console.log('pie base')
// mixin 中提供 creatChart
this.creatChart()
// 本组件的特殊设置

View File

@@ -2,5 +2,9 @@ import Vue from 'vue'
Vue.component('G2LineBase', resolve => { require(['@/components/charts/G2/components/Line/base.vue'], resolve) })
Vue.component('G2LineStep', resolve => { require(['@/components/charts/G2/components/Line/step.vue'], resolve) })
Vue.component('G2ColumnBase', resolve => { require(['@/components/charts/G2/components/Column/base.vue'], resolve) })
Vue.component('G2BarBase', resolve => { require(['@/components/charts/G2/components/Bar/base.vue'], resolve) })
Vue.component('G2PieBase', resolve => { require(['@/components/charts/G2/components/Pie/base.vue'], resolve) })

14
src/mock/chart/G2Pie.js Normal file
View File

@@ -0,0 +1,14 @@
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,3 +1,4 @@
import './G2Bar'
import './G2Column'
import './G2Line'
import './G2Pie'

View File

@@ -33,7 +33,7 @@
<GridItem v-bind="layout.layout[4]" @resized="handleResized(chart[4].refName)">
<el-card class="header-in">
<ChartCardHeader slot="header" @refresh="handleRefreshData(4)" title="近年行情"></ChartCardHeader>
<G2PieBase :ref="chart[4].refName" v-bind="chart[4]"></G2PieBase>
</el-card>
</GridItem>
<!-- 卡片 -->
@@ -79,6 +79,12 @@ export default {
refName: 'G2BarBase',
data: [],
padding: [30, 40, 50, 50]
},
{
api: {url: '/api/chart/G2Pie', data: {type: 'base'}},
refName: 'G2PieBase',
data: [],
padding: [30, 40, 50, 50]
}
],
layout: {