feat: enhance booth management functionality in outdoor fair
- Added `react-rnd` for draggable booth positioning in the booth management interface. - Implemented booth booking, cancellation, and swapping features. - Updated `BoothTab` component to fetch and display booth data with enhanced UI for booth interactions. - Introduced modal dialogs for booking and managing booth assignments. - Enhanced venue information service to support booth-related API calls. - Updated `VenueInfoDetail` to allow for booth layout management and generation. - Improved overall user experience with better state management and loading indicators.
This commit is contained in:
@@ -78,6 +78,19 @@ export interface VenueInfoDictForm {
|
||||
dictLabel: string;
|
||||
}
|
||||
|
||||
export interface VenueBoothItem {
|
||||
id?: number;
|
||||
boothId?: number;
|
||||
venueId?: number;
|
||||
boothNumber: string;
|
||||
positionX: number;
|
||||
positionY: number;
|
||||
bookingId?: number;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
status?: 'available' | 'reserved';
|
||||
}
|
||||
|
||||
const CMS_VENUE_INFO_BASE = '/api/cms/venue-info';
|
||||
|
||||
const formatDate = (value: any) => {
|
||||
@@ -156,3 +169,51 @@ export async function addVenueInfoDictOption(data: VenueInfoDictForm) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getVenueBoothList(venueId: number) {
|
||||
return request<{ code: number; msg?: string; data: VenueBoothItem[] }>(
|
||||
`${CMS_VENUE_INFO_BASE}/${venueId}/booths`,
|
||||
{ method: 'GET' },
|
||||
);
|
||||
}
|
||||
|
||||
export async function saveVenueBoothList(venueId: number, data: VenueBoothItem[]) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/${venueId}/booths`, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getOutdoorFairBoothMap(fairId: number) {
|
||||
return request<{ code: number; msg?: string; data: VenueBoothItem[] }>(
|
||||
`${CMS_VENUE_INFO_BASE}/fair/${fairId}/booth-map`,
|
||||
{ method: 'GET' },
|
||||
);
|
||||
}
|
||||
|
||||
export async function bookOutdoorFairBooth(
|
||||
fairId: number,
|
||||
data: { boothId: number; companyId: number; companyName: string; status?: string },
|
||||
) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/fair/${fairId}/booth-booking`, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function cancelOutdoorFairBooth(fairId: number, boothId: number) {
|
||||
return request<VenueInfoCommonResult>(
|
||||
`${CMS_VENUE_INFO_BASE}/fair/${fairId}/booth-booking/${boothId}`,
|
||||
{ method: 'DELETE' },
|
||||
);
|
||||
}
|
||||
|
||||
export async function swapOutdoorFairBooth(
|
||||
fairId: number,
|
||||
data: { firstBoothId: number; secondBoothId: number },
|
||||
) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/fair/${fairId}/booth-swap`, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user