Blame view

src/views/basic/askTestQuestion/components/testMultiClassReport.vue 3.88 KB
f45b3c05   LH_PC   云平台新UI界面
1
2
3
  <template>
      <div style="margin-right: 20px;width: 100%">
          <el-row class="row-type">
ef16e57e   LH_PC   fix:前端版本迭代
4
              <label>报表类型</label>
f45b3c05   LH_PC   云平台新UI界面
5
6
7
8
9
10
              <el-select class="opration-select" v-model="currentType" style="margin-left: 10px;">
                  <el-option v-for="(item, index) in types" :lable="item" :key="index" :value="item" />
              </el-select>
          </el-row>
          <el-row class="row-type" style="margin-top: 10px;">
              <el-table v-if="$props.params" class="default-table" :data="listReport">
6bca489d   LH_PC   云平台二期UI
11
                  <el-table-column prop="subjectName" label="科目" width="100" />
ef16e57e   LH_PC   fix:前端版本迭代
12
                  <el-table-column prop="paperName" label="试卷名称" />
f45b3c05   LH_PC   云平台新UI界面
13
14
15
                  <el-table-column prop="classCorrectRate" label="已考班级">
                      <template slot-scope="scoped">
                          <el-checkbox-group v-model="scoped.row.checkedClassList">
ef16e57e   LH_PC   fix:前端版本迭代
16
17
                              <el-checkbox :key="index" v-for="(item, index) in scoped.row.classInfos"
                                  :label="item.classId">
f45b3c05   LH_PC   云平台新UI界面
18
19
20
21
22
                                  {{ item.className }}
                              </el-checkbox>
                          </el-checkbox-group>
                      </template>
                  </el-table-column>
6bca489d   LH_PC   云平台二期UI
23
24
                  <el-table-column prop="score" label="卷面分" width="100" />
                  <el-table-column label="操作" width="100">
f45b3c05   LH_PC   云平台新UI界面
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
                      <template slot-scope="scoped">
                          <el-button type="text" @click="_linkToDetail(scoped.row)">查看</el-button>
                      </template>
                  </el-table-column>
              </el-table>
          </el-row>
      </div>
  </template>
  <script>
  export default {
      name: "testMultiClassReport",
      props: {
          params: null
      },
      async created() {
          this.role =
              this.$store.getters.info.showRole ||
              this.$store.getters.info.permissions[0].role;
  
          await this._loadDatas();
      },
      watch: {
          async 'currentType'(value) {
              await this._loadDatas();
          }
      },
      methods: {
ef16e57e   LH_PC   fix:前端版本迭代
52
          _linkToDetail(dataRow) {
f45b3c05   LH_PC   云平台新UI界面
53
54
55
56
57
58
59
60
              this.$router.push({
                  path: "/testReportDetail",
                  query: {
                      dataType: 3,
                      classIds: dataRow.checkedClassList.join(","),
                      id: dataRow.paperId,
                      title: dataRow.paperName,
                      subjectName: dataRow.subjectName,
6bca489d   LH_PC   云平台二期UI
61
                      diffType: this.currentType,
f45b3c05   LH_PC   云平台新UI界面
62
63
64
65
                  },
              });
          },
          async _loadDatas() {
ef16e57e   LH_PC   fix:前端版本迭代
66
  
f45b3c05   LH_PC   云平台新UI界面
67
68
69
              var dataRequestParams = {
                  classIds: this.$props.params.class ? [this.$props.params.class] :
                      this.$props.params.classIds ? [...this.$props.params.classIds] : null,
6bca489d   LH_PC   云平台二期UI
70
                  diffType: this.currentType == "任课班级对比" ? "1" : "0",
f45b3c05   LH_PC   云平台新UI界面
71
72
73
74
75
                  end: this.$props.params.dataRange ? this.$props.params.dataRange[1] : null,
                  start: this.$props.params.dataRange ? this.$props.params.dataRange[0] : null,
                  subjects: this.$props.params.subject ? [this.$props.params.subject] :
                      this.$props.params.subjects ? [...this.$props.params.subjects] : null
              };
ef16e57e   LH_PC   fix:前端版本迭代
76
  
f45b3c05   LH_PC   云平台新UI界面
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
              var dataRequest = this.$request.tListExamReport;
  
  
              var dataResponse = await dataRequest({ ...dataRequestParams });
  
              if (dataResponse.status != 0) {
                  this.$message.error(response.info);
                  return;
              }
  
              this.listReport = dataResponse.data.map(item => {
                  item.checkedClassList = item.classInfos.map(item => item.classId);
                  return item;
              })
          },
      },
      data() {
          return {
              listReport: [],
              role: "",
              types: ["任课班级对比", "年级对比"],
              currentType: "任课班级对比",
          };
      },
  };
  </script>
  <style scoped></style>