2024-11-11 16:06:09 +02:00
|
|
|
<template>
|
2024-11-18 23:28:33 +02:00
|
|
|
<div class="max-w-lg mx-auto py-6 px-4 md:px-6">
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="max-w-lg mx-auto py-8">
|
|
|
|
|
<!-- Секция выбора размещения -->
|
|
|
|
|
<CreateSection isActive>
|
|
|
|
|
<CreatePlacementSection
|
|
|
|
|
v-model="placement"
|
|
|
|
|
@nextStep="placement && activateSections('actions')"
|
|
|
|
|
/>
|
|
|
|
|
</CreateSection>
|
2024-11-18 18:26:28 +02:00
|
|
|
|
2024-11-18 23:28:33 +02:00
|
|
|
<!-- Секция выбора доступных действий -->
|
|
|
|
|
<CreateSection :isActive="activeSteps.includes('actions')">
|
|
|
|
|
<CreateActionsSection
|
|
|
|
|
v-model="selectedActions"
|
|
|
|
|
@nextStep="
|
|
|
|
|
selectedActions.length &&
|
|
|
|
|
activateSections(selectedActions.includes('sendMessage') ? 'delivery' : 'summary')
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</CreateSection>
|
2024-11-18 18:26:28 +02:00
|
|
|
|
2024-11-18 23:28:33 +02:00
|
|
|
<!-- Секция выбора способа доставки -->
|
|
|
|
|
<CreateSection
|
|
|
|
|
v-if="selectedActions.includes('sendMessage')"
|
|
|
|
|
:isActive="activeSteps.includes('delivery')"
|
|
|
|
|
>
|
|
|
|
|
<CreateDeliverySection
|
|
|
|
|
v-model="deliveryMethod"
|
|
|
|
|
@nextStep="deliveryMethod && activateSections('messages', 'summary')"
|
|
|
|
|
/>
|
|
|
|
|
</CreateSection>
|
2024-11-18 18:26:28 +02:00
|
|
|
|
2024-11-18 23:28:33 +02:00
|
|
|
<!-- Секция сообщений для отправки -->
|
|
|
|
|
<CreateSection
|
|
|
|
|
v-if="selectedActions.includes('sendMessage') && activeSteps.includes('messages')"
|
|
|
|
|
:isActive="true"
|
|
|
|
|
>
|
|
|
|
|
<CreateMessagesSection :placement v-model="messages" />
|
|
|
|
|
</CreateSection>
|
2024-11-18 18:26:28 +02:00
|
|
|
|
2024-11-18 23:28:33 +02:00
|
|
|
<!-- Секция итогового резюме -->
|
|
|
|
|
<CreateSection :isActive="activeSteps.includes('summary')">
|
|
|
|
|
<CreateSummarySection
|
|
|
|
|
:placement="placement"
|
|
|
|
|
:actions="selectedActions"
|
|
|
|
|
:deliveryMethod="deliveryMethod"
|
|
|
|
|
:user_uuid="user_uuid"
|
|
|
|
|
:predefinedMessage="selectedActions.includes('sendMessage') ? messages : undefined"
|
|
|
|
|
/>
|
|
|
|
|
</CreateSection>
|
2024-11-18 18:26:28 +02:00
|
|
|
|
2024-11-18 23:28:33 +02:00
|
|
|
<div class="h-[30dvh] md:h-[10dvh] overflow-hidden"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2024-11-11 16:06:09 +02:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-11-14 16:43:46 +02:00
|
|
|
|
2024-11-14 16:48:32 +02:00
|
|
|
<script setup lang="ts">
|
2024-11-14 16:43:46 +02:00
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
2024-11-18 18:26:28 +02:00
|
|
|
// Шаги и состояния для работы с секциями
|
|
|
|
|
const activeSteps = ref(['placement'])
|
2024-11-14 16:43:46 +02:00
|
|
|
|
2024-11-18 18:26:28 +02:00
|
|
|
const selectedActions = ref<string[]>([])
|
|
|
|
|
const placement = ref('')
|
|
|
|
|
const deliveryMethod = ref('')
|
|
|
|
|
const messages = ref<string[]>([])
|
|
|
|
|
const user_uuid = 'example-user-uuid' // Временно захардкожено, заменить на динамическое
|
2024-11-14 16:43:46 +02:00
|
|
|
|
2024-11-18 18:26:28 +02:00
|
|
|
// Функция активации следующих шагов
|
|
|
|
|
function activateSections(...sections: string[]) {
|
|
|
|
|
sections.forEach((section) => {
|
|
|
|
|
if (!activeSteps.value.includes(section)) {
|
|
|
|
|
activeSteps.value.push(section)
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-11-14 16:43:46 +02:00
|
|
|
}
|
|
|
|
|
</script>
|