From 65efadc343659c3558c088bee284adaa76ef3f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B2=85?= <907037276@qq.com> Date: Tue, 29 Sep 2026 10:59:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E7=AB=AF=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=BB=9F=E4=B8=80=E4=B8=BA=E6=95=99=E5=B8=88=E7=AB=AF?= =?UTF-8?q?=E6=B5=85=E8=89=B2=E9=A3=8E=E6=A0=BC=EF=BC=9A=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=A4=8D=E7=94=A8teacher-light-mode?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8EteacherLayout=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=BD=9C=E7=94=A8=E5=9F=9F=EF=BC=8C=E8=B6=85=E7=AE=A1=E4=B8=BB?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E8=83=8C=E6=99=AF=E6=B5=85=E8=89=B2=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=B7=A5=E4=BD=9C=E5=8F=B0=E9=A6=96=E9=A1=B5=E4=B8=8E?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86=E6=9A=97?= =?UTF-8?q?=E8=89=B2=E7=A7=91=E6=8A=80=E9=A3=8E=E6=89=B9=E9=87=8F=E8=BD=AC?= =?UTF-8?q?=E6=B5=85=E8=89=B2(=E5=AF=BC=E8=88=AA=E6=9D=A1=E4=B8=BA?= =?UTF-8?q?=E5=85=A8=E7=AB=AF=E7=BB=9F=E4=B8=80=E5=93=81=E7=89=8C=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=9D=E6=8C=81=E4=B8=8D=E5=8F=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/sidebar.scss | 17 + src/layout/index.vue | 9 +- src/views/index.vue | 106 +++--- src/views/schoolAdmin/trainingTask/index.vue | 374 +++++++++---------- 4 files changed, 262 insertions(+), 244 deletions(-) diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index 573fb5b..f2adddd 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -248,6 +248,7 @@ } } + /* 超管端主区域:与教师端一致改浅色(body.teacher-light-mode 时),保留暗色作为无亮色主题时的兜底 */ .platform-admin-main { height: calc(100vh - 50px); overflow: auto !important; @@ -272,6 +273,22 @@ } } + /* @at-root 跳出 #app 并提升特异性(压过 #app .platform-admin-main 的 ID 权重深色规则) */ + @at-root body.teacher-light-mode #app .platform-admin-main { + background: + radial-gradient(circle at 12% 18%, rgba(30, 136, 229, 0.05), transparent 34%), + radial-gradient(circle at 78% 6%, rgba(66, 165, 245, 0.04), transparent 28%), + linear-gradient(135deg, #f7fafd 0%, #eef4fb 48%, #f5f8fc 100%) !important; + + &::-webkit-scrollbar-track { + background: rgba(30, 60, 100, 0.06); + } + + &::-webkit-scrollbar-thumb { + background: rgba(59, 130, 246, 0.35); + } + } + .studentLayout, .teacherLayout { background: diff --git a/src/layout/index.vue b/src/layout/index.vue index 69ceb26..a1906cb 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -33,14 +33,14 @@ const fixedHeader = computed(() => settingsStore.fixedHeader); const useTopNavbarOnly = computed(() => role.value === 1 || role.value === 2); // 教师端纯白极简:顶部标题栏与内容区同一画布;学生端墨黑 -const titleBgColor = computed(() => (role.value === 3 ? "#ffffff" : role.value === 4 ? "#1f2937" : "#072048")); +const titleBgColor = computed(() => (role.value === 3 || role.value === 1 ? "#ffffff" : role.value === 4 ? "#1f2937" : "#072048")); const classObj = computed(() => ({ hideSidebar: !sidebar.value.opened, openSidebar: sidebar.value.opened, withoutAnimation: sidebar.value.withoutAnimation, mobile: device.value === "mobile", - teacherLayout: role.value === 3, + teacherLayout: role.value === 3 || role.value === 1, studentLayout: role.value !== 1 && role.value !== 2 && role.value !== 3, })); @@ -68,11 +68,12 @@ function setLayout() { settingRef.value.openSetting(); } -// 教师端亮色模式标识:挂在 body 上,使 teleport 到 body 的弹层(下拉、日期选择器、弹窗等)也能命中亮色样式 +// 亮色模式标识:挂在 body 上,使 teleport 到 body 的弹层(下拉、日期选择器、弹窗等)也能命中亮色样式 +// 平台管理员(超管端)与教师共用同一套浅色主题 const TEACHER_LIGHT_CLASS = "teacher-light-mode"; const STUDENT_LIGHT_CLASS = "student-light-mode"; watchEffect(() => { - if (role.value === 3) { + if (role.value === 3 || role.value === 1) { document.body.classList.add(TEACHER_LIGHT_CLASS); document.body.classList.remove(STUDENT_LIGHT_CLASS); } else if (role.value === 4) { diff --git a/src/views/index.vue b/src/views/index.vue index 5128a5d..b2eb471 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -7,18 +7,18 @@