Explorar o código

添加组卷作业详情

shmily1213 hai 1 mes
pai
achega
f2a5e7d34e

+ 4 - 0
src/api/modules/study.ts

@@ -233,6 +233,10 @@ export function getPaperWorkList(parmas: {state?: EnumPaperWorkState}) {
   return flyio.get('/front/student/record/test', parmas) as Promise<ApiResponseList<PaperWork>>;
 }
 
+export function getPaperWorkDetail(id: number) {
+  return flyio.get(`/front/student/record/test/${id}`) as Promise<ApiResponse<Examinee>>;
+}
+
 export function getPaperWorkStatistic() {
   return flyio.get('/front/student/paperStats', {}) as Promise<ApiResponse<Record<string, number>[]>>;
 }

+ 14 - 1
src/pagesStudy/pages/homework/components/paper-work.vue

@@ -43,6 +43,7 @@
 <script lang="ts" setup>
 import { EnumPaperType, EnumPaperWorkState } from '@/common/enum';
 import { useTransferPage } from '@/hooks/useTransferPage';
+import { getPaperWorkDetail } from '@/api/modules/study';
 import { Study } from '@/types';
 const { transferTo } = useTransferPage();
 const props = defineProps<{
@@ -58,7 +59,19 @@ const publishTime = computed(() => {
 });
 
 const handleDetail = () => {
-  console.log(props.data);
+  uni.$ie.showLoading();
+  getPaperWorkDetail(props.data.id).then(res => {
+    uni.$ie.hideLoading();
+    transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
+      data: {
+        examineeId: res.data.examineeId
+      }
+    });
+  }).catch(err => {
+    uni.$ie.hideLoading();
+    console.error(err);
+  });
+
 }
 
 const handleStart = () => {

+ 5 - 3
src/pagesStudy/pages/study-history/components/exam-history-student.vue

@@ -6,8 +6,8 @@
   </view>
 </template>
 <script lang="ts" setup>
-import { getSimulatedRecord } from '@/api/modules/study';
-import { EnumExamRecordType } from '@/common/enum';
+import { getSimulatedRecord, getPaperWorkList } from '@/api/modules/study';
+import { EnumExamRecordType, EnumPaperWorkState } from '@/common/enum';
 import examRecordItem from '@/pagesStudy/components/exam-record-item.vue';
 import { Study } from '@/types';
 const props = defineProps({
@@ -23,7 +23,9 @@ const loadData = async (type: string) => {
     const { data } = await getSimulatedRecord();
     dataList.value = data;
   } else {
-
+    const { rows } = await getPaperWorkList({state: EnumPaperWorkState.COMPLETED});
+    // dataList.value = rows;
+    console.log(rows)
 
   }