no message

Former-commit-id: a686cbec6aa82ccf0a5a2f738602d72ff3fa00e5
Former-commit-id: 7e986278ddb45ad7f2373e759f923148f92a3981
Former-commit-id: 4efa4699c64d12049ead46e050e95d495364516b
This commit is contained in:
李杨
2018-01-29 17:26:19 +08:00
parent 85dc585c32
commit fbe0e17ae6
7 changed files with 96 additions and 9 deletions

View File

@@ -4,13 +4,19 @@
<GridItem v-bind="layout.layout[0]" @resize="resizeHandler('G2Line1')" @resized="resizedHandler('G2Line1')">
<el-card class="header-in">
<div slot="header">近年趋势</div>
<G2Line1 ref="G2Line1" :data="G2Line1"></G2Line1>
<G2Line1 ref="G2Line1" :data="chartData.G2Line1"></G2Line1>
</el-card>
</GridItem>
<GridItem v-bind="layout.layout[1]" @resize="resizeHandler('G2Pie1')" @resized="resizedHandler('G2Pie1')">
<el-card class="header-in">
<div slot="header">人员分布</div>
<G2Pie1 ref="G2Pie1" :data="G2Pie1"></G2Pie1>
<G2Pie1 ref="G2Pie1" :data="chartData.G2Pie1"></G2Pie1>
</el-card>
</GridItem>
<GridItem v-bind="layout.layout[2]" @resize="resizeHandler('G2Column1')" @resized="resizedHandler('G2Column1')">
<el-card class="header-in">
<div slot="header">人员分布</div>
<G2Column1 ref="G2Column1" :data="chartData.G2Column1"></G2Column1>
</el-card>
</GridItem>
</GridLayout>

View File

@@ -2,8 +2,11 @@ export default {
data () {
return {
// 数据
G2Line1: [],
G2Pie1: []
chartData: {
G2Line1: [],
G2Pie1: [],
G2Column1: []
}
}
},
mounted () {
@@ -15,12 +18,16 @@ export default {
syncData () {
const api = [
{url: '/api/chart/G2Line', data: {code: 1}},
{url: '/api/chart/G2Pie', data: {code: 1}}
{url: '/api/chart/G2Pie', data: {code: 1}},
{url: '/api/chart/G2Column', data: {code: 1}}
]
this.$axios.all(api.map(e => this.$axios.post(e.url, e.data)))
.then(this.$axios.spread((G2Line1, G2Pie1) => {
this.G2Line1 = G2Line1
this.G2Pie1 = G2Pie1
.then(this.$axios.spread((G2Line1, G2Pie1, G2Column1) => {
this.chartData = {
G2Line1,
G2Pie1,
G2Column1
}
}))
}
}

View File

@@ -4,7 +4,8 @@ export default {
layout: {
layout: [
{'x': 0, 'y': 0, 'w': 8, 'h': 9, 'i': '0'},
{'x': 8, 'y': 0, 'w': 4, 'h': 9, 'i': '1'}
{'x': 8, 'y': 0, 'w': 4, 'h': 9, 'i': '1'},
{'x': 0, 'y': 9, 'w': 5, 'h': 7, 'i': '2'}
],
colNum: 12,
rowHeight: 30,