@ -10,14 +10,16 @@
< div : class = "[{ 'has-logo': showLogo }, { 'student-sidebar-shell': isCourseStyleSidebar }, { 'is-student-nav': isStudentRole }, { 'is-collapse': isCollapse }]" :style ="sidebarStyle" >
< div : class = "[{ 'has-logo': showLogo }, { 'student-sidebar-shell': isCourseStyleSidebar }, { 'is-student-nav': isStudentRole }, { 'is-collapse': isCollapse }]" :style ="sidebarStyle" >
<!-- < logo v -if = " showLogo " :collapse ="isCollapse" / > -- >
<!-- < logo v -if = " showLogo " :collapse ="isCollapse" / > -- >
< template v-if ="isCourseStyleSidebar" >
< template v-if ="isCourseStyleSidebar" >
<!-- 右缘折叠把手 : 贴侧边栏右缘垂直居中 , 点击收起 / 展开 -- >
<!-- 右缘折叠把手 : 贴侧边栏右缘垂直居中 , 点击收起 / 展开
常驻显示 — — 此前按 「 教师角色 + 学生实训页路由 」 做条件渲染 ,
学生端切到非实训页 ( 首页 / AI 智能助手 / 学情分析 / 考试 / 实验报告 / BI 等 ) 时
按钮会凭空消失 , 同一角色在不同页面表现不一致 , 这里去掉条件固定常显 -- >
< button
< button
v - if = "isTeacherRole || isStudentTrainingWorkspace"
class = "course-sidebar-toggle"
class = "course-sidebar-toggle"
type = "button"
type = "button"
: aria - label = "isCollapse ? '展开导航' : '收起导航'"
: aria - label = "isCollapse ? '展开导航' : '收起导航'"
: title = "isCollapse ? '展开导航' : '收起导航'"
: title = "isCollapse ? '展开导航' : '收起导航'"
@ click = "toggleCourseSidebar"
@ click . stop = "toggleCourseSidebar"
>
>
< el -icon class = "toggle-arrow toggle-arrow--left" > < ArrowLeftBold / > < / e l - i c o n >
< el -icon class = "toggle-arrow toggle-arrow--left" > < ArrowLeftBold / > < / e l - i c o n >
< el -icon class = "toggle-arrow toggle-arrow--right" > < ArrowRightBold / > < / e l - i c o n >
< el -icon class = "toggle-arrow toggle-arrow--right" > < ArrowRightBold / > < / e l - i c o n >
@ -26,7 +28,7 @@
<!-- 学生端 : el - menu / el - sub - menu , 分组默认展开 、 可折叠 -- >
<!-- 学生端 : el - menu / el - sub - menu , 分组默认展开 、 可折叠 -- >
< el -scrollbar v-if ="isStudentRole" class="student-sidebar-scroll" wrap-class="scrollbar-wrapper" >
< el -scrollbar v-if ="isStudentRole" class="student-sidebar-scroll" wrap-class="scrollbar-wrapper" >
< el -menu
< el -menu
: key = " studentMenuKey"
: key = " `${ studentMenuKey}-${isCollapse ? 'collapsed' : 'expanded'}` "
class = "student-course-menu"
class = "student-course-menu"
mode = "vertical"
mode = "vertical"
: default - active = "activeMenu"
: default - active = "activeMenu"
@ -339,9 +341,6 @@ const isCollapse = computed(() => !appStore.sidebar.opened);
const isTeacherRole = computed ( ( ) => Number ( userStore . userInfo . roleId ) === 3 ) ;
const isTeacherRole = computed ( ( ) => Number ( userStore . userInfo . roleId ) === 3 ) ;
const isStudentRole = computed ( ( ) => ! [ 1 , 2 , 3 ] . includes ( Number ( userStore . userInfo . roleId ) ) ) ;
const isStudentRole = computed ( ( ) => ! [ 1 , 2 , 3 ] . includes ( Number ( userStore . userInfo . roleId ) ) ) ;
const isCourseStyleSidebar = computed ( ( ) => isStudentRole . value || isTeacherRole . value ) ;
const isCourseStyleSidebar = computed ( ( ) => isStudentRole . value || isTeacherRole . value ) ;
const isStudentTrainingWorkspace = computed ( ( ) => isStudentRole . value && [
"/foundation/" , "/demand/" , "/product/" , "/channel/" , "/assessment/" , "/test/" , "/comprehensive/" ,
] . some ( ( prefix ) => route . path . startsWith ( prefix ) ) ) ;
function toggleCourseSidebar ( ) {
function toggleCourseSidebar ( ) {
appStore . toggleSideBar ( false ) ;
appStore . toggleSideBar ( false ) ;
}
}