From 71e6b74dd4356c9713bff9ba8204c178c20268e0 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 5 Nov 2024 00:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/layout/components/Aside.vue | 8 +- src/renderer/src/router/index.js | 134 +++++++++++-------- src/renderer/src/views/desktop/index.vue | 12 +- 3 files changed, 90 insertions(+), 64 deletions(-) diff --git a/src/renderer/src/layout/components/Aside.vue b/src/renderer/src/layout/components/Aside.vue index 75880b5..3fb8a8b 100644 --- a/src/renderer/src/layout/components/Aside.vue +++ b/src/renderer/src/layout/components/Aside.vue @@ -81,13 +81,13 @@ const headerMenus = [ name: '教学工作台', id: 2, icon: 'icon-gongzuotai', - path: '/home' + path: '/desktop' }, { name: '资源中心', id: 3, icon: 'icon-kechengziyuan1', - path: '/resource' + path: '/resource/index' }, ] @@ -96,13 +96,13 @@ const sideBottomMenu = [ name: '算力', id: 4, icon: 'icon-yanhouke-shengyinyichang', - path: '/hashrate' + path: '/hashrate/index' }, { name: '设置', id: 5, icon: 'icon-set', - path: '/setting' + path: '/setting/index' }, ] diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index b976cf5..afdc4e8 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -58,23 +58,40 @@ export const constantRoutes = [ }, ] }, + + ...toolRouters +] + +const dynamicRoutes = [ { path: '/', component: Layout, - redirect: '/home', + redirect: '/desktop', meta: { title: '教学工作台' }, children: [ { - path: '/home', + path: 'desktop', component: () => import('@/views/desktop/index.vue'), name: 'desktop', meta: { title: '教学工作台' } }, { - path: '/resource', - component: () => import('@/views/resource/index.vue'), - name: 'resource', - 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: 'examReport', + component: () => import('@/views/examReport/index.vue'), + name: 'examReport', + meta: { title: '考试分析', showBread: true } }, { path: 'prepare', @@ -82,24 +99,33 @@ export const constantRoutes = [ name: 'prepare', 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', component: () => import('@/views/teach/index.vue'), name: 'teach', 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', component: () => import('@/views/profile/index.vue'), @@ -125,50 +151,50 @@ export const constantRoutes = [ name: 'class', meta: { title: '班级中心' } }, + + ] + }, + { + path: '/resource', + component: Layout, + children: [ { - 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: '/newClassTask', - component: () => import('@/views/classTask/newClassTask.vue'), - name: 'newClassCorrect', - meta: { title: '作业设计', showBread: true } - }, - { - 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: '设置' } + path: 'index', + component: () => import('@/views/resource/index.vue'), + name: 'resource', + 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({ history: createWebHashHistory(), //hash 模式 - routes: constantRoutes + routes: [...constantRoutes,...dynamicRoutes] }) export default router diff --git a/src/renderer/src/views/desktop/index.vue b/src/renderer/src/views/desktop/index.vue index 5931567..609694d 100644 --- a/src/renderer/src/views/desktop/index.vue +++ b/src/renderer/src/views/desktop/index.vue @@ -70,19 +70,19 @@ const menuList = [{ { name: '课标分析', icon: '#icon-kebiao', - path: '/standardanalysis?', + path: 'standardanalysis?', id: '1-1' }, { name: '教材分析', icon: '#icon-jiaocaixuanze', - path: '/textbookAnalysis', + path: 'textbookAnalysis', id: '1-2' }, { name: '考试分析', icon: '#icon-kaoshi', - path: '/examReport', + path: 'examReport', id: '1-3' }, { @@ -115,7 +115,7 @@ const menuList = [{ icon: '#icon-zuoyesheji', // isOuter: true, // path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask', - path: '/newClassTask', + path: 'newClassTask', id: '2-1' }, { @@ -123,13 +123,13 @@ const menuList = [{ icon: '#icon-zuoyebuzhi', // isOuter: true, // path: '/teaching/classtaskassign?titleName=作业布置', - path: '/classTaskAssign', + path: 'classTaskAssign', id: '2-2' }, { name: '作业批改', icon: '#icon-zuoyepigai', - path: '/classTask', + path: 'classTask', id: '2-3' }, {