From 77d5fc373b3bd0c6eb038b7fb6c0592a0ebefde7 Mon Sep 17 00:00:00 2001 From: qinzhenpen Date: Thu, 17 Sep 2026 18:00:44 +0800 Subject: [PATCH] =?UTF-8?q?style(teacher-end):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=95=99=E5=B8=88=E7=AB=AF=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 给页面内所有普通操作按钮添加type="primary"统一风格 2. 重构全局scss按钮样式,区分实心按钮、文字按钮、朴素按钮的样式规则 3. 调整表格操作列按钮为文字按钮样式,统一交互体验 --- src/assets/styles/teacher-light.scss | 214 ++++++++++++--------- src/views/teacherEnd/class/index.vue | 6 +- src/views/teacherEnd/defaultTask/index.vue | 2 +- src/views/teacherEnd/exam/index.vue | 8 +- src/views/teacherEnd/student/index.vue | 10 +- 5 files changed, 141 insertions(+), 99 deletions(-) diff --git a/src/assets/styles/teacher-light.scss b/src/assets/styles/teacher-light.scss index 17b7d79..42c0cf0 100644 --- a/src/assets/styles/teacher-light.scss +++ b/src/assets/styles/teacher-light.scss @@ -260,19 +260,28 @@ box-shadow: none; transform: none; - // 默认按钮 - &:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info):not(.is-text):not(.is-link) { - background-color: #ffffff !important; - border-color: #c9d8e8 !important; - color: #2c4a6a !important; + // 默认按钮(无 type):统一蓝实心 + 白字,和 primary 完全一致 + &:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info):not(.is-text):not(.is-link):not(.is-plain) { + background-color: #1e88e5 !important; + border-color: #1e88e5 !important; + color: #ffffff !important; + box-shadow: none !important; &:hover, &:focus { - background-color: #f0f7ff !important; - border-color: #1e88e5 !important; - color: #1e88e5 !important; - box-shadow: none !important; - transform: none !important; + background-color: #42a5f5 !important; + border-color: #42a5f5 !important; + color: #ffffff !important; + box-shadow: 0 4px 12px rgba(30, 136, 229, 0.22) !important; + } + + &.is-disabled, + &.is-disabled:hover { + background-color: #e8f3fe !important; + border-color: #9cc8ef !important; + color: #64b5f6 !important; + opacity: 1; + cursor: not-allowed !important; } } @@ -813,73 +822,28 @@ margin-right: 2px; } - // 把文字按钮(is-text / is-link)重置为实心 + // 表格操作列的文字按钮(is-text / is-link):透明底 + 彩色字 + // 颜色由 Section 6 / Section 16 的 is-text 规则控制,这里只保证透明度 & 尺寸 &.is-text, &.is-link { - &.el-button--primary { - background-color: #1e88e5 !important; - border-color: #1e88e5 !important; - color: #ffffff !important; - - &:hover, - &:focus { - background-color: #42a5f5 !important; - border-color: #42a5f5 !important; - color: #ffffff !important; - } - } - - &.el-button--success { - background-color: #2ba471 !important; - border-color: #2ba471 !important; - color: #ffffff !important; - - &:hover, - &:focus { - background-color: #3cbb85 !important; - border-color: #3cbb85 !important; - color: #ffffff !important; - } - } - - &.el-button--warning { - background-color: #e8a33d !important; - border-color: #e8a33d !important; - color: #ffffff !important; - - &:hover, - &:focus { - background-color: #f2b45a !important; - border-color: #f2b45a !important; - color: #ffffff !important; - } - } - - &.el-button--danger { - background-color: #e05a5a !important; - border-color: #e05a5a !important; - color: #ffffff !important; + background: transparent !important; + background-image: none !important; + background-color: transparent !important; + border-color: transparent !important; + box-shadow: none !important; + font-weight: 500 !important; - &:hover, - &:focus { - background-color: #ec7272 !important; - border-color: #ec7272 !important; - color: #ffffff !important; - } + &:hover:not(.is-disabled) { + background: rgba(30, 136, 229, 0.08) !important; + box-shadow: none !important; } - // 无类型的文字按钮 -> 白底描边 - &:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info) { - background-color: #ffffff !important; - border-color: #c9d8e8 !important; - color: #2c4a6a !important; - - &:hover, - &:focus { - background-color: #f0f7ff !important; - border-color: #1e88e5 !important; - color: #1e88e5 !important; - } + &.is-disabled { + background: #f0f7ff !important; + background-image: none !important; + background-color: #f0f7ff !important; + border-color: transparent !important; + cursor: not-allowed !important; } } @@ -1940,25 +1904,103 @@ body.teacher-light-mode { color: #8aa8c4 !important; } - // 按钮暗黑渐变 - .el-button--primary { - border-color: #1976d2 !important; - background: linear-gradient(135deg, #1e88e5, #1565c0) !important; - box-shadow: 0 4px 12px rgba(30, 136, 229, 0.22) !important; - } + // 按钮(AppMain.vue .teacher-main 暗黑按钮覆盖,优先级高于 Section 6) + // 实心按钮(非 text/link/plain) + .el-button:not(.is-text):not(.is-link):not(.is-plain) { + // primary 实心 + &.el-button--primary { + border-color: #1e88e5 !important; + background: #1e88e5 !important; + color: #ffffff !important; + box-shadow: none !important; + + &:hover, &:focus { + background: #42a5f5 !important; + border-color: #42a5f5 !important; + color: #ffffff !important; + } + + &.is-disabled { + background: #e8f3fe !important; + border-color: #9cc8ef !important; + color: #64b5f6 !important; + } + } + + // success 实心 + &.el-button--success { + border-color: #2ba471 !important; + background: #2ba471 !important; + color: #ffffff !important; + &:hover { background: #3cbb85 !important; border-color: #3cbb85 !important; } + &.is-disabled { background: #e5f7ee !important; border-color: #b0dfc5 !important; color: #6bbf95 !important; } + } + + // warning 实心 + &.el-button--warning { + border-color: #e8a33d !important; + background: #e8a33d !important; + color: #ffffff !important; + &:hover { background: #f2b45a !important; border-color: #f2b45a !important; } + &.is-disabled { background: #fdf3e2 !important; border-color: #f3d3a0 !important; color: #d4a059 !important; } + } + + // danger 实心 + &.el-button--danger { + border-color: #e05a5a !important; + background: #e05a5a !important; + color: #ffffff !important; + &:hover { background: #ec7272 !important; border-color: #ec7272 !important; } + &.is-disabled { background: #fdecec !important; border-color: #f3b0b0 !important; color: #d98a8a !important; } + } - .el-button--warning { - border-color: #e6a23c !important; - background: #e6a23c !important; - color: #ffffff !important; + // default(无 type):蓝实心 + 白字,和 primary 完全一致 + &:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info) { + background: #1e88e5 !important; + border-color: #1e88e5 !important; + color: #ffffff !important; + &:hover { background: #42a5f5 !important; border-color: #42a5f5 !important; color: #ffffff !important; } + &.is-disabled { background: #e8f3fe !important; border-color: #9cc8ef !important; color: #64b5f6 !important; cursor: not-allowed !important; } + } } - .el-button.is-text { - color: #1976d2 !important; + // text/link 文字按钮:透明底 + 彩色字(操作列用) + .el-button.is-text, + .el-button.is-link { + background: transparent !important; + background-image: none !important; + background-color: transparent !important; + border-color: transparent !important; + box-shadow: none !important; + + &.el-button--primary { color: #1976d2 !important; } + &.el-button--success { color: #1a7d4f !important; } + &.el-button--warning { color: #b36a14 !important; } + &.el-button--danger { color: #d04545 !important; } + &.el-button--info { color: #5e6b7c !important; } + + &:hover:not(.is-disabled) { + background: rgba(30, 136, 229, 0.08) !important; + box-shadow: none !important; + } + + &.is-disabled { + background: #f0f7ff !important; + background-image: none !important; + background-color: #f0f7ff !important; + border-color: transparent !important; + color: #9cc8ef !important; + cursor: not-allowed !important; + } } - .el-button--danger.is-text { - color: #f56c6c !important; + // plain 朴素按钮:浅色底 + 深字 + .el-button.is-plain { + &.el-button--primary { background: #e8f3fe !important; border-color: #9cc8ef !important; color: #1565c0 !important; &:hover { background: #1e88e5 !important; color: #fff !important; border-color: #1e88e5 !important; } } + &.el-button--success { background: #e5f7ee !important; border-color: #b0dfc5 !important; color: #1a7d4f !important; &:hover { background: #2ba471 !important; color: #fff !important; border-color: #2ba471 !important; } } + &.el-button--warning { background: #fdf3e2 !important; border-color: #f3d3a0 !important; color: #b36a14 !important; &:hover { background: #e8a33d !important; color: #fff !important; border-color: #e8a33d !important; } } + &.el-button--danger { background: #fdecec !important; border-color: #f3b0b0 !important; color: #c0392b !important; &:hover { background: #e05a5a !important; color: #fff !important; border-color: #e05a5a !important; } } + &.is-disabled { opacity: 0.55; } } // 表格 CSS 变量(暗黑 table 的根源) diff --git a/src/views/teacherEnd/class/index.vue b/src/views/teacherEnd/class/index.vue index 498b010..0043fc1 100644 --- a/src/views/teacherEnd/class/index.vue +++ b/src/views/teacherEnd/class/index.vue @@ -1,4 +1,4 @@ -