|
@@ -0,0 +1,93 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="iscome">
|
|
|
|
+ <el-card style="padding:10px;margin:5px">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="14">
|
|
|
|
+ <div id="chartPie" style="height:350px;"></div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="10">
|
|
|
|
+ <ul>
|
|
|
|
+ <li>已参加培训:{{ istrain }} 人</li>
|
|
|
|
+ <li>未参加培训:{{ nottrain }} 人</li>
|
|
|
|
+ </ul>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-card>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import _ from 'lodash';
|
|
|
|
+import echarts from 'echarts/lib/echarts';
|
|
|
|
+import 'echarts/lib/chart/pie';
|
|
|
|
+import 'echarts/lib/component/title';
|
|
|
|
+import 'echarts/lib/component/legend';
|
|
|
|
+import 'echarts/lib/component/toolbox';
|
|
|
|
+import 'echarts/lib/component/markPoint';
|
|
|
|
+import 'echarts/lib/component/tooltip';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+export default {
|
|
|
|
+ name: 'iscome',
|
|
|
|
+ props: {
|
|
|
|
+ istrain: { type: Number, default: 0 },
|
|
|
|
+ nottrain: { type: Number, default: 0 },
|
|
|
|
+ },
|
|
|
|
+ components: {},
|
|
|
|
+ data: function() {
|
|
|
|
+ return {
|
|
|
|
+ myPie: null,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.init();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ init(type) {
|
|
|
|
+ this.myPie = echarts.init(document.getElementById('chartPie'));
|
|
|
|
+ const option = {
|
|
|
|
+ title: { text: '当前学生参加培训情况' },
|
|
|
|
+ tooltip: { trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)' },
|
|
|
|
+ legend: {
|
|
|
|
+ data: ['已参加培训', '未参加培训'],
|
|
|
|
+ },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: '统计',
|
|
|
|
+ label: {
|
|
|
|
+ show: true,
|
|
|
|
+ position: 'top',
|
|
|
|
+ },
|
|
|
|
+ type: 'pie',
|
|
|
|
+ data: [
|
|
|
|
+ { name: '已参加培训', value: this.istrain, itemStyle: { color: '#7cb5ec' } },
|
|
|
|
+ { name: '未参加培训', value: this.nottrain, itemStyle: { color: '#ffa94b' } },
|
|
|
|
+ ],
|
|
|
|
+ animationType: 'scale',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ toolbox: {
|
|
|
|
+ show: true,
|
|
|
|
+ feature: {
|
|
|
|
+ dataView: { readOnly: false },
|
|
|
|
+ saveAsImage: {},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ this.myPie.setOption(option);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ pageTitle() {
|
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|