ExamingHome.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="container">
  3. <div class="header">
  4. <RemainTime></RemainTime>
  5. <OverallProgress :exam-question-list="examQuestionList"></OverallProgress>
  6. <QuestionFilters :exam-question-list="examQuestionList"></QuestionFilters>
  7. <Button class="qm-primary-button">交卷</Button>
  8. </div>
  9. <div class="main">
  10. <QuestionView :exam-question="examQuestion"></QuestionView>
  11. </div>
  12. <div class="side">
  13. <div class="question-nav">
  14. question nav
  15. </div>
  16. <div class="camera">
  17. camera
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import RemainTime from "./RemainTime.vue";
  24. import OverallProgress from "./OverallProgress.vue";
  25. import QuestionFilters from "./QuestionFilters.vue";
  26. import QuestionView from "./QuestionView.vue";
  27. export default {
  28. data() {
  29. return {
  30. exam: null,
  31. paperStruct: null,
  32. examQuestionList: [],
  33. examQuestion: null
  34. };
  35. },
  36. async mounted() {
  37. const exam = await this.$http.get(
  38. "/api/ecs_exam_work/exam/" + this.$route.params.examId
  39. );
  40. this.exam = exam.data;
  41. const paperStruct = await this.$http.get(
  42. "/api/exam_question/paper_struct/?exam_record_id=" +
  43. this.$route.query.examRecordId
  44. );
  45. this.paperStruct = paperStruct.data;
  46. // FIXME: global API processing. mock or not
  47. const examQuestionList = await this.$http.get(
  48. "/api/mock/exam_question/?exam_record_id=" +
  49. this.$route.query.examRecordId
  50. );
  51. this.examQuestionList = examQuestionList.data;
  52. this.examQuestion = this.examQuestionList[0];
  53. },
  54. components: {
  55. RemainTime,
  56. OverallProgress,
  57. QuestionFilters,
  58. QuestionView
  59. }
  60. };
  61. </script>
  62. <style scoped>
  63. .container {
  64. /* display: flex;
  65. flex-direction: row; */
  66. display: grid;
  67. grid-template-areas:
  68. "header header"
  69. "main side";
  70. grid-template-rows: 80px 1fr;
  71. grid-template-columns: 1fr 300px;
  72. height: 100vh;
  73. }
  74. .header {
  75. /* display: flex;
  76. flex-direction: row; */
  77. display: grid;
  78. place-items: center;
  79. grid-template-columns: 200px 1fr 300px 100px;
  80. grid-area: header;
  81. height: 80px;
  82. }
  83. .main {
  84. display: grid;
  85. grid-area: main;
  86. }
  87. .side {
  88. display: grid;
  89. grid-area: side;
  90. }
  91. </style>