van-pull-refresh and van-list shared the same state.loading, causing
the loading spinner to never disappear when API calls completed.
Split into state.refreshing (pull-refresh) and state.loading (list).
Add try/finally to guarantee both states always reset.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add DeptSwitcher that shows department name + switch button when
user is in a multi-department org. Uses Van ActionSheet for
department selection. Integrated into user-profile.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces bold centered date with nav arrows in landscape matrix view
with the same view-toolbar__nav + view-toolbar__range pattern used
by the regular toolbar (lighter font, wrapping text, consistent sizing).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add lastQueryKey to skip redundant API calls when same date range is re-queried
- Run query / query_repeats / subsidiary queries in parallel with Promise.all
- Force-refresh cache after CUD operations via search(true)
- Update searchForSubsidiaries to accept params for independent invocation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
FC mis-calculates column widths when switching from hidden (v-show: none)
to visible. Using v-if forces full remount with correct container dimensions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove FC headerToolbar and its customButtons (prev/today/next/createClazz)
- Add calendar navigation (navGoPrev/Today/Next) reading FC api
- Unified .view-toolbar with nav + range for both calendar and matrix
- calendarDateRange ref updated in datesSet, weekRange computed dispatches per view
- Remove dead FC button CSS
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- .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>
- Remove FullCalendar button focus shadow to match matrix view buttons
- Allow date range text to wrap to 2 lines with smaller font
- Reload calendar data when switching back from matrix view
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Call triggerMatrixSearch() when switching from calendar to matrix view
- Add datesSet early-return in matrix mode to prevent state overwrite
- Add initial mount check for matrix mode
- Align matrix week start to Monday (was Sunday) to match calendar view
The matrix view was not loading data because triggerMatrixSearch was
not called in setViewMode, and FullCalendar's datesSet callback was
overwriting the state date range when switching views. Also the week
started on Sunday vs the calendar's Monday, causing the two views to
display different weeks.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When sudo2() fails (e.g. CI user whose login JWT lacks current_org_id),
fall back to using the auth token as the sudo token instead of propagating
the error. This prevents the route guard from aborting org/department
loading, allowing subsequent API calls (loadMyDepartments, etc.) to proceed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Restores 0910774 rotation structure (external day header + rotated
stage with ml-* layout) and adds missing ml-* CSS rules. Changes
landscape-stage overflow from hidden to visible so viewport can
handle scrolling of time slot content.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matrix landscape now stays in the rotated stage (same as calendar), but the
internal layout is transposed: time slots are columns (overflow-x: auto) and
days are reversed rows, so after 90° rotation the visual result has days
left-to-right across the top and time slots scrollable vertically.
Header (landscape-matrix-header) stays outside rotation for natural fixed
positioning at the top of the landscape viewport.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Wrap entire beforeEach guard in try/catch to prevent crashes from
breaking navigation and leaving a blank page
- Add missing next() at end of try block so all code paths resolve
- Integrate switchDepartment() after loadMyDepartments() when exactly
1 department is available, enabling transparent single-dept flow
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Revert matrix landscape to use the native ml-* template which has the
correct layout (time slots = rows, days = columns, header fixed, body
scrollable). This avoids the scroll-direction issues caused by 90° CSS
rotation. Calendar landscape retains rotation.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add Department type to types.ts
- Add loadMyDepartments / switchDepartment to store/org.ts
- Auto-load departments after org switch in main.ts
- Single-department orgs auto-select default department
- localStorage persistence for CurrentDepartmentId
- Override --clazz-landscape-body-height for matrix to subtract header
height, eliminating white space when scrolling
- Set overflow: visible on landscape-stage for matrix so ml-body content
can overflow the stage
- Add min-width: max-content on matrix container so content overflows
in X direction → becomes vertical scroll after 90° rotation
- ml-body disabled internal scrolling when inside rotated viewport
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matrix landscape now uses the same landscape-stage 90° CSS rotation as
the calendar view. The weekday header (ml-header) is rendered outside
the rotated container so it stays fixed at the top. Matrix body
(ml-body) is inside the rotation and scrollable.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
"排课" = scheduled class instance, "课程" = course content/curriculum.
All 21 instances of incorrect usage were in clazz/tongzhi/user-settings
contexts where the underlying data is a clazz (clazz_id, clazz_name,
is_repeat), not a course.
Affected files: clazz/index.vue (10), tongzhi/index.vue (4),
tongzhi/detail.vue (3), store/clazz.ts (3), user-settings.vue (1).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 排课 and 打卡 tabs were hidden behind v-if="is_teacher",
excluding the SUPERVISOR role from accessing the clazz page.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The query() function in clazz store only filtered for TEACHER and
STUDENT roles, causing SUPERVISOR role to always get an empty list.
Added SUPERVISOR alongside TEACHER to show supervisor's own courses.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously vConsole was only shown to users with a role carrying the
SYS_TESTER label. Extend visibility to users who have the SYS_CAN_SUDO
tag (the "root tag"), since those users also need debug access during
E2E testing and general troubleshooting.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The datesSet callback was formatting dates as "YYYY-MM-DD HH:mm:ss"
but the by_hty_id backend endpoints now use string_to_date which
only accepts "YYYY-MM-DD" format. Caused "trailing input" errors.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Subsidiary courses now only appear in SUPERVISOR mode, not TEACHER mode.
Matrix view shows each subsidiary teacher's courses with a distinct color.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
"试看" (preview) from the storefront should show a read-only view without
admin operations (编辑, 删除, 发布上架, 下架). Add preview=1 query param
to distinguish preview from direct management navigation. Also limit
previewable sections to first one in preview mode, consistent with
non-owner experience.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Only show columns for time slots that have actual courses
- Event blocks show: lesson period, time range, teacher, students
- Horizontal scroll when many slot columns
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove Y-axis time slot rows (was wrong)
- X-axis: hierarchical header (weekday + date | time slot name)
- Body: lane-packed event blocks in each date×slot column
- Show teacher name and student names in each block
- Empty slots show clickable '+' placeholder
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add flex column layout for landscape full-screen fill
- Show teacher name and student names in matrix event blocks
- Refactor useClazzViewModel with makeEvent() helper
- Fix CSS nesting for .slot-row
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add "创建排课" custom button in FullCalendar header toolbar, defaults
to current date/time + 45min duration, guarded by is_teacher check
- Add margin-bottom to 操作记录 cell so it doesn't crowd the footer buttons
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>