Просмотр исходного кода

考试/调查问卷(任务)-章节/作业(固定)

canghailong 6 месяцев назад
Родитель
Сommit
e123ecf57b
1 измененных файлов с 18 добавлено и 26 удалено
  1. 18 26
      src/views/student/paper/index.vue

+ 18 - 26
src/views/student/paper/index.vue

@@ -7,7 +7,7 @@
 					<div>{{ examName }}</div>
 				</h3>
 				<a-select
-					v-if="examType==1"
+					v-if="examType == 1"
 					class="mb-3"
 					v-model:value="examTypeSelect"
 					placeholder="所有分类"
@@ -44,7 +44,8 @@
 							</template>
 
 							<template v-if="record.paperType && column.key === 'paperType'">
-								{{ paperTypeEnum(record.paperType) }}
+								<span v-if="record.paperType == 3 || record.paperType == 4">{{ paperTypeEnum(record.paperType) }}</span>
+								<span v-if="record.paperType == 1 || record.paperType == 2">{{ examTypeName(record.paperType) }}</span>
 							</template>
 
 							<template v-if="column.key === 'status'">
@@ -101,41 +102,32 @@
 			return examNameOption.find((r) => r.value == id).label
 		}
 	})
-
-	const examName = computed(() => {
-		switch (examType.value) {
-			case '1':
-				return '考试'
-				break
-			case '2':
-				return '章节测验'
-				break
-			case '3':
-				return '调查问卷'
-				break
-			case '4':
-				return '作业'
-				break
-		}
-	})
 	const typeOptionsVal = ref([
 		{
 			label: '考试',
-			value: '1'
+			value: '1',
+			paperType:'6'
 		},
 		{
 			label: '章节测验',
-			value: '2'
+			value: '2',
+			paperType:'3'
 		},
 		{
 			label: '调查问卷',
-			value: '3'
+			value: '3',
+			paperType:'5'
 		},
 		{
 			label: '作业',
-			value: '4'
+			value: '4',
+			paperType:'2'
 		}
 	])
+	const examName = computed(() => {
+		return examType.value ? typeOptionsVal.value.find((e) => e.value == examType.value).label : ''
+	})
+
 	const handleChangeVal = (value) => {
 		getTaskList()
 	}
@@ -195,12 +187,12 @@
 				size: pagination.value.pageSize,
 				subjectId: pagination.value.subjectId,
 				courseId: route.query.id,
-				paperType: paperType.value,
-				examType: examType.value == 1 ? examTypeSelect.value : examType.value
 			}
-			if (examType.value == 4 || examType.value == 2) {
+			if (examType.value == 2 || examType.value == 4) {
+				params.paperType = typeOptionsVal.value.find(d=>d.value==examType.value).paperType
 				res = await examPaperApi.newPageList(params)
 			} else {
+				params.examType = examType.value == 1 ? examTypeSelect.value : examType.value
 				res = await examPaperApi.pageExamList(params)
 			}