@softdin/portal-admin 0.0.0-stage → 0.2.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/README.md +95 -2
- package/dist-lib/chunks/AppLayout-COCPfLWo.js +303 -0
- package/dist-lib/chunks/AuditoriaView-Bcf_kOqI.js +643 -0
- package/dist-lib/chunks/CarnetView-BsdUtYeu.js +450 -0
- package/dist-lib/chunks/CarteleraView-CRnVjt-S.js +996 -0
- package/dist-lib/chunks/CertificadosView-DvHDflcN.js +549 -0
- package/dist-lib/chunks/ChatBandejaView-HqhdSw7G.js +274 -0
- package/dist-lib/chunks/ChatConfiguracionView-BdH5gDdR.js +716 -0
- package/dist-lib/chunks/ChatConocimientoView-nKTAKxFa.js +263 -0
- package/dist-lib/chunks/ChatConversacionView-Do74V09l.js +477 -0
- package/dist-lib/chunks/ChatInformeView-BIiAH9L_.js +280 -0
- package/dist-lib/chunks/ChatRespuestasView-QFXbyg8U.js +183 -0
- package/dist-lib/chunks/EmpleadosView-BtqrO5-8.js +311 -0
- package/dist-lib/chunks/HomologacionView-UCZk4u6R.js +949 -0
- package/dist-lib/chunks/IngresoSsoView-BKkcnrYO.js +98 -0
- package/dist-lib/chunks/SolicitudesView-CYPD2A1s.js +900 -0
- package/dist-lib/chunks/TiposSolicitudView-CrWTVizl.js +168 -0
- package/dist-lib/chunks/ToggleSwitch-BYrIyheq.js +55 -0
- package/dist-lib/chunks/_plugin-vue_export-helper-BOaGB7Aw.js +8 -0
- package/dist-lib/chunks/api-M7D1c3IT.js +97 -0
- package/dist-lib/chunks/apiError-BHGbwz97.js +15 -0
- package/dist-lib/chunks/auth.store-BrGKZg-7.js +220 -0
- package/dist-lib/chunks/chat.service-C7ZQf4w3.js +241 -0
- package/dist-lib/chunks/cliente-interno.store-De39VsEE.js +203 -0
- package/dist-lib/chunks/homologacion-CoeHD7cB.js +131 -0
- package/dist-lib/chunks/portal-empleado-6KQrnsQJ.js +120 -0
- package/dist-lib/chunks/tipos-D93bLfFC.js +22 -0
- package/dist-lib/portal-admin.js +196 -0
- package/dist-lib/style.css +4813 -0
- package/dist-lib/types/App.vue.d.ts +3 -0
- package/dist-lib/types/components/AppLayout.vue.d.ts +3 -0
- package/dist-lib/types/components/CarnetClientesInternos.vue.d.ts +11 -0
- package/dist-lib/types/components/InvitacionPortalModal.vue.d.ts +20 -0
- package/dist-lib/types/components/MenuUsuario.vue.d.ts +3 -0
- package/dist-lib/types/components/VistoBuenoPortalModal.vue.d.ts +23 -0
- package/dist-lib/types/components/auditoria/AuditoriaFila.vue.d.ts +16 -0
- package/dist-lib/types/components/auditoria/AuditoriaFiltros.vue.d.ts +30 -0
- package/dist-lib/types/components/auditoria/AuditoriaPaginador.vue.d.ts +14 -0
- package/dist-lib/types/components/cartelera/PaginaCarteleraImagen.vue.d.ts +14 -0
- package/dist-lib/types/components/cartelera/PublicacionFormModal.vue.d.ts +27 -0
- package/dist-lib/types/components/cartelera/VistaCelularCartelera.vue.d.ts +34 -0
- package/dist-lib/types/components/certificados/AtenderCertificadoModal.vue.d.ts +22 -0
- package/dist-lib/types/components/certificados/RechazarCertificadoModal.vue.d.ts +18 -0
- package/dist-lib/types/components/certificados/ResumenSolicitudCertificado.vue.d.ts +8 -0
- package/dist-lib/types/components/chat/ChatClientesInternos.vue.d.ts +21 -0
- package/dist-lib/types/components/chat/ChatHorarioCampos.vue.d.ts +21 -0
- package/dist-lib/types/components/forms/ExportExcelButton.vue.d.ts +30 -0
- package/dist-lib/types/components/forms/ToggleSwitch.vue.d.ts +17 -0
- package/dist-lib/types/components/homologacion/HomologacionFila.vue.d.ts +30 -0
- package/dist-lib/types/components/homologacion/TipoPermisoFormModal.vue.d.ts +26 -0
- package/dist-lib/types/components/homologacion/TipoSolicitudFormModal.vue.d.ts +27 -0
- package/dist-lib/types/lib/auditoria.d.ts +25 -0
- package/dist-lib/types/lib/cartelera-paginas.d.ts +26 -0
- package/dist-lib/types/lib/cartelera-vigencia.d.ts +3 -0
- package/dist-lib/types/lib/export-excel-csv.d.ts +4 -0
- package/dist-lib/types/lib/export-excel.d.ts +9 -0
- package/dist-lib/types/lib/exportar-listado.d.ts +68 -0
- package/dist-lib/types/lib/homologacion.d.ts +41 -0
- package/dist-lib/types/lib/portal-empleado.d.ts +32 -0
- package/dist-lib/types/modulo.d.ts +31 -0
- package/dist-lib/types/portal-admin/config.d.ts +17 -0
- package/dist-lib/types/portal-admin/rutas.d.ts +17 -0
- package/dist-lib/types/portal-admin/tipos.d.ts +68 -0
- package/dist-lib/types/router/index.d.ts +7 -0
- package/dist-lib/types/services/api.d.ts +29 -0
- package/dist-lib/types/services/auditoria.service.d.ts +63 -0
- package/dist-lib/types/services/auth.service.d.ts +61 -0
- package/dist-lib/types/services/carnet.service.d.ts +56 -0
- package/dist-lib/types/services/cartelera.service.d.ts +69 -0
- package/dist-lib/types/services/chat.service.d.ts +279 -0
- package/dist-lib/types/services/configuracion-cliente-interno.service.d.ts +23 -0
- package/dist-lib/types/services/homologacion.service.d.ts +105 -0
- package/dist-lib/types/services/portal-empleado.service.d.ts +112 -0
- package/dist-lib/types/services/solicitudes-certificado.service.d.ts +59 -0
- package/dist-lib/types/stores/auth.store.d.ts +125 -0
- package/dist-lib/types/stores/cliente-interno.store.d.ts +65 -0
- package/dist-lib/types/utils/apiError.d.ts +4 -0
- package/dist-lib/types/views/AuditoriaView.vue.d.ts +3 -0
- package/dist-lib/types/views/CarnetView.vue.d.ts +3 -0
- package/dist-lib/types/views/CarteleraView.vue.d.ts +3 -0
- package/dist-lib/types/views/CertificadosView.vue.d.ts +3 -0
- package/dist-lib/types/views/EmpleadosView.vue.d.ts +3 -0
- package/dist-lib/types/views/HomologacionView.vue.d.ts +4 -0
- package/dist-lib/types/views/IngresoSsoView.vue.d.ts +3 -0
- package/dist-lib/types/views/LoginView.vue.d.ts +3 -0
- package/dist-lib/types/views/OlvideView.vue.d.ts +3 -0
- package/dist-lib/types/views/RestablecerView.vue.d.ts +3 -0
- package/dist-lib/types/views/SolicitudesView.vue.d.ts +3 -0
- package/dist-lib/types/views/TiposSolicitudView.vue.d.ts +3 -0
- package/dist-lib/types/views/chat/ChatBandejaView.vue.d.ts +3 -0
- package/dist-lib/types/views/chat/ChatConfiguracionView.vue.d.ts +3 -0
- package/dist-lib/types/views/chat/ChatConocimientoView.vue.d.ts +3 -0
- package/dist-lib/types/views/chat/ChatConversacionView.vue.d.ts +11 -0
- package/dist-lib/types/views/chat/ChatInformeView.vue.d.ts +3 -0
- package/dist-lib/types/views/chat/ChatRespuestasView.vue.d.ts +3 -0
- package/package.json +66 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/portal-admin/tipos.ts
|
|
2
|
+
/** Nombres de las rutas del módulo: siempre con el prefijo `portal-`. */
|
|
3
|
+
var RUTAS_PORTAL = {
|
|
4
|
+
inicio: "portal-inicio",
|
|
5
|
+
ingreso: "portal-ingreso",
|
|
6
|
+
solicitudes: "portal-solicitudes",
|
|
7
|
+
certificados: "portal-certificados",
|
|
8
|
+
empleados: "portal-empleados",
|
|
9
|
+
tiposSolicitud: "portal-tipos-solicitud",
|
|
10
|
+
homologacion: "portal-homologacion",
|
|
11
|
+
carnet: "portal-carnet",
|
|
12
|
+
cartelera: "portal-cartelera",
|
|
13
|
+
chat: "portal-chat",
|
|
14
|
+
chatConfiguracion: "portal-chat-configuracion",
|
|
15
|
+
chatRespuestas: "portal-chat-respuestas",
|
|
16
|
+
chatInforme: "portal-chat-informe",
|
|
17
|
+
chatConocimiento: "portal-chat-conocimiento",
|
|
18
|
+
chatConversacion: "portal-chat-conversacion",
|
|
19
|
+
auditoria: "portal-auditoria"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { RUTAS_PORTAL as t };
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { i as configurarApiUrl, n as apiUrlConfigurada, o as setupApiInterceptors, r as apiUrlRecordada, t as api } from "./chunks/api-M7D1c3IT.js";
|
|
2
|
+
import { i as unirRuta, n as configPortal, r as normalizarBasePath, t as useAuthStore } from "./chunks/auth.store-BrGKZg-7.js";
|
|
3
|
+
import { t as useClienteInternoStore } from "./chunks/cliente-interno.store-De39VsEE.js";
|
|
4
|
+
import { t as RUTAS_PORTAL } from "./chunks/tipos-D93bLfFC.js";
|
|
5
|
+
//#region src/portal-admin/rutas.ts
|
|
6
|
+
/**
|
|
7
|
+
* Rutas del portal administrativo. Todas llevan `meta.portalAdmin` (así la guardia sabe que
|
|
8
|
+
* son suyas) y nombres con prefijo `portal-` para no chocar con los de la app que las monta.
|
|
9
|
+
*/
|
|
10
|
+
function crearRutasPortalAdmin(opciones = {}) {
|
|
11
|
+
const base = normalizarBasePath(opciones.basePath);
|
|
12
|
+
const extra = opciones.metaRutas ?? {};
|
|
13
|
+
const meta = (titulo, otros = {}) => ({
|
|
14
|
+
...extra,
|
|
15
|
+
titulo,
|
|
16
|
+
portalAdmin: true,
|
|
17
|
+
...otros
|
|
18
|
+
});
|
|
19
|
+
const rutas = [{
|
|
20
|
+
path: base,
|
|
21
|
+
component: () => import("./chunks/AppLayout-COCPfLWo.js"),
|
|
22
|
+
meta: {
|
|
23
|
+
...extra,
|
|
24
|
+
portalAdmin: true
|
|
25
|
+
},
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
path: "",
|
|
29
|
+
name: RUTAS_PORTAL.inicio,
|
|
30
|
+
redirect: { name: RUTAS_PORTAL.solicitudes }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
path: "solicitudes",
|
|
34
|
+
name: RUTAS_PORTAL.solicitudes,
|
|
35
|
+
component: () => import("./chunks/SolicitudesView-CYPD2A1s.js"),
|
|
36
|
+
meta: meta("Solicitudes")
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
path: "certificados",
|
|
40
|
+
name: RUTAS_PORTAL.certificados,
|
|
41
|
+
component: () => import("./chunks/CertificadosView-DvHDflcN.js"),
|
|
42
|
+
meta: meta("Certificados")
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: "empleados",
|
|
46
|
+
name: RUTAS_PORTAL.empleados,
|
|
47
|
+
component: () => import("./chunks/EmpleadosView-BtqrO5-8.js"),
|
|
48
|
+
meta: meta("Empleados")
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: "tipos-solicitud",
|
|
52
|
+
name: RUTAS_PORTAL.tiposSolicitud,
|
|
53
|
+
component: () => import("./chunks/TiposSolicitudView-CrWTVizl.js"),
|
|
54
|
+
meta: meta("Tipos de solicitud")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: "homologacion",
|
|
58
|
+
name: RUTAS_PORTAL.homologacion,
|
|
59
|
+
component: () => import("./chunks/HomologacionView-UCZk4u6R.js"),
|
|
60
|
+
meta: meta("Homologación")
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
path: "carnet",
|
|
64
|
+
name: RUTAS_PORTAL.carnet,
|
|
65
|
+
component: () => import("./chunks/CarnetView-BsdUtYeu.js"),
|
|
66
|
+
meta: meta("Carnet digital")
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: "cartelera",
|
|
70
|
+
name: RUTAS_PORTAL.cartelera,
|
|
71
|
+
component: () => import("./chunks/CarteleraView-CRnVjt-S.js"),
|
|
72
|
+
meta: meta("Cartelera")
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
path: "chat",
|
|
76
|
+
name: RUTAS_PORTAL.chat,
|
|
77
|
+
component: () => import("./chunks/ChatBandejaView-HqhdSw7G.js"),
|
|
78
|
+
meta: meta("Chat")
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
path: "chat/configuracion",
|
|
82
|
+
name: RUTAS_PORTAL.chatConfiguracion,
|
|
83
|
+
component: () => import("./chunks/ChatConfiguracionView-BdH5gDdR.js"),
|
|
84
|
+
meta: meta("Configuración del chat")
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
path: "chat/respuestas",
|
|
88
|
+
name: RUTAS_PORTAL.chatRespuestas,
|
|
89
|
+
component: () => import("./chunks/ChatRespuestasView-QFXbyg8U.js"),
|
|
90
|
+
meta: meta("Respuestas guardadas")
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
path: "chat/informe",
|
|
94
|
+
name: RUTAS_PORTAL.chatInforme,
|
|
95
|
+
component: () => import("./chunks/ChatInformeView-BIiAH9L_.js"),
|
|
96
|
+
meta: meta("Informe del chat")
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
path: "chat/conocimiento",
|
|
100
|
+
name: RUTAS_PORTAL.chatConocimiento,
|
|
101
|
+
component: () => import("./chunks/ChatConocimientoView-nKTAKxFa.js"),
|
|
102
|
+
meta: meta("Base de conocimiento")
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
path: "auditoria",
|
|
106
|
+
name: RUTAS_PORTAL.auditoria,
|
|
107
|
+
component: () => import("./chunks/AuditoriaView-Bcf_kOqI.js"),
|
|
108
|
+
meta: meta("Auditoría", { soloAdmin: true })
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
path: "chat/:id(\\d+)",
|
|
112
|
+
name: RUTAS_PORTAL.chatConversacion,
|
|
113
|
+
component: () => import("./chunks/ChatConversacionView-Do74V09l.js"),
|
|
114
|
+
props: (r) => ({ id: Number(r.params.id) }),
|
|
115
|
+
meta: meta("Conversación")
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}];
|
|
119
|
+
if (opciones.conSso) rutas.unshift({
|
|
120
|
+
path: unirRuta(base, "ingreso"),
|
|
121
|
+
name: RUTAS_PORTAL.ingreso,
|
|
122
|
+
component: () => import("./chunks/IngresoSsoView-BKkcnrYO.js"),
|
|
123
|
+
meta: meta("Ingreso al portal", { portalIngreso: true })
|
|
124
|
+
});
|
|
125
|
+
return rutas;
|
|
126
|
+
}
|
|
127
|
+
/** A dónde ir sin sesión del portal: el ingreso por SSO o el login propio de la app. */
|
|
128
|
+
function sinSesion(volver) {
|
|
129
|
+
const query = volver ? { volver } : void 0;
|
|
130
|
+
return configPortal.sesion ? {
|
|
131
|
+
name: RUTAS_PORTAL.ingreso,
|
|
132
|
+
query
|
|
133
|
+
} : {
|
|
134
|
+
name: "login",
|
|
135
|
+
query
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Guardia de las rutas del módulo (las demás pasan sin tocarlas): sin sesión al ingreso, una
|
|
140
|
+
* verificación de `rrhh/me` por carga y las pantallas de solo administradores.
|
|
141
|
+
*/
|
|
142
|
+
async function guardiaPortalAdmin(to) {
|
|
143
|
+
if (!to.matched.some((r) => r.meta.portalAdmin)) return true;
|
|
144
|
+
if (to.meta.portalIngreso) return true;
|
|
145
|
+
const auth = useAuthStore();
|
|
146
|
+
if (!auth.isAuthenticated) return sinSesion(to.fullPath);
|
|
147
|
+
try {
|
|
148
|
+
await auth.verificar();
|
|
149
|
+
} catch {
|
|
150
|
+
if (!auth.isAuthenticated) return sinSesion();
|
|
151
|
+
}
|
|
152
|
+
if (to.meta.soloAdmin && !auth.esAdmin) return { name: RUTAS_PORTAL.solicitudes };
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/modulo.ts
|
|
157
|
+
/**
|
|
158
|
+
* Configura el cliente HTTP del portal, registra sus rutas bajo `basePath` (y bajo
|
|
159
|
+
* `rutaPadre`, si se da) y su guardia. Debe llamarse con Pinia ya instalada y antes de
|
|
160
|
+
* `app.use(router)` para que la primera navegación ya encuentre las rutas.
|
|
161
|
+
*/
|
|
162
|
+
function instalarPortalAdmin(router, opciones = {}) {
|
|
163
|
+
configPortal.basePath = normalizarBasePath(opciones.basePath);
|
|
164
|
+
configPortal.sesion = opciones.sesion ?? null;
|
|
165
|
+
configPortal.alSalir = opciones.alSalir ?? null;
|
|
166
|
+
configPortal.cambioDeTenant = opciones.cambioDeTenant ?? true;
|
|
167
|
+
const apiUrl = opciones.apiUrl || (configPortal.sesion ? apiUrlRecordada() : null);
|
|
168
|
+
if (apiUrl) configurarApiUrl(apiUrl);
|
|
169
|
+
const alExpirar = opciones.alExpirar ?? (() => {
|
|
170
|
+
useAuthStore().clearSession();
|
|
171
|
+
router.push(configPortal.sesion ? { name: RUTAS_PORTAL.ingreso } : {
|
|
172
|
+
name: "login",
|
|
173
|
+
query: { motivo: "sesion" }
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
setupApiInterceptors(() => useAuthStore().token, alExpirar, configPortal.sesion ? () => useAuthStore().renovarSso() : null);
|
|
177
|
+
const rutas = crearRutasPortalAdmin({
|
|
178
|
+
basePath: configPortal.basePath,
|
|
179
|
+
conSso: configPortal.sesion !== null,
|
|
180
|
+
metaRutas: opciones.metaRutas
|
|
181
|
+
});
|
|
182
|
+
for (const ruta of rutas) if (opciones.rutaPadre) router.addRoute(opciones.rutaPadre, ruta);
|
|
183
|
+
else router.addRoute(ruta);
|
|
184
|
+
router.beforeEach(guardiaPortalAdmin);
|
|
185
|
+
return {
|
|
186
|
+
rutas,
|
|
187
|
+
async cerrarSesion() {
|
|
188
|
+
const auth = useAuthStore();
|
|
189
|
+
if (auth.token && apiUrlConfigurada()) await auth.logout();
|
|
190
|
+
else auth.clearSession();
|
|
191
|
+
useClienteInternoStore().reiniciar();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { RUTAS_PORTAL, crearRutasPortalAdmin, guardiaPortalAdmin, instalarPortalAdmin, api as portalApi, useAuthStore as usePortalAuthStore, useClienteInternoStore as usePortalClienteInternoStore };
|