refactor web

This commit is contained in:
bridge
2025-11-21 01:52:53 +08:00
parent c7a8cdd420
commit fcc67199ef
6 changed files with 31 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -22,6 +22,18 @@ const filteredEvents = computed(() => {
const emptyEventMessage = computed(() => (
filterValue.value === 'all' ? '暂无事件' : '该修士暂无事件'
))
function formatEventDate(event: { year?: number; month?: number; monthStamp?: number }) {
if (typeof event.year === 'number' && typeof event.month === 'number') {
return `${event.year}${event.month}`
}
if (typeof event.monthStamp === 'number') {
const year = Math.floor(event.monthStamp / 12)
const month = event.monthStamp % 12 || 12
return `${year}${month}`
}
return '未知'
}
</script>
<template>
@@ -38,7 +50,8 @@ const emptyEventMessage = computed(() => (
<div v-if="filteredEvents.length === 0" class="empty">{{ emptyEventMessage }}</div>
<div v-else class="event-list">
<div v-for="event in filteredEvents" :key="event.id" class="event-item">
{{ event.content || event.text }}
<div class="event-date">{{ formatEventDate(event) }}</div>
<div class="event-content">{{ event.content || event.text }}</div>
</div>
</div>
</section>
@@ -78,18 +91,31 @@ const emptyEventMessage = computed(() => (
}
.event-item {
font-size: 14px;
line-height: 1.6;
color: #ddd;
display: flex;
gap: 8px;
padding: 6px 0;
border-bottom: 1px solid #2a2a2a;
white-space: pre-line;
}
.event-item:last-child {
border-bottom: none;
}
.event-date {
flex: 0 0 25%;
font-size: 12px;
color: #999;
white-space: nowrap;
}
.event-content {
flex: 1;
font-size: 14px;
line-height: 1.6;
color: #ddd;
white-space: pre-line;
}
.empty {
padding: 20px;
text-align: center;