Selaa lähdekoodia

资源学习足迹

canghailong 6 kuukautta sitten
vanhempi
sitoutus
3dd59badeb

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

@@ -86,10 +86,14 @@ export default {
 	footprintClassAdd(data) {
 		return request('disk/courselog/add', data)
 	},
-	//学习足迹
+	//课程足迹
 	footprintClassList(data) {
 		return request('disk/coursestudentburialpoint/page', data, 'get')
 	},
+	//资源足迹
+	resourceFootprint(data) {
+		return request('disk/footprint/page', data, 'get')
+	},
 	//课程公告已读
 	readAdd(data) {
 		return request('disk/userread/add', data)

+ 8 - 1
src/router/student.js

@@ -49,7 +49,14 @@ const routes = [
 				path: '/learningFootprint',
 				component: () => import('@/views/student/learningFootprint/index.vue'),
 				meta: {
-					title: '学习足迹'
+					title: '课程足迹'
+				}
+			},
+			{
+				path: '/resourceFootprint',
+				component: () => import('@/views/student/resourceFootprint/index.vue'),
+				meta: {
+					title: '资源足迹'
 				}
 			},
 			{

+ 2 - 1
src/views/portal/components/Header.vue

@@ -36,7 +36,8 @@
 							</a-menu-item>
 							<a-menu-item key="inSsiteMessage">站内信</a-menu-item>
 							<a-menu-item key="classNotice">课程公告</a-menu-item>
-							<a-menu-item key="learningFootprint">学习足迹</a-menu-item>
+							<a-menu-item key="learningFootprint">课程足迹</a-menu-item>
+							<a-menu-item key="resourceFootprint">资源足迹</a-menu-item>
 							<a-menu-item key="passwordRetrieve">密码找回</a-menu-item>
 							<a-menu-item key="activate">激活</a-menu-item>
 							<a-menu-item key="1" @click="outLogin()">退出登录</a-menu-item>

+ 66 - 0
src/views/student/resourceFootprint/index.vue

@@ -0,0 +1,66 @@
+<template>
+	<div>
+		<a-image width="100%" :preview="false" :src="bannerSrc" class="mb-4" />
+		<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 === 'action'">
+						<a-space>
+							<a @click="jumpDetail(record)">详情</a>
+						</a-space>
+					</template>
+				</template>
+			</s-table>
+		</a-card>
+	</div>
+</template>
+
+<script setup name="learningFootprint">
+	import classCentre from '@/api/student/classCentre'
+	import { useRouter } from 'vue-router'
+	import { parseTime } from '@/utils/exam'
+	import bannerSrc from '@/assets/images/banner.jpg'
+	function formatDateTime(val) {
+		if (!val) return ''
+		return parseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
+	}
+
+	const router = useRouter()
+	const columns = [
+		{
+			title: '资源名',
+			dataIndex: 'fileName'
+		},
+		{
+			title: '资源地址',
+			dataIndex: 'filePath'
+		},
+		{
+			title: '资源文件类型',
+			dataIndex: 'extendName'
+		},
+		{
+			title: '创建时间',
+			dataIndex: 'createTime'
+		},
+		{
+			title: '操作',
+			dataIndex: 'action',
+			width: '100px'
+		}
+	]
+	const loadData = (parameter) => {
+		return classCentre.resourceFootprint(parameter).then((data) => {
+			return data
+		})
+	}
+	const jumpDetail = (item) => {
+		router.push({
+			path: '/student/resourceDetails',
+			query: {
+				id: item.id
+			}
+		})
+	}
+</script>