Parcourir la source

报告及bug fix

zhangjie il y a 1 an
Parent
commit
ee4f4f9a3d

BIN
src/assets/images/report/bg-footer.png


BIN
src/assets/images/report/cover-bg.png


BIN
src/assets/images/report/cover-title.png


BIN
src/assets/images/report/icon-circle-bule.png


BIN
src/assets/images/report/icon-circle-yellow.png


BIN
src/assets/images/report/icon-star.png


BIN
src/assets/images/report/tips-bg.png


+ 1 - 0
src/assets/styles/index.scss

@@ -5,6 +5,7 @@
 
 @import "./login.scss";
 @import "./pages.scss";
+@import "./report.scss";
 
 @import "./element-ui-costom.scss";
 @import "./common-comp.scss";

+ 13 - 0
src/assets/styles/pages.scss

@@ -1438,3 +1438,16 @@
     }
   }
 }
+// report-preview
+.report-preview {
+  .el-dialog__footer {
+    display: none;
+  }
+  .el-dialog__body {
+    background-color: $--color-background;
+  }
+  .report-page {
+    background-color: #fff;
+    margin: 10px auto;
+  }
+}

+ 29 - 62
src/assets/styles/report.scss

@@ -44,11 +44,6 @@ span {
   padding: 0;
   box-sizing: border-box;
 }
-body {
-  font-size: 19px;
-  color: $midDark;
-  font-family: "PingFang SC", Tahoma, Helvetica, Arial, sans-serif;
-}
 .font-normal {
   font-family: "PingFang SC Regular", "Microsoft YaHei", Tahoma, Helvetica,
     Arial, sans-serif;
@@ -78,19 +73,7 @@ fieldset,
 img {
   border: 0;
 }
-abbr {
-  border: 0;
-  font-variant: normal;
-}
-a {
-  text-decoration: none;
-  color: inherit;
-  *color: #999999;
-}
 
-img {
-  vertical-align: middle;
-}
 .page-error {
   color: $purple;
   font-size: 25px;
@@ -98,14 +81,21 @@ img {
   padding: 150px 30px;
 }
 
-/* page-box */
-.page-box {
+.mb-20 {
+  margin-bottom: 20px;
+}
+
+/* report-page */
+.report-page {
   width: 1160px;
   height: 1639px;
   margin: 0 auto;
   position: relative;
   padding: 37px 58px 70px;
   page-break-after: always;
+  font-size: 19px;
+  color: $midDark;
+  font-family: "PingFang SC", Tahoma, Helvetica, Arial, sans-serif;
 
   .page-body {
     background: #fff;
@@ -115,20 +105,8 @@ img {
   .page-content {
     margin-top: 39px;
     height: 1388px;
-    border: 2px dotted rgba(221, 221, 221, 1);
     position: relative;
     overflow: hidden;
-
-    &::before {
-      content: "";
-      display: block;
-      position: absolute;
-      left: 0;
-      top: 0;
-      z-index: auto;
-      width: 100%;
-      border-bottom: 4px solid $mainColor;
-    }
   }
   .page-foot {
     position: absolute;
@@ -144,7 +122,7 @@ img {
     .foot-right {
       float: right;
       padding-right: 180px;
-      background-image: url(../images/bg-footer.png);
+      background-image: url(../images/report/bg-footer.png);
       background-repeat: no-repeat;
       background-position: right 10px;
     }
@@ -225,7 +203,7 @@ img {
     background-size: 100% 100%;
   }
   .icon-star {
-    background-image: url(../images/common/icon-star.png);
+    background-image: url(../images/report/icon-star.png);
   }
 
   // page-title
@@ -236,30 +214,10 @@ img {
     line-height: 70px;
   }
   .page-title-2 {
-    position: absolute;
-    top: 0;
-    left: 0;
-    z-index: auto;
     font-size: 27px;
     font-weight: 600;
-    background: $mainColor;
-    color: #fff;
+    color: $mainColor;
     line-height: 39px;
-    padding: 10px 39px;
-    height: 58px;
-
-    &::after {
-      content: "";
-      display: block;
-      position: absolute;
-      width: 0;
-      height: 0;
-      right: -1px;
-      bottom: -1px;
-      border-width: 14px;
-      border-style: solid;
-      border-color: transparent #fff #fff transparent;
-    }
   }
 }
 
@@ -292,8 +250,8 @@ img {
 
 // .cover
 .cover {
-  &-box {
-    background-image: url(../images/cover-bg.png);
+  &-page {
+    background-image: url(../images/report/cover-bg.png);
     background-repeat: no-repeat;
     background-size: 100% 100%;
     background-position: left top;
@@ -306,8 +264,9 @@ img {
     height: 117px;
     left: 160px;
     top: 263px;
-    background-image: url(../images/cover-title.png);
-    background-size: 100% 100%;
+    font-size: 117px;
+    line-height: 1;
+    color: #fff;
   }
   &-footer {
     position: absolute;
@@ -335,6 +294,14 @@ img {
     }
   }
 }
+// summary
+.summary-chart {
+  height: 340px;
+}
+// college
+.college-chart {
+  height: 340px;
+}
 
 // teacher
 .chart-teachers {
@@ -384,14 +351,14 @@ img {
     }
     &:nth-of-type(5) {
       &::before {
-        background-image: url(../images/icon-circle-bule.png);
+        background-image: url(../images/report/icon-circle-bule.png);
         background-repeat: no-repeat;
         background-size: 100% 100%;
       }
     }
     &:nth-of-type(6) {
       &::before {
-        background-image: url(../images/icon-circle-yellow.png);
+        background-image: url(../images/report/icon-circle-yellow.png);
         background-repeat: no-repeat;
         background-size: 100% 100%;
       }
@@ -504,7 +471,7 @@ img {
     &.tips-tag {
       color: #fff;
       padding: 0 20px 0 10px;
-      background-image: url(../images/tips-bg.png);
+      background-image: url(../images/report/tips-bg.png);
       background-size: 100% 100%;
       background-repeat: no-repeat;
     }
@@ -525,7 +492,7 @@ img {
     height: 30px;
     top: 0;
     left: 0;
-    background-image: url(../images/icon-star.png);
+    background-image: url(../images/report/icon-star.png);
     background-repeat: no-repeat;
     background-size: 100% 100%;
   }

+ 6 - 2
src/modules/mark/components/ScoreReportPreview.vue

@@ -1,5 +1,6 @@
 <template>
   <el-dialog
+    class="report-preview"
     :visible.sync="modalIsShow"
     top="0"
     :close-on-click-modal="false"
@@ -7,7 +8,6 @@
     :show-close="false"
     append-to-body
     fullscreen
-    @open="initData"
   >
     <div slot="title">
       <h2 class="el-dialog__title">成绩报告</h2>
@@ -17,13 +17,18 @@
       </div>
     </div>
 
+    <report v-if="modalIsShow" ref="reportRef" :baseinfo="instance"></report>
+
     <div slot="footer"></div>
   </el-dialog>
 </template>
 
 <script>
+import Report from "./report/Report.vue";
+
 export default {
   name: "score-report-preview",
+  components: { Report },
   props: {
     instance: {
       type: Object,
@@ -38,7 +43,6 @@ export default {
     };
   },
   methods: {
-    initData() {},
     cancel() {
       this.modalIsShow = false;
     },

+ 2 - 2
src/modules/mark/components/markDetail/MarkDetailIssue.vue

@@ -225,7 +225,7 @@ export default {
       ).catch(() => {});
       if (confirm !== "confirm") return;
 
-      this.toReset(this.multipleSelection.map((item) => item.id));
+      this.toReset(this.multipleSelection.map((item) => item.taskId));
     },
     async toSimpleReset(row) {
       const confirm = await this.$confirm("确定要重置当前问题卷吗?", "提示", {
@@ -233,7 +233,7 @@ export default {
       }).catch(() => {});
       if (confirm !== "confirm") return;
 
-      this.toReset([row.id]);
+      this.toReset([row.taskId]);
     },
     async toReset(taskIds) {
       if (!taskIds.length) return;

+ 68 - 3
src/modules/mark/components/report/Report.vue

@@ -1,13 +1,78 @@
 <template>
-  <div class="report">report</div>
+  <div class="report">
+    <template v-if="dataReady">
+      <report-cover></report-cover>
+      <report-summary></report-summary>
+      <report-college></report-college>
+      <report-class></report-class>
+      <report-teacher></report-teacher>
+      <report-question type="objective"></report-question>
+      <report-question type="subjective"></report-question>
+    </template>
+  </div>
 </template>
 
 <script>
+import reportData from "./data";
+import { mapMutations } from "vuex";
+import ReportCover from "./ReportCover.vue";
+import ReportSummary from "./ReportSummary.vue";
+import ReportCollege from "./ReportCollege.vue";
+import ReportClass from "./ReportClass.vue";
+import ReportTeacher from "./ReportTeacher.vue";
+import ReportQuestion from "./ReportQuestion.vue";
+import { scoreReport } from "../../api";
+
 export default {
   name: "report",
+  props: {
+    baseinfo: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  components: {
+    ReportCover,
+    ReportSummary,
+    ReportCollege,
+    ReportClass,
+    ReportTeacher,
+    ReportQuestion,
+  },
   data() {
-    return {};
+    return {
+      dataReady: false,
+    };
+  },
+  mounted() {
+    this.initData1();
+  },
+  methods: {
+    ...mapMutations("report", ["setData", "resetData"]),
+    initData1() {
+      this.resetData();
+      this.setData({
+        ...reportData,
+        baseinfo: {
+          examName: "测试考试1",
+          schoolName: "测试学校1",
+          courseName: "测试科目1",
+        },
+      });
+      this.dataReady = true;
+    },
+    async initData() {
+      this.resetData();
+      const res = await scoreReport({
+        examId: this.baseinfo.examId,
+        paperNumber: this.baseinfo.paperNumber,
+      });
+      if (!res) return;
+      this.setData({ ...res, baseinfo: this.baseinfo });
+      this.dataReady = true;
+    },
   },
-  methods: {},
 };
 </script>

+ 1 - 1
src/modules/mark/components/report/ReportBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="page-box">
+  <div class="report-page">
     <div class="page-body">
       <h1 class="page-title-1">{{ title }}</h1>
       <div class="page-content">

+ 22 - 12
src/modules/mark/components/report/ReportClass.vue

@@ -1,18 +1,24 @@
 <template>
   <div class="report-class">
-    <report-box title="班级成绩分析">
+    <report-box
+      v-for="(classPage, cindex) in classCharts"
+      :key="`chart-${cindex}`"
+      title="班级成绩分析"
+    >
       <div
-        v-if="(chart, cindex) in classCharts"
-        :key="cindex"
-        class="page-chart"
+        v-for="(chart, index) in classPage"
+        :key="index"
+        class="college-chart"
       >
         <v-chart :option="chart"></v-chart>
       </div>
-      <table
-        v-for="(tgroup, tindex) in classTables"
-        :key="tindex"
-        class="table table-border"
-      >
+    </report-box>
+    <report-box
+      v-for="(tgroup, tindex) in classTables"
+      :key="`table-${tindex}`"
+      title="班级成绩分析"
+    >
+      <table class="table table-border">
         <tr>
           <th>班级</th>
           <th>平均分</th>
@@ -56,16 +62,20 @@ export default {
   computed: {
     ...mapState("report", ["class"]),
   },
+  mounted() {
+    this.initData();
+  },
   methods: {
     initData() {
       const classes = this.class.map((item) => {
         return {
           ...item,
-          name: item.class,
+          name: item.className,
         };
       });
-      this.classCharts = sectionArr(classes, 10).map((data) =>
-        getBarsOptions(data)
+      this.classCharts = sectionArr(
+        sectionArr(classes, 6).map((data) => getBarsOptions(data)),
+        4
       );
       this.classTables = sectionArr(classes, 30);
     },

+ 21 - 11
src/modules/mark/components/report/ReportCollege.vue

@@ -1,18 +1,24 @@
 <template>
   <div class="report-college">
-    <report-box title="学院成绩分析">
+    <report-box
+      v-for="(chartPage, cindex) in collegeCharts"
+      :key="`chart-${cindex}`"
+      title="学院成绩分析"
+    >
       <div
-        v-if="(chart, cindex) in collegeCharts"
-        :key="cindex"
-        class="page-chart"
+        v-for="(chart, index) in chartPage"
+        :key="index"
+        class="college-chart"
       >
         <v-chart :option="chart"></v-chart>
       </div>
-      <table
-        v-for="(tgroup, tindex) in collegeTables"
-        :key="tindex"
-        class="table table-border"
-      >
+    </report-box>
+    <report-box
+      v-for="(tgroup, tindex) in collegeTables"
+      :key="`table-${tindex}`"
+      title="学院成绩分析"
+    >
+      <table class="table table-border">
         <tr>
           <th>学院</th>
           <th>平均分</th>
@@ -56,6 +62,9 @@ export default {
   computed: {
     ...mapState("report", ["college"]),
   },
+  mounted() {
+    this.initData();
+  },
   methods: {
     initData() {
       const college = this.college.map((item) => {
@@ -64,8 +73,9 @@ export default {
           name: item.college,
         };
       });
-      this.collegeCharts = sectionArr(college, 10).map((data) =>
-        getBarsOptions(data)
+      this.collegeCharts = sectionArr(
+        sectionArr(college, 6).map((data) => getBarsOptions(data)),
+        4
       );
       this.collegeTables = sectionArr(college, 30);
     },

+ 2 - 2
src/modules/mark/components/report/ReportCover.vue

@@ -1,6 +1,6 @@
 <template>
-  <div class="page-box cover-box">
-    <div class="cover-title"></div>
+  <div class="report-page cover-page">
+    <div class="cover-title">成绩分析报告</div>
     <div class="cover-footer">
       <p>
         <span>考试名称:</span><span>{{ baseinfo.examName }}</span>

+ 34 - 15
src/modules/mark/components/report/ReportQuestion.vue

@@ -1,18 +1,20 @@
 <template>
   <div class="report-question">
-    <report-box :title="title">
-      <div
-        v-if="(chart, cindex) in questionCharts"
-        :key="cindex"
-        class="page-chart"
-      >
-        <v-chart :option="chart"></v-chart>
+    <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"></v-chart>
       </div>
-      <table
-        v-for="(tgroup, tindex) in questionTables"
-        :key="tindex"
-        class="table table-border"
-      >
+    </report-box>
+    <report-box
+      v-for="(tgroup, tindex) in questionTables"
+      :key="`table-${tindex}`"
+      :title="title"
+    >
+      <table class="table table-border">
         <tr>
           <th>题目名称</th>
           <th>大题号</th>
@@ -52,6 +54,7 @@ export default {
     return {
       questionCharts: [],
       questionTables: [],
+      chartSplitRange: 26,
     };
   },
   computed: {
@@ -63,14 +66,30 @@ export default {
       return `${this.typeName}成绩分析`;
     },
   },
+  mounted() {
+    this.initData();
+  },
   methods: {
     initData() {
       const question =
         this.type === "subjective" ? this.subjective : this.objective;
-      this.questionCharts = sectionArr(question, 26).map((data) =>
-        getBarPointTopicOptions(data)
+      this.questionCharts = sectionArr(question, this.chartSplitRange).map(
+        (data) => {
+          return {
+            chart: getBarPointTopicOptions(data),
+            count: data.length,
+            style: this.getChartStyle(data.length),
+          };
+        }
       );
-      this.questionTables = sectionArr(question, 32);
+      this.questionTables = sectionArr(question, 30);
+    },
+    getChartStyle(count) {
+      const labelHeight = Math.round(1170 / this.chartSplitRange);
+
+      return {
+        height: `${200 + count * labelHeight}px`,
+      };
     },
   },
 };

+ 11 - 17
src/modules/mark/components/report/ReportSummary.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="report-summary">
     <report-box title="总览">
-      <h2 class="page-title-2">考试概况</h2>
-      <table class="table table-border">
+      <h2 class="page-title-2 mb-20">考试概况</h2>
+      <table class="table table-border mb-20">
         <tr>
           <th>总考生数</th>
           <th>实考</th>
@@ -30,13 +30,9 @@
           <td>{{ overview.excellentRate }}</td>
         </tr>
       </table>
-      <h2>成绩分数段分析</h2>
-      <div
-        v-if="(chart, cindex) in scoreRangeCharts"
-        :key="cindex"
-        class="page-chart"
-      >
-        <v-chart :option="chart"></v-chart>
+      <h2 class="page-title-2 mb-20">成绩分数段分析</h2>
+      <div class="summary-chart mb-20">
+        <v-chart v-if="scoreRangeChart" :option="scoreRangeChart"></v-chart>
       </div>
       <table class="table table-border">
         <tr>
@@ -44,7 +40,7 @@
           <th>分数段人数</th>
           <th>占比(%)</th>
         </tr>
-        <tr v-for="(item, ind) in scoreRangeTables" :key="ind">
+        <tr v-for="(item, ind) in scoreRange" :key="ind">
           <td>{{ item.minScore }}~{{ item.maxScore }}</td>
           <td>{{ item.studentCount }}</td>
           <td>{{ item.rate }}</td>
@@ -57,7 +53,6 @@
 <script>
 import { mapState } from "vuex";
 import ReportBox from "./ReportBox.vue";
-import { sectionArr } from "./utils";
 import { getScoreBarOptions } from "./chart";
 
 export default {
@@ -65,19 +60,18 @@ export default {
   components: { ReportBox },
   data() {
     return {
-      scoreRangeCharts: [],
-      scoreRangeTables: [],
+      scoreRangeChart: null,
     };
   },
   computed: {
     ...mapState("report", ["overview", "scoreRange"]),
   },
+  mounted() {
+    this.initData();
+  },
   methods: {
     initData() {
-      this.scoreRangeCharts = sectionArr(this.scoreRange, 10).map((data) =>
-        getScoreBarOptions(data)
-      );
-      this.scoreRangeTables = sectionArr(this.scoreRange, 30);
+      this.scoreRangeChart = getScoreBarOptions(this.scoreRange);
     },
   },
 };

+ 6 - 3
src/modules/mark/components/report/ReportTeacher.vue

@@ -2,15 +2,15 @@
   <div class="report-teacher">
     <report-box title="任课老师分析">
       <div
-        v-if="(chart, cindex) in teacherCharts"
-        :key="cindex"
+        v-for="(chart, cindex) in teacherCharts"
+        :key="`chart-${cindex}`"
         class="page-chart"
       >
         <v-chart :option="chart"></v-chart>
       </div>
       <table
         v-for="(tgroup, tindex) in teacherTables"
-        :key="tindex"
+        :key="`table-${tindex}`"
         class="table table-border"
       >
         <tr>
@@ -59,6 +59,9 @@ export default {
       teacherTables: [],
     };
   },
+  mounted() {
+    this.initData();
+  },
   computed: {
     ...mapState("report", ["teacher"]),
   },

+ 24 - 10
src/modules/mark/components/report/chart.js

@@ -23,7 +23,7 @@ export function getScoreBarOptions(dataObj) {
     {
       type: "bar",
       data: dataObj.map((item) => item.studentCount),
-      barWidth: 20,
+      barWidth: 16,
     },
   ];
 
@@ -33,13 +33,15 @@ export function getScoreBarOptions(dataObj) {
     grid: {
       left: 50,
       top: 40,
-      bottom: 40,
+      bottom: 50,
+      right: 50,
       show: true,
       borderColor: "rgba(230,230,230,1)",
     },
     yAxis: [
       {
         type: "value",
+        z: 1,
         axisTick: {
           show: false,
         },
@@ -50,6 +52,7 @@ export function getScoreBarOptions(dataObj) {
           },
         },
         axisLine: {
+          show: true,
           lineStyle: {
             color: "rgba(233,233,233,1)",
           },
@@ -109,9 +112,19 @@ export function getBarsOptions(dataObj) {
       "rgba(67, 80, 136, 0.8)",
       "rgba(250, 212, 68, 0.8)",
     ],
+    legend: {
+      itemGap: 30,
+      itemWidth: 14,
+      bottom: 10,
+      textStyle: {
+        fontSize: 19,
+      },
+    },
     grid: {
-      top: 50,
+      top: 30,
       bottom: 90,
+      left: 50,
+      right: 50,
       show: true,
       borderColor: "rgba(230,230,230,1)",
     },
@@ -153,6 +166,7 @@ export function getBarsOptions(dataObj) {
     yAxis: [
       {
         type: "value",
+        z: 1,
         axisTick: {
           show: false,
         },
@@ -178,19 +192,19 @@ export function getBarsOptions(dataObj) {
         type: "bar",
         data: avgDatas,
         name: "平均分",
-        barWidth: 20,
+        barWidth: 16,
       },
       {
         type: "bar",
         data: maxDatas,
         name: "最高分",
-        barWidth: 20,
+        barWidth: 16,
       },
       {
         type: "bar",
         data: minDatas,
         name: "最低分",
-        barWidth: 20,
+        barWidth: 16,
       },
     ],
   };
@@ -200,8 +214,8 @@ export function getBarPointTopicOptions(dataObj) {
     (item) => `${item.title} ${item.mainNumber}-${item.subNumber}`
   );
   let avgDatas = dataObj.map((item) => item.avgScore);
-  let scoreRateDatas = dataObj.map((item) => item.scoreRate);
-  let fullRateDatas = dataObj.map((item) => item.fullScoreRate);
+  let scoreRateDatas = dataObj.map((item) => item.scoreRate / 100);
+  let fullRateDatas = dataObj.map((item) => item.fullScoreRate / 100);
   const xAxisTopMax = Math.ceil(getArrayMaxNum(avgDatas));
 
   let legendData = ["单题平均分", "得分率", "满分率"];
@@ -256,9 +270,9 @@ export function getBarPointTopicOptions(dataObj) {
     grid: [
       {
         left: "20%",
-        top: 120,
+        top: 40,
         width: "66%",
-        bottom: 100,
+        bottom: 90,
         show: true,
         borderColor: "rgba(230,230,230,1)",
       },

+ 131 - 0
src/modules/mark/components/report/data.js

@@ -0,0 +1,131 @@
+const overview = {
+  studentCount: 452,
+  actualCount: 450,
+  absentCount: 2,
+  breachCount: 4,
+  avgScore: 75,
+  maxScore: 100,
+  minScore: 40,
+  passCount: 400,
+  passRate: 90,
+  excellentCount: 145,
+  excellentRate: 20,
+};
+// 分数段
+let scoreRange = [];
+let totalScore = 100;
+let scoreDist = 10;
+let scoreCount = Math.ceil(totalScore / scoreDist);
+for (let i = 0; i < scoreCount; i++) {
+  scoreRange.push({
+    minScore: i * scoreDist,
+    maxScore: (i + 1) * scoreDist,
+    studentCount: getRandomNumer(0, 100),
+    rate: getRandomNumer(10, 30, 2),
+  });
+}
+
+// 学院
+let college = [];
+let collegeCount = 30;
+for (let i = 0; i < collegeCount; i++) {
+  college.push({
+    college: "学院" + (i + 1),
+    avgScore: getRandomNumer(0, 100),
+    maxScore: getRandomNumer(90, 100),
+    minScore: getRandomNumer(0, 30),
+    passCount: getRandomNumer(40, 60),
+    passRate: getRandomNumer(50, 100, 2),
+    excellentCount: getRandomNumer(20, 30),
+    excellentRate: getRandomNumer(5, 20, 2),
+  });
+}
+// 班级
+let classList = [];
+let classCount = 30;
+for (let i = 0; i < classCount; i++) {
+  classList.push({
+    className: "班级" + (i + 1),
+    avgScore: getRandomNumer(0, 100),
+    maxScore: getRandomNumer(90, 100),
+    minScore: getRandomNumer(0, 30),
+    passCount: getRandomNumer(40, 60),
+    passRate: getRandomNumer(50, 100, 2),
+    excellentCount: getRandomNumer(20, 30),
+    excellentRate: getRandomNumer(5, 20, 2),
+  });
+}
+
+// 教师
+let teacher = [];
+let teacherCount = 10;
+for (let i = 0; i < teacherCount; i++) {
+  teacher.push({
+    teacherName: "老师" + (i + 1),
+    avgScore: getRandomNumer(0, 100),
+    maxScore: getRandomNumer(90, 100),
+    minScore: getRandomNumer(0, 30),
+    passCount: getRandomNumer(40, 60),
+    passRate: getRandomNumer(50, 100, 2),
+    excellentCount: getRandomNumer(20, 30),
+    excellentRate: getRandomNumer(5, 20, 2),
+  });
+}
+// 试题
+let objective = [];
+let objectiveMainCount = 3;
+let objectiveSubCount = getRandomNumer(10, 30);
+for (let i = 0; i < objectiveMainCount; i++) {
+  for (let j = 0; j < objectiveSubCount; j++) {
+    objective.push({
+      title: "客观题",
+      mainNumber: i + 1,
+      subNumber: j + 1,
+      score: 3,
+      avgScore: getRandomNumer(0, 3, 2),
+      scoreRate: getRandomNumer(20, 100, 2),
+      fullScoreRate: getRandomNumer(20, 100, 2),
+    });
+  }
+}
+let subjective = [];
+let subjectiveMainCount = 4;
+let subjectiveSubCount = getRandomNumer(10, 30);
+for (let i = 0; i < subjectiveMainCount; i++) {
+  for (let j = 0; j < subjectiveSubCount; j++) {
+    subjective.push({
+      title: "主观题",
+      mainNumber: i + 1,
+      subNumber: j + 1,
+      score: 3,
+      avgScore: getRandomNumer(0, 3, 2),
+      scoreRate: getRandomNumer(20, 100, 2),
+      fullScoreRate: getRandomNumer(20, 100, 2),
+    });
+  }
+}
+
+const data = {
+  overview,
+  scoreRange,
+  college,
+  class: classList,
+  teacher,
+  objective,
+  subjective,
+};
+
+function getRandomNumer(min, max, precision = 0) {
+  return tofixed(Math.random() * (max - min) + min, precision);
+}
+
+function tofixed(num, precision = 0) {
+  if (!num) return num;
+  if (precision) {
+    return parseFloat(num.toFixed(precision));
+  } else {
+    return Math.round(num);
+  }
+}
+
+export default data;