perf: 日历日、周视图选择添加任务会进入all day

This commit is contained in:
kuaifan 2021-12-22 21:37:07 +08:00
parent 8a7186c1b1
commit 6d9237c399

View File

@ -30,6 +30,7 @@
:template="calendarTemplate" :template="calendarTemplate"
:calendars="calendarList" :calendars="calendarList"
:schedules="list" :schedules="list"
:taskView="false"
@beforeCreateSchedule="onBeforeCreateSchedule" @beforeCreateSchedule="onBeforeCreateSchedule"
@beforeClickSchedule="onBeforeClickSchedule" @beforeClickSchedule="onBeforeClickSchedule"
@beforeUpdateSchedule="onBeforeUpdateSchedule" @beforeUpdateSchedule="onBeforeUpdateSchedule"
@ -87,12 +88,14 @@ export default {
return data.owner; return data.owner;
}) })
return datas.map(data => { return datas.map(data => {
let isAllday = $A.rightExists(data.start_at, "00:00:00") && $A.rightExists(data.end_at, "23:59:59")
let task = { let task = {
id: data.id, id: data.id,
calendarId: String(data.project_id), calendarId: String(data.project_id),
title: data.name, title: data.name,
body: data.desc, body: data.desc,
category: 'allday', isAllDay: isAllday,
category: isAllday ? 'allday' : 'time',
start: $A.Date(data.start_at).toISOString(), start: $A.Date(data.start_at).toISOString(),
end: $A.Date(data.end_at).toISOString(), end: $A.Date(data.end_at).toISOString(),
color: "#515a6e", color: "#515a6e",