Blame view

src/views/standard/ask/analysis.vue 16.7 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
2
3
4
5
6
7
    <div>
      <back-box>
        <template slot="title">
          <span>单课分析</span>
        </template>
      </back-box>
ee6e7628   梁保满   备题组卷借口数据对接调整
8
9
10
11
      <div class="page-content">
        <div class="tab-box">
          <span
            class="tab-item"
e5e4a3e6   梁保满   v1.3
12
13
14
15
16
            v-for="(item, index) in tabList"
            :key="index"
            :class="type == index + 1 ? 'active' : ''"
            @click="setType(index + 1)"
            >{{ item }}</span
ee6e7628   梁保满   备题组卷借口数据对接调整
17
18
          >
        </div>
9309dc5d   梁保满   任课老师接口完成
19
        <div v-loading="loading">
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
20
          <div id="print-content">
3617eaad   梁保满   长水账号设置
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
            <ul class="info" v-if="type == 1">
              <li class="info-item">科目:{{ detail.subjectName }}</li>
              <li class="info-item">课时:{{ detail.title }}</li>
              <li class="info-item">上课时间:{{ detail.startTime }}</li>
              <li class="info-item">下课时间:{{ detail.endTime }}</li>
              <li class="info-item">签到人数:{{ detail.answeredNum }}</li>
              <li class="info-item">题目总数:{{ detail.questionNum }}</li>
              <li class="info-item">答题总数:{{ detail.totalAnswersNum }}</li>
              <li class="info-item">课时时长:{{ detail.duration }}分钟</li>
              <li class="info-item">
                总参与度::{{ detail.participationRate }}%
              </li>
              <li class="info-item">
                班级总正确率:{{ detail.classCorrectRate }}%
              </li>
              <li class="info-item">
                已答总正确率:{{ detail.answerCorrectRate }}%
              </li>
              <li class="info-item">
                反馈时长:{{ setDuration(detail.consumingDuration) }}
              </li>
            </ul>
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
43
44
45
46
47
            <el-table
              v-if="type == 1"
              :data="tableData"
              border
              style="width: 100%"
9309dc5d   梁保满   任课老师接口完成
48
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
              <el-table-column prop="questionIndex" label="题号" align="center"
                ><template slot-scope="scoped"
                  >Q{{ scoped.row.questionIndex }}</template
                ></el-table-column
              >
              <el-table-column prop="questionType" label="题型" align="center">
                <template slot-scope="scoped">{{
                  setSubPro(scoped.row.questionType)
                }}</template>
              </el-table-column>
              <el-table-column
                prop="answeredNum"
                label="答题人数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="correctAnswerNum"
                label="答对人数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="participationRate"
                label="班级参与度"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.participationRate }}%</template
                ></el-table-column
              >
              <el-table-column
                prop="classCorrectRate"
                label="班级正确率"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.classCorrectRate }}%</template
                ></el-table-column
              >
              <el-table-column
                prop="answerCorrectRate"
                label="已答正确率"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.answerCorrectRate }}%</template
                ></el-table-column
              >
              <el-table-column
                prop="correctAnswer"
                label="正确答案"
                align="center"
              >
                <template slot-scope="scoped">{{
                  scoped.row.correctAnswer == 1
                    ? "✓"
                    : scoped.row.correctAnswer == 2
                    ? "✗"
                    : scoped.row.correctAnswer
                }}</template></el-table-column
              >
              <el-table-column prop="fallible" label="干扰答案" align="center"
                ><template slot-scope="scoped">{{
                  scoped.row.fallible == 1
                    ? "✓"
                    : scoped.row.fallible == 2
                    ? "✗"
                    : scoped.row.fallible
                }}</template></el-table-column
              >
              <!-- <el-table-column prop="screenshot" label="题干" align="center">
9309dc5d   梁保满   任课老师接口完成
121
122
              <template slot-scope="scoped">
                <el-image
8ea67428   梁保满   飞书bug
123
                  v-if="scoped.row.screenshot"
9309dc5d   梁保满   任课老师接口完成
124
125
126
127
                  style="width: 60px; height: 40px"
                  :src="scoped.row.screenshot"
                  :preview-src-list="[scoped.row.screenshot]"
                >
8ea67428   梁保满   飞书bug
128
129
                </el-image><span v-else>暂无</span></template
            ></el-table-column> -->
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
130
131
132
133
134
135
            </el-table>
            <el-table
              v-if="type == 2"
              :data="tableData"
              border
              style="width: 100%"
9309dc5d   梁保满   任课老师接口完成
136
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
              <el-table-column
                prop="studentCode"
                label="学号"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="studentName"
                label="姓名"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="answerTimes"
                label="答题次数"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="consumingDuration"
                label="答题耗时"
                align="center"
                ><template slot-scope="scoped">{{
                  setDuration(scoped.row.consumingDuration)
                }}</template></el-table-column
              >
              <el-table-column
                prop="correctAnswerTimes"
                label="答对次数"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="participationRate"
                label="参与度"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.participationRate }}%</template
                ></el-table-column
              >
              <el-table-column
                prop="correctRate"
                label="正确率"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.correctRate }}%</template
                ></el-table-column
              >
              <el-table-column
                prop="answerCorrectRate"
                label="已答正确率"
                sortable
                align="center"
                ><template slot-scope="scoped"
                  >{{ scoped.row.answerCorrectRate }}%</template
                ></el-table-column
              >
              <el-table-column
                v-for="(item, index) in optionsList"
                :key="index"
                :label="'Q' + (index + 1)"
                align="center"
                ><template slot-scope="scoped">
                  <span :class="scoped.row['isRight' + index] ? '' : 'red'">{{
                    scoped.row["answer" + index]
                  }}</span>
                </template>
              </el-table-column>
            </el-table>
            <el-table
              v-if="type == 3"
              :data="tableData"
              border
              style="width: 100%"
9309dc5d   梁保满   任课老师接口完成
209
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
              <el-table-column
                prop="studentCode"
                label="学号"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="studentName"
                label="姓名"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="rushAnswerTimes"
                label="抢答成功次数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="rushAnswerCorrectTimes"
                label="答对次数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="checkAnswerTimes"
                label="抽答次数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="checkAnswerCorrectTimes"
                label="抽答答对次数"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="interactionsNum"
                label="参与得分"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="interactionsCorrectNum"
                label="对错得分"
                sortable
                align="center"
              ></el-table-column>
            </el-table>
            <el-table
              v-if="type == 4"
              :data="tableData"
              border
              style="width: 100%"
9309dc5d   梁保满   任课老师接口完成
262
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
              <el-table-column
                prop="studentName"
                label="姓名"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="checkInTime"
                label="签到时间"
                sortable
                align="center"
              ></el-table-column>
              <el-table-column
                prop="makeUpTime"
                label="补签时间"
                sortable
                align="center"
              ></el-table-column>
            </el-table>
          </div>
9309dc5d   梁保满   任课老师接口完成
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
          <div class="pagination-box" v-show="type == 1">
            <el-pagination
              small=""
              layout="total,prev, pager, next"
              :hide-on-single-page="true"
              :total="total"
              @current-change="changePage"
              :current-page="page"
              :page-size="size"
            >
            </el-pagination>
          </div>
          <p class="down">
            <el-button
              @click="exportData"
533a17d8   梁保满   备题组卷添加批量设置答案
297
              type="primary"
9309dc5d   梁保满   任课老师接口完成
298
299
300
301
302
              plain
              round
              icon="fa fa-cloud-download"
              >导出报表</el-button
            >
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
303
            <el-button
3617eaad   梁保满   长水账号设置
304
              v-if="!this.$store.getters.code"
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
305
306
307
308
309
310
311
              @click="print"
              type="primary"
              plain
              round
              icon="el-icon-printer"
              >打印</el-button
            >
255e2506   梁保满   飞书bug及优化
312
            <!-- <el-button @click="edit" type="primary" round>修改答案</el-button> -->
9309dc5d   梁保满   任课老师接口完成
313
314
          </p>
        </div>
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
315
      </div>
9309dc5d   梁保满   任课老师接口完成
316
317
318
319
320
321
322
323
  
      <set-answer
        :diaVisible="dialogVisible"
        :questionList="form.questionList"
        :paperId="form.id"
        @saveSuccess="handleSuccess"
        @cancel="cancel"
      />
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
324
    </div>
4c4f7640   梁保满   路由表,路由前端文件
325
326
327
  </template>
  
  <script>
3617eaad   梁保满   长水账号设置
328
  import { downloadFile, tablePrint } from "@/utils";
ee6e7628   梁保满   备题组卷借口数据对接调整
329
330
331
  export default {
    data() {
      return {
9309dc5d   梁保满   任课老师接口完成
332
333
        dialogVisible: false,
        loading: false,
ee6e7628   梁保满   备题组卷借口数据对接调整
334
335
        id: "",
        type: 1,
9309dc5d   梁保满   任课老师接口完成
336
337
338
339
        form: {
          id: "",
          questionList: [],
        },
e5e4a3e6   梁保满   v1.3
340
        tabList: ["答题表现", "学生问答表现", "学生互动表现", "签到明细"],
9309dc5d   梁保满   任课老师接口完成
341
342
        detail: {},
        tableData: [],
255e2506   梁保满   飞书bug及优化
343
        optionsList: [],
9309dc5d   梁保满   任课老师接口完成
344
345
346
        page: 1,
        size: 20,
        total: 0,
e5e4a3e6   梁保满   v1.3
347
        status: 0,
ee6e7628   梁保满   备题组卷借口数据对接调整
348
349
350
351
      };
    },
    created() {
      this.id = this.$route.query.id;
e5e4a3e6   梁保满   v1.3
352
      this.status = this.$route.query.status ? this.$route.query.status : 0;
9309dc5d   梁保满   任课老师接口完成
353
354
      this._QueryData();
      this.periodDetail();
ee6e7628   梁保满   备题组卷借口数据对接调整
355
356
    },
    methods: {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
357
      print() {
e5e4a3e6   梁保满   v1.3
358
359
360
361
        tablePrint(
          "print-content",
          this.detail.title + "_" + this.tabList[this.type - 1]
        );
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
362
      },
9309dc5d   梁保满   任课老师接口完成
363
364
365
366
367
      setType(type) {
        this.type = type;
        this.page = 1;
        this._QueryData();
      },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
368
369
370
371
      setDuration(times) {
        let m = parseInt(times / 1000 / 60);
        let s = parseInt((times / 1000) % 60);
        let ms = times;
503b6063   梁保满   判断题答案选项
372
        let aTime;
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
373
374
375
376
377
378
379
380
381
        if (times == 0) {
          aTime = `0`;
        } else {
          if (m == 0 && s == 0) {
            aTime = `${ms}毫秒`;
          } else if (m == 0 && s != 0) {
            aTime = `${s}秒`;
          } else if (m != 0 && s != 0) {
            aTime = `${m}分${s}秒`;
503b6063   梁保满   判断题答案选项
382
383
          }
        }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
384
        return aTime;
d32e461c   梁保满   备题组卷
385
      },
9309dc5d   梁保满   任课老师接口完成
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
      setSubPro(type) {
        let tit;
        switch (type) {
          case 2:
            tit = "单选题";
            break;
          case 3:
            tit = "多选题";
            break;
          case 4:
            tit = "判断题";
            break;
          case 5:
            tit = "主观题";
            break;
          default:
            tit = "其他";
        }
        return tit;
      },
      cancel() {
        this.dialogVisible = false;
      },
      handleSuccess() {
        this.dialogVisible = false;
8ea67428   梁保满   飞书bug
411
        this._QueryData();
9309dc5d   梁保满   任课老师接口完成
412
413
414
415
416
      },
      async edit() {
        if (this.editLoading) return;
        this.editLoading = true;
        const { data, status, info } = await this.$request.periodQuestionList({
6d7bd862   梁保满   飞书bug
417
          periodId: this.id,
9309dc5d   梁保满   任课老师接口完成
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
        });
        this.editLoading = false;
        if (status === 0) {
          this.form.id = this.id;
          this.form.questionList = (data.list && [...data.list]) || [];
          this.dialogVisible = true;
        } else {
          this.$message.error(info);
        }
      },
      changePage(page) {
        this.page = page;
        this._QueryData();
      },
      async periodDetail() {
        let { data, info, status } = await this.$request.periodDetail({
          periodId: this.id,
        });
        if (status == 0) {
          this.detail = { ...data };
255e2506   梁保满   飞书bug及优化
438
439
440
441
442
443
          this.detail.duration = this.detail.duration
            ? (this.detail.duration / 60).toFixed(2)
            : 0;
          this.detail.consumingDuration = this.detail.consumingDuration
            ? (this.detail.consumingDuration / 60).toFixed(2)
            : 0;
9309dc5d   梁保满   任课老师接口完成
444
445
446
447
        } else {
          this.$message.error(info);
        }
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
448
      async _QueryData() {
9309dc5d   梁保满   任课老师接口完成
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
        const queryData =
          this.type == 1
            ? this.$request.periodQuestionReport
            : this.$request.periodStudentReport;
        let query = {};
        if (this.type == 2) {
          query.type = 1;
        } else if (this.type == 3) {
          query.type = 2;
        } else if (this.type == 4) {
          query.type = 3;
        }
        this.loading = true;
        let { data, info, status } = await queryData({
          periodId: this.id,
          page: this.page,
          size: this.size,
          ...query,
ee6e7628   梁保满   备题组卷借口数据对接调整
467
        });
9309dc5d   梁保满   任课老师接口完成
468
469
        this.loading = false;
        if (status === 0) {
255e2506   梁保满   飞书bug及优化
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
          if (this.type == 2) {
            let optionsList = [];
            this.tableData = data?.list.map((item) => {
              let params = {};
              const detail = JSON.parse(item.detail);
              if (detail.length > optionsList.length) {
                optionsList = [...detail];
              }
              detail.map((items, index) => {
                params["isRight" + index] = items.isRight;
                params["answer" + index] =
                  items.answer == 1
                    ? "✓"
                    : items.answer == 2
                    ? "✗"
                    : items.answer;
              });
              return {
                ...item,
                ...params,
              };
            });
            this.optionsList = [...optionsList];
          } else {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
494
495
            this.tableData = data?.list.sort((a, b) => {
              return a.questionIndex - b.questionIndex;
255e2506   梁保满   飞书bug及优化
496
497
            });
          }
9309dc5d   梁保满   任课老师接口完成
498
499
500
501
502
503
504
          this.total = data.count;
        } else {
          this.$message.error(info);
        }
      },
      //导出
      async exportData() {
255e2506   梁保满   飞书bug及优化
505
        if (this.exportLoading == true) return;
9309dc5d   梁保满   任课老师接口完成
506
        this.exportLoading = true;
255e2506   梁保满   飞书bug及优化
507
508
509
        const data = await this.$request.exportPeriodReport({
          periodId: this.id,
        });
9309dc5d   梁保满   任课老师接口完成
510
511
        this.exportLoading = false;
        if (data) {
255e2506   梁保满   飞书bug及优化
512
513
514
          let blob = new Blob([data], {
            type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
          });
e5e4a3e6   梁保满   v1.3
515
          downloadFile(this.status?"随堂问-已归档单课时报表.xlsx":"随堂问-单课时报表.xlsx", blob);
9309dc5d   梁保满   任课老师接口完成
516
        } else {
236b1f0e   梁保满   周末-飞书bug
517
          this.$message.error("下载失败");
9309dc5d   梁保满   任课老师接口完成
518
        }
ee6e7628   梁保满   备题组卷借口数据对接调整
519
520
521
      },
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
522
  </script>
dbbfc6c5   梁保满   飞书优化及bug
523
524
525
526
527
528
529
530
531
532
  <style>
  div::-webkit-scrollbar {
    width: 3px;
    height: 10px;
  }
  div::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background-color: #ccc;
  }
  </style>
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
533
  <style lang="scss" scoped>
9309dc5d   梁保满   任课老师接口完成
534
535
536
537
538
539
  .down {
    padding-top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
540
541
542
  .red {
    color: #f30;
  }
ee6e7628   梁保满   备题组卷借口数据对接调整
543
544
545
  .page-content {
    padding: 20px 20px 0;
  }
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
546
547
  .tab-box {
    width: 800px;
ee6e7628   梁保满   备题组卷借口数据对接调整
548
    margin: 0 auto 12px;
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
549
550
551
552
553
554
555
556
557
558
559
560
561
    background: #f8f8f8;
    border-radius: 20px;
    display: flex;
    .tab-item {
      flex: 1;
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-size: 16px;
      color: #666;
      font-weight: 500;
      background: transparent;
      border-radius: 20px;
ee6e7628   梁保满   备题组卷借口数据对接调整
562
      cursor: pointer;
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
563
564
565
566
567
568
      &.active {
        background: #667ffd;
        color: #fff;
      }
    }
  }
ee6e7628   梁保满   备题组卷借口数据对接调整
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
  .info {
    display: flex;
    flex-wrap: wrap;
    border-left: 1px solid #e2e2e2;
    border-top: 1px solid #e2e2e2;
    margin-bottom: 12px;
    .info-item {
      width: 25%;
      height: 50px;
      box-sizing: border-box;
      flex-shrink: 0;
      background: #f8f8f8;
      border-right: 1px solid #e2e2e2;
      border-bottom: 1px solid #e2e2e2;
      line-height: 50px;
      text-align: center;
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
587
  </style>