wm-menu 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/wm-menu.umd.js +147 -160
- package/bundles/wm-menu.umd.js.map +1 -1
- package/bundles/wm-menu.umd.min.js +2 -2
- package/bundles/wm-menu.umd.min.js.map +1 -1
- package/esm2015/lib/wm-menu/services/wm-menu-alerta-panico.service.js +4 -21
- package/esm2015/lib/wm-menu/wm-menu.component.js +8 -3
- package/esm5/lib/wm-menu/services/wm-menu-alerta-panico.service.js +4 -21
- package/esm5/lib/wm-menu/wm-menu.component.js +8 -3
- package/fesm2015/wm-menu.js +145 -158
- package/fesm2015/wm-menu.js.map +1 -1
- package/fesm5/wm-menu.js +147 -160
- package/fesm5/wm-menu.js.map +1 -1
- package/lib/wm-menu/wm-menu.component.d.ts +4 -1
- package/package.json +1 -1
- package/wm-menu.metadata.json +1 -1
package/bundles/wm-menu.umd.js
CHANGED
|
@@ -324,146 +324,6 @@
|
|
|
324
324
|
return WmMenuServicioService;
|
|
325
325
|
}());
|
|
326
326
|
|
|
327
|
-
var WmMenuComponent = /** @class */ (function () {
|
|
328
|
-
function WmMenuComponent(wmMenuServicioService) {
|
|
329
|
-
this.wmMenuServicioService = wmMenuServicioService;
|
|
330
|
-
this.menuSecundarioSel = new MenuSecundario();
|
|
331
|
-
this.menuLateralAbierto = false;
|
|
332
|
-
this.menuIdioma = [];
|
|
333
|
-
}
|
|
334
|
-
WmMenuComponent.prototype.ngOnInit = function () {
|
|
335
|
-
var _this = this;
|
|
336
|
-
this.cargarMenuCuenta();
|
|
337
|
-
if (this.urlMenu && this.token) {
|
|
338
|
-
var helper = new angularJwt.JwtHelperService();
|
|
339
|
-
var decodedToken = helper.decodeToken(this.token);
|
|
340
|
-
this.wmMenuServicioService
|
|
341
|
-
.menuApiObtener(this.urlMenu, decodedToken["id_usuario"], this.token)
|
|
342
|
-
.subscribe(function (resp) {
|
|
343
|
-
_this.menuPrincipal = _this.wmMenuServicioService.mapearMenu(resp);
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
if (this.urlIdiomas && this.token) {
|
|
347
|
-
var helper = new angularJwt.JwtHelperService();
|
|
348
|
-
var decodedToken = helper.decodeToken(this.token);
|
|
349
|
-
this.wmMenuServicioService
|
|
350
|
-
.menuIdiomasObtener(this.urlIdiomas, decodedToken["id_usuario"], this.token)
|
|
351
|
-
.subscribe(function (resp) {
|
|
352
|
-
_this.menuIdioma = resp;
|
|
353
|
-
_this.cargarMenuCuenta();
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
if (this.urlBaseAlmacenamiento && this.token) {
|
|
357
|
-
var helper = new angularJwt.JwtHelperService();
|
|
358
|
-
var decodedToken = helper.decodeToken(this.token);
|
|
359
|
-
this.wmMenuServicioService
|
|
360
|
-
.almacenamientoApiObtener(this.urlBaseAlmacenamiento, decodedToken["id_usuario"], this.token)
|
|
361
|
-
.subscribe(function (resp) {
|
|
362
|
-
var utilizado = resp[0] && resp[0].Utilizado ? resp[0].Utilizado : 0;
|
|
363
|
-
var total = resp[0] && resp[0].Total ? resp[0].Total : 0;
|
|
364
|
-
_this.porcentajeUtilizado = Math.round((utilizado / total) * 100);
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
WmMenuComponent.prototype.clickMenuPrincipal = function (i) {
|
|
369
|
-
if (this.menuPrincipal[i].hijos && this.menuPrincipal[i].hijos.length) {
|
|
370
|
-
if (this.menuPrincipalSel == this.menuPrincipal[i]) {
|
|
371
|
-
this.menuPrincipalSel = null;
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
this.menuPrincipalSel = this.menuPrincipal[i];
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
WmMenuComponent.prototype.clickMenuSecundario = function (i) {
|
|
379
|
-
this.menuSecundarioSel = this.menuSecundario[i];
|
|
380
|
-
this.menuPrincipalSel = null;
|
|
381
|
-
};
|
|
382
|
-
WmMenuComponent.prototype.cargarMenuCuenta = function () {
|
|
383
|
-
var _a;
|
|
384
|
-
if (this.urlCuentaSeguridad && this.token) {
|
|
385
|
-
var helper = new angularJwt.JwtHelperService();
|
|
386
|
-
var decodedToken = helper.decodeToken(this.token);
|
|
387
|
-
this.menuSecundario = [{
|
|
388
|
-
titulo: decodedToken["unique_name"],
|
|
389
|
-
icono: "account_circle",
|
|
390
|
-
hijos: [
|
|
391
|
-
{ titulo: decodedToken["unique_name"], url: "", icono: "person" },
|
|
392
|
-
{ titulo: this.menuIdioma && this.menuIdioma.CambiarContrasenna ? this.menuIdioma.CambiarContrasenna : "Cambiar contraseña", url: this.urlCuentaSeguridad + "CambioContrasena", icono: "vpn_key" },
|
|
393
|
-
this.activar2fa == "1" ? { titulo: this.menuIdioma && this.menuIdioma.Configurar2fa ? this.menuIdioma.Configurar2fa : "Configurar 2FA", url: this.urlCuentaSeguridad + "Habilitacion2FA", icono: "verified_user" } : null,
|
|
394
|
-
this.urlguiasOnline != null && this.urlguiasOnline !== "" && ((_a = this.urlguiasOnline) === null || _a === void 0 ? void 0 : _a.length) != 0 ? { titulo: this.menuIdioma && this.menuIdioma.guiasOnline ? this.menuIdioma.guiasOnline : "Guias Online", url: this.urlguiasOnline, icono: "menu_book" } : null,
|
|
395
|
-
{ titulo: this.menuIdioma && this.menuIdioma.CerrarSesion ? this.menuIdioma.CerrarSesion : "Cerrar sesión", url: this.urlCuentaSeguridad + "CerrarSesion", icono: "exit_to_app" }
|
|
396
|
-
].filter(function (hijo) { return hijo != null; }),
|
|
397
|
-
}];
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
WmMenuComponent.ctorParameters = function () { return [
|
|
401
|
-
{ type: WmMenuServicioService }
|
|
402
|
-
]; };
|
|
403
|
-
__decorate([
|
|
404
|
-
core.Input()
|
|
405
|
-
], WmMenuComponent.prototype, "logo", void 0);
|
|
406
|
-
__decorate([
|
|
407
|
-
core.Input()
|
|
408
|
-
], WmMenuComponent.prototype, "colorFondo", void 0);
|
|
409
|
-
__decorate([
|
|
410
|
-
core.Input()
|
|
411
|
-
], WmMenuComponent.prototype, "colorTexto", void 0);
|
|
412
|
-
__decorate([
|
|
413
|
-
core.Input()
|
|
414
|
-
], WmMenuComponent.prototype, "menuPrincipal", void 0);
|
|
415
|
-
__decorate([
|
|
416
|
-
core.Input()
|
|
417
|
-
], WmMenuComponent.prototype, "menuSecundario", void 0);
|
|
418
|
-
__decorate([
|
|
419
|
-
core.Input()
|
|
420
|
-
], WmMenuComponent.prototype, "urlMenu", void 0);
|
|
421
|
-
__decorate([
|
|
422
|
-
core.Input()
|
|
423
|
-
], WmMenuComponent.prototype, "token", void 0);
|
|
424
|
-
__decorate([
|
|
425
|
-
core.Input()
|
|
426
|
-
], WmMenuComponent.prototype, "urlCuentaSeguridad", void 0);
|
|
427
|
-
__decorate([
|
|
428
|
-
core.Input()
|
|
429
|
-
], WmMenuComponent.prototype, "activar2fa", void 0);
|
|
430
|
-
__decorate([
|
|
431
|
-
core.Input()
|
|
432
|
-
], WmMenuComponent.prototype, "urlguiasOnline", void 0);
|
|
433
|
-
__decorate([
|
|
434
|
-
core.Input()
|
|
435
|
-
], WmMenuComponent.prototype, "urlObtenerAlertasPanico", void 0);
|
|
436
|
-
__decorate([
|
|
437
|
-
core.Input()
|
|
438
|
-
], WmMenuComponent.prototype, "urlObtenerParametro", void 0);
|
|
439
|
-
__decorate([
|
|
440
|
-
core.Input()
|
|
441
|
-
], WmMenuComponent.prototype, "rutaAudio", void 0);
|
|
442
|
-
__decorate([
|
|
443
|
-
core.Input()
|
|
444
|
-
], WmMenuComponent.prototype, "nombreCliente", void 0);
|
|
445
|
-
__decorate([
|
|
446
|
-
core.Input()
|
|
447
|
-
], WmMenuComponent.prototype, "nombreUsuario", void 0);
|
|
448
|
-
__decorate([
|
|
449
|
-
core.Input()
|
|
450
|
-
], WmMenuComponent.prototype, "versionWeb", void 0);
|
|
451
|
-
__decorate([
|
|
452
|
-
core.Input()
|
|
453
|
-
], WmMenuComponent.prototype, "urlBaseAlmacenamiento", void 0);
|
|
454
|
-
__decorate([
|
|
455
|
-
core.Input()
|
|
456
|
-
], WmMenuComponent.prototype, "urlIdiomas", void 0);
|
|
457
|
-
WmMenuComponent = __decorate([
|
|
458
|
-
core.Component({
|
|
459
|
-
selector: 'wm-menu',
|
|
460
|
-
template: "<div class=\"menu\" [ngStyle]=\"{'background-color': colorFondo, 'color': colorTexto}\">\r\n <div class=\"d-lg-none\">\r\n <button mat-icon-button (click)=\"menuLateralAbierto=!menuLateralAbierto; menuPrincipalSel = null\">\r\n <mat-icon *ngIf=\"!menuLateralAbierto\" class=\"animate__animated animate__fadeInRight animate__faster\">menu\r\n </mat-icon>\r\n <mat-icon *ngIf=\"menuLateralAbierto\" class=\"animate__animated animate__fadeInLeft animate__faster\">close\r\n </mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"d-lg-none logo-menu-principal\">\r\n <img class=\"logo\" src=\"{{logo}}\">\r\n </div>\r\n <div class=\"d-none d-lg-block\">\r\n <img class=\"logo\" src=\"{{logo}}\">\r\n <div *ngFor=\"let menuItem of menuPrincipal; let i=index\" class=\"d-inline-block\">\r\n\r\n <a *ngIf=\"menuItem.url\" mat-button [href]=\"menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n {{menuItem.titulo}}\r\n </a>\r\n <button *ngIf=\"!menuItem.url\" mat-button (click)=\"clickMenuPrincipal(i)\">\r\n {{menuItem.titulo}}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"info-adicional\">\r\n <div class=\"datos border-r mt-1\" *ngIf=\"nombreCliente\">{{nombreCliente}}<mat-icon>people</mat-icon></div>\r\n <div class=\"datos border-r mt-1\" *ngIf=\"nombreUsuario\">{{nombreUsuario}}<mat-icon>person_outline</mat-icon></div>\r\n <div class=\"version\" *ngIf=\"versionWeb\">{{versionWeb}}</div>\r\n <div class=\"content-idioma\" *ngIf=\"urlIdiomas\">\r\n <mat-menu #menuIdiomas=\"matMenu\">\r\n <a mat-menu-item *ngFor=\"let menuItem of menuIdioma.Culturas\" href=\"{{urlCuentaSeguridad}}CambiarIdioma?culture={{menuItem.Name}}&ReturnUrl=/\">\r\n {{menuItem.NativeName}}\r\n </a>\r\n </mat-menu>\r\n <button mat-button [matMenuTriggerFor]=\"menuIdiomas\"><label class=\"mt-1\">{{menuIdioma.Lenguaje}}</label><mat-icon class=\"icon-idioma\">language</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n <div>\r\n <mat-menu #submenu=\"matMenu\">\r\n <a mat-menu-item *ngFor=\"let menuItem of menuSecundarioSel.hijos\" href=\"{{menuItem.url}}\"\r\n [disabled]=\"!menuItem.url\">\r\n <mat-icon *ngIf=\"menuItem.icono\">{{menuItem.icono}}</mat-icon>\r\n {{menuItem.titulo}}\r\n </a>\r\n </mat-menu>\r\n <button *ngFor=\"let menuItem of menuSecundario; let i = index\" mat-icon-button [matMenuTriggerFor]=\"submenu\"\r\n (click)=\"clickMenuSecundario(i)\">\r\n <mat-icon>{{menuItem.icono}}</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"menu-lateral d-lg-none animate__animated animate__fadeInRight animate__faster\" *ngIf=\"menuLateralAbierto\">\r\n <div class=\"row\">\r\n <div *ngFor=\"let menuItem of menuPrincipal; let i=index\" class=\"col-sm-6 col-md-4\">\r\n <a *ngIf=\"menuItem.url\" [href]=\"menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n <div>\r\n <mat-icon svgIcon=\"{{menuItem.icono}}\">{{menuItem.icono}}</mat-icon>\r\n <p>{{menuItem.titulo}}</p>\r\n </div>\r\n </a>\r\n <span *ngIf=\"!menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n <div>\r\n <mat-icon svgIcon=\"{{menuItem.icono}}\">{{menuItem.icono}}</mat-icon>\r\n <p>{{menuItem.titulo}}</p>\r\n </div>\r\n </span>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"sub-menu-fondo animate__animated animate__fadeIn animate__faster\" (click)=\"menuPrincipalSel=null\"\r\n *ngIf=\"menuPrincipalSel\"></div>\r\n\r\n<div class=\"sub-menu animate__animated animate__fadeIn animate__faster\" *ngIf=\"menuPrincipalSel\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-lg-5\">\r\n <div class=\"px-3 px-sm-5 pt-5 pb-lg-5 text-center descripcion-menu\">\r\n <mat-icon [ngStyle]=\"{'color': colorFondo}\" svgIcon=\"{{menuPrincipalSel.icono}}\">\r\n {{menuPrincipalSel.icono}}</mat-icon>\r\n <p>{{menuPrincipalSel.titulo}}</p>\r\n <p class=\"text-secondary\">{{menuPrincipalSel.descripcion}}</p>\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-lg-7 my-4\">\r\n <div class=\"px-3 px-md-4 py-2 py-md-2\">\r\n <ul class=\"list-unstyled\">\r\n\r\n <li class=\"mb-3 d-flex\" *ngFor=\"let menuItem of menuPrincipalSel.hijos\">\r\n <mat-icon>{{menuItem.icono}}</mat-icon>\r\n <div class=\"ml-2 flex-fill\">\r\n <a href=\"{{menuItem.url}}\" *ngIf=\"menuItem.url\">\r\n <div class=\"lead mb-2\">{{menuItem.titulo}}</div>\r\n </a>\r\n <div class=\"lead mb-2\" *ngIf=\"!menuItem.url\">{{menuItem.titulo}}</div>\r\n\r\n <a href=\"{{menuSubItem.url}}\" class=\"pl-2 my-2\" *ngFor=\"let menuSubItem of menuItem.hijos\">\r\n <div class=\"text-secondary\">{{menuSubItem.titulo}}</div>\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <button mat-icon-button class=\"close-icon d-lg-none\" (click)=\"menuPrincipalSel=null\">\r\n <mat-icon>arrow_back</mat-icon>\r\n </button>\r\n</div>\r\n<div class=\"alerta-almacenamiento\" *ngIf=\"porcentajeUtilizado >= 100\">Su capacidad de almacenamiento ha llegado al {{porcentajeUtilizado}}% , libere espacio o adquiera mayor capacidad</div>",
|
|
461
|
-
styles: [".menu{height:46px;display:flex;justify-content:space-between;align-items:center;top:0;left:0;right:0;background-color:#1c98a4;color:#fff;padding:0 4px}.menu .d-lg-block .mat-button{font-weight:400;height:46px;line-height:46px}.menu .logo{display:inline-block;height:40px}.menu .logo-menu-principal{position:absolute;display:block;left:65px}.menu .logo-menu-principal>img{display:block;margin:0 -50%}.menu .info-adicional{color:#fff;display:flex;justify-content:end;font-size:13px;position:absolute;right:47px}.menu .info-adicional .border-r{border-right:1px solid #fff}.menu .info-adicional .version{margin:7px 0 0 7px}.menu .info-adicional div.datos{margin:0 2px 0 5px;height:28px}.menu .info-adicional .mat-icon{vertical-align:middle;font-size:17px;color:#fff;line-height:21px;margin-left:2px}.menu .info-adicional button{padding:0 0 0 15px}.menu .info-adicional .content-idioma{margin:-5px 2px 0 5px;display:block;cursor:pointer}.menu .info-adicional .icon-idioma{font-size:17px!important;vertical-align:text-top!important;color:#fffc}.sub-menu{width:100%;position:absolute;top:46px;z-index:1000;background-color:#fff;display:flex;overflow-y:auto;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.sub-menu .close-icon{position:absolute;left:4px;top:4px}.sub-menu .descripcion-menu .mat-icon{color:#1c98a4;width:100px;height:100px}.sub-menu .descripcion-menu p:first-of-type{font-weight:300;font-size:30px;margin:16px 0}.sub-menu .descripcion-menu p:last-of-type{color:#6c757d}.sub-menu li{float:left;width:50%}.sub-menu li>.mat-icon{color:#444}.sub-menu li:nth-child(even){float:right}.sub-menu li a{transition:.5s;display:block}.sub-menu li a:hover{margin-left:8px}.sub-menu li .lead{line-height:24px;color:#212529;font-size:17px}.sub-menu-fondo{background:#272d3357;position:absolute;top:46px;bottom:0;left:0;right:0;z-index:1000}.menu-lateral{width:100%;position:absolute;top:46px;bottom:0;left:0;right:0;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;background:#f7f7f7;padding:20px}.menu-lateral>div>div>*>div{text-align:center;padding:16px;background-color:#fff;margin:0 0 16px;color:#333;cursor:pointer;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.menu-lateral>div>div>*>div>.mat-icon{width:50px;height:50px}.menu-lateral>div>div>*>div>p{padding:0;margin:8px 0 0}a.mat-menu-item{color:#444!important}.alerta-almacenamiento{background:#ffffec;border-bottom:1px solid #efff00;min-height:39px;line-height:36px;font-size:12px;padding:0 0 0 25px}@media (max-width:767.98px){.sub-menu ul{margin:auto;padding:0 10px}.sub-menu ul li{float:none;width:100%}.sub-menu ul li:nth-child(even){float:none}}@media (max-width:991.98px){.sub-menu{bottom:0}}@media (min-width:600px){.logo-menu-principal{left:50%!important}}* :focus,:active{outline:0!important}"]
|
|
462
|
-
})
|
|
463
|
-
], WmMenuComponent);
|
|
464
|
-
return WmMenuComponent;
|
|
465
|
-
}());
|
|
466
|
-
|
|
467
327
|
var WmMenuAlertaPanicoService = /** @class */ (function () {
|
|
468
328
|
function WmMenuAlertaPanicoService(wmMenuServicioService) {
|
|
469
329
|
this.wmMenuServicioService = wmMenuServicioService;
|
|
@@ -473,28 +333,23 @@
|
|
|
473
333
|
this.IdsAlertasPanicoActivas = new Set(); // Almacena los IDs de las alertas ya manejadas
|
|
474
334
|
this.soundTimeout = null; // Controla el temporizador del sonido
|
|
475
335
|
this.isRunning = false;
|
|
476
|
-
console.log('WmMenuAlertaPanicoService inicializado.');
|
|
477
336
|
}
|
|
478
337
|
WmMenuAlertaPanicoService.prototype.iniciarProceso = function (intervalMs, callback, urlObtenerParametro, token, rutaAudio) {
|
|
479
338
|
var _this = this;
|
|
480
|
-
console.log('iniciarProceso llamado con parámetros:', { intervalMs: intervalMs, urlObtenerParametro: urlObtenerParametro, token: token, rutaAudio: rutaAudio });
|
|
481
339
|
this.rutaAudio = rutaAudio;
|
|
482
340
|
var iniciarConInteraccion = function () {
|
|
483
|
-
console.log('iniciarConInteraccion ejecutado.');
|
|
484
341
|
_this.wmMenuServicioService
|
|
485
342
|
.menuApiObtener(urlObtenerParametro, null, token, 'ReporteAlertasPanico')
|
|
486
343
|
.subscribe(function (resp) {
|
|
487
|
-
|
|
344
|
+
// validar si el parametro ReporteAlertasPanico esta encendido
|
|
488
345
|
if (resp && resp.length > 0 && resp[0].Valor == 1) {
|
|
489
346
|
if (_this.isRunning) {
|
|
490
|
-
console.log('Proceso ya está corriendo.');
|
|
491
347
|
return;
|
|
492
348
|
}
|
|
349
|
+
// Inicializar la variable desde localStorage
|
|
493
350
|
var storedIds = localStorage.getItem('ALERTAS_PANICO_ACTIVAS_WM');
|
|
494
351
|
_this.IdsAlertasPanicoActivas = storedIds ? new Set(JSON.parse(storedIds)) : new Set();
|
|
495
|
-
console.log('IdsAlertasPanicoActivas inicializado:', _this.IdsAlertasPanicoActivas);
|
|
496
352
|
var ejecutarProceso_1 = function () {
|
|
497
|
-
console.log('ejecutarProceso iniciado.');
|
|
498
353
|
_this.isRunning = true;
|
|
499
354
|
callback();
|
|
500
355
|
setTimeout(function () {
|
|
@@ -507,49 +362,42 @@
|
|
|
507
362
|
});
|
|
508
363
|
};
|
|
509
364
|
['drag', 'click'].forEach(function (evento) {
|
|
510
|
-
console.log("Evento " + evento + " registrado para iniciar proceso.");
|
|
511
365
|
document.addEventListener(evento, function () {
|
|
512
366
|
iniciarConInteraccion();
|
|
513
367
|
}, { once: true });
|
|
514
368
|
});
|
|
515
369
|
};
|
|
516
370
|
WmMenuAlertaPanicoService.prototype.stopProcess = function () {
|
|
517
|
-
console.log('stopProcess ejecutado.');
|
|
518
371
|
this.isRunning = false;
|
|
519
372
|
if (this.subscription) {
|
|
520
373
|
this.subscription.unsubscribe();
|
|
521
374
|
}
|
|
522
375
|
};
|
|
523
376
|
WmMenuAlertaPanicoService.prototype.ngOnDestroy = function () {
|
|
524
|
-
console.log('ngOnDestroy ejecutado.');
|
|
525
377
|
this.stopSound();
|
|
526
378
|
this.stopFlashingTitle();
|
|
527
379
|
};
|
|
528
380
|
WmMenuAlertaPanicoService.prototype.playSound = function () {
|
|
529
381
|
var _this = this;
|
|
530
|
-
console.log('playSound llamado.');
|
|
531
382
|
if (this.isPlaying)
|
|
532
383
|
return; // Evita reproducir si ya está sonando
|
|
533
384
|
this.isPlaying = true;
|
|
534
385
|
if (!this.audio) {
|
|
535
386
|
this.audio = new Audio(this.rutaAudio); // Ruta al archivo de sonido
|
|
536
387
|
}
|
|
537
|
-
console.log("Audio cargado: ", this.audio);
|
|
538
388
|
this.audio.loop = true; // Reproducir en bucle
|
|
539
389
|
this.audio.play()
|
|
540
390
|
.then(function () {
|
|
541
|
-
console.log('Sonido reproduciéndose.');
|
|
542
391
|
// Detener el sonido después de 10 segundos
|
|
543
392
|
_this.soundTimeout = setTimeout(function () {
|
|
544
393
|
_this.stopSound();
|
|
545
394
|
}, 10000); // Detener después de 10 segundos
|
|
546
395
|
})
|
|
547
396
|
.catch(function (error) {
|
|
548
|
-
console.
|
|
397
|
+
console.log('Error al reproducir el sonido:', error);
|
|
549
398
|
});
|
|
550
399
|
};
|
|
551
400
|
WmMenuAlertaPanicoService.prototype.stopSound = function () {
|
|
552
|
-
console.log('stopSound llamado.');
|
|
553
401
|
if (this.audio) {
|
|
554
402
|
this.audio.pause();
|
|
555
403
|
this.audio.currentTime = 0; // Reinicia el sonido
|
|
@@ -562,7 +410,6 @@
|
|
|
562
410
|
};
|
|
563
411
|
WmMenuAlertaPanicoService.prototype.startFlashingTitle = function () {
|
|
564
412
|
var _this = this;
|
|
565
|
-
console.log('startFlashingTitle llamado.');
|
|
566
413
|
var toggle = false;
|
|
567
414
|
// Almacenar el título original si aún no se ha guardado
|
|
568
415
|
if (!this.originalTitle) {
|
|
@@ -577,7 +424,6 @@
|
|
|
577
424
|
}
|
|
578
425
|
};
|
|
579
426
|
WmMenuAlertaPanicoService.prototype.stopFlashingTitle = function () {
|
|
580
|
-
console.log('stopFlashingTitle llamado.');
|
|
581
427
|
if (this.intervalId) {
|
|
582
428
|
clearInterval(this.intervalId);
|
|
583
429
|
this.intervalId = null;
|
|
@@ -586,16 +432,13 @@
|
|
|
586
432
|
};
|
|
587
433
|
WmMenuAlertaPanicoService.prototype.revisarAlertasPendientes = function (urlObtenerAlertasPanico, token) {
|
|
588
434
|
var _this = this;
|
|
589
|
-
console.log('revisarAlertasPendientes llamado con parámetros:', { urlObtenerAlertasPanico: urlObtenerAlertasPanico, token: token });
|
|
590
435
|
var helper = new angularJwt.JwtHelperService();
|
|
591
436
|
var decodedToken = helper.decodeToken(token);
|
|
592
437
|
this.wmMenuServicioService
|
|
593
438
|
.menuApiObtener(urlObtenerAlertasPanico, decodedToken['id_usuario'], token)
|
|
594
439
|
.subscribe(function (resp) {
|
|
595
|
-
console.log('Respuesta obtenida de revisarAlertasPendientes:', resp);
|
|
596
440
|
if (resp && resp.length > 0) {
|
|
597
441
|
var alertasIds_1 = resp.map(function (alerta) { return alerta.IdAlertaPanico; });
|
|
598
|
-
console.log('IDs de alertas obtenidas:', alertasIds_1);
|
|
599
442
|
// Eliminar IDs que no están en la respuesta del servicio
|
|
600
443
|
_this.IdsAlertasPanicoActivas.forEach(function (id) {
|
|
601
444
|
if (!alertasIds_1.includes(id)) {
|
|
@@ -635,6 +478,150 @@
|
|
|
635
478
|
return WmMenuAlertaPanicoService;
|
|
636
479
|
}());
|
|
637
480
|
|
|
481
|
+
var WmMenuComponent = /** @class */ (function () {
|
|
482
|
+
function WmMenuComponent(wmMenuServicioService, alertaPanicoService) {
|
|
483
|
+
this.wmMenuServicioService = wmMenuServicioService;
|
|
484
|
+
this.alertaPanicoService = alertaPanicoService;
|
|
485
|
+
this.menuSecundarioSel = new MenuSecundario();
|
|
486
|
+
this.menuLateralAbierto = false;
|
|
487
|
+
this.menuIdioma = [];
|
|
488
|
+
this.intervaloPeticionesMs = 60000;
|
|
489
|
+
}
|
|
490
|
+
WmMenuComponent.prototype.ngOnInit = function () {
|
|
491
|
+
var _this = this;
|
|
492
|
+
this.cargarMenuCuenta();
|
|
493
|
+
this.alertaPanicoService.iniciarProceso(this.intervaloPeticionesMs, function () { return _this.alertaPanicoService.revisarAlertasPendientes(_this.urlObtenerAlertasPanico, _this.token); }, this.urlObtenerParametro, this.token, this.rutaAudio);
|
|
494
|
+
if (this.urlMenu && this.token) {
|
|
495
|
+
var helper = new angularJwt.JwtHelperService();
|
|
496
|
+
var decodedToken = helper.decodeToken(this.token);
|
|
497
|
+
this.wmMenuServicioService
|
|
498
|
+
.menuApiObtener(this.urlMenu, decodedToken["id_usuario"], this.token)
|
|
499
|
+
.subscribe(function (resp) {
|
|
500
|
+
_this.menuPrincipal = _this.wmMenuServicioService.mapearMenu(resp);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
if (this.urlIdiomas && this.token) {
|
|
504
|
+
var helper = new angularJwt.JwtHelperService();
|
|
505
|
+
var decodedToken = helper.decodeToken(this.token);
|
|
506
|
+
this.wmMenuServicioService
|
|
507
|
+
.menuIdiomasObtener(this.urlIdiomas, decodedToken["id_usuario"], this.token)
|
|
508
|
+
.subscribe(function (resp) {
|
|
509
|
+
_this.menuIdioma = resp;
|
|
510
|
+
_this.cargarMenuCuenta();
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
if (this.urlBaseAlmacenamiento && this.token) {
|
|
514
|
+
var helper = new angularJwt.JwtHelperService();
|
|
515
|
+
var decodedToken = helper.decodeToken(this.token);
|
|
516
|
+
this.wmMenuServicioService
|
|
517
|
+
.almacenamientoApiObtener(this.urlBaseAlmacenamiento, decodedToken["id_usuario"], this.token)
|
|
518
|
+
.subscribe(function (resp) {
|
|
519
|
+
var utilizado = resp[0] && resp[0].Utilizado ? resp[0].Utilizado : 0;
|
|
520
|
+
var total = resp[0] && resp[0].Total ? resp[0].Total : 0;
|
|
521
|
+
_this.porcentajeUtilizado = Math.round((utilizado / total) * 100);
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
WmMenuComponent.prototype.clickMenuPrincipal = function (i) {
|
|
526
|
+
if (this.menuPrincipal[i].hijos && this.menuPrincipal[i].hijos.length) {
|
|
527
|
+
if (this.menuPrincipalSel == this.menuPrincipal[i]) {
|
|
528
|
+
this.menuPrincipalSel = null;
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
this.menuPrincipalSel = this.menuPrincipal[i];
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
WmMenuComponent.prototype.clickMenuSecundario = function (i) {
|
|
536
|
+
this.menuSecundarioSel = this.menuSecundario[i];
|
|
537
|
+
this.menuPrincipalSel = null;
|
|
538
|
+
};
|
|
539
|
+
WmMenuComponent.prototype.cargarMenuCuenta = function () {
|
|
540
|
+
var _a;
|
|
541
|
+
if (this.urlCuentaSeguridad && this.token) {
|
|
542
|
+
var helper = new angularJwt.JwtHelperService();
|
|
543
|
+
var decodedToken = helper.decodeToken(this.token);
|
|
544
|
+
this.menuSecundario = [{
|
|
545
|
+
titulo: decodedToken["unique_name"],
|
|
546
|
+
icono: "account_circle",
|
|
547
|
+
hijos: [
|
|
548
|
+
{ titulo: decodedToken["unique_name"], url: "", icono: "person" },
|
|
549
|
+
{ titulo: this.menuIdioma && this.menuIdioma.CambiarContrasenna ? this.menuIdioma.CambiarContrasenna : "Cambiar contraseña", url: this.urlCuentaSeguridad + "CambioContrasena", icono: "vpn_key" },
|
|
550
|
+
this.activar2fa == "1" ? { titulo: this.menuIdioma && this.menuIdioma.Configurar2fa ? this.menuIdioma.Configurar2fa : "Configurar 2FA", url: this.urlCuentaSeguridad + "Habilitacion2FA", icono: "verified_user" } : null,
|
|
551
|
+
this.urlguiasOnline != null && this.urlguiasOnline !== "" && ((_a = this.urlguiasOnline) === null || _a === void 0 ? void 0 : _a.length) != 0 ? { titulo: this.menuIdioma && this.menuIdioma.guiasOnline ? this.menuIdioma.guiasOnline : "Guias Online", url: this.urlguiasOnline, icono: "menu_book" } : null,
|
|
552
|
+
{ titulo: this.menuIdioma && this.menuIdioma.CerrarSesion ? this.menuIdioma.CerrarSesion : "Cerrar sesión", url: this.urlCuentaSeguridad + "CerrarSesion", icono: "exit_to_app" }
|
|
553
|
+
].filter(function (hijo) { return hijo != null; }),
|
|
554
|
+
}];
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
WmMenuComponent.ctorParameters = function () { return [
|
|
558
|
+
{ type: WmMenuServicioService },
|
|
559
|
+
{ type: WmMenuAlertaPanicoService }
|
|
560
|
+
]; };
|
|
561
|
+
__decorate([
|
|
562
|
+
core.Input()
|
|
563
|
+
], WmMenuComponent.prototype, "logo", void 0);
|
|
564
|
+
__decorate([
|
|
565
|
+
core.Input()
|
|
566
|
+
], WmMenuComponent.prototype, "colorFondo", void 0);
|
|
567
|
+
__decorate([
|
|
568
|
+
core.Input()
|
|
569
|
+
], WmMenuComponent.prototype, "colorTexto", void 0);
|
|
570
|
+
__decorate([
|
|
571
|
+
core.Input()
|
|
572
|
+
], WmMenuComponent.prototype, "menuPrincipal", void 0);
|
|
573
|
+
__decorate([
|
|
574
|
+
core.Input()
|
|
575
|
+
], WmMenuComponent.prototype, "menuSecundario", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
core.Input()
|
|
578
|
+
], WmMenuComponent.prototype, "urlMenu", void 0);
|
|
579
|
+
__decorate([
|
|
580
|
+
core.Input()
|
|
581
|
+
], WmMenuComponent.prototype, "token", void 0);
|
|
582
|
+
__decorate([
|
|
583
|
+
core.Input()
|
|
584
|
+
], WmMenuComponent.prototype, "urlCuentaSeguridad", void 0);
|
|
585
|
+
__decorate([
|
|
586
|
+
core.Input()
|
|
587
|
+
], WmMenuComponent.prototype, "activar2fa", void 0);
|
|
588
|
+
__decorate([
|
|
589
|
+
core.Input()
|
|
590
|
+
], WmMenuComponent.prototype, "urlguiasOnline", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
core.Input()
|
|
593
|
+
], WmMenuComponent.prototype, "urlObtenerAlertasPanico", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
core.Input()
|
|
596
|
+
], WmMenuComponent.prototype, "urlObtenerParametro", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
core.Input()
|
|
599
|
+
], WmMenuComponent.prototype, "rutaAudio", void 0);
|
|
600
|
+
__decorate([
|
|
601
|
+
core.Input()
|
|
602
|
+
], WmMenuComponent.prototype, "nombreCliente", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
core.Input()
|
|
605
|
+
], WmMenuComponent.prototype, "nombreUsuario", void 0);
|
|
606
|
+
__decorate([
|
|
607
|
+
core.Input()
|
|
608
|
+
], WmMenuComponent.prototype, "versionWeb", void 0);
|
|
609
|
+
__decorate([
|
|
610
|
+
core.Input()
|
|
611
|
+
], WmMenuComponent.prototype, "urlBaseAlmacenamiento", void 0);
|
|
612
|
+
__decorate([
|
|
613
|
+
core.Input()
|
|
614
|
+
], WmMenuComponent.prototype, "urlIdiomas", void 0);
|
|
615
|
+
WmMenuComponent = __decorate([
|
|
616
|
+
core.Component({
|
|
617
|
+
selector: 'wm-menu',
|
|
618
|
+
template: "<div class=\"menu\" [ngStyle]=\"{'background-color': colorFondo, 'color': colorTexto}\">\r\n <div class=\"d-lg-none\">\r\n <button mat-icon-button (click)=\"menuLateralAbierto=!menuLateralAbierto; menuPrincipalSel = null\">\r\n <mat-icon *ngIf=\"!menuLateralAbierto\" class=\"animate__animated animate__fadeInRight animate__faster\">menu\r\n </mat-icon>\r\n <mat-icon *ngIf=\"menuLateralAbierto\" class=\"animate__animated animate__fadeInLeft animate__faster\">close\r\n </mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"d-lg-none logo-menu-principal\">\r\n <img class=\"logo\" src=\"{{logo}}\">\r\n </div>\r\n <div class=\"d-none d-lg-block\">\r\n <img class=\"logo\" src=\"{{logo}}\">\r\n <div *ngFor=\"let menuItem of menuPrincipal; let i=index\" class=\"d-inline-block\">\r\n\r\n <a *ngIf=\"menuItem.url\" mat-button [href]=\"menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n {{menuItem.titulo}}\r\n </a>\r\n <button *ngIf=\"!menuItem.url\" mat-button (click)=\"clickMenuPrincipal(i)\">\r\n {{menuItem.titulo}}\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"info-adicional\">\r\n <div class=\"datos border-r mt-1\" *ngIf=\"nombreCliente\">{{nombreCliente}}<mat-icon>people</mat-icon></div>\r\n <div class=\"datos border-r mt-1\" *ngIf=\"nombreUsuario\">{{nombreUsuario}}<mat-icon>person_outline</mat-icon></div>\r\n <div class=\"version\" *ngIf=\"versionWeb\">{{versionWeb}}</div>\r\n <div class=\"content-idioma\" *ngIf=\"urlIdiomas\">\r\n <mat-menu #menuIdiomas=\"matMenu\">\r\n <a mat-menu-item *ngFor=\"let menuItem of menuIdioma.Culturas\" href=\"{{urlCuentaSeguridad}}CambiarIdioma?culture={{menuItem.Name}}&ReturnUrl=/\">\r\n {{menuItem.NativeName}}\r\n </a>\r\n </mat-menu>\r\n <button mat-button [matMenuTriggerFor]=\"menuIdiomas\"><label class=\"mt-1\">{{menuIdioma.Lenguaje}}</label><mat-icon class=\"icon-idioma\">language</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n <div>\r\n <mat-menu #submenu=\"matMenu\">\r\n <a mat-menu-item *ngFor=\"let menuItem of menuSecundarioSel.hijos\" href=\"{{menuItem.url}}\"\r\n [disabled]=\"!menuItem.url\">\r\n <mat-icon *ngIf=\"menuItem.icono\">{{menuItem.icono}}</mat-icon>\r\n {{menuItem.titulo}}\r\n </a>\r\n </mat-menu>\r\n <button *ngFor=\"let menuItem of menuSecundario; let i = index\" mat-icon-button [matMenuTriggerFor]=\"submenu\"\r\n (click)=\"clickMenuSecundario(i)\">\r\n <mat-icon>{{menuItem.icono}}</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"menu-lateral d-lg-none animate__animated animate__fadeInRight animate__faster\" *ngIf=\"menuLateralAbierto\">\r\n <div class=\"row\">\r\n <div *ngFor=\"let menuItem of menuPrincipal; let i=index\" class=\"col-sm-6 col-md-4\">\r\n <a *ngIf=\"menuItem.url\" [href]=\"menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n <div>\r\n <mat-icon svgIcon=\"{{menuItem.icono}}\">{{menuItem.icono}}</mat-icon>\r\n <p>{{menuItem.titulo}}</p>\r\n </div>\r\n </a>\r\n <span *ngIf=\"!menuItem.url\" (click)=\"clickMenuPrincipal(i)\">\r\n <div>\r\n <mat-icon svgIcon=\"{{menuItem.icono}}\">{{menuItem.icono}}</mat-icon>\r\n <p>{{menuItem.titulo}}</p>\r\n </div>\r\n </span>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"sub-menu-fondo animate__animated animate__fadeIn animate__faster\" (click)=\"menuPrincipalSel=null\"\r\n *ngIf=\"menuPrincipalSel\"></div>\r\n\r\n<div class=\"sub-menu animate__animated animate__fadeIn animate__faster\" *ngIf=\"menuPrincipalSel\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-lg-5\">\r\n <div class=\"px-3 px-sm-5 pt-5 pb-lg-5 text-center descripcion-menu\">\r\n <mat-icon [ngStyle]=\"{'color': colorFondo}\" svgIcon=\"{{menuPrincipalSel.icono}}\">\r\n {{menuPrincipalSel.icono}}</mat-icon>\r\n <p>{{menuPrincipalSel.titulo}}</p>\r\n <p class=\"text-secondary\">{{menuPrincipalSel.descripcion}}</p>\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-lg-7 my-4\">\r\n <div class=\"px-3 px-md-4 py-2 py-md-2\">\r\n <ul class=\"list-unstyled\">\r\n\r\n <li class=\"mb-3 d-flex\" *ngFor=\"let menuItem of menuPrincipalSel.hijos\">\r\n <mat-icon>{{menuItem.icono}}</mat-icon>\r\n <div class=\"ml-2 flex-fill\">\r\n <a href=\"{{menuItem.url}}\" *ngIf=\"menuItem.url\">\r\n <div class=\"lead mb-2\">{{menuItem.titulo}}</div>\r\n </a>\r\n <div class=\"lead mb-2\" *ngIf=\"!menuItem.url\">{{menuItem.titulo}}</div>\r\n\r\n <a href=\"{{menuSubItem.url}}\" class=\"pl-2 my-2\" *ngFor=\"let menuSubItem of menuItem.hijos\">\r\n <div class=\"text-secondary\">{{menuSubItem.titulo}}</div>\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <button mat-icon-button class=\"close-icon d-lg-none\" (click)=\"menuPrincipalSel=null\">\r\n <mat-icon>arrow_back</mat-icon>\r\n </button>\r\n</div>\r\n<div class=\"alerta-almacenamiento\" *ngIf=\"porcentajeUtilizado >= 100\">Su capacidad de almacenamiento ha llegado al {{porcentajeUtilizado}}% , libere espacio o adquiera mayor capacidad</div>",
|
|
619
|
+
styles: [".menu{height:46px;display:flex;justify-content:space-between;align-items:center;top:0;left:0;right:0;background-color:#1c98a4;color:#fff;padding:0 4px}.menu .d-lg-block .mat-button{font-weight:400;height:46px;line-height:46px}.menu .logo{display:inline-block;height:40px}.menu .logo-menu-principal{position:absolute;display:block;left:65px}.menu .logo-menu-principal>img{display:block;margin:0 -50%}.menu .info-adicional{color:#fff;display:flex;justify-content:end;font-size:13px;position:absolute;right:47px}.menu .info-adicional .border-r{border-right:1px solid #fff}.menu .info-adicional .version{margin:7px 0 0 7px}.menu .info-adicional div.datos{margin:0 2px 0 5px;height:28px}.menu .info-adicional .mat-icon{vertical-align:middle;font-size:17px;color:#fff;line-height:21px;margin-left:2px}.menu .info-adicional button{padding:0 0 0 15px}.menu .info-adicional .content-idioma{margin:-5px 2px 0 5px;display:block;cursor:pointer}.menu .info-adicional .icon-idioma{font-size:17px!important;vertical-align:text-top!important;color:#fffc}.sub-menu{width:100%;position:absolute;top:46px;z-index:1000;background-color:#fff;display:flex;overflow-y:auto;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.sub-menu .close-icon{position:absolute;left:4px;top:4px}.sub-menu .descripcion-menu .mat-icon{color:#1c98a4;width:100px;height:100px}.sub-menu .descripcion-menu p:first-of-type{font-weight:300;font-size:30px;margin:16px 0}.sub-menu .descripcion-menu p:last-of-type{color:#6c757d}.sub-menu li{float:left;width:50%}.sub-menu li>.mat-icon{color:#444}.sub-menu li:nth-child(even){float:right}.sub-menu li a{transition:.5s;display:block}.sub-menu li a:hover{margin-left:8px}.sub-menu li .lead{line-height:24px;color:#212529;font-size:17px}.sub-menu-fondo{background:#272d3357;position:absolute;top:46px;bottom:0;left:0;right:0;z-index:1000}.menu-lateral{width:100%;position:absolute;top:46px;bottom:0;left:0;right:0;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;background:#f7f7f7;padding:20px}.menu-lateral>div>div>*>div{text-align:center;padding:16px;background-color:#fff;margin:0 0 16px;color:#333;cursor:pointer;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.menu-lateral>div>div>*>div>.mat-icon{width:50px;height:50px}.menu-lateral>div>div>*>div>p{padding:0;margin:8px 0 0}a.mat-menu-item{color:#444!important}.alerta-almacenamiento{background:#ffffec;border-bottom:1px solid #efff00;min-height:39px;line-height:36px;font-size:12px;padding:0 0 0 25px}@media (max-width:767.98px){.sub-menu ul{margin:auto;padding:0 10px}.sub-menu ul li{float:none;width:100%}.sub-menu ul li:nth-child(even){float:none}}@media (max-width:991.98px){.sub-menu{bottom:0}}@media (min-width:600px){.logo-menu-principal{left:50%!important}}* :focus,:active{outline:0!important}"]
|
|
620
|
+
})
|
|
621
|
+
], WmMenuComponent);
|
|
622
|
+
return WmMenuComponent;
|
|
623
|
+
}());
|
|
624
|
+
|
|
638
625
|
var WmMenuModule = /** @class */ (function () {
|
|
639
626
|
function WmMenuModule() {
|
|
640
627
|
}
|