OfflineExamHome.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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>{{ locationTitle }}</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 { mapState } from "vuex";
  20. import EcsOfflineList from "./OfflineExamList.vue";
  21. export default {
  22. name: "OfflineExamHome",
  23. components: {
  24. "ecs-offline-list": EcsOfflineList,
  25. },
  26. data() {
  27. return {
  28. courses: [],
  29. };
  30. },
  31. computed: {
  32. ...mapState(["menus"]),
  33. locationTitle() {
  34. return (
  35. this.menus.find(
  36. v => v.link.toUpperCase() === this.$route.path.toUpperCase()
  37. ) || {}
  38. ).name;
  39. },
  40. },
  41. async mounted() {
  42. try {
  43. window._hmt.push(["_trackEvent", "离线考试页面", "进入列表", ""]);
  44. this.logger({ page: "离线考试页面", action: "进入页面" });
  45. await this.fetchData();
  46. } catch (error) {
  47. this.$Message.error({
  48. content: "获取离线考试列表失败",
  49. duration: 15,
  50. closable: true,
  51. });
  52. }
  53. },
  54. methods: {
  55. async fetchData() {
  56. const res = await this.$http.get(
  57. "/api/ecs_oe_admin/offlineExam/getOfflineCourse"
  58. );
  59. this.courses = res.data.map(c => ({
  60. examId: c.examId,
  61. examRecordDataId: c.examRecordDataId,
  62. courseName: c.courseName,
  63. specialtyName: c.specialtyName,
  64. orgName: c.orgName,
  65. examStudentId: c.examStudentId,
  66. startTime: c.startTime,
  67. endTime: c.endTime,
  68. offlineFileUrl: c.offlineFileUrl,
  69. paperId: c.paperId,
  70. }));
  71. },
  72. },
  73. };
  74. </script>
  75. <style scoped>
  76. .home {
  77. margin: 20px;
  78. }
  79. </style>