결제, 구독 기능

This commit is contained in:
2025-05-11 17:27:39 +09:00
parent 2924a61a9d
commit 1db3a03ffd
18 changed files with 3276 additions and 180 deletions
@@ -12,7 +12,7 @@
<Tab value="기본정보"><i class="pi pi-info-circle mr-2" />기본정보</Tab>
<Tab value="참가자 관리"><i class="pi pi-users mr-2" />참가자 관리</Tab>
<Tab value="점수 관리"><i class="pi pi-chart-bar mr-2" />점수 관리</Tab>
<Tab value="팀 편성"><i class="pi pi-sitemap mr-2" /> 편성</Tab>
<Tab v-if="hasTeamFeature" value="팀 편성"><i class="pi pi-sitemap mr-2" /> 편성</Tab>
</TabList>
<TabPanels>
<!-- 기본 정보 -->
@@ -77,7 +77,7 @@
/>
</TabPanel>
<!-- 편성 -->
<TabPanel value="팀 편성">
<TabPanel v-if="hasTeamFeature" value="팀 편성">
<TeamGeneration :participants="confirmedParticipants" :teams="teams" @save-teams="handleSaveTeams" />
</TabPanel>
</TabPanels>
@@ -105,6 +105,8 @@ const props = defineProps({
getStatusName: { type: Function, required: true },
getStatusSeverity: { type: Function, required: true },
formatDate: { type: Function, required: true },
// 팀 기능 사용 권한 여부
hasTeamFeature: { type: Boolean, default: false },
// (권장) 상태명이 매칭 안 될 경우 실제 상태 문자열 반환
// getStatusName 함수 예시:
@@ -139,11 +141,16 @@ const hideDialog = () => {
// 팀 생성 결과 저장
const teams = ref([]);
// 이벤트 상세 다이얼로그가 열릴 때마다 팀 목록 불러오기
// 이벤트 상세 다이얼로그가 열릴 때마다 팀 목록 불러오기 (팀 기능 사용 권한이 있는 경우에만)
watch(() => eventModel.value.id, async (eventId) => {
if (eventId) {
const latestTeams = await teamService.getTeams(eventId);
teams.value = latestTeams;
if (eventId && props.hasTeamFeature) {
try {
const latestTeams = await teamService.getTeams(eventId);
teams.value = latestTeams;
} catch (error) {
console.error('팀 정보를 불러오는 중 오류가 발생했습니다:', error);
teams.value = [];
}
}
}, { immediate: true });
@@ -166,6 +173,12 @@ import { useToast } from 'primevue/usetoast';
const toast = useToast();
async function handleSaveTeams(savedTeams) {
// 팀 기능 사용 권한이 없는 경우 저장하지 않음
if (!props.hasTeamFeature) {
toast.add({ severity: 'error', summary: '권한 없음', detail: '팀 기능을 사용할 수 있는 권한이 없습니다.', life: 3000 });
return;
}
const eventId = eventModel.value.id;
try {
await teamService.saveTeams(eventId, savedTeams);