|
|
|
|
@ -30,7 +30,7 @@
|
|
|
|
|
:title="getEventTooltip(event, new Date(event.segStartISO))"
|
|
|
|
|
@click.stop="openCreateModal('editor', event.id)"
|
|
|
|
|
>
|
|
|
|
|
{{ event.title }}
|
|
|
|
|
{{ getEventDisplayText(event) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -370,11 +370,12 @@ import { getToken } from '@/utils/auth';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getEventTooltip(event, date) {
|
|
|
|
|
const displayTitle = this.getEventDisplayText(event)
|
|
|
|
|
const startDate = new Date(event.start_time)
|
|
|
|
|
|
|
|
|
|
// 如果没有end_time,只显示事件标题和开始时间
|
|
|
|
|
if (!event.end_time) {
|
|
|
|
|
return `${event.title}\n时间:${this.formatDateTime(event.start_time)}`
|
|
|
|
|
return `${displayTitle}\n时间:${this.formatDateTime(event.start_time)}`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const endDate = new Date(event.end_time)
|
|
|
|
|
@ -384,9 +385,9 @@ import { getToken } from '@/utils/auth';
|
|
|
|
|
startDate.getFullYear() !== endDate.getFullYear()
|
|
|
|
|
|
|
|
|
|
if (isMultiDay) {
|
|
|
|
|
return `${event.title}\n时间:${this.formatDateTime(event.start_time)} ~ ${this.formatDateTime(event.end_time)}`
|
|
|
|
|
return `${displayTitle}\n时间:${this.formatDateTime(event.start_time)} ~ ${this.formatDateTime(event.end_time)}`
|
|
|
|
|
} else {
|
|
|
|
|
return `${event.title}\n时间:${this.formatDateTime(event.start_time)} ~ ${this.formatDateTime(event.end_time)}`
|
|
|
|
|
return `${displayTitle}\n时间:${this.formatDateTime(event.start_time)} ~ ${this.formatDateTime(event.end_time)}`
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getCalendarSegments() {
|
|
|
|
|
@ -397,7 +398,9 @@ import { getToken } from '@/utils/auth';
|
|
|
|
|
const currentMonth = this.calendarDate.getMonth()
|
|
|
|
|
const currentYear = this.calendarDate.getFullYear()
|
|
|
|
|
const monthStart = new Date(currentYear, currentMonth, 1)
|
|
|
|
|
monthStart.setHours(0, 0, 0, 0)
|
|
|
|
|
const monthEnd = new Date(currentYear, currentMonth + 1, 0)
|
|
|
|
|
monthEnd.setHours(23, 59, 59, 999)
|
|
|
|
|
|
|
|
|
|
function getWeekStart(date) {
|
|
|
|
|
const d = new Date(date)
|
|
|
|
|
@ -651,6 +654,14 @@ import { getToken } from '@/utils/auth';
|
|
|
|
|
|
|
|
|
|
return {}
|
|
|
|
|
},
|
|
|
|
|
getEventDisplayText(event) {
|
|
|
|
|
const title = event.title || ''
|
|
|
|
|
const address = (event.address || '').trim()
|
|
|
|
|
if (address) {
|
|
|
|
|
return `${address}-${title}`.trim()
|
|
|
|
|
}
|
|
|
|
|
return title
|
|
|
|
|
},
|
|
|
|
|
getEventDisplayTitle(event, date) {
|
|
|
|
|
const startDate = new Date(event.start_time)
|
|
|
|
|
const currentDate = new Date(date)
|
|
|
|
|
|