|
@@ -1,20 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<div class="report-question">
|
|
<div class="report-question">
|
|
- <report-box
|
|
|
|
- v-for="(cgroup, cindex) in questionCharts"
|
|
|
|
- :key="`chart-${cindex}`"
|
|
|
|
- :title="title"
|
|
|
|
- >
|
|
|
|
- <div class="question-chart" :style="cgroup.style">
|
|
|
|
- <v-chart :option="cgroup.chart" :init-options="initOption"></v-chart>
|
|
|
|
|
|
+ <report-box v-for="(page, pindex) in pages" :key="pindex" :title="title">
|
|
|
|
+ <div v-if="page.charts" class="question-chart" :style="page.charts.style">
|
|
|
|
+ <v-chart
|
|
|
|
+ :option="page.charts.chart"
|
|
|
|
+ :init-options="initOption"
|
|
|
|
+ ></v-chart>
|
|
</div>
|
|
</div>
|
|
- </report-box>
|
|
|
|
- <report-box
|
|
|
|
- v-for="(tgroup, tindex) in questionTables"
|
|
|
|
- :key="`table-${tindex}`"
|
|
|
|
- :title="title"
|
|
|
|
- >
|
|
|
|
- <table class="report-table report-table-border">
|
|
|
|
|
|
+ <table v-if="page.tables" class="report-table report-table-border">
|
|
<tr>
|
|
<tr>
|
|
<th>题目名称</th>
|
|
<th>题目名称</th>
|
|
<th>大题号</th>
|
|
<th>大题号</th>
|
|
@@ -24,7 +17,7 @@
|
|
<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.title }}</td>
|
|
<td>{{ item.title }}</td>
|
|
<td>{{ item.mainNumber }}</td>
|
|
<td>{{ item.mainNumber }}</td>
|
|
<td>{{ item.subNumber }}</td>
|
|
<td>{{ item.subNumber }}</td>
|
|
@@ -54,6 +47,7 @@ export default {
|
|
return {
|
|
return {
|
|
questionCharts: [],
|
|
questionCharts: [],
|
|
questionTables: [],
|
|
questionTables: [],
|
|
|
|
+ pages: [],
|
|
chartSplitRange: 30,
|
|
chartSplitRange: 30,
|
|
initOption,
|
|
initOption,
|
|
};
|
|
};
|
|
@@ -74,7 +68,8 @@ export default {
|
|
initData() {
|
|
initData() {
|
|
const question =
|
|
const question =
|
|
this.type === "subjective" ? this.subjective : this.objective;
|
|
this.type === "subjective" ? this.subjective : this.objective;
|
|
- this.questionCharts = sectionArr(question, this.chartSplitRange).map(
|
|
|
|
|
|
+
|
|
|
|
+ const questionCharts = sectionArr(question, this.chartSplitRange).map(
|
|
(data) => {
|
|
(data) => {
|
|
return {
|
|
return {
|
|
chart: getBarPointTopicOptions(data),
|
|
chart: getBarPointTopicOptions(data),
|
|
@@ -83,7 +78,31 @@ export default {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
);
|
|
);
|
|
- this.questionTables = sectionArr(question, this.chartSplitRange);
|
|
|
|
|
|
+ const questionTables = sectionArr(question, this.chartSplitRange);
|
|
|
|
+
|
|
|
|
+ let pages = [];
|
|
|
|
+ if (question.length <= 14) {
|
|
|
|
+ pages = [
|
|
|
|
+ {
|
|
|
|
+ charts: questionCharts[0],
|
|
|
|
+ tables: questionTables[0],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ } else {
|
|
|
|
+ questionCharts.forEach((chart) => {
|
|
|
|
+ pages.push({
|
|
|
|
+ charts: chart,
|
|
|
|
+ tables: null,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ questionTables.forEach((table) => {
|
|
|
|
+ pages.push({
|
|
|
|
+ charts: null,
|
|
|
|
+ tables: table,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.pages = pages;
|
|
},
|
|
},
|
|
getChartStyle(count) {
|
|
getChartStyle(count) {
|
|
const labelHeight = 28;
|
|
const labelHeight = 28;
|