Fix UI overlapping, transport load error handling, and schedule filtering bugs
This commit is contained in:
@ -1,9 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
||||
const mountError = ref(false)
|
||||
|
||||
const reloadPage = () => {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// Aquí iría cualquier inicialización global del layout si fuera necesaria
|
||||
console.log('Transporte Hub mounted')
|
||||
} catch (e) {
|
||||
console.error('Error mounting Transporte Hub:', e)
|
||||
mountError.value = true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -24,8 +40,17 @@ const route = useRoute()
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="mountError" class="error-container">
|
||||
<span class="material-icons">error_outline</span>
|
||||
<p>Error al cargar la sección de transporte</p>
|
||||
<button @click="reloadPage" class="retry-btn">
|
||||
<span class="material-icons">refresh</span>
|
||||
Reintentar
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<router-view v-slot="{ Component }">
|
||||
<router-view v-else v-slot="{ Component }">
|
||||
<transition name="fade" mode="out-in">
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
@ -118,4 +143,39 @@ const route = useRoute()
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.error-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40px 20px;
|
||||
text-align: center;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.error-container .material-icons {
|
||||
font-size: 48px;
|
||||
color: #ef4444;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
margin-top: 16px;
|
||||
padding: 10px 24px;
|
||||
background: var(--active-color);
|
||||
color: #101820;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.retry-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user