diff --git a/src/pages/clazz/components/ClazzMatrixView.vue b/src/pages/clazz/components/ClazzMatrixView.vue index 46523db..b53ddaf 100644 --- a/src/pages/clazz/components/ClazzMatrixView.vue +++ b/src/pages/clazz/components/ClazzMatrixView.vue @@ -1,41 +1,49 @@ @@ -43,36 +51,34 @@ @@ -151,102 +144,135 @@ export default defineComponent({ .matrix-wrapper { width: 100%; height: 100%; - display: flex; - flex-direction: column; - font-size: 0.24rem; - overflow: auto; } -/* ═══ 双行表头 ═══ */ -.matrix-header { - display: flex; - flex-shrink: 0; - position: sticky; - top: 0; - z-index: 2; +.matrix-grid { + display: grid; + grid-template-columns: 1.2rem repeat(4, 1fr); + grid-template-rows: auto repeat(7, 1fr); + height: 100%; + min-height: 100%; +} + +.grid-cell { + min-width: 0; + min-height: 0; + overflow: hidden; +} + +/* ─── Corner ─── */ +.corner-cell { background: #f7f8fa; border-bottom: 1px solid #e8e8e8; + border-right: 1px solid #e8e8e8; +} - .header-col { - flex-shrink: 0; - width: 2.4rem; - text-align: center; - border-left: 1px solid #f0f0f0; - padding: 0.12rem 0.06rem; +/* ─── Header row (time slots) ─── */ +.header-cell { + background: #f7f8fa; + text-align: center; + padding: 0.08rem 0.04rem; + border-bottom: 1px solid #e8e8e8; + border-left: 1px solid #f0f0f0; - &:first-child { border-left: none; } - - .header-date { - font-weight: 600; - font-size: 0.26rem; - line-height: 1.5; - } - .header-time { - font-size: 0.22rem; - color: #888; - line-height: 1.4; - } + .header-label { + font-weight: 600; + font-size: 0.22rem; + line-height: 1.4; + } + .header-time { + font-size: 0.18rem; + color: #888; + line-height: 1.3; } } -/* ═══ 表体 ═══ */ -.matrix-body { +/* ─── Day sidebar ─── */ +.day-cell { display: flex; - flex: 1; - overflow: auto; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 0.04rem; + background: #fafafa; + border-bottom: 1px solid #f0f0f0; + border-right: 1px solid #f0f0f0; - .body-col { - flex-shrink: 0; - width: 2.4rem; - padding: 0.08rem; - border-left: 1px solid #f5f5f5; - display: flex; - flex-direction: column; - gap: 0.06rem; - - &:first-child { border-left: none; } - } - - .event-lane { - display: flex; - gap: 0.06rem; - } - - .event-block { - flex: 1; - padding: 0.06rem 0.1rem; - border-radius: 0.06rem; - cursor: pointer; - overflow: hidden; + .day-name { + font-weight: 600; font-size: 0.22rem; - transition: box-shadow 0.15s; - - &:hover { box-shadow: 0 0.04rem 0.12rem rgba(0,0,0,0.15); } - - &--ghost { opacity: 0.55; border-style: dashed; } - - .ev-title { font-weight: 600; font-size: 0.24rem; } - .ev-time { font-size: 0.2rem; color: #666; } - .ev-teacher { font-size: 0.2rem; color: #555; margin-top: 0.02rem; } - .ev-students { font-size: 0.2rem; color: #777; } + line-height: 1.4; + } + .day-date { + font-size: 0.18rem; + color: #888; + line-height: 1.3; } - .slot-empty { - flex: 1; - display: flex; - align-items: center; - justify-content: center; - min-height: 1rem; - color: #ccc; - font-size: 0.3rem; - cursor: pointer; - border: 1px dashed #eee; - border-radius: 0.06rem; + &--today { + background: #e6f7ff; + .day-name { color: #1890ff; } + } +} - &:hover { - background: #f0f5ff; - color: #3788d8; - } +/* ─── Event cells ─── */ +.event-cell { + padding: 0.03rem; + border-bottom: 1px solid #f5f5f5; + border-left: 1px solid #f5f5f5; +} + +.event-block { + padding: 0.04rem 0.06rem; + border-radius: 0.04rem; + cursor: pointer; + overflow: hidden; + margin-bottom: 0.02rem; + + &:last-child { margin-bottom: 0; } + + .ev-title { + font-weight: 600; + font-size: 0.2rem; + line-height: 1.4; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .ev-teacher { + font-size: 0.16rem; + color: #555; + line-height: 1.3; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .ev-students { + font-size: 0.16rem; + color: #777; + line-height: 1.3; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} + +.cell-empty { + display: flex; + align-items: center; + justify-content: center; + height: 100%; + min-height: 0.5rem; + color: #ccc; + font-size: 0.28rem; + cursor: pointer; + border-radius: 0.04rem; + + &:active { + background: #f0f5ff; + color: #3788d8; } }