fix: move matrix nav/range into own toolbar below view-toolbar, matching calendar layout

- .view-toolbar now only has view toggle (and orient button for matrix)
- Matrix nav buttons (‹ 本周 ›) and date range moved to .matrix-toolbar inside matrix-page
- Calender keeps FC's built-in headerToolbar — both views now share same layout pattern

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 09:09:23 +08:00
parent fc8d7de10b
commit e93f844a61
+77 -68
View File
@@ -1,15 +1,6 @@
<template>
<div class="clazz-page">
<div class="view-toolbar" :class="{ 'view-toolbar--landscape': isLandscape }">
<div class="view-toolbar__main">
<div class="view-toolbar__nav" v-if="viewMode === 'matrix'">
<van-button size="small" @click="matrixGoPrev"></van-button>
<van-button size="small" @click="matrixGoToday">本周</van-button>
<van-button size="small" @click="matrixGoNext"></van-button>
</div>
<span class="view-toolbar__range" v-if="viewMode === 'matrix'">{{ matrixWeekRange }}</span>
<span class="view-toolbar__range" v-else>日历周视图</span>
</div>
<div class="view-toolbar__actions">
<div v-if="viewMode === 'matrix'" class="view-toolbar__orient">
<van-button size="small" plain @click="isLandscape = !isLandscape">
@@ -89,28 +80,38 @@
<FullCalendar ref="calendar" :options="options" />
</div>
</div>
<div v-show="viewMode === 'matrix'" class="matrix-container">
<div v-if="teacherList.length > 1" class="matrix-teacher-filter">
<van-tag
:color="selectedTeacherIds.length === 0 ? '#1989fa' : '#e8e8e8'"
:text-color="selectedTeacherIds.length === 0 ? '#fff' : '#666'"
@click="selectedTeacherIds = []"
>全部</van-tag>
<van-tag
v-for="t in teacherList" :key="t.id"
:color="selectedTeacherIds.length === 0 || selectedTeacherIds.includes(t.id) ? t.color : '#e8e8e8'"
:text-color="selectedTeacherIds.length === 0 || selectedTeacherIds.includes(t.id) ? '#fff' : '#999'"
@click="toggleTeacherFilter(t.id)"
>{{ t.name }}</van-tag>
<div v-show="viewMode === 'matrix'" class="matrix-page">
<div class="matrix-toolbar">
<div class="matrix-toolbar__nav">
<van-button size="small" @click="matrixGoPrev"></van-button>
<van-button size="small" @click="matrixGoToday">本周</van-button>
<van-button size="small" @click="matrixGoNext"></van-button>
</div>
<span class="matrix-toolbar__range">{{ matrixWeekRange }}</span>
</div>
<div class="matrix-container">
<div v-if="teacherList.length > 1" class="matrix-teacher-filter">
<van-tag
:color="selectedTeacherIds.length === 0 ? '#1989fa' : '#e8e8e8'"
:text-color="selectedTeacherIds.length === 0 ? '#fff' : '#666'"
@click="selectedTeacherIds = []"
>全部</van-tag>
<van-tag
v-for="t in teacherList" :key="t.id"
:color="selectedTeacherIds.length === 0 || selectedTeacherIds.includes(t.id) ? t.color : '#e8e8e8'"
:text-color="selectedTeacherIds.length === 0 || selectedTeacherIds.includes(t.id) ? '#fff' : '#999'"
@click="toggleTeacherFilter(t.id)"
>{{ t.name }}</van-tag>
</div>
<ClazzMatrixView
:events="filteredMatrixEvents"
:week-start="matrixWeekStart"
:week-end="matrixWeekEnd"
:landscape="false"
@cell-click="onMatrixCellClick"
@event-click="onMatrixEventClick"
/>
</div>
<ClazzMatrixView
:events="filteredMatrixEvents"
:week-start="matrixWeekStart"
:week-end="matrixWeekEnd"
:landscape="false"
@cell-click="onMatrixCellClick"
@event-click="onMatrixEventClick"
/>
</div>
<div class="footer-subsidiary" ref="footer" v-if="subsidiaries.length > 0">
<van-tag type="primary" :color="isTagPlain(item) ? 'rgba(204, 204, 204, 0.5)' : item.color" :text-color="isTagPlain(item) ? item.color : '#333'" @click="toggleTeacherView(item.to_user_id)" v-for="item in subsidiaries">{{ item.to_user_realname }}</van-tag>
@@ -1363,9 +1364,7 @@ export default defineComponent({
.view-toolbar {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.08rem;
justify-content: center;
padding: 0.08rem 0.12rem;
background: #fff;
border-bottom: 1px solid #f0f0f0;
@@ -1374,47 +1373,12 @@ export default defineComponent({
display: none;
}
&__main {
min-width: 0;
display: flex;
align-items: center;
gap: 0.08rem;
}
&__actions {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 0.08rem;
}
&__range {
min-width: 0;
font-size: 0.2rem;
color: #666;
line-height: 1.3;
white-space: normal;
overflow: visible;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
&__nav {
display: flex;
align-items: center;
gap: 0.08rem;
.van-button--small {
height: 0.5rem;
min-width: 0.62rem;
padding: 0 0.15rem;
font-size: 0.24rem;
white-space: nowrap;
}
}
&__orient {
.van-button--small {
height: 0.5rem;
@@ -1444,6 +1408,51 @@ export default defineComponent({
}
}
/* ═══ 矩阵视图内置工具栏(与日历 FC headerToolbar 对齐) ═══ */
.matrix-page {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.matrix-toolbar {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 0.08rem;
padding: 0.08rem 0.12rem;
background: #fff;
border-bottom: 1px solid #f0f0f0;
&__nav {
display: flex;
align-items: center;
gap: 0.08rem;
.van-button--small {
height: 0.5rem;
min-width: 0.62rem;
padding: 0 0.15rem;
font-size: 0.24rem;
white-space: nowrap;
}
}
&__range {
min-width: 0;
font-size: 0.2rem;
color: #666;
line-height: 1.3;
white-space: normal;
overflow: visible;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.landscape-shell {
--landscape-toolbar-height: 0.68rem;
--clazz-landscape-body-height: calc(100dvh - var(--landscape-toolbar-height));