forked from TDTP/admin_transporte_frontend
test
parent
a2687861a2
commit
9c1d9bf372
|
@ -1,15 +1,15 @@
|
|||
<script>
|
||||
import Paginate from "$/components/Paginate.svelte";
|
||||
|
||||
|
||||
import { downloadGtfsArchivo, getGtfsArchivo,getGtfsArchivoId,getGtfsBase } from "$/services/gtfs_archivo";
|
||||
import PageTitle from "$/components/PageTitle.svelte";
|
||||
import PageTitle from "$/components/PageTitle.svelte";
|
||||
import { useLocation } from "svelte-navigator";
|
||||
import { getPermisosPath } from "$/services/usuarios";
|
||||
import ModalgtfsUpload from "./ModalgtfsUpload.svelte";
|
||||
import { getRedTransporte } from "$/services/red_transporte";
|
||||
import { space } from "svelte/internal";
|
||||
|
||||
let id_red;
|
||||
|
||||
let id_red;
|
||||
let escritura = false;
|
||||
|
||||
const limit = 15;
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
async function onPage(p) {
|
||||
try {
|
||||
if (!id_red) {
|
||||
if (!id_red) {
|
||||
return;
|
||||
}
|
||||
loading = true
|
||||
|
@ -81,14 +81,14 @@
|
|||
// Extraer la fecha, la hora y el desplazamiento de zona horaria
|
||||
const [datePart, timePart] = isoString.split('T');
|
||||
const [time, offset] = timePart.split(/(?=[-+])/); // Usa una expresión regular para dividir por el signo más cercano (+ o -)
|
||||
|
||||
|
||||
// Convertir a fecha/hora UTC
|
||||
const dateTime = new Date(`${datePart}T${time}Z`);
|
||||
|
||||
|
||||
// Extraer las horas y minutos del desplazamiento
|
||||
const offsetSign = offset[0] === '+' ? 1 : -1; // Determinar si el desplazamiento es positivo o negativo
|
||||
const [offsetHours, offsetMinutes] = offset.slice(1).split(':').map(Number);
|
||||
|
||||
|
||||
// Ajustar la fecha/hora basándose en el desplazamiento
|
||||
dateTime.setUTCHours(dateTime.getUTCHours() + offsetSign * offsetHours);
|
||||
dateTime.setUTCMinutes(dateTime.getUTCMinutes() + offsetSign * offsetMinutes);
|
||||
|
@ -101,7 +101,7 @@
|
|||
const adjustedMinutes = String(dateTime.getUTCMinutes()).padStart(2, '0');
|
||||
|
||||
return `${adjustedDate}-${adjustedMonth}-${adjustedYear} ${adjustedHours}:${adjustedMinutes}`;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -141,14 +141,14 @@
|
|||
<a href={"#"} on:click|preventDefault={() => onOrderBy('id_gtfs')}>ID</a>
|
||||
<!-- {#if ordering === 'id_gtfs'}<i class="bi bi-caret-up-fill"></i>{/if}
|
||||
{#if ordering === '-id_gtfs'}<i class="bi bi-caret-down-fill"></i>{/if}-->
|
||||
|
||||
|
||||
</th>
|
||||
<th>
|
||||
<a href={"#"} on:click|preventDefault={() => onOrderBy('archivo')}>Archivo</a>
|
||||
<!-- {#if ordering === 'archivo'}<i class="bi bi-caret-up-fill"></i>{/if}
|
||||
{#if ordering === '-archivo'}<i class="bi bi-caret-down-fill"></i>{/if}-->
|
||||
</th>
|
||||
|
||||
|
||||
<th>
|
||||
<a href={"#"} on:click|preventDefault={() => onOrderBy('created')}>Creado el</a>
|
||||
<!-- {#if ordering === 'created'}<i class="bi bi-caret-up-fill"></i>{/if}
|
||||
|
@ -187,20 +187,20 @@
|
|||
{/if}
|
||||
</td>
|
||||
<td>{adjustDateTimeByOffset(app.created)}</td>
|
||||
|
||||
|
||||
<td >
|
||||
{#if app.status.toUpperCase().includes('CON REPAROS')}
|
||||
{#if app.status.toUpperCase().startsWith('E') or app.status.toUpperCase().startsWith('V')}
|
||||
<!-- Elemento interactivo para usuarios con 'CON REPAROS' en el estado -->
|
||||
|
||||
|
||||
<a href={"#"} on:click|preventDefault={() => reporteErroresCargaGTFS(id_red, app.id_gtfs)}>
|
||||
{app.status}</a>
|
||||
|
||||
|
||||
{:else}
|
||||
<!-- Solo texto para estados sin 'CON REPAROS' -->
|
||||
{app.status}
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
|
||||
<td>{app.valid_from}</td>
|
||||
<td>{app.vigente ? '✅':'🚫'}</td>
|
||||
</tr>
|
||||
|
@ -224,11 +224,11 @@
|
|||
|
||||
{#if showUpload}
|
||||
<ModalgtfsUpload on:close={() => showUpload = false} {id_red} on:refresh={() => onPage(page)} />
|
||||
|
||||
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.table-responsive {
|
||||
max-height: calc(100vh - 300px);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue