于添 3 ヶ月 前
コミット
faeeaa7338

+ 4 - 0
src/api/student/classCentre.js

@@ -101,5 +101,9 @@ export default {
 	//未读数查询
 	UnreadNum(data) {
 		return request('disk/userread/getCount', data, 'get')
+	},
+	//未读数查询
+	deleteBurialPoint(data) {
+		return request('disk/coursestudentburialpoint/deleteBurialPoint', data, 'get')
 	}
 }

+ 8 - 1
src/router/student.js

@@ -49,7 +49,7 @@ const routes = [
 				path: '/learningFootprint',
 				component: () => import('@/views/student/learningFootprint/index.vue'),
 				meta: {
-					title: '课程足迹'
+					title: '学习足迹'
 				}
 			},
 			{
@@ -101,6 +101,13 @@ const routes = [
 					title: '课程收藏'
 				}
 			},
+			{
+				path: 'link',
+				component: () => import('@/views/student/link/index.vue'),
+				meta: {
+					title: '超链接'
+				}
+			},
 			{
 				path: 'paper/:examType(\\d+)',
 				component: () => import('@/views/student/paper/index.vue'),

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

@@ -16,6 +16,7 @@
 						<a-menu-item key="student/paper/4">我的作业</a-menu-item>
 						<a-menu-item key="student/classCollect">课程收藏</a-menu-item>
 					</a-sub-menu>
+					<a-menu-item key="student/link">超链接</a-menu-item>
 				</a-menu>
 			</div>
 			<div class="header-right">
@@ -36,7 +37,7 @@
 							</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>

+ 5 - 3
src/views/resourceCenter/components/ResourceList.vue

@@ -7,7 +7,7 @@
 					<span style="font-weight: bold; font-size: 20px" class="ml-2">共计 {{ total }} 个资源</span>
 				</div>
 				<div style="width: 20px"></div>
-				<TabSwitcher @selectTab="selectTab" />
+				<TabSwitcherNew @selectTab="selectTab" />
 			</div>
 			<div>
 				<a-range-picker v-model:value="timeArr" format="YYYY-MM-DD" @change="dateChange" class="mr-3" />
@@ -102,7 +102,7 @@
 <script setup>
 	import { ref } from 'vue'
 	import allResource from '@/assets/images/allResource.png'
-	import TabSwitcher from './TabSwitcher.vue'
+	import TabSwitcherNew from './TabSwitcherNew.vue'
 	import { list } from '@/api/portal'
 	import tool from '@/utils/tool'
 	import EventBus from '@/utils/EventBus'
@@ -128,8 +128,10 @@
 	const selectTab = (key) => {
 		if (key == 'latest') {
 			tabKey.value = 0
-		} else {
+		} else if(key == 'hot' ){
 			tabKey.value = 1
+		} else if(key == 'new' ){
+			tabKey.value = 2
 		}
 		currentPage.sortflag = tabKey.value
 		currentPage.current = 1

+ 50 - 0
src/views/resourceCenter/components/TabSwitcherNew.vue

@@ -0,0 +1,50 @@
+<template>
+	<div class="tab-switcher">
+		<div :class="{ active: selectedTab === 'latest' }" @click="selectTab('latest')"><span style="font-size: 12px">最新</span></div>
+		<div :class="{ active: selectedTab === 'hot' }" @click="selectTab('hot')"><span style="font-size: 12px">热门</span></div>
+		<div :class="{ active: selectedTab === 'new' }" @click="selectTab('new')"><span style="font-size: 12px">素材库</span></div>
+	</div>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	const emit = defineEmits(['selectTab'])
+	const selectedTab = ref('latest')
+
+	const selectTab = (tab) => {
+		if (selectedTab.value != tab) {
+			selectedTab.value = tab
+			emit('selectTab', tab)
+		}
+	}
+</script>
+
+<style scoped>
+	.tab-switcher {
+		display: flex;
+		border-radius: 5px;
+		border: 1px solid #1e90ff;
+		overflow: hidden;
+	}
+
+	.tab-switcher div {
+		padding: 1px 25px;
+		background-color: #ffffff;
+
+		cursor: pointer;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.tab-switcher div.active {
+		background-color: #1e90ff;
+		color: white;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.tab-switcher div:not(:last-child) {
+	}
+</style>

+ 13 - 6
src/views/student/learningFootprint/index.vue

@@ -10,7 +10,8 @@
 					<template v-if="column.dataIndex == 'type'">{{ typeName(record.type) }}</template>
 					<template v-if="column.dataIndex === 'action'">
 						<a-space>
-							<a @click="jumpDetail(record)">详情</a>
+<!--							<a @click="jumpDetail(record)">详情</a>-->
+							<a @click="deleteItem(record)">删除</a>
 						</a-space>
 					</template>
 				</template>
@@ -97,12 +98,13 @@
 			title: '方式',
 			dataIndex: 'type'
 		},
-		// {
-		// 	title: '操作',
-		// 	dataIndex: 'action',
-		// 	width: '100px'
-		// }
+		{
+			title: '操作',
+			dataIndex: 'action',
+			width: '100px'
+		}
 	]
+	const table = ref(null)
 	const loadData = (parameter) => {
 		return classCentre.footprintClassList(parameter).then((data) => {
 			return data
@@ -116,4 +118,9 @@
 			}
 		})
 	}
+	const deleteItem = (item) => {
+		classCentre.deleteBurialPoint({id :item.id }).then((res)=>{
+			table.value.refresh()
+		})
+	}
 </script>

+ 11 - 0
src/views/student/link/index.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped lang="less">
+
+</style>

+ 236 - 0
src/views/student/link/listViewTeacher.vue

@@ -0,0 +1,236 @@
+<template>
+
+		<a-table
+			ref="table"
+			:columns="columns"
+			:data-source="dataSources"
+			:row-key="(record) => record.courseId"
+			bordered
+			:expand-row-by-click="true"
+			:pagination="false"
+			size="small"
+		>
+			<template #bodyCell="{ column, text, record }">
+<!--				<template v-if="column.dataIndex === 'createTime'">-->
+<!--					<span>{{ formatDateTime(record.createTime) }}</span>-->
+<!--				</template>-->
+
+<!--				<template v-if="column.dataIndex === 'action'">-->
+<!--	&lt;!&ndash;				<a-button size="small" @click="handleDetail(record)" style="margin-right: 5px">详情</a-button>&ndash;&gt;-->
+<!--	&lt;!&ndash;				<a-button size="small" @click="handleEdit(record)" style="margin-right: 5px">编辑</a-button>&ndash;&gt;-->
+<!--					<a-popover v-model:visible="popoverVisibles[record.collegeId]" title="确定删除?" trigger="click">-->
+<!--						<template #content>-->
+<!--							<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定-->
+<!--							</a-button>-->
+<!--							<a-button @click="()=>{	popoverVisibles[record.collegeId] = false}">取消</a-button>-->
+<!--						</template>-->
+<!--						&lt;!&ndash;					<a-button size="small" style="margin-right: 5px">选择</a-button>&ndash;&gt;-->
+<!--						<a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>-->
+<!--					</a-popover>-->
+<!--				</template>-->
+			</template>
+		</a-table>
+		<div style="display: flex; width: 100%; justify-content: flex-end; margin-top: 10px">
+			<a-pagination
+				v-model:current="pagination.current"
+				v-model:pageSize="pagination.size"
+				:total="total"
+				show-less-items
+				@change="handlerChange"
+			/>
+		</div>
+
+</template>
+
+<script setup>
+import tool from '@/utils/tool'
+import {ref, onMounted} from 'vue'
+import {useRouter} from 'vue-router'
+import {parseTime} from "@/utils/exam";
+
+const router = useRouter()
+//网络
+// import { overviewLearningProgressApi } from '@/api/statisticalAnalysis/overviewLearningProgress'
+const emit = defineEmits(['handleEdit'])
+//发布按钮状态
+const releaseVisible = ref(false)
+const loading = ref(false) // 列表loading
+const dataSources = ref([])
+const popoverVisible = ref({})
+const popoverVisibles = ref({})
+const visible = ref(false)
+const formState = ref({
+	name: '',
+	loacl: ''
+}) // 列表loading
+const columns = [
+	{
+		title: '课程课时名称',
+		dataIndex: 'courseHourName',
+		// sorter: true,
+		width: '15%'
+	},
+	{
+		title: '学生名称',
+		dataIndex: 'userName',
+		// sorter: true,
+		width: '15%'
+	},
+	{
+		title: '观看次数',
+		dataIndex: 'viewCount',
+		// sorter: true,
+		width: '15%'
+	},
+	{
+		title: '课时id',
+		dataIndex: 'hourId',
+		// sorter: true,
+		width: '15%'
+	},
+	{
+		title: '学生id',
+		dataIndex: 'userId',
+		// sorter: true,
+		width: '15%'
+	},
+	{
+		title: '创建日期',
+		dataIndex: 'createDate',
+		// sorter: true,
+		width: '12%'
+	},
+]
+// tool.formatTimestamp()
+const formatDateTime = (val) => {
+	if (!val) return ''
+	return parseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
+}
+const formatTimestamp = (time) => {
+	return tool.formatTimestamp(time)
+}
+const total = ref(0)
+const pagination = ref({
+	size: 10,
+	current: 1,
+})
+// const onChangeCurrent = (current) => {
+// 	router.push({
+// 		path: '/' + current
+// 	})
+// }
+const handlerChange = (page, pageSize) => {
+	console.log('分页参数', page, pageSize)
+	// pagination.value.size = pageSize
+	// pagination.value.current = page
+
+	getList()
+}
+const handleOk = () => {
+	visible.value = false
+}
+const open = (id) => {
+	visible.value = true
+	pagination.value.size = 10
+	pagination.value.current = 1
+	getList(id)
+}
+const handleDetail = (record) => {
+	console.log('查看详情', record)
+	router.push({
+		path: '/portal/courseDetails',
+		query: {
+			id: record.courseId
+		}
+	})
+	// 在这里添加查看详情的逻辑
+}
+
+// 编辑按钮点击事件
+const handleEdit = (record) => {
+	console.log('编辑记录', record)
+	// 在这里添加编辑记录的逻辑
+
+	emit('handleEdit', record)
+}
+
+// 上架按钮点击事件
+const handleShelf = (record,num) => {
+	console.log('上架记录', record)
+	popoverVisible.value[record.collegeId] = false
+	// 在这里添加上架记录的逻辑
+	// {
+	// 	"courseId": "1948183431150227458",
+	// 	"putawayStatus": 1
+	// }
+	// updateCourseStatus({courseId : record.courseId,putawayStatus : num}).then((res)=>{
+	// 	getList()
+	// })
+
+}
+
+// 删除按钮点击事件
+const handleDelete = (record) => {
+	console.log('删除记录', record)
+	// 在这里添加删除记录的逻辑
+}
+const getList = (id) => {
+	const params = {
+		courseId: id,
+		startTime: undefined,
+		endTime: undefined,
+		size : pagination.value.size,
+		current : pagination.value.current
+	}
+	overviewLearningProgressApi.getStudyDetailCourseView(params).then((data)=>{
+		console.log('获取列表', data)
+		dataSources.value = data.records
+		pagination.value.current = data.current
+		pagination.value.size = data.size
+		total.value = data.total
+	})
+}
+const setList = (search) => {
+	console.log('获取列表 setList',search)
+	// courseName: '',
+	// 	collegeId: '',
+	// 	majorId: '',
+	// 	courseType: '',
+	// 	loacl: []
+	formState.value = search
+	pagination.value.current = 1
+	list({...pagination.value, ...formState.value}).then((data) => {
+		if (data.code == 200) {
+			dataSources.value = data.data.records
+			pagination.value.current = data.data.current
+			pagination.value.size = data.data.size
+			total.value = data.data.total
+		}
+		// data.records
+	})
+}
+
+// 重置按钮点击事件
+onMounted(() => {
+	// getListData()
+	// getList()
+})
+
+
+// watch(
+// 	() => dataSources.value,
+// 	(newVal, oldVal) => {
+// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
+// 	},
+// 	{ deep: true, immediate: true }
+// )
+defineExpose({
+	open
+})
+</script>
+
+<style scoped>
+.desc p {
+	margin-bottom: 1em;
+}
+</style>