exam-record-item.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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-26 text-fore-light">提交时间: {{ data.date || '-' }}</view>
  6. <view class="text-26 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]">卷面得分:{{ data.score || '-' }}</view>
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="ts" setup>
  19. import { Study } from '@/types';
  20. import { useTransferPage } from '@/hooks/useTransferPage';
  21. import { EnumSimulatedRecordStatus } from '@/common/enum';
  22. import { beginExaminee } from '@/api/modules/study';
  23. const { transferTo } = useTransferPage();
  24. const props = defineProps<{
  25. data: Study.SimulatedRecord;
  26. }>();
  27. const isFinished = computed(() => {
  28. return props.data.state === EnumSimulatedRecordStatus.SUBMIT;
  29. });
  30. const handleDetail = () => {
  31. if (isFinished.value) {
  32. transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
  33. data: {
  34. examineeId: props.data.id
  35. }
  36. });
  37. } else {
  38. transferTo('/pagesStudy/pages/start-exam/start-exam', {
  39. data: {
  40. name: '模拟考试-' + props.data.subjectName,
  41. paperType: 'Simulated',
  42. simulationInfo: {
  43. examineeId: props.data.id,
  44. }
  45. }
  46. });
  47. }
  48. };
  49. </script>
  50. <style lang="scss" scoped></style>