From 36ce59c4ab0ee2b15fb79899d6ae2dd31afa48a7 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Tue, 21 Jul 2026 14:34:23 +0800 Subject: [PATCH] refactor: migrate frontend event page --- frontend/src/views/Calendar.vue | 14 +- frontend/src/views/CalendarEvent.vue | 673 ++++++++++++++++++++++++++- 2 files changed, 677 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/Calendar.vue b/frontend/src/views/Calendar.vue index 04eed4a..f236ef5 100644 --- a/frontend/src/views/Calendar.vue +++ b/frontend/src/views/Calendar.vue @@ -81,7 +81,7 @@ const windowRange = computed(() => { return { startTs, endTs, year, month1 } }) -// Analyse phase: build the 42 cells and expand every event (loop expansion + +// Analyse phase: build the 6 * 7 cells and expand every event (loop expansion + // multi-day splitting). Deliberately does NOT read the visibility maps so it // stays cached across visibility toggles. const expandedCells = computed(() => { @@ -89,10 +89,10 @@ const expandedCells = computed(() => { const owned = ownedUuids.value const myTz = myTimezone.value - // build the 42 day cells + // build the 6 * 7 day cells const cells: CalendarCell[] = [] const iter = new Date(startTs * 60000) - for (let i = 0; i < 42; i++) { + for (let i = 0; i < 6 * 7; i++) { cells.push({ month: iter.getMonth() + 1, day: iter.getDate(), @@ -119,17 +119,19 @@ const expandedCells = computed(() => { if (typeof result === 'undefined') continue const loopText = resolveLoopRules4Text(item[8], item[5], item[7]) const tzWarn = myTz !== item[7] - // lock icon = event is in one of MY collections (belongTo). (Legacy + // lock icon = event is NOT in one of MY collections (belongTo). (Legacy // mistakenly keyed this by the event uuid; fixed per migration decision.) - const isLocked = owned.has(item[1]) + const isLocked = !owned.has(item[1]) for (const range of result) { const it0 = range[0] const it1 = range[1] + // try get event belong to which cell const eventDateTime = new Date(it0 * 60000) let count = Math.floor((it0 - startTs) / DAY1_SPAN) let exitFlag = false - while (count < 42) { + // then split event + while (count < 6 * 7) { const eventItem: ScheduleEventItem = { uuid: item[0], belongTo: item[1], diff --git a/frontend/src/views/CalendarEvent.vue b/frontend/src/views/CalendarEvent.vue index 7cfaba0..e5ee660 100644 --- a/frontend/src/views/CalendarEvent.vue +++ b/frontend/src/views/CalendarEvent.vue @@ -1,8 +1,673 @@ - + - +