zhangjie пре 1 година
родитељ
комит
4c425e82c3

+ 5 - 5
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.taskId));
+      this.toReset(this.multipleSelection.map((item) => item.id));
     },
     async toSimpleReset(row) {
       const confirm = await this.$confirm("确定要重置当前问题卷吗?", "提示", {
@@ -233,13 +233,13 @@ export default {
       }).catch(() => {});
       if (confirm !== "confirm") return;
 
-      this.toReset([row.taskId]);
+      this.toReset([row.id]);
     },
-    async toReset(taskIds) {
-      if (!taskIds.length) return;
+    async toReset(ids) {
+      if (!ids.length) return;
 
       await markIssueReset({
-        taskIds,
+        ids: ids.join(),
       });
       this.$message.success("操作成功!");
       this.getList();

+ 25 - 17
src/modules/mark/components/report/ReportTeacher.vue

@@ -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);
     },
   },
 };

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

@@ -59,6 +59,7 @@ for (let i = 0; i < classCount; i++) {
 // 教师
 let teacher = [];
 let teacherCount = 10;
+let teacherClass = [];
 for (let i = 0; i < teacherCount; i++) {
   teacher.push({
     teacherName: "老师" + (i + 1),
@@ -70,7 +71,22 @@ for (let i = 0; i < teacherCount; i++) {
     excellentCount: getRandomNumer(20, 30),
     excellentRate: getRandomNumer(5, 20, 2),
   });
+  const classCount = getRandomNumer(1, 6);
+  for (let j = 0; j < classCount; j++) {
+    teacherClass.push({
+      teacherName: "老师" + (i + 1),
+      className: "班级名称" + (j + 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;
@@ -111,6 +127,7 @@ const data = {
   college,
   class: classList,
   teacher,
+  teacherClass,
   objective,
   subjective,
 };

+ 2 - 0
src/modules/mark/components/report/reportStore.js

@@ -5,6 +5,7 @@ const state = {
   college: [],
   class: [],
   teacher: [],
+  teacherClass: [],
   objective: [],
   subjective: [],
 };
@@ -22,6 +23,7 @@ const mutations = {
     state.college = [];
     state.class = [];
     state.teacher = [];
+    state.teacherClass = [];
     state.objective = [];
     state.subjective = [];
   },