|
@@ -1,28 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<el-card header="运营数据">
|
|
<el-card header="运营数据">
|
|
<statistic class="statistic" :cols="0">
|
|
<statistic class="statistic" :cols="0">
|
|
- <statistic-item>
|
|
|
|
- <span>合作单位</span>
|
|
|
|
|
|
+ <statistic-item v-for="(item, key) in items" :key="key" :class="{active: active === key}" @click="active = key">
|
|
|
|
+ <span>{{item.title}}</span>
|
|
<span>
|
|
<span>
|
|
- <count-to :endVal="56"/>
|
|
|
|
- </span>
|
|
|
|
- </statistic-item>
|
|
|
|
- <statistic-item>
|
|
|
|
- <span>乐团数量</span>
|
|
|
|
- <span>
|
|
|
|
- <count-to :endVal="62"/>
|
|
|
|
- </span>
|
|
|
|
- </statistic-item>
|
|
|
|
- <statistic-item>
|
|
|
|
- <span>乐团学员</span>
|
|
|
|
- <span>
|
|
|
|
- <count-to :endVal="6203"/>
|
|
|
|
- </span>
|
|
|
|
- </statistic-item>
|
|
|
|
- <statistic-item>
|
|
|
|
- <span>其它学员</span>
|
|
|
|
- <span>
|
|
|
|
- <count-to :endVal="2162"/>
|
|
|
|
|
|
+ <count-to :endVal="item.percent"/>
|
|
</span>
|
|
</span>
|
|
</statistic-item>
|
|
</statistic-item>
|
|
</statistic>
|
|
</statistic>
|
|
@@ -33,24 +15,33 @@
|
|
import countTo from 'vue-count-to'
|
|
import countTo from 'vue-count-to'
|
|
import veHistogram from 'v-charts/lib/histogram.common'
|
|
import veHistogram from 'v-charts/lib/histogram.common'
|
|
export default {
|
|
export default {
|
|
|
|
+ props: ['data'],
|
|
components: {
|
|
components: {
|
|
've-histogram': veHistogram,
|
|
've-histogram': veHistogram,
|
|
'count-to': countTo
|
|
'count-to': countTo
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ items() {
|
|
|
|
+ return {
|
|
|
|
+ SCHOOL: this.data['SCHOOL'] || {},
|
|
|
|
+ MUSIC_GROUP_NUM: this.data['MUSIC_GROUP_NUM'] || {},
|
|
|
|
+ MUSIC_GROUP_STUDENT: this.data['MUSIC_GROUP_STUDENT'] || {},
|
|
|
|
+ OTHER_STUDENT: this.data['OTHER_STUDENT'] || {},
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ chartData() {
|
|
|
|
+ const data = this.data[this.active] || {}
|
|
|
|
+ return {
|
|
|
|
+ columns: ['月份', data.title],
|
|
|
|
+ rows: (data.indexMonthData || []).map(item => ({
|
|
|
|
+ '月份': this.$helpers.dayjs(item.month).month() + 1 + '月', [data.title]: item.activateNum,
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
- let data = []
|
|
|
|
return {
|
|
return {
|
|
- chartData: {
|
|
|
|
- columns: ['日期', '访问用户', '下单用户', '下单率'],
|
|
|
|
- rows: [
|
|
|
|
- { '日期': '1/1', '访问用户': 1393, '下单用户': 1093, '下单率': 0.32 },
|
|
|
|
- { '日期': '1/2', '访问用户': 3530, '下单用户': 3230, '下单率': 0.26 },
|
|
|
|
- { '日期': '1/3', '访问用户': 2923, '下单用户': 2623, '下单率': 0.76 },
|
|
|
|
- { '日期': '1/4', '访问用户': 1723, '下单用户': 1423, '下单率': 0.49 },
|
|
|
|
- { '日期': '1/5', '访问用户': 3792, '下单用户': 3492, '下单率': 0.323 },
|
|
|
|
- { '日期': '1/6', '访问用户': 4593, '下单用户': 4293, '下单率': 0.78 }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
|
|
+ active: 'SCHOOL',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -59,6 +50,9 @@ export default {
|
|
.statistic{
|
|
.statistic{
|
|
/deep/ .statistic-content{
|
|
/deep/ .statistic-content{
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
+ &.active > span{
|
|
|
|
+ color: #14928a !important;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|