Browse Source

学生端路由处理

canghailong 7 months ago
parent
commit
30b2b06c5d
3 changed files with 87 additions and 83 deletions
  1. 68 0
      src/router/student.js
  2. 1 1
      src/router/systemRouter.js
  3. 18 82
      src/views/portal/components/Header.vue

+ 68 - 0
src/router/student.js

@@ -1,4 +1,8 @@
 const forum = [
+	{
+		path: '/',
+		redirect: '/portal/resourceCenter'
+	},
 	{
 		path: '/student/classCentre',
 		hide: true,
@@ -6,6 +10,70 @@ const forum = [
 		meta: {
 			title: '课程中心详情'
 		}
+	},
+	{
+		path: '/student/paper',
+		name: 'studentPaper',
+		component: () => import('@/views/student/paper/index.vue'),
+		meta: {
+			title: '学生试卷'
+		}
+	},
+	{
+		path: '/student/questionError',
+		name: 'questionError',
+		component: () => import('@/views/student/question-error/index.vue'),
+		meta: {
+			title: '错题本'
+		}
+	},
+	{
+		path: '/student/do',
+		name: 'studentDo',
+		component: () => import('@/views/student/exam/paper/do.vue'),
+		meta: {
+			title: '试卷答题' //从学生试卷列表进入
+		}
+	},
+	{
+		path: '/student/read',
+		name: 'studentRead',
+		component: () => import('@/views/student/exam/paper/read.vue'),
+		meta: {
+			title: '试卷查看' //学生端,老师端都可用
+		}
+	},
+	{
+		path: '/exm/question',
+		name: 'exmQuestion',
+		component: () => import('@/views/exm/question/index.vue'),
+		meta: {
+			title: '题目列表'
+		}
+	},
+	{
+		path: '/exm/exampaper',
+		name: 'exmExampaper',
+		component: () => import('@/views/exm/exampaper/index.vue'),
+		meta: {
+			title: '试卷列表'
+		}
+	},
+	{
+		path: '/exm/questionnaireManagement',
+		name: 'exmQuestionnaireManagement',
+		component: () => import('@/views/exm/questionnaireManagement/index.vue'),
+		meta: {
+			title: '问卷管理'
+		}
+	},
+	{
+		path: '/exm/examinationManagement',
+		name: 'exmExaminationManagement',
+		component: () => import('@/views/exm/examinationManagement/index.vue'),
+		meta: {
+			title: '考试管理'
+		}
 	}
 ]
 export default forum

+ 1 - 1
src/router/systemRouter.js

@@ -7,7 +7,7 @@ import routerUtil from '@/utils/routerUtil'
 const routes = [
 	{
 		name: 'layout',
-		path: '/',
+		path: '/layoutIndex',
 		component: () => import('@/layout/index.vue'),
 		redirect: tool.data.get('MENU') ? routerUtil.getIndexMenu(tool.data.get('MENU')).path : config.DASHBOARD_URL,
 		children: []

+ 18 - 82
src/views/portal/components/Header.vue

@@ -1,89 +1,20 @@
 <template>
 	<div>
-		<!-- //根据平台不同传不同参0后台(管理员)1老师2学生   eduIdentity
+		<!-- //根据平台不同传不同参 0后台(管理员)1老师 2学生   eduIdentity
 		{{userInfo.eduIdentity}}
 		管理员 -->
-		<div v-if="userInfo.eduIdentity == 0" style="display: flex; width: 100vw; justify-content: space-between; align-items: center">
-			<div style="display: flex; padding-left: 10%">
-				<div style="width: 120px; height: 55px; background-color: brown" />
-				<a-menu v-model:selectedKeys="current" mode="horizontal" theme="light" style="line-height: 55px">
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">资源管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">全院课程</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">全院开课</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">数据挖掘</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">镜像控制台</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">专业</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">院系</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">组织机构</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">后台管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">资源任务分配</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">统计分析</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">论坛</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">站内信</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">公告发布</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">管理员登录</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceManagement">密码找回</a-menu-item>
-				</a-menu>
-			</div>
-
-			<div class="header-right">
-				<div style="display: flex">
-					<UserOutlined :style="{ fontSize: '16px', color: '#00000083' }" />
-					<div style="width: 5px"></div>
-					<span style="font-size: 12px; color: #00000083">登录</span>
-				</div>
-				<div style="width: 20px"></div>
-				<div style="display: flex">
-					<span style="font-size: 12px; color: #00000083">注册</span>
-				</div>
-			</div>
-		</div>
-		<div v-if="userInfo.eduIdentity == 1" style="display: flex; width: 100vw; justify-content: space-between; align-items: center">
-			<div style="display: flex; padding-left: 10%">
-				<div style="width: 120px; height: 55px; background-color: brown" />
-				<a-menu v-model:selectedKeys="current" mode="horizontal" theme="light" style="line-height: 55px">
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/resourceCenter">资源中心</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/personalResources">个人资源</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">课程管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">问答管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="classManagement">班级管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">考试管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">问卷管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">试题管理</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">统计分析</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">个人中心</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">论坛</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">站内信</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="announcementManagement">课程公告发布</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">登录</a-menu-item>
-					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">密码找回</a-menu-item>
-				</a-menu>
-			</div>
-
-			<div class="header-right">
-				<div style="display: flex">
-					<UserOutlined :style="{ fontSize: '16px', color: '#00000083' }" />
-					<div style="width: 5px"></div>
-					<span style="font-size: 12px; color: #00000083">登录</span>
-				</div>
-				<div style="width: 20px"></div>
-				<div style="display: flex">
-					<span style="font-size: 12px; color: #00000083">注册</span>
-				</div>
-			</div>
-		</div>
 		<div v-if="userInfo.eduIdentity == 2" class="fcbc">
 			<div class="headerBtn">
-				<div style="width: 120px; background-color: brown;" ></div>
+				<div style="width: 120px; background-color: brown"></div>
 				<a-menu v-model:selectedKeys="current" mode="horizontal">
 					<a-menu-item key="portal/resourceCenter">资源中心</a-menu-item>
 					<a-menu-item key="portal/courseCenter">课程中心</a-menu-item>
 					<a-menu-item key="portal/resourceManagement">课程详情</a-menu-item>
 					<a-sub-menu key="myList">
 						<template #title>我的</template>
-						<a-menu-item key="portal/personalResources">我的考试</a-menu-item>
+						<a-menu-item key="student/paper">我的考试</a-menu-item>
 						<a-menu-item key="portal/courseManagement">我的作业</a-menu-item>
-						<a-menu-item key="portal/courseManagement">调查问卷</a-menu-item>
+						<a-menu-item key="exm/questionnaireManagement">调查问卷</a-menu-item>
 					</a-sub-menu>
 				</a-menu>
 			</div>
@@ -93,21 +24,20 @@
 					<template #overlay>
 						<a-menu>
 							<a-menu-item key="portal/courseManagement">个人中心</a-menu-item>
-							<a-menu-item key="portal/courseManagement">论坛</a-menu-item>
+							<a-menu-item key="forum" @click="jump('/forum')">论坛</a-menu-item>
 							<a-menu-item key="portal/courseManagement">站内信</a-menu-item>
 							<a-menu-item key="portal/courseManagement">课程公告</a-menu-item>
 							<a-menu-item key="portal/personalResources">学习足迹</a-menu-item>
-							<a-menu-item key="portal/courseManagement">登录</a-menu-item>
+							<a-menu-item key="slogin" @click="jump('/slogin')">登录</a-menu-item>
 							<a-menu-item key="portal/courseManagement">密码找回</a-menu-item>
 							<a-menu-item key="outLogin" @click="handleUser('outLogin')">退出登陆</a-menu-item>
 						</a-menu>
 					</template>
 				</a-dropdown>
-				<div class="ml-2" @click="slogin">登录</div>
-				<div class="ml-2">注册</div>
+				<div class="ml-2 cur" @click="slogin">登录</div>
 			</div>
 		</div>
-		<div class="line" style=""></div>
+		<div class="line"></div>
 	</div>
 </template>
 
@@ -133,11 +63,16 @@
 			}
 		}
 	)
-	const slogin = () =>{
+	const slogin = () => {
 		router.push({
 			path: '/slogin'
 		})
 	}
+	const jump = (url) => {
+		router.push({
+			path: url
+		})
+	}
 	const handleUser = (key) => {
 		if (key === 'outLogin') {
 			Modal.confirm({
@@ -173,7 +108,6 @@
 			})
 		}
 	}
-
 </script>
 
 <style scoped lang="less">
@@ -186,7 +120,7 @@
 	.headerBtn {
 		display: flex;
 		padding-left: 10%;
-		flex:1;
+		flex: 1;
 		:deep(.ant-menu-horizontal) {
 			line-height: 55px;
 		}
@@ -203,7 +137,9 @@
 		align-items: center;
 		background-color: #fff;
 	}
-	
+	.cur {
+		cursor: pointer;
+	}
 	.line {
 		width: 100%;
 		height: 0.25px;