ExamingEnd.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="container" v-if="afterExamRemark !== null">
  3. <div class="instructions">
  4. <h1 class="">考试已结束</h1>
  5. <div><img class="user-avatar" :src="user.photoPath" alt="无底照" /></div>
  6. <div v-if="showObjectScore && !examResult.isWarn">客观分: {{examResult.objectiveScore}}</div>
  7. <div v-if="examResult.isWarn">成绩待审核</div>
  8. <h1 class="">考后说明: </h1>
  9. <div class="" style="text-align: left; padding-bottom: 20px">
  10. <p v-html="afterExamRemark"></p>
  11. </div>
  12. <router-link class="qm-primary-button" to="/online-exam" style="display: inline-block; width: 100%;">
  13. 返回主页</router-link>
  14. </div>
  15. <div class="exam-detail">
  16. <h3 class="">科目:{{exam.name}}</h3>
  17. <br>
  18. <h4 class="">试卷总分:{{paperTotalScore}}</h4>
  19. <br>
  20. </div>
  21. </div>
  22. <div v-else>
  23. 正在等待数据返回...
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState as globalMapState } from "vuex";
  28. import { createNamespacedHelpers } from "vuex";
  29. const { mapState } = createNamespacedHelpers("examingHomeModule");
  30. export default {
  31. data() {
  32. return {
  33. afterExamRemark: null,
  34. showObjectScore: null,
  35. paperTotalScore: null
  36. };
  37. },
  38. async mounted() {
  39. const afterExamRemark = await this.$http.get(
  40. "/api/ecs_exam_work/exam/examOrgProperty/" +
  41. this.$route.params.examId +
  42. `/AFTER_EXAM_REMARK`
  43. );
  44. this.afterExamRemark = afterExamRemark.data || "";
  45. const showObjectScore = await this.$http.get(
  46. "/api/ecs_exam_work/exam/examOrgProperty/" +
  47. this.$route.params.examId +
  48. `/IS_OBJ_SCORE_VIEW`
  49. );
  50. this.showObjectScore = showObjectScore.data || false;
  51. this.paperTotalScore = this.paperStruct.defaultPaper.questionGroupList
  52. .map(q => q.groupScore)
  53. .reduce((p, c) => p + c);
  54. },
  55. computed: {
  56. ...globalMapState(["user"]),
  57. ...mapState(["exam", "examResult", "paperStruct"])
  58. },
  59. methods: {}
  60. };
  61. </script>
  62. <style scoped>
  63. .container {
  64. display: grid;
  65. grid-template-columns: 1fr 300px;
  66. width: 100wh;
  67. height: 100vh;
  68. }
  69. .instructions {
  70. display: grid;
  71. grid-template-rows: 40px 300px 100px 30px minmax(200px, auto) 1fr;
  72. padding: 40px 20px;
  73. }
  74. .user-avatar {
  75. display: inline-block;
  76. width: 280px;
  77. height: 280px;
  78. object-fit: contain;
  79. }
  80. .exam-detail {
  81. padding: 40px 20px;
  82. background-color: #f5f5f5;
  83. text-align: left;
  84. }
  85. .list-group {
  86. list-style: none;
  87. }
  88. .list-group li {
  89. border-bottom: 1px solid #eeeeee;
  90. padding-top: 10px;
  91. }
  92. .pull-right {
  93. text-align: right;
  94. float: right;
  95. }
  96. </style>