You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
278 lines
6.3 KiB
Vue
278 lines
6.3 KiB
Vue
<!-- components/process/ProcessSection.vue -->
|
|
<template>
|
|
<section v-if="proceso" class="process-section" aria-labelledby="process-title">
|
|
<div class="section-container">
|
|
<div class="section-header">
|
|
<h2 id="process-title" class="section-title">{{ proceso.titulo || 'Proceso de Admisión 2026' }}</h2>
|
|
<p class="section-subtitle">
|
|
{{ proceso.subtitulo || 'Sigue estos pasos para postular' }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="process-card">
|
|
<a-steps
|
|
:current="currentStep"
|
|
:direction="isMobile ? 'vertical' : 'horizontal'"
|
|
:responsive="false"
|
|
class="modern-steps"
|
|
>
|
|
<a-step
|
|
v-for="step in steps"
|
|
:key="step.title"
|
|
:title="step.title"
|
|
:description="step.description"
|
|
/>
|
|
</a-steps>
|
|
|
|
<div class="process-note">
|
|
<span class="dot" />
|
|
<span>Fechas referenciales. Verifica el cronograma oficial de la Dirección de Admisión</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, computed, onMounted, onUnmounted } from "vue"
|
|
|
|
const props = defineProps({
|
|
proceso: {
|
|
type: Object,
|
|
default: null,
|
|
},
|
|
})
|
|
|
|
const isMobile = ref(false)
|
|
const checkScreen = () => {
|
|
isMobile.value = window.innerWidth < 768
|
|
}
|
|
|
|
onMounted(() => {
|
|
checkScreen()
|
|
window.addEventListener("resize", checkScreen)
|
|
})
|
|
|
|
onUnmounted(() => {
|
|
window.removeEventListener("resize", checkScreen)
|
|
})
|
|
|
|
function formatRango(inicio, fin) {
|
|
if (!inicio && !fin) return null
|
|
const opts = { day: 'numeric', month: 'short' }
|
|
const i = inicio ? new Date(inicio).toLocaleDateString('es-PE', opts) : null
|
|
const f = fin ? new Date(fin).toLocaleDateString('es-PE', opts) : null
|
|
if (i && f) return `${i} - ${f}`
|
|
if (i) return `Desde ${i}`
|
|
return `Hasta ${f}`
|
|
}
|
|
|
|
function formatFecha(fecha) {
|
|
if (!fecha) return null
|
|
return new Date(fecha).toLocaleDateString('es-PE', { day: 'numeric', month: 'long' })
|
|
}
|
|
|
|
const steps = computed(() => {
|
|
const p = props.proceso
|
|
if (!p) return []
|
|
|
|
const list = []
|
|
|
|
const preinscripcion = formatRango(p.fecha_inicio_preinscripcion, p.fecha_fin_preinscripcion)
|
|
if (preinscripcion) {
|
|
list.push({ title: 'Preinscripción Virtual', description: preinscripcion })
|
|
}
|
|
|
|
const inscripcion = formatRango(p.fecha_inicio_inscripcion, p.fecha_fin_inscripcion)
|
|
if (inscripcion) {
|
|
list.push({ title: 'Inscripción Presencial', description: inscripcion })
|
|
}
|
|
|
|
const examen = formatRango(p.fecha_examen1, p.fecha_examen2)
|
|
if (examen) {
|
|
list.push({ title: 'Examen', description: examen })
|
|
}
|
|
|
|
const resultados = formatFecha(p.fecha_resultados)
|
|
if (resultados) {
|
|
list.push({ title: 'Resultados', description: resultados })
|
|
}
|
|
|
|
const biometrico = formatRango(p.fecha_inicio_biometrico, p.fecha_fin_biometrico)
|
|
if (biometrico) {
|
|
list.push({ title: 'Control Biométrico', description: biometrico })
|
|
}
|
|
|
|
return list
|
|
})
|
|
|
|
const now = new Date()
|
|
|
|
const currentStep = computed(() => {
|
|
const p = props.proceso
|
|
if (!p) return 0
|
|
|
|
if (p.fecha_inicio_biometrico && now >= new Date(p.fecha_inicio_biometrico)) return steps.value.length - 1
|
|
if (p.fecha_resultados && now >= new Date(p.fecha_resultados)) return steps.value.findIndex(s => s.title === 'Resultados')
|
|
if (p.fecha_examen1 && now >= new Date(p.fecha_examen1)) return steps.value.findIndex(s => s.title === 'Examen')
|
|
if (p.fecha_inicio_inscripcion && now >= new Date(p.fecha_inicio_inscripcion)) return steps.value.findIndex(s => s.title === 'Inscripción Presencial')
|
|
if (p.fecha_inicio_preinscripcion && now >= new Date(p.fecha_inicio_preinscripcion)) return steps.value.findIndex(s => s.title === 'Preinscripción Virtual')
|
|
|
|
return 0
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.process-section {
|
|
padding: 30px 0;
|
|
background: #ffffff;
|
|
font-family: "Times New Roman", Times, serif;
|
|
}
|
|
|
|
.section-container {
|
|
max-width: 1100px;
|
|
margin: 0 auto;
|
|
padding: 0 20px;
|
|
}
|
|
|
|
.section-header {
|
|
text-align: center;
|
|
margin-bottom: 18px;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 2.1rem;
|
|
font-weight: 700;
|
|
color: #2c3e50;
|
|
margin: 0 0 6px 0;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.section-subtitle {
|
|
font-size: 1rem;
|
|
color: #777;
|
|
margin: 0;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.process-card {
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 14px;
|
|
padding: 16px 14px 12px;
|
|
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
|
|
background: #fff;
|
|
}
|
|
|
|
.modern-steps {
|
|
padding: 8px 8px;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-title) {
|
|
white-space: normal !important;
|
|
overflow: visible !important;
|
|
text-overflow: clip !important;
|
|
max-width: none !important;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-content) {
|
|
min-width: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-container) {
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item) {
|
|
flex: 1 1 0;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-title) {
|
|
font-size: 0.95rem;
|
|
font-weight: 700;
|
|
color: #34495e;
|
|
line-height: 1.15;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-description) {
|
|
font-size: 0.82rem;
|
|
color: #888;
|
|
margin-top: 2px;
|
|
line-height: 1.25;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-icon) {
|
|
width: 30px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-tail::after) {
|
|
height: 2px;
|
|
background: #dfe6e9;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-process .ant-steps-item-icon) {
|
|
background-color: #1e3a8a;
|
|
border-color: #1e3a8a;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-finish .ant-steps-item-icon > .ant-steps-icon) {
|
|
color: #1e3a8a;
|
|
}
|
|
.modern-steps :deep(.ant-steps-item-finish .ant-steps-item-icon) {
|
|
border-color: #1e3a8a;
|
|
}
|
|
|
|
.process-note {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
margin-top: 10px;
|
|
font-size: 0.86rem;
|
|
color: #6b7280;
|
|
}
|
|
|
|
.dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #1e3a8a;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
@media (max-width: 992px) {
|
|
.section-title {
|
|
font-size: 1.85rem;
|
|
}
|
|
.modern-steps :deep(.ant-steps-item-title) {
|
|
font-size: 0.92rem;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.process-section {
|
|
padding: 24px 0;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 1.55rem;
|
|
}
|
|
|
|
.process-card {
|
|
padding: 12px 10px 10px;
|
|
}
|
|
|
|
.modern-steps {
|
|
padding: 4px 4px;
|
|
}
|
|
|
|
.modern-steps :deep(.ant-steps-item-icon) {
|
|
width: 28px;
|
|
height: 28px;
|
|
line-height: 28px;
|
|
}
|
|
}
|
|
</style>
|