|
@@ -1,6 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div class="report-question">
|
|
<div class="report-question">
|
|
- <report-box v-for="(page, pindex) in pages" :key="pindex" :title="title">
|
|
|
|
|
|
+ <report-box
|
|
|
|
+ v-for="(page, pindex) in pages"
|
|
|
|
+ :key="pindex"
|
|
|
|
+ :title="page.title"
|
|
|
|
+ >
|
|
<div v-if="page.charts" class="question-chart" :style="page.charts.style">
|
|
<div v-if="page.charts" class="question-chart" :style="page.charts.style">
|
|
<v-chart
|
|
<v-chart
|
|
:option="page.charts.chart"
|
|
:option="page.charts.chart"
|
|
@@ -68,9 +72,23 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
initData() {
|
|
initData() {
|
|
- const question =
|
|
|
|
- this.type === "subjective" ? this.subjective : this.objective;
|
|
|
|
|
|
+ if (this.type === "subjective") {
|
|
|
|
+ this.pages = this.buildPapers(this.subjective);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const pages = [];
|
|
|
|
+ this.objective.forEach((item) => {
|
|
|
|
+ const result = this.buildPapers(
|
|
|
|
+ item.list,
|
|
|
|
+ this.objective.length > 1 ? item.paperType : ""
|
|
|
|
+ );
|
|
|
|
+ pages.push(...result);
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ this.pages = pages;
|
|
|
|
+ },
|
|
|
|
+ buildPapers(question, paperType = "") {
|
|
const questionCharts = sectionArr(question, this.chartSplitRange).map(
|
|
const questionCharts = sectionArr(question, this.chartSplitRange).map(
|
|
(data) => {
|
|
(data) => {
|
|
return {
|
|
return {
|
|
@@ -82,10 +100,15 @@ export default {
|
|
);
|
|
);
|
|
const questionTables = sectionArr(question, this.chartSplitRange);
|
|
const questionTables = sectionArr(question, this.chartSplitRange);
|
|
|
|
|
|
|
|
+ const title = paperType
|
|
|
|
+ ? `${this.title}-${paperType}卷`
|
|
|
|
+ : `${this.title}`;
|
|
|
|
+
|
|
let pages = [];
|
|
let pages = [];
|
|
if (question.length <= 14) {
|
|
if (question.length <= 14) {
|
|
pages = [
|
|
pages = [
|
|
{
|
|
{
|
|
|
|
+ title,
|
|
charts: questionCharts[0],
|
|
charts: questionCharts[0],
|
|
tables: questionTables[0],
|
|
tables: questionTables[0],
|
|
},
|
|
},
|
|
@@ -93,18 +116,20 @@ export default {
|
|
} else {
|
|
} else {
|
|
questionCharts.forEach((chart) => {
|
|
questionCharts.forEach((chart) => {
|
|
pages.push({
|
|
pages.push({
|
|
|
|
+ title,
|
|
charts: chart,
|
|
charts: chart,
|
|
tables: null,
|
|
tables: null,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
questionTables.forEach((table) => {
|
|
questionTables.forEach((table) => {
|
|
pages.push({
|
|
pages.push({
|
|
|
|
+ title,
|
|
charts: null,
|
|
charts: null,
|
|
tables: table,
|
|
tables: table,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- this.pages = pages;
|
|
|
|
|
|
+ return pages;
|
|
},
|
|
},
|
|
getChartStyle(count) {
|
|
getChartStyle(count) {
|
|
const labelHeight = 28;
|
|
const labelHeight = 28;
|