|
@@ -34,7 +34,6 @@
|
|
|
.vm-video-list .ant-comment-inner {
|
|
|
padding: 0;
|
|
|
}
|
|
|
-
|
|
|
</style>
|
|
|
<template>
|
|
|
<div class="vm-video-list">
|
|
@@ -43,7 +42,13 @@
|
|
|
<div class="panel-heading">{{ title }}</div>
|
|
|
</a-row>
|
|
|
</a-row>
|
|
|
- <a-row class="image-list" :gutter="16" style="padding:0 8px"></a-row>
|
|
|
+ <a-row class="image-list" :gutter="16" style="padding:0 8px">
|
|
|
+ <a-col :span="12">
|
|
|
+ <div id="chart">
|
|
|
+ <apexchart width="50%" height="300" type="bar" :options="options" :series="series"></apexchart>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -62,18 +67,71 @@ export default {
|
|
|
data: function() {
|
|
|
return {
|
|
|
title: '报表统计',
|
|
|
- statistics:[]
|
|
|
+ statistics: [],
|
|
|
+ showData: null,
|
|
|
+ options: {
|
|
|
+ chart: {
|
|
|
+ id: 'vuechart-example'
|
|
|
+ },
|
|
|
+ xaxis: {
|
|
|
+ categories: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: 'series-1',
|
|
|
+ data: []
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ updateChart() {
|
|
|
+ // const max = 90
|
|
|
+ // const min = 20
|
|
|
+ getAccountReport().then(res => {
|
|
|
+ for (const key in res) {
|
|
|
+ this.options.series[0].data.push(res[key])
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ const newData = this.series[0].data.map(() => {
|
|
|
+ return Math.floor(Math.random() * (max - min + 1)) + min
|
|
|
+ })
|
|
|
+ this.series = [
|
|
|
+ {
|
|
|
+ data: newData
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
- methods: {},
|
|
|
watch: {},
|
|
|
mounted: function() {
|
|
|
this.$nextTick(() => {
|
|
|
- getAccountReport().then(res=>{
|
|
|
- if(res.code == 0){
|
|
|
- console.log(res)
|
|
|
- }
|
|
|
- })
|
|
|
+ getAccountReport().then(res => {
|
|
|
+ var dataNew = []
|
|
|
+ var dataX = []
|
|
|
+ for (const key in res.bytedance) {
|
|
|
+ dataNew.push(res.bytedance[key])
|
|
|
+ dataX.push(key)
|
|
|
+ }
|
|
|
+ var indexX = dataX.findIndex(v => v === 'cost')
|
|
|
+ dataX.splice(indexX, 1)
|
|
|
+ dataNew.splice(indexX, 1)
|
|
|
+ this.series = [
|
|
|
+ {
|
|
|
+ data: dataNew
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.options = {
|
|
|
+ chart: {
|
|
|
+ id: 'vuechart-example'
|
|
|
+ },
|
|
|
+ xaxis: {
|
|
|
+ categories: dataX
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|