|
@@ -1,18 +1,20 @@
|
|
|
<template>
|
|
|
<div class="report-teacher">
|
|
|
- <report-box title="任课老师分析">
|
|
|
- <div
|
|
|
- v-for="(chart, cindex) in teacherCharts"
|
|
|
- :key="`chart-${cindex}`"
|
|
|
- class="page-chart"
|
|
|
- >
|
|
|
+ <report-box
|
|
|
+ v-for="(tpage, cindex) in teacherCharts"
|
|
|
+ :key="`chart-${cindex}`"
|
|
|
+ title="任课老师分析"
|
|
|
+ >
|
|
|
+ <div v-for="(chart, index) in tpage" :key="index" class="college-chart">
|
|
|
<v-chart :option="chart"></v-chart>
|
|
|
</div>
|
|
|
- <table
|
|
|
- v-for="(tgroup, tindex) in teacherTables"
|
|
|
- :key="`table-${tindex}`"
|
|
|
- class="table table-border"
|
|
|
- >
|
|
|
+ </report-box>
|
|
|
+ <report-box
|
|
|
+ v-for="(tgroup, cindex) in teacherTables"
|
|
|
+ :key="`table-${cindex}`"
|
|
|
+ title="任课老师分析"
|
|
|
+ >
|
|
|
+ <table class="table table-border">
|
|
|
<tr>
|
|
|
<th>任课老师</th>
|
|
|
<th>班级</th>
|
|
@@ -49,7 +51,7 @@ import { mapState } from "vuex";
|
|
|
import ReportBox from "./ReportBox.vue";
|
|
|
import { sectionArr } from "./utils";
|
|
|
import { getBarsOptions } from "./chart";
|
|
|
-// TODO:
|
|
|
+
|
|
|
export default {
|
|
|
name: "report-teacher",
|
|
|
components: { ReportBox },
|
|
@@ -63,15 +65,21 @@ export default {
|
|
|
this.initData();
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState("report", ["teacher"]),
|
|
|
+ ...mapState("report", ["teacher", "teacherClass"]),
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
|
- const teacher = this.teacher;
|
|
|
- this.teacherCharts = sectionArr(teacher, 10).map((data) =>
|
|
|
- getBarsOptions(data)
|
|
|
+ const teacher = this.teacher.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.teacherName,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.teacherCharts = sectionArr(
|
|
|
+ sectionArr(teacher, 6).map((data) => getBarsOptions(data)),
|
|
|
+ 4
|
|
|
);
|
|
|
- this.teacherTables = sectionArr(teacher, 30);
|
|
|
+ this.teacherTables = sectionArr(this.teacherClass, 30);
|
|
|
},
|
|
|
},
|
|
|
};
|