Inicio del desarrollo del sistema de notificaciones

This commit is contained in:
2025-01-05 17:23:33 -03:00
parent 57bfb42f00
commit c1c088813a
6 changed files with 154 additions and 1 deletions

View File

@@ -1,7 +1,75 @@
<script lang="ts">
import { onMount } from "svelte";
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte";
import type { MensajeDto } from "../types";
import ModalEstatico from "../Componentes/ModalEstatico.svelte";
const token = sessionStorage.getItem("token");
let mensajes: MensajeDto[] = $state([]);
let showspinner:boolean =$state(false);
let mostrarleidos: boolean = $state(false);
let modaldata:string =$state("");
onMount(async () => {
showspinner = true;
SinLeer();
})
async function SinLeer() {
mostrarleidos = false;
}
async function Leidos() {
mostrarleidos = true;
}
</script>
<NavBarAutocompletable/>
<NavBarAutocompletable/>
{#if modaldata}
<ModalEstatico payload={modaldata} close={()=>!!(modaldata = "")} />
{/if}
<div class="container">
<br>
<div class="btn-group">
<button class="btn btn-primary" class:active={mostrarleidos==false} onclick={SinLeer} >Sin Leer</button>
<button class="btn btn-primary" class:active={mostrarleidos==true} onclick={Leidos} >Leidos</button>
</div>
<br>
<div class="container-fluid" style="margin-top: 1cm;">
{#if showspinner}
<div class=" justify-content-center position-absolute top-50 start-50">
<div class="spinner-border" role="status"></div>
Cargando...
</div>
{:else}
<table class="table table-responsive table-striped table-hover">
<thead>
<tr>
<th>Remitente</th>
<th>Accion</th>
<th>Mensaje</th>
<th>Fecha</th>
<th>Propiedad</th>
</tr>
</thead>
<tbody>
{#each mensajes as men }
<tr>
<td>men.remitente</td>
<td>men.accion</td>
<td>men.mensaje</td>
<td>men.fecha</td>
<td>men.propiedad</td>
</tr>
{/each}
</tbody>
</table>
{/if}
</div>
</div>

View File

@@ -54,3 +54,12 @@ export type Propiedad = {
idtipropiedad: number,
monto: number
};
export type MensajeDto = {
remitente: string,
accion: string,
mensaje: string,
fecha: Date,
propiedad: string,
}