big update
This commit is contained in:
parent
d53ebf9ecd
commit
5c7e93fcc7
26 changed files with 1890 additions and 423 deletions
|
|
@ -196,14 +196,17 @@
|
|||
|
||||
<!-- Meeting Details Modal -->
|
||||
<MeetingDetailsModal
|
||||
v-model:visible="showMeetingModal"
|
||||
:visible="showMeetingModal"
|
||||
@update:visible="showMeetingModal = $event"
|
||||
:meeting="selectedMeeting"
|
||||
@close="closeMeetingModal"
|
||||
@meeting-updated="handleMeetingUpdated"
|
||||
/>
|
||||
|
||||
<!-- New Meeting Modal -->
|
||||
<BidMeetingModal
|
||||
v-model:visible="showNewMeetingModal"
|
||||
:visible="showNewMeetingModal"
|
||||
@update:visible="showNewMeetingModal = $event"
|
||||
:initial-address="queryAddress"
|
||||
@confirm="handleNewMeetingConfirm"
|
||||
@cancel="handleNewMeetingCancel"
|
||||
|
|
@ -228,6 +231,7 @@ const notificationStore = useNotificationStore();
|
|||
// Query parameters
|
||||
const isNewMode = computed(() => route.query.new === "true");
|
||||
const queryAddress = computed(() => route.query.address || "");
|
||||
const queryMeetingName = computed(() => route.query.name || "");
|
||||
|
||||
// Date management
|
||||
const currentWeekStart = ref(new Date());
|
||||
|
|
@ -459,6 +463,12 @@ const closeMeetingModal = () => {
|
|||
selectedMeeting.value = null;
|
||||
};
|
||||
|
||||
const handleMeetingUpdated = async () => {
|
||||
// Reload both scheduled and unscheduled meetings
|
||||
await loadWeekMeetings();
|
||||
await loadUnscheduledMeetings();
|
||||
};
|
||||
|
||||
const openNewMeetingModal = () => {
|
||||
showNewMeetingModal.value = true;
|
||||
};
|
||||
|
|
@ -470,7 +480,7 @@ const handleNewMeetingConfirm = async (meetingData) => {
|
|||
loadingStore.setLoading(true);
|
||||
|
||||
// Create the meeting via API
|
||||
const result = await Api.createBidMeeting(meetingData.address, meetingData.notes || "");
|
||||
const result = await Api.createBidMeeting(meetingData);
|
||||
|
||||
showNewMeetingModal.value = false;
|
||||
|
||||
|
|
@ -955,6 +965,100 @@ const navigateToSpecificMeeting = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
const findAndDisplayMeetingByName = async () => {
|
||||
if (!queryMeetingName.value) return;
|
||||
|
||||
console.log("Searching for meeting:", queryMeetingName.value);
|
||||
|
||||
// First, search in the unscheduled meetings list
|
||||
const unscheduledMeeting = unscheduledMeetings.value.find(
|
||||
(m) => m.name === queryMeetingName.value
|
||||
);
|
||||
|
||||
if (unscheduledMeeting) {
|
||||
console.log("Found in unscheduled meetings:", unscheduledMeeting);
|
||||
// Meeting is unscheduled, just show notification
|
||||
notificationStore.addNotification({
|
||||
type: "info",
|
||||
title: "Unscheduled Meeting",
|
||||
message: "This meeting has not been scheduled yet. Drag it to a time slot to schedule it.",
|
||||
duration: 6000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Not in unscheduled list, fetch from API to get schedule details
|
||||
try {
|
||||
loadingStore.setLoading(true);
|
||||
const meetingData = await Api.getBidMeeting(queryMeetingName.value);
|
||||
|
||||
if (!meetingData) {
|
||||
notificationStore.addNotification({
|
||||
type: "error",
|
||||
title: "Meeting Not Found",
|
||||
message: "Could not find the specified meeting.",
|
||||
duration: 5000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if meeting is scheduled
|
||||
if (!meetingData.startTime) {
|
||||
notificationStore.addNotification({
|
||||
type: "info",
|
||||
title: "Unscheduled Meeting",
|
||||
message: "This meeting has not been scheduled yet.",
|
||||
duration: 5000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the start time to get date and time
|
||||
const startDateTime = new Date(meetingData.startTime);
|
||||
const meetingDate = startDateTime.toISOString().split("T")[0];
|
||||
const meetingTime = `${startDateTime.getHours().toString().padStart(2, "0")}:${startDateTime.getMinutes().toString().padStart(2, "0")}`;
|
||||
|
||||
// Navigate to the week containing this meeting
|
||||
currentWeekStart.value = new Date(
|
||||
startDateTime.getFullYear(),
|
||||
startDateTime.getMonth(),
|
||||
startDateTime.getDate()
|
||||
);
|
||||
|
||||
// Reload meetings for this week
|
||||
await loadWeekMeetings();
|
||||
|
||||
// Find the meeting in the loaded meetings
|
||||
const scheduledMeeting = meetings.value.find(
|
||||
(m) => m.name === queryMeetingName.value
|
||||
);
|
||||
|
||||
if (scheduledMeeting) {
|
||||
// Auto-open the meeting details modal
|
||||
setTimeout(() => {
|
||||
showMeetingDetails(scheduledMeeting);
|
||||
}, 300);
|
||||
} else {
|
||||
notificationStore.addNotification({
|
||||
type: "warning",
|
||||
title: "Meeting Found",
|
||||
message: `Meeting is scheduled for ${formatDate(meetingDate)} at ${formatTimeDisplay(meetingTime)}`,
|
||||
duration: 6000,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching meeting:", error);
|
||||
notificationStore.addNotification({
|
||||
type: "error",
|
||||
title: "Error",
|
||||
message: "Failed to load meeting details.",
|
||||
duration: 5000,
|
||||
});
|
||||
} finally {
|
||||
loadingStore.setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// Lifecycle
|
||||
onMounted(async () => {
|
||||
initializeWeek();
|
||||
|
|
@ -967,6 +1071,9 @@ onMounted(async () => {
|
|||
setTimeout(() => {
|
||||
openNewMeetingModal();
|
||||
}, 500);
|
||||
} else if (queryMeetingName.value) {
|
||||
// Find and display specific meeting by name
|
||||
await findAndDisplayMeetingByName();
|
||||
} else if (queryAddress.value) {
|
||||
// View mode with address - find and show existing meeting details
|
||||
await navigateToSpecificMeeting();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue