OfflineExamHome.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <main-layout>
  3. <Breadcrumb
  4. style="text-align: left; padding-left: 20px; height: 40px;
  5. line-height: 40px; background-color: #fafafa;"
  6. >
  7. 当前所在位置:
  8. <BreadcrumbItem>离线考试</BreadcrumbItem>
  9. </Breadcrumb>
  10. <div class="home">
  11. <ecs-offline-list
  12. :courses="courses"
  13. @reloadList="fetchData"
  14. ></ecs-offline-list>
  15. </div>
  16. </main-layout>
  17. </template>
  18. <script>
  19. import EcsOfflineList from "./OfflineExamList.vue";
  20. export default {
  21. name: "OfflineExamHome",
  22. data() {
  23. return {
  24. courses: []
  25. };
  26. },
  27. async mounted() {
  28. try {
  29. window._hmt.push(["_trackEvent", "离线考试页面", "进入列表", ""]);
  30. await this.fetchData();
  31. } catch (error) {
  32. this.$Message.error({
  33. content: "获取离线考试列表失败",
  34. duration: 15,
  35. closable: true
  36. });
  37. }
  38. },
  39. methods: {
  40. async fetchData() {
  41. const res = await this.$http.get(
  42. "/api/ecs_oe_student/offlineExam/getOfflineCourse"
  43. );
  44. this.courses = res.data.map(c => ({
  45. examId: c.examId,
  46. examRecordDataId: c.examRecordDataId,
  47. courseName: c.courseName,
  48. specialtyName: c.specialtyName,
  49. orgName: c.orgName,
  50. examStudentId: c.examStudentId,
  51. startTime: c.startTime,
  52. endTime: c.endTime,
  53. offlineFileUrl: c.offlineFileUrl,
  54. paperId: c.paperId
  55. }));
  56. }
  57. },
  58. components: {
  59. "ecs-offline-list": EcsOfflineList
  60. }
  61. };
  62. </script>
  63. <style scoped>
  64. .home {
  65. margin: 20px;
  66. }
  67. </style>