顶部学期切换栏优化

This commit is contained in:
2026-08-27 16:21:42 +08:00
parent 5a81ce54b0
commit b33e6b4a52
+65 -10
View File
@@ -29,6 +29,7 @@
size="small"
filterable
class="semester-select"
popper-class="semester-select-popper"
@change="handleSwitch"
>
<el-option
@@ -223,10 +224,10 @@ export default {
}
&__switch {
background: transparent;
border: none;
padding: 0;
border-radius: 0;
background: rgba(255, 255, 255, 0.09);
border: 1px solid rgba(255, 255, 255, 0.16);
padding: 0 16px;
border-radius: 7px;
height: 36px;
/* 用一层定高 flex 容器包裹 select,彻底隔离其默认行高外溢 */
@@ -248,22 +249,31 @@ export default {
}
::v-deep .el-input__inner {
background: rgba(255, 255, 255, 0.12);
border: 1px solid rgba(255, 255, 255, 0.35);
color: #fff;
background: transparent !important;
border: none !important;
color: #fff !important;
border-radius: 7px;
height: 36px;
padding: 0 12px;
padding: 0;
display: flex;
align-items: center;
&::placeholder {
color: rgba(255, 255, 255, 0.7);
color: rgba(255, 255, 255, 0.7) !important;
}
}
::v-deep .el-input__inner:hover {
border-color: rgba(255, 255, 255, 0.6);
background: transparent !important;
}
/* 去掉 focus 时的蓝色外光晕(Element 默认 box-shadow */
::v-deep .el-input__inner:focus,
::v-deep .el-select .el-input__inner:focus,
::v-deep .el-select .el-input.is-focus .el-input__inner {
border-color: transparent !important;
box-shadow: none !important;
outline: none !important;
}
::v-deep .el-input__icon {
@@ -272,3 +282,48 @@ export default {
}
}
</style>
<style lang="scss">
/* 学期下拉浮层渲染在 body 下,scoped 无法命中,故用非 scoped 样式通过 popper-class 单独定制,
使其与顶部深色栏视觉统一(仅作用于 SemesterBar 的下拉,不影响页面其他 select)。 */
.semester-select-popper {
background: #084c3f !important;
border: 1px solid rgba(255, 255, 255, 0.14) !important;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
border-radius: 7px;
.el-select-dropdown__list {
padding: 4px;
}
.el-select-dropdown__item {
color: rgba(255, 255, 255, 0.85);
border-radius: 5px;
height: 32px;
line-height: 32px;
&.hover,
&:hover {
background: rgba(255, 255, 255, 0.12);
color: #fff;
}
&.selected {
color: #fff;
font-weight: 600;
background: rgba(255, 255, 255, 0.16);
}
/* 关键选项的选中图标保持可见 */
.el-select-dropdown__item span {
color: #fff;
}
}
.el-scrollbar__bar.is-vertical {
> div {
background-color: rgba(255, 255, 255, 0.25);
}
}
}
</style>