diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index ca6fa2c..059261d 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -249,6 +249,7 @@ } } + /* 超管端主区域:与教师端一致改浅色(body.teacher-light-mode 时),保留暗色作为无亮色主题时的兜底 */ .platform-admin-main { height: calc(100vh - 50px); overflow: auto !important; @@ -270,6 +271,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: radial-gradient(circle at 10% 20%, rgba(11, 42, 74, 0.74), transparent 34%), radial-gradient(circle at 88% 8%, rgba(0, 136, 210, 0.24), transparent 28%), linear-gradient(135deg, #02050c 0%, #07101d 52%, #02060d 100%); diff --git a/src/assets/styles/teacher-light.scss b/src/assets/styles/teacher-light.scss index 72d5aea..42c9742 100644 --- a/src/assets/styles/teacher-light.scss +++ b/src/assets/styles/teacher-light.scss @@ -2956,3 +2956,28 @@ body.student-light-mode { font-weight: 600; } } + +/* ============================================================= + * 超管工作台(views/index.vue 引入 admin-theme.scss 的暗色按钮) + * 在浅色模式下改为主题蓝实心白字;#app 前缀压过教师端 outline 规则 + * ============================================================= */ +body.teacher-light-mode #app .school-admin-workbench .el-button--primary, +body.teacher-light-mode #app .school-admin-workbench .el-button--success { + background: #2563eb !important; + border-color: #2563eb !important; + color: #ffffff !important; + box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35) !important; + + &:hover, + &:focus { + background: #1d4ed8 !important; + border-color: #1d4ed8 !important; + color: #ffffff !important; + } + + &.is-disabled { + background: #93c5fd !important; + border-color: #93c5fd !important; + color: #ffffff !important; + } +} 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 @@