Update: Se suprime la barra inferior | Se muestra mensaje de "pase a consulta" en el propio turno | Se modifica query para mostrar todas las estancias independientemente de su estado

This commit is contained in:
2025-09-05 10:57:17 +02:00
parent f5d1957f2e
commit eaeff5e80f
3 changed files with 54 additions and 22 deletions
+38 -8
View File
@@ -24,7 +24,7 @@ function cargarTabla(endpoint, tablaId) {
const td1 = document.createElement("td");
td1.textContent = fila[0];
td1.className = `border align-middle ${sizeClass}`;
td1.className = `border align-middle ${sizeClass} m`;
td1.style.backgroundColor = window.themeColors.bg1;
tr.appendChild(td1);
@@ -38,11 +38,41 @@ function cargarTabla(endpoint, tablaId) {
td2.className = `border bg-[#a9a9a9] align-middle ${sizeClass}`;
} else if (estadoConsulta == 1) {
td2.textContent = fila[2];
td2.style.backgroundColor = window.themeColors.bg2;
const originalText = fila[2];
const blinkText = `<span class="text-[2.25rem]">PASE A<br>CONSULTA</span>`;
let blink = false;
if (estadoTurno == 1) {
td2.className = `border blink-yellow align-middle ${sizeClass}`;
td2.className = `border align-middle ${sizeClass}`;
td2.innerHTML = originalText;
td2.style.backgroundColor = '#ffff00';
td2.style.color = "#000000";
if (td2.blinkInterval) {
clearInterval(td2.blinkInterval);
}
td2.blinkInterval = setInterval(() => {
blink = !blink;
if (blink) {
td2.innerHTML = blinkText;
td2.style.fontWeight = "bold";
} else {
td2.textContent = originalText;
td2.style.fontWeight = "";
}
}, 1000);
} else {
td2.className = `border align-middle ${sizeClass}`;
td2.style.backgroundColor = window.themeColors.bg2;
td2.textContent = originalText;
if (td2.blinkInterval) {
clearInterval(td2.blinkInterval);
td2.blinkInterval = null;
}
}
} else {
td2.textContent = fila[2];
@@ -77,14 +107,14 @@ function cargarFooter() {
});
}
function actualizarTablas(){
cargarTabla("/api/datos1","turnos1");
if (document.getElementById("turnos2")){
cargarTabla("/api/datos2","turnos2");
function actualizarTablas() {
cargarTabla("/api/datos1", "turnos1");
if (document.getElementById("turnos2")) {
cargarTabla("/api/datos2", "turnos2");
}
}
cargarFooter();
//cargarFooter();
actualizarTablas();
setInterval(actualizarTablas, 20000);
setInterval(cargarFooter, 45000);
//setInterval(cargarFooter, 45000);