소스 검색

修复考试页面标题显示问题

shmily1213 3 주 전
부모
커밋
ca9012530d

+ 9 - 8
src/pagesStudy/components/exam-record-item.vue

@@ -42,15 +42,16 @@ const handleDetail = () => {
       }
     });
   } else {
-    transferTo('/pagesStudy/pages/exam-start/exam-start', {
-      data: {
-        name: '模拟考试-' + props.data.subjectName,
-        paperType: EnumPaperType.SIMULATED,
-        readonly: false,
-        simulationInfo: {
-          examineeId: props.data.id,
-        }
+    const pageOptions: Transfer.ExamAnalysisPageOptions = {
+      paperType: EnumPaperType.SIMULATED,
+      readonly: false,
+      simulationInfo: {
+        examineeId: props.data.id,
+        name: props.data.subjectName
       }
+    }
+    transferTo('/pagesStudy/pages/exam-start/exam-start', {
+      data: pageOptions
     });
   }
 };

+ 9 - 9
src/pagesStudy/components/ie-exam-record-item.vue

@@ -42,16 +42,16 @@ const handleDetail = () => {
       }
     });
   } else {
-    transferTo('/pagesStudy/pages/exam-start/exam-start', {
-      data: {
-        // name: '模拟考试-' + props.data.subjectName,
-        paperType: EnumPaperType.SIMULATED,
-        readonly: false,
-        simulationInfo: {
-          examineeId: props.data.id,
-          name: props.data.subjectName,
-        }
+    const pageOptions: Transfer.ExamAnalysisPageOptions = {
+      paperType: EnumPaperType.SIMULATED,
+      readonly: false,
+      simulationInfo: {
+        examineeId: props.data.id,
+        name: props.data.subjectName
       }
+    }
+    transferTo('/pagesStudy/pages/exam-start/exam-start', {
+      data: pageOptions
     });
   }
 };

+ 2 - 2
src/pagesStudy/components/paper-work-item.vue

@@ -5,8 +5,8 @@
         <view class="w-12 h-12 rounded-full bg-[#E5E5E5]"></view>
         <view class="ml-10">{{ publishTime }}{{ `${data.publishUser ? `-${data.publishUser}` : ''}` }}</view>
       </view>
-      <view :class="['text-28', data.state === EnumPaperWorkState.NOT_COMPLETED ? 'text-warning' : 'text-success']">
-        {{ data.state === EnumPaperWorkState.NOT_COMPLETED ? '未完成' : '已完成' }}
+      <view :class="['text-28', data.state === EnumPaperWorkState.COMPLETED ? 'text-success' : 'text-warning']">
+        {{ data.state === EnumPaperWorkState.COMPLETED ? '已完成' : '未完成' }}
       </view>
     </view>
     <view class="px-46 py-30 relative">

+ 2 - 0
src/pagesStudy/pages/exam-start/components/exam-navbar.vue

@@ -33,11 +33,13 @@ const titleMap = {
   [EnumPaperType.PRACTICE]: '知识点练习',
   [EnumPaperType.SIMULATED]: '模拟考试',
   [EnumPaperType.TEST]: '组卷作业',
+  [EnumPaperType.COURSE]: '教材同步练习',
 }
 const readonlyTitleMap = {
   [EnumPaperType.PRACTICE]: '练习解析',
   [EnumPaperType.SIMULATED]: '考试解析',
   [EnumPaperType.TEST]: '作业解析',
+  [EnumPaperType.COURSE]: '练习解析',
 }
 const isPractice = computed(() => {
   return examPageOptions?.paperType === EnumPaperType.PRACTICE;

+ 9 - 4
src/pagesStudy/pages/exam-start/components/exam-subtitle.vue

@@ -12,6 +12,7 @@ import { useUserStore } from '@/store/userStore';
 import { Transfer } from '@/types';
 import { EXAM_PAGE_OPTIONS, EXAM_DATA } from '@/types/injectionSymbols';
 import { useExam } from '@/composables/useExam';
+import { EnumPaperType } from '@/common/enum';
 
 const userStore = useUserStore();
 const examPageOptions = inject(EXAM_PAGE_OPTIONS) || {} as Transfer.ExamAnalysisPageOptions;
@@ -20,7 +21,7 @@ const { virtualCurrentIndex, virtualTotalCount } = examData;
 
 const pageSubtitle = computed(() => {
   if (examPageOptions && examPageOptions.practiceInfo) {
-    const { practiceInfo: { directed, questionType, name } } = examPageOptions;
+    const { practiceInfo: { directed, questionType, name }, paperType } = examPageOptions;
     let titlePrefix = '';
     if (userStore.isVHS) {
       if (questionType === 0) {
@@ -29,10 +30,14 @@ const pageSubtitle = computed(() => {
         titlePrefix = '必刷题';
       }
     } else {
-      if (directed) {
-        titlePrefix = '定向刷题';
+      if (paperType === EnumPaperType.COURSE) {
+        titlePrefix = '教材同步练习';
       } else {
-        titlePrefix = '全量刷题';
+        if (directed) {
+          titlePrefix = '定向刷题';
+        } else {
+          titlePrefix = '全量刷题';
+        }
       }
     }
     return titlePrefix + '-' + name;

+ 13 - 14
src/pagesStudy/pages/knowledge-practice-detail/knowledge-practice-detail.vue

@@ -82,21 +82,20 @@ const handleQuestionDetail = (item: Study.Question) => {
   if (!examineeData.value) {
     return;
   }
+  const pageOptions: Transfer.ExamAnalysisPageOptions = {
+    paperType: prevData.value.paperType || EnumPaperType.PRACTICE,
+    readonly: true,
+    questionId: item.id,
+    practiceInfo: {
+      name: prevData.value.name,
+      relateId: examineeData.value.knowledgeId,
+      directed: prevData.value.directed,
+      examineeId: examineeData.value.examineeId,
+      questionType: prevData.value.questionType
+    },
+  }
   transferTo('/pagesStudy/pages/exam-start/exam-start', {
-    data: {
-      // name: paperName.value,
-      paperType: prevData.value.paperType || EnumPaperType.PRACTICE,
-      readonly: true,
-      questionId: item.id,
-      practiceInfo: {
-        name: prevData.value.name,
-        relateId: examineeData.value.knowledgeId,
-        directed: prevData.value.directed,
-        examineeId: examineeData.value.examineeId,
-        // 对口升学
-        questionType: prevData.value.questionType
-      },
-    }
+    data: pageOptions
   });
 }
 const handleStartPractice = () => {

+ 11 - 10
src/pagesStudy/pages/knowledge-practice/knowledge-practice.vue

@@ -98,17 +98,18 @@ const loadKnowledgeList = async () => {
 const handleStartPractice = async (node: Study.KnowledgeNode) => {
   const hasAuth = checkVipPermission();
   if (hasAuth) {
+    const pageOptions: Transfer.ExamAnalysisPageOptions = {
+      paperType: EnumPaperType.PRACTICE,
+      readonly: false,
+      practiceInfo: {
+        name: node.name,
+        relateId: node.id,
+        directed: prevData.value.directed,
+        questionType: prevData.value.questionType
+      }
+    }
     transferTo('/pagesStudy/pages/exam-start/exam-start', {
-      data: {
-        paperType: EnumPaperType.PRACTICE,
-        practiceInfo: {
-          name: node.name,
-          relateId: node.id,
-          directed: prevData.value.directed,
-          // 对口升学
-          questionType: prevData.value.questionType
-        }
-      } as Transfer.ExamAnalysisPageOptions
+      data: pageOptions
     });
   }
 }

+ 10 - 8
src/pagesStudy/pages/simulation-start/simulation-start.vue

@@ -59,7 +59,7 @@ import { getOpenExaminee, getPaper } from '@/api/modules/study';
 import { useUserStore } from '@/store/userStore';
 import { useAppStore } from '@/store/appStore';
 import { EnumDictName, EnumPaperType } from '@/common/enum';
-import { Study } from '@/types';
+import { Study, Transfer } from '@/types';
 
 const { prevData, transferTo } = useTransferPage();
 const userStore = useUserStore();
@@ -90,14 +90,16 @@ const subjectInfo = computed(() => {
   return prevData.value.subjectInfo;
 });
 const handleStartTest = () => {
-  transferTo('/pagesStudy/pages/exam-start/exam-start', {
-    data: {
-      paperType: EnumPaperType.SIMULATED,
-      name: '模拟考试-' + subjectInfo.value.subject,
-      simulationInfo: {
-        examineeId: examineeId.value
-      }
+  const pageOptions: Transfer.ExamAnalysisPageOptions = {
+    paperType: EnumPaperType.SIMULATED,
+    readonly: false,
+    simulationInfo: {
+      examineeId: examineeId.value,
+      name: subjectInfo.value.subject
     }
+  }
+  transferTo('/pagesStudy/pages/exam-start/exam-start', {
+    data: pageOptions
   });
 }
 const loadData = async () => {

+ 11 - 8
src/pagesStudy/pages/textbooks-practice/textbooks-practice.vue

@@ -27,6 +27,7 @@ import * as Study from '@/types/study';
 import { EnumPaperType, EnumUserRole } from '@/common/enum';
 import { useUserStore } from '@/store/userStore';
 import { useAuth } from '@/hooks/useAuth';
+import { Transfer } from '@/types';
 
 const { prevData, transferTo } = useTransferPage();
 const userStore = useUserStore();
@@ -62,15 +63,17 @@ const loadKnowledgeList = async (page: number, size: number) => {
 const handleStartPractice = async (node: Study.KnowledgeNode) => {
   const hasAuth = checkVipPermission();
   if (hasAuth) {
-    transferTo('/pagesStudy/pages/exam-start/exam-start', {
-      data: {
-        name: '教材同步练习-' + node.name,
-        paperType: EnumPaperType.COURSE,
-        practiceInfo: {
-          name: node.name,
-          relateId: node.id
-        },
+    const pageOptions: Transfer.ExamAnalysisPageOptions = {
+      paperType: EnumPaperType.COURSE,
+      readonly: false,
+      practiceInfo: {
+        name: node.name,
+        relateId: node.id,
+        directed: false
       }
+    }
+    transferTo('/pagesStudy/pages/exam-start/exam-start', {
+      data: pageOptions
     });
   }
 }