|  | @@ -1,5 +1,13 @@
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  | -  <el-card header="学员变动">
 |  | 
 | 
											
												
													
														|  | 
 |  | +  <el-card>
 | 
											
												
													
														|  | 
 |  | +    <div slot="header" class="clearfix">
 | 
											
												
													
														|  | 
 |  | +      <span>学员变动</span>
 | 
											
												
													
														|  | 
 |  | +      <el-button
 | 
											
												
													
														|  | 
 |  | +        @click="isHistogram = !isHistogram"
 | 
											
												
													
														|  | 
 |  | +        style="float: right; padding: 3px 0"
 | 
											
												
													
														|  | 
 |  | +        type="text"
 | 
											
												
													
														|  | 
 |  | +      >{{isHistogram ? '学员转化漏斗图' : '学员柱状图'}}</el-button>
 | 
											
												
													
														|  | 
 |  | +    </div>
 | 
											
												
													
														|  |      <statistic class="statistic" :cols="0">
 |  |      <statistic class="statistic" :cols="0">
 | 
											
												
													
														|  |        <statistic-item v-for="(item, key) in items" :key="key" :class="{active: active === key}" @click="active = key">
 |  |        <statistic-item v-for="(item, key) in items" :key="key" :class="{active: active === key}" @click="active = key">
 | 
											
												
													
														|  |          <span>
 |  |          <span>
 | 
											
										
											
												
													
														|  | @@ -13,15 +21,18 @@
 | 
											
												
													
														|  |          </span>
 |  |          </span>
 | 
											
												
													
														|  |        </statistic-item>
 |  |        </statistic-item>
 | 
											
												
													
														|  |      </statistic>
 |  |      </statistic>
 | 
											
												
													
														|  | -    <ve-histogram style="width: 100%;" height="350px" :data="chartData"></ve-histogram>
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <ve-histogram v-if="isHistogram" style="width: 100%;" height="345px" :data="chartData"></ve-histogram>
 | 
											
												
													
														|  | 
 |  | +    <ve-funnel v-else style="width: 100%;" height="345px" :data="funnelData"></ve-funnel>
 | 
											
												
													
														|  |    </el-card>
 |  |    </el-card>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  |  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'
 | 
											
												
													
														|  | 
 |  | +import veFunnel from 'v-charts/lib/funnel.common'
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
												
													
														|  |    props: ['data'],
 |  |    props: ['data'],
 | 
											
												
													
														|  |    components: {
 |  |    components: {
 | 
											
												
													
														|  | 
 |  | +    've-funnel': veFunnel,
 | 
											
												
													
														|  |      've-histogram': veHistogram,
 |  |      've-histogram': veHistogram,
 | 
											
												
													
														|  |      'count-to': countTo
 |  |      'count-to': countTo
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
										
											
												
													
														|  | @@ -52,11 +63,23 @@ export default {
 | 
											
												
													
														|  |          columns: ['月份', ...values.map(item => item.title)],
 |  |          columns: ['月份', ...values.map(item => item.title)],
 | 
											
												
													
														|  |          rows: Object.values(months)
 |  |          rows: Object.values(months)
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    funnelData() {
 | 
											
												
													
														|  | 
 |  | +      return {
 | 
											
												
													
														|  | 
 |  | +        columns: ['状态', '数值'],
 | 
											
												
													
														|  | 
 |  | +        rows: [
 | 
											
												
													
														|  | 
 |  | +          { '状态': '展示', '数值': 900 },
 | 
											
												
													
														|  | 
 |  | +          { '状态': '访问', '数值': 600 },
 | 
											
												
													
														|  | 
 |  | +          { '状态': '点击', '数值': 300 },
 | 
											
												
													
														|  | 
 |  | +          { '状态': '订单', '数值': 100 }
 | 
											
												
													
														|  | 
 |  | +        ]
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    data () {
 |  |    data () {
 | 
											
												
													
														|  |      return {
 |  |      return {
 | 
											
												
													
														|  |        active: 'NEWLY_STUDENT_NUM',
 |  |        active: 'NEWLY_STUDENT_NUM',
 | 
											
												
													
														|  | 
 |  | +      isHistogram: true,
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |  }
 |  |  }
 |