This commit is contained in:
2026-05-06 16:47:17 +08:00
parent 49785004aa
commit 3fcc98f6f6
6 changed files with 103 additions and 13 deletions
+2 -1
View File
@@ -638,6 +638,7 @@
"remark_placeholder": "Enter remark",
"event_save_success": "Event saved successfully",
"event_delete_success": "Event deleted successfully",
"confirm_delete_event": "Are you sure you want to delete this event?"
"confirm_delete_event": "Are you sure you want to delete this event?",
"is_public_event": "Public Event"
}
}
+2 -1
View File
@@ -638,6 +638,7 @@
"remark_placeholder": "请输入备注",
"event_save_success": "事件保存成功",
"event_delete_success": "事件删除成功",
"confirm_delete_event": "确定要删除此事件吗?"
"confirm_delete_event": "确定要删除此事件吗?",
"is_public_event": "公共日程"
}
}
@@ -37,6 +37,7 @@ const eventData = ref({
startDate: "",
endDate: "",
color: "#3788d9",
isPublic: false,
isEditing: false,
isEditable: false,
})
@@ -77,13 +78,14 @@ function closeEventModal() {
showModal.value = false
}
function openEventModal(dateStr, dataEnd, id = 0, title = "", color = "#3788d9", isEditing = false, isEditable = true) {
function openEventModal(dateStr, dataEnd, id = 0, title = "", color = "#3788d9", isPublic = false, isEditing = false, isEditable = true) {
eventData.value = {
id: id,
title: title,
startDate: dateStr,
endDate: dataEnd,
color: color,
isPublic: isPublic,
isEditing: isEditing,
isEditable: isEditable,
}
@@ -97,6 +99,7 @@ function editEvent(info) {
parseInt(info.event.id),
info.event.title,
info.event.backgroundColor,
info.event.extendedProps?.isPublic || false,
true,
info.event.durationEditable,
)
@@ -142,6 +145,7 @@ async function saveEvent() {
: DateUtils.toRealEnd(eventData.value.endDate),
),
schedule_type: scheduleType,
is_public: eventData.value.isPublic,
})
} else {
result = await calendarApi.addEvent({
@@ -154,6 +158,7 @@ async function saveEvent() {
: DateUtils.toRealEnd(eventData.value.endDate),
),
schedule_type: scheduleType,
is_public: eventData.value.isPublic,
})
}
@@ -563,6 +568,20 @@ onMounted(() => {
</div>
</div>
</div>
<!-- 公共日程开关 -->
<div class="mb-4 flex items-center justify-between">
<span class="text-gray-700">{{ t('calendar.is_public_event') }}</span>
<label class="relative inline-flex items-center cursor-pointer">
<input
v-model="eventData.isPublic"
type="checkbox"
class="sr-only peer"
:disabled="!eventData.isEditable"
/>
<div class="w-11 h-6 bg-gray-300 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-cyan-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"></div>
</label>
</div>
</div>
<!-- 底部固定 -->