exam-record-item.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="bg-white">
  3. <view class="text-30 text-fore-title">{{ data.name }}</view>
  4. <view class="mt-32 flex items-center justify-between">
  5. <view class="text-24 text-fore-light">提交时间: {{ data.date || '-' }}</view>
  6. <view class="text-28 text-primary flex items-center gap-x-4" @click="handleDetail">
  7. <text>{{ isFinished ? '查看分析' : '继续考试' }}</text>
  8. <uv-icon name="arrow-right" size="14" color="var(--primary-color)" />
  9. </view>
  10. </view>
  11. <view
  12. class="mt-20 border border-solid border-[#FEF6DA] bg-[#FFFBEB] rounded-5 py-20 px-16 flex items-center justify-between">
  13. <view class="text-24 text-[#F59E0B]">考试科目:{{ data.subjectName }}</view>
  14. <view class="text-24 text-[#F59E0B]">卷面得分:{{ getScore }}</view>
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="ts" setup>
  19. import { Study, Transfer } from '@/types';
  20. import { useTransferPage } from '@/hooks/useTransferPage';
  21. import { EnumPaperType, EnumSimulatedRecordStatus } from '@/common/enum';
  22. import { beginExaminee } from '@/api/modules/study';
  23. const { transferTo } = useTransferPage<any, Transfer.SimulationAnalysisPageOptions | Transfer.ExamAnalysisPageOptions>();
  24. const props = defineProps<{
  25. data: Study.SimulatedRecord;
  26. }>();
  27. const isFinished = computed(() => {
  28. return props.data.state === EnumSimulatedRecordStatus.SUBMIT;
  29. });
  30. const getScore = computed(() => {
  31. if (props.data.score === undefined || props.data.score === null) {
  32. return '-';
  33. }
  34. return props.data.score;
  35. })
  36. const handleDetail = () => {
  37. if (isFinished.value) {
  38. transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
  39. data: {
  40. examineeId: props.data.id,
  41. paperType: EnumPaperType.SIMULATED
  42. }
  43. });
  44. } else {
  45. transferTo('/pagesStudy/pages/exam-start/exam-start', {
  46. data: {
  47. name: '模拟考试-' + props.data.subjectName,
  48. paperType: EnumPaperType.SIMULATED,
  49. readonly: false,
  50. simulationInfo: {
  51. examineeId: props.data.id,
  52. }
  53. }
  54. });
  55. }
  56. };
  57. </script>
  58. <style lang="scss" scoped></style>