调整路由

This commit is contained in:
lyc 2024-11-05 00:39:06 +08:00
parent 2ca3d89d1c
commit 71e6b74dd4
3 changed files with 90 additions and 64 deletions

View File

@ -81,13 +81,13 @@ const headerMenus = [
name: '教学工作台', name: '教学工作台',
id: 2, id: 2,
icon: 'icon-gongzuotai', icon: 'icon-gongzuotai',
path: '/home' path: '/desktop'
}, },
{ {
name: '资源中心', name: '资源中心',
id: 3, id: 3,
icon: 'icon-kechengziyuan1', icon: 'icon-kechengziyuan1',
path: '/resource' path: '/resource/index'
}, },
] ]
@ -96,13 +96,13 @@ const sideBottomMenu = [
name: '算力', name: '算力',
id: 4, id: 4,
icon: 'icon-yanhouke-shengyinyichang', icon: 'icon-yanhouke-shengyinyichang',
path: '/hashrate' path: '/hashrate/index'
}, },
{ {
name: '设置', name: '设置',
id: 5, id: 5,
icon: 'icon-set', icon: 'icon-set',
path: '/setting' path: '/setting/index'
}, },
] ]

View File

@ -58,23 +58,40 @@ export const constantRoutes = [
}, },
] ]
}, },
...toolRouters
]
const dynamicRoutes = [
{ {
path: '/', path: '/',
component: Layout, component: Layout,
redirect: '/home', redirect: '/desktop',
meta: { title: '教学工作台' }, meta: { title: '教学工作台' },
children: [ children: [
{ {
path: '/home', path: 'desktop',
component: () => import('@/views/desktop/index.vue'), component: () => import('@/views/desktop/index.vue'),
name: 'desktop', name: 'desktop',
meta: { title: '教学工作台' } meta: { title: '教学工作台' }
}, },
{ {
path: '/resource', path: 'standardanalysis',
component: () => import('@/views/resource/index.vue'), component: () => import('@/views/teach/standardAnalysis/index.vue'),
name: 'resource', name: 'standardanalysis',
meta: { title: '资源库' } meta: { title: '课标分析', showBread: true }
},
{
path: 'textbookAnalysis',
component: () => import('@/views/textbookAnalysis/index.vue'),
name: 'textbookAnalysis',
meta: { title: '教材分析', showBread: true }
},
{
path: 'examReport',
component: () => import('@/views/examReport/index.vue'),
name: 'examReport',
meta: { title: '考试分析', showBread: true }
}, },
{ {
path: 'prepare', path: 'prepare',
@ -82,24 +99,33 @@ export const constantRoutes = [
name: 'prepare', name: 'prepare',
meta: { title: '教学实践', showBread: true } meta: { title: '教学实践', showBread: true }
}, },
{
path: 'newClassTask',
component: () => import('@/views/classTask/newClassTask.vue'),
name: 'newClassCorrect',
meta: { title: '作业设计', showBread: true }
},
{
path: 'classTaskAssign',
component: () => import('@/views/classTask/classTaskAssign.vue'),
name: 'classTaskAssign',
meta: { title: '作业布置', showBread: true }
},
{
path: 'classTask',
component: () => import('@/views/classTask/classTask.vue'),
name: 'classCorrect',
meta: { title: '作业批改', showBread: true }
},
{ {
path: '/teach', path: '/teach',
component: () => import('@/views/teach/index.vue'), component: () => import('@/views/teach/index.vue'),
name: 'teach', name: 'teach',
meta: { title: '授课' } meta: { title: '授课' }
}, },
{
path: '/standardanalysis',
component: () => import('@/views/teach/standardAnalysis/index.vue'),
name: 'standardanalysis',
meta: { title: '课标分析', showBread: true }
},
{
path: '/textbookAnalysis',
component: () => import('@/views/textbookAnalysis/index.vue'),
name: 'textbookAnalysis',
meta: { title: '教材分析', showBread: true }
},
{ {
path: '/profile', path: '/profile',
component: () => import('@/views/profile/index.vue'), component: () => import('@/views/profile/index.vue'),
@ -125,50 +151,50 @@ export const constantRoutes = [
name: 'class', name: 'class',
meta: { title: '班级中心' } meta: { title: '班级中心' }
}, },
{
path: '/classTaskAssign', ]
component: () => import('@/views/classTask/classTaskAssign.vue'),
name: 'classTaskAssign',
meta: { title: '作业布置', showBread: true }
}, },
{ {
path: '/classTask', path: '/resource',
component: () => import('@/views/classTask/classTask.vue'), component: Layout,
name: 'classCorrect', children: [
meta: { title: '作业批改', showBread: true }
},
{ {
path: '/newClassTask', path: 'index',
component: () => import('@/views/classTask/newClassTask.vue'), component: () => import('@/views/resource/index.vue'),
name: 'newClassCorrect', name: 'resource',
meta: { title: '作业设计', showBread: true } meta: { title: '资源库' },
},
{
path: '/examReport',
component: () => import('@/views/examReport/index.vue'),
name: 'examReport',
meta: { title: '考试分析', showBread: true }
},
{
path: '/hashrate',
component: () => import('@/views/hashrate/index.vue'),
name: 'hashrate',
meta: { title: '算力' }
},
{
path: '/setting',
component: () => import('@/views/setting/index.vue'),
name: 'setting',
meta: { title: '设置' }
} }
] ]
}, },
...toolRouters {
path: '/hashrate',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/hashrate/index.vue'),
name: 'hashrate',
meta: { title: '算力' },
}
]
},
{
path: '/setting',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/setting/index.vue'),
name: 'setting',
meta: { title: '设置' },
}
]
}
] ]
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(), //hash 模式 history: createWebHashHistory(), //hash 模式
routes: constantRoutes routes: [...constantRoutes,...dynamicRoutes]
}) })
export default router export default router

View File

@ -70,19 +70,19 @@ const menuList = [{
{ {
name: '课标分析', name: '课标分析',
icon: '#icon-kebiao', icon: '#icon-kebiao',
path: '/standardanalysis?', path: 'standardanalysis?',
id: '1-1' id: '1-1'
}, },
{ {
name: '教材分析', name: '教材分析',
icon: '#icon-jiaocaixuanze', icon: '#icon-jiaocaixuanze',
path: '/textbookAnalysis', path: 'textbookAnalysis',
id: '1-2' id: '1-2'
}, },
{ {
name: '考试分析', name: '考试分析',
icon: '#icon-kaoshi', icon: '#icon-kaoshi',
path: '/examReport', path: 'examReport',
id: '1-3' id: '1-3'
}, },
{ {
@ -115,7 +115,7 @@ const menuList = [{
icon: '#icon-zuoyesheji', icon: '#icon-zuoyesheji',
// isOuter: true, // isOuter: true,
// path: '/teaching/classtaskassign?titleName=&openDialog=newClassTask', // path: '/teaching/classtaskassign?titleName=&openDialog=newClassTask',
path: '/newClassTask', path: 'newClassTask',
id: '2-1' id: '2-1'
}, },
{ {
@ -123,13 +123,13 @@ const menuList = [{
icon: '#icon-zuoyebuzhi', icon: '#icon-zuoyebuzhi',
// isOuter: true, // isOuter: true,
// path: '/teaching/classtaskassign?titleName=', // path: '/teaching/classtaskassign?titleName=',
path: '/classTaskAssign', path: 'classTaskAssign',
id: '2-2' id: '2-2'
}, },
{ {
name: '作业批改', name: '作业批改',
icon: '#icon-zuoyepigai', icon: '#icon-zuoyepigai',
path: '/classTask', path: 'classTask',
id: '2-3' id: '2-3'
}, },
{ {