|
@@ -1,24 +1,21 @@
|
|
<template>
|
|
<template>
|
|
<div class="report-teacher">
|
|
<div class="report-teacher">
|
|
<report-box
|
|
<report-box
|
|
- v-for="(tpage, cindex) in teacherCharts"
|
|
|
|
- :key="`chart-${cindex}`"
|
|
|
|
|
|
+ v-for="(page, pindex) in pages"
|
|
|
|
+ :key="pindex"
|
|
title="任课老师分析"
|
|
title="任课老师分析"
|
|
>
|
|
>
|
|
- <div v-for="(chart, index) in tpage" :key="index" class="college-chart">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-for="(chart, index) in page.charts"
|
|
|
|
+ :key="`chart-${index}`"
|
|
|
|
+ class="college-chart"
|
|
|
|
+ >
|
|
<v-chart :option="chart" :init-options="initOption"></v-chart>
|
|
<v-chart :option="chart" :init-options="initOption"></v-chart>
|
|
</div>
|
|
</div>
|
|
- </report-box>
|
|
|
|
- <report-box
|
|
|
|
- v-for="(tgroup, cindex) in teacherTables"
|
|
|
|
- :key="`table-${cindex}`"
|
|
|
|
- title="任课老师分析"
|
|
|
|
- >
|
|
|
|
- <table class="table table-border">
|
|
|
|
|
|
+ <table v-if="page.tables.length" class="report-table report-table-border">
|
|
<tr>
|
|
<tr>
|
|
<th>任课老师</th>
|
|
<th>任课老师</th>
|
|
<th>班级</th>
|
|
<th>班级</th>
|
|
- <!-- <th>有效人数</th> -->
|
|
|
|
<th>最高分</th>
|
|
<th>最高分</th>
|
|
<th>最低分</th>
|
|
<th>最低分</th>
|
|
<th>及格数</th>
|
|
<th>及格数</th>
|
|
@@ -26,12 +23,10 @@
|
|
<th>优秀数</th>
|
|
<th>优秀数</th>
|
|
<th>优秀率(%)</th>
|
|
<th>优秀率(%)</th>
|
|
<th>平均分</th>
|
|
<th>平均分</th>
|
|
- <!-- <th>相对平均分</th> -->
|
|
|
|
</tr>
|
|
</tr>
|
|
- <tr v-for="(item, ind) in tgroup" :key="ind">
|
|
|
|
|
|
+ <tr v-for="(item, ind) in page.tables" :key="ind">
|
|
<td>{{ item.teacher }}</td>
|
|
<td>{{ item.teacher }}</td>
|
|
<td>{{ item.className }}</td>
|
|
<td>{{ item.className }}</td>
|
|
- <!-- <td>{{ item.totalCount }}</td> -->
|
|
|
|
<td>{{ item.maxScore }}</td>
|
|
<td>{{ item.maxScore }}</td>
|
|
<td>{{ item.minScore }}</td>
|
|
<td>{{ item.minScore }}</td>
|
|
<td>{{ item.passCount }}</td>
|
|
<td>{{ item.passCount }}</td>
|
|
@@ -39,7 +34,6 @@
|
|
<td>{{ item.excellentCount }}</td>
|
|
<td>{{ item.excellentCount }}</td>
|
|
<td>{{ item.excellentRate }}</td>
|
|
<td>{{ item.excellentRate }}</td>
|
|
<td>{{ item.avgScore }}</td>
|
|
<td>{{ item.avgScore }}</td>
|
|
- <!-- <td>{{ item.relativeAvgScore }}</td> -->
|
|
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
</report-box>
|
|
</report-box>
|
|
@@ -49,16 +43,15 @@
|
|
<script>
|
|
<script>
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
import ReportBox from "./ReportBox.vue";
|
|
import ReportBox from "./ReportBox.vue";
|
|
-import { sectionArr } from "./utils";
|
|
|
|
-import { getBarsOptions, initOption } from "./chart";
|
|
|
|
|
|
+import { sectionArr, sectionArrFirstPage } from "./utils";
|
|
|
|
+import { getBarTeachersOptions, initOption } from "./chart";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "report-teacher",
|
|
name: "report-teacher",
|
|
components: { ReportBox },
|
|
components: { ReportBox },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- teacherCharts: [],
|
|
|
|
- teacherTables: [],
|
|
|
|
|
|
+ pages: [],
|
|
initOption,
|
|
initOption,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -76,11 +69,35 @@ export default {
|
|
name: item.teacher,
|
|
name: item.teacher,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- this.teacherCharts = sectionArr(
|
|
|
|
- sectionArr(teacher, 6).map((data) => getBarsOptions(data)),
|
|
|
|
- 4
|
|
|
|
|
|
+ const maxChartCountPerPage = 4;
|
|
|
|
+ const maxTableCountPerPage = 30;
|
|
|
|
+ const groupCharts = sectionArr(teacher, 4).map((data) =>
|
|
|
|
+ getBarTeachersOptions(data)
|
|
);
|
|
);
|
|
- this.teacherTables = sectionArr(this.teacherClass, 30);
|
|
|
|
|
|
+ let pages = [];
|
|
|
|
+ let curPage = { charts: [], tables: [] };
|
|
|
|
+ groupCharts.forEach((item) => {
|
|
|
|
+ curPage.charts.push(item);
|
|
|
|
+ if (curPage.charts.length === maxChartCountPerPage) {
|
|
|
|
+ pages.push(curPage);
|
|
|
|
+ curPage = { charts: [], tables: [] };
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ const firstPageTableCount = Math.floor(
|
|
|
|
+ (maxChartCountPerPage - curPage.charts.length) *
|
|
|
|
+ (maxTableCountPerPage / maxChartCountPerPage)
|
|
|
|
+ );
|
|
|
|
+ const groupTables = sectionArrFirstPage(
|
|
|
|
+ this.teacherClass,
|
|
|
|
+ maxTableCountPerPage,
|
|
|
|
+ firstPageTableCount
|
|
|
|
+ );
|
|
|
|
+ groupTables.forEach((item) => {
|
|
|
|
+ curPage.tables = item;
|
|
|
|
+ pages.push(curPage);
|
|
|
|
+ curPage = { charts: [], tables: [] };
|
|
|
|
+ });
|
|
|
|
+ this.pages = pages;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|