ie-exam-history.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="h-full bg-white flex flex-col">
  3. <view class="px-30 py-20 flex gap-x-20">
  4. <view class="exam-type-item" :class="{ 'is-active': examType === EnumExamRecordType.SIMULATED }"
  5. @click="handleChangeExamType(EnumExamRecordType.SIMULATED)">
  6. <ie-image src="/pagesStudy/static/image/icon-exam-test.png" custom-class="w-64 h-60" />
  7. <view class="exam-type-text">模拟仿真</view>
  8. </view>
  9. <view class="exam-type-item" :class="{ 'is-active': examType === EnumExamRecordType.HOMEWORK }"
  10. @click="handleChangeExamType(EnumExamRecordType.HOMEWORK)">
  11. <ie-image src="/pagesStudy/static/image/icon-exam-homework.png" custom-class="w-64 h-60" />
  12. <view class="exam-type-text">组卷作业</view>
  13. </view>
  14. </view>
  15. <scroll-view class="flex-1 min-h-1" scroll-y>
  16. <ie-exam-history-student v-if="isStudent" :exam-type="examType" />
  17. <ie-exam-history-teacher v-else :exam-type="examType" />
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script lang="ts" setup>
  22. import { EnumExamRecordType } from '@/common/enum';
  23. import IeExamHistoryStudent from './ie-exam-history-student.vue';
  24. import IeExamHistoryTeacher from './ie-exam-history-teacher.vue';
  25. import { useUserStore } from '@/store/userStore';
  26. const { isStudent } = storeToRefs(useUserStore());
  27. const examType = ref(EnumExamRecordType.SIMULATED);
  28. const handleChangeExamType = (type: EnumExamRecordType) => {
  29. examType.value = type;
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .exam-type-item {
  34. @apply flex-1 h-175 rounded-15 bg-[#F5F5F5] flex flex-col items-center justify-center gap-y-10;
  35. }
  36. .exam-type-text {
  37. @apply text-28 text-fore-title font-bold;
  38. }
  39. .is-active {
  40. @apply bg-[#E6F7FF] relative;
  41. &::after {
  42. content: "";
  43. display: block;
  44. position: absolute;
  45. bottom: -9px;
  46. left: 50%;
  47. transform: translateX(-50%);
  48. width: 0;
  49. height: 0;
  50. border-left: 14px solid transparent;
  51. border-right: 14px solid transparent;
  52. border-top: 10px solid #E6F7FF;
  53. }
  54. .exam-type-text {
  55. @apply text-primary;
  56. }
  57. }
  58. </style>