no message
Former-commit-id: 1ec246744a653ec6359b0070410e2cadb34b1665 Former-commit-id: b32f6520504d85ab2188914922c07c1d0e3dec32 Former-commit-id: dfbc0be8d5128ef0cef1db9f32b4e56f59941c9d
This commit is contained in:
@@ -26,6 +26,7 @@ export default {
|
||||
},
|
||||
// 初始化图表
|
||||
init () {
|
||||
console.log('pie base')
|
||||
// mixin 中提供 creatChart
|
||||
this.creatChart()
|
||||
// 本组件的特殊设置
|
||||
|
||||
@@ -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
14
src/mock/chart/G2Pie.js
Normal 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 {}
|
||||
}
|
||||
})
|
||||
@@ -1,3 +1,4 @@
|
||||
import './G2Bar'
|
||||
import './G2Column'
|
||||
import './G2Line'
|
||||
import './G2Pie'
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user