Ver Fonte

我的作业/章节测验(同接口),学习足迹

canghailong há 6 meses atrás
pai
commit
4eadabc654

+ 1 - 1
src/api/student/classCentre.js

@@ -88,7 +88,7 @@ export default {
 	},
 	//学习足迹
 	footprintClassList(data) {
-		return request('disk/courselog/page', data, 'get')
+		return request('disk/coursestudentburialpoint/page', data, 'get')
 	},
 	//课程公告已读
 	readAdd(data) {

+ 1 - 2
src/views/forum/addForum.vue

@@ -55,7 +55,6 @@
 								style="width: 100%"
 								:options="usertypeOptions"
 								:filter-option="filterOption"
-								@popupScroll="popupScroll"
 							></a-select>
 						</a-form-item>
 					</a-col>
@@ -112,7 +111,7 @@
 		return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	}
 	const userPagination = ref({
-		size: 10,
+		size:9999999,
 		current: 1
 	})
 	const userTotal = ref(0)

+ 3 - 3
src/views/forum/form.vue

@@ -37,8 +37,8 @@
 							style="width: 100%"
 							:options="usertypeOptions"
 							:filter-option="filterOption"
-							@popupScroll="popupScroll"
 						></a-select>
+						<!-- @popupScroll="popupScroll" -->
 					</a-form-item>
 				</a-col>
 				<a-col :span="24">
@@ -82,7 +82,7 @@
 		return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	}
 	const userPagination = ref({
-		size: 10,
+		size: 99999999,
 		current: 1
 	})
 	const userTotal = ref(0)
@@ -92,7 +92,7 @@
 			userTotal.value = res.total
 			let userList = res.records.map((r) => {
 				return {
-					label: `${r.name}-${r.eduIdentityName}`,
+					label: `${r.name}-${r.eduIdentityName??''}`,
 					value: r.id,
 					...r
 				}

+ 19 - 21
src/views/student/classCentre/index.vue

@@ -155,7 +155,7 @@
 		return null
 	}
 	const videoPoster = computed(() => {
-		return classTimeData.value.filter((r) => r.funcType == 0)[0]?.url
+		return classTimeData.value.find((r) => r.funcType == 0)?.url
 	})
 	const getClassData = () => {
 		classCentre.addViewCount({ courseId: route.query.id })
@@ -196,9 +196,9 @@
 					url: sysConfig.FILE_URL + r.url
 				}
 			})
-			videoUrl.value = classTimeData.value.filter((r) => r.funcType == 1)[0]?.url
+			videoUrl.value = classTimeData.value.find((r) => r.funcType == 1)?.url
 			nextTick(() => {
-				videoRef.value.src = classTimeData.value.filter((r) => r.funcType == 1)[0]?.url
+				videoRef.value.src = classTimeData.value.find((r) => r.funcType == 1)?.url
 				videoStart()
 				footprintClassAdd()
 				getVideoTime()
@@ -219,11 +219,11 @@
 	const noteRef = ref()
 	const askDivRef = ref()
 	const itemObj = computed(() => {
-		let item = classTimeData.value.length > 0 ? classTimeData.value.filter((r) => r.funcType == 2)[0] : { url: '' }
+		let item = classTimeData.value.length > 0 ? classTimeData.value.find((r) => r.funcType == 2) : { url: '' }
 		return item
 	})
 	const danmuObj = computed(() => {
-		let item = classTimeData.value.length > 0 ? classTimeData.value.filter((r) => r.funcType == 3)[0] : { url: '' }
+		let item = classTimeData.value.length > 0 ? classTimeData.value.find((r) => r.funcType == 3) : { url: '' }
 		return item
 	})
 	const videoUrl = ref('')
@@ -271,7 +271,7 @@
 	const forumData = computed(() => {
 		let item = findNodeByKey(classTimeList.value, selectedKeys.value[0], classTimeList.value[0]) ?? {}
 		if (!item.src) {
-			item.src = classTimeData.value.filter((r) => r.funcType == 1)[0]?.url
+			item.src = classTimeData.value.find((r) => r.funcType == 1)?.url
 		}
 		return {
 			id: classHourData.value?.id,
@@ -336,18 +336,16 @@
 			(initialtime.value || initialtime.value == 0) &&
 			(videoRef.value.currentTime || videoRef.value.currentTime == 0)
 		) {
-			classCentre
-				.classPlanAdd({
-					startTime: parseFloat(initialtime.value),
-					endTime: Math.round(videoRef.value.currentTime * 1000),
-					progress: Math.round(progress),
-					hourId: classHourData.value?.id,
-					stayTime: outNowTimesStr.value - nowTimesStr,
-					type: type,
-					funcType: type,
-					...classDetailParams.value
-				})
-				.then((data) => {})
+			classCentre.classPlanAdd({
+				startTime: parseFloat(initialtime.value),
+				endTime: Math.round(videoRef.value.currentTime * 1000),
+				progress: Math.round(progress),
+				hourId: classHourData.value?.id,
+				stayTime: outNowTimesStr.value - nowTimesStr,
+				type: type,
+				funcType: type,
+				...classDetailParams.value
+			})
 		}
 	}
 	const isLike = () => {
@@ -372,9 +370,9 @@
 			hourId: classHourData.value.id,
 			chapterId: selectedKeys.value[0],
 			courseId: classDetail.value.courseId,
-			fileId: classHourData.value.courseRelates.filter((r) => r.funcType == 1)[0].relateId,
-			fileName: classHourData.value.courseRelates.filter((r) => r.funcType == 1)[0].name,
-			filePath: classHourData.value.courseRelates.filter((r) => r.funcType == 1)[0].url
+			fileId: classHourData.value.courseRelates.find((r) => r.funcType == 1)?.relateId,
+			fileName: classHourData.value.courseRelates.find((r) => r.funcType == 1)?.name,
+			filePath: classHourData.value.courseRelates.find((r) => r.funcType == 1)?.url
 		}
 	})
 	//足迹

+ 42 - 7
src/views/student/learningFootprint/index.vue

@@ -2,7 +2,8 @@
 	<a-card>
 		<s-table ref="table" :columns="columns" :data="loadData" bordered :row-key="(record) => record.id">
 			<template #bodyCell="{ column, record }">
-				<template v-if="column.dataIndex == 'createTime'">{{ formatDateTime(record.createTime) }}</template>
+				<template v-if="column.dataIndex == 'funcType'">{{ funcTypeName(record.funcType) }}</template>
+				<template v-if="column.dataIndex == 'type'">{{ typeName(record.type) }}</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
 						<a @click="jumpDetail(record)">详情</a>
@@ -17,10 +18,36 @@
 	import classCentre from '@/api/student/classCentre'
 	import { useRouter } from 'vue-router'
 	import { parseTime } from '@/utils/exam'
-	function formatDateTime(val) {
-		if (!val) return ''
-		return parseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
-	}
+	const typeList = ref([
+		{
+			value: '1',
+			label: '查看'
+		},
+		{
+			value: '2',
+			label: '下载'
+		},
+		{
+			value: '3',
+			label: '快进'
+		},
+		{
+			value: '4',
+			label: '快退'
+		}
+	])
+	const funcTypeList = ref([
+		{
+			value: '1',
+			label: '视频'
+		},
+		{
+			value: '2',
+			label: '讲义'
+		}
+	])
+	const typeName = computed(() => (e) =>typeList.value.find((r) => r.value == e)?.label)
+	const funcTypeName = computed(() => (e) =>funcTypeList.value.find((r) => r.value == e)?.label)
 	const router = useRouter()
 	const columns = [
 		{
@@ -32,13 +59,21 @@
 			dataIndex: 'chapterName'
 		},
 		{
-			title: '时间',
-			dataIndex: 'createTime'
+			title: '课时名',
+			dataIndex: 'hourhlame'
 		},
 		{
 			title: '文件名',
 			dataIndex: 'fileName'
 		},
+		{
+			title: '类型',
+			dataIndex: 'funcType'
+		},
+		{
+			title: '方式',
+			dataIndex: 'type'
+		},
 		{
 			title: '操作',
 			dataIndex: 'action',

+ 8 - 23
src/views/student/paper/index.vue

@@ -61,7 +61,6 @@
 <script setup>
 	import { useExamStore } from '@/store/exam'
 	import examPaperApi from '@/api/student/examPaper'
-	import taskApi from '@/api/student/examPaper'
 	import { useRoute } from 'vue-router'
 	import tool from '@/utils/tool'
 	import { parseTime } from '@/utils/exam'
@@ -118,25 +117,15 @@
 			ellipsis: true
 		}
 	]
-	const taskColumns = computed(() =>
-		taskAllColumns.value.filter((r) => r.columnsType.includes(parseFloat(examType.value)))
-	)
-	const taskAllColumns = ref([
-		{ title: '课程名称', dataIndex: 'courseName', key: 'courseName', columnsType: [4] },
-		{ title: '章节名称', dataIndex: 'chapterName', key: 'chapterName', columnsType: [4] },
-		{ title: '课时名称', dataIndex: 'hourName', key: 'hourName', columnsType: [4] },
-		{ title: '作业名称', dataIndex: 'name', key: 'name', columnsType: [4] },
-		{ title: '试卷类型', dataIndex: 'paperType', key: 'paperType', width: 120, columnsType: [4] },
+	const taskColumns = ref([
+		{ title: '问卷名称', dataIndex: 'examName', key: 'examName' },
+		{ title: '问卷类型', dataIndex: 'examType', key: 'examType', width: 120 },
+		{ title: '开始时间', dataIndex: 'startTime', key: 'startTime', width: 180 },
+		{ title: '结束时间', dataIndex: 'endTime', key: 'endTime', width: 180 },
 
-		{ title: '问卷名称', dataIndex: 'examName', key: 'examName', columnsType: [1, 2, 3] },
-		{ title: '问卷类型', dataIndex: 'examType', key: 'examType', width: 120, columnsType: [1, 2, 3] },
-		{ title: '开始时间', dataIndex: 'startTime', key: 'startTime', width: 180, columnsType: [1, 2, 3] },
-		{ title: '结束时间', dataIndex: 'endTime', key: 'endTime', width: 180, columnsType: [1, 2, 3] },
-
-		{ title: '状态', dataIndex: 'status', key: 'status', width: 90, columnsType: [1, 2, 3, 4] },
-		{ title: '操作', key: 'action', align: 'right', width: 120, columnsType: [1, 2, 3, 4] }
+		{ title: '状态', dataIndex: 'status', key: 'status', width: 90},
+		{ title: '操作', key: 'action', align: 'right', width: 120}
 	])
-
 	const statusTextFormatter = (status) => {
 		if (status === 0) return '未答题'
 		if (status === 1) return '待判分'
@@ -161,11 +150,7 @@
 				paperType: paperType.value,
 				examType: examType.value
 			}
-			if (examType.value == 4) {
-				res = await examPaperApi.newPageList(params)
-			} else {
-				res = await taskApi.pageExamList(params)
-			}
+			res = await examPaperApi.pageExamList(params)
 
 			taskList.value = res?.records || []
 			pagination.value.total = res.total