Explorar o código

Adaptacion pull

Jose Brito %!s(int64=3) %!d(string=hai) anos
pai
achega
75287179e1

+ 17 - 0
sistema-mantenimiento-front/angular.json

@@ -17,6 +17,23 @@
         "build": {
           "builder": "@angular-devkit/build-angular:browser",
           "options": {
+            "allowedCommonJsDependencies": [
+              "crypto", 
+              "rxjs-compat", 
+              "lodash", 
+              "jspdf-autotable", 
+              "libsodium-wrappers", 
+              "libsodium", 
+              "canvg", 
+              "jspdf", 
+              "jspdf-autotable", 
+              "rxjs",
+              "crypto-browserify",
+              "tslib", 
+              "zone.js",
+              "raf",
+              "@babel/runtime-corejs3"
+            ],
             "outputPath": "dist/sistema-mantenimiento-front",
             "index": "src/index.html",
             "main": "src/main.ts",

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 644 - 51
sistema-mantenimiento-front/package-lock.json


+ 14 - 0
sistema-mantenimiento-front/package.json

@@ -23,16 +23,30 @@
     "@angular/router": "~13.1.0",
     "@ng-web-apis/common": "^2.0.0",
     "@ng-web-apis/geolocation": "^1.0.4",
+    "@ngx-translate/core": "^14.0.0",
+    "@ngx-translate/http-loader": "^7.0.0",
+    "@syncfusion/ej2-angular-base": "^20.1.48",
+    "@syncfusion/ej2-angular-diagrams": "^20.1.48",
+    "@syncfusion/ej2-angular-dropdowns": "^20.1.50",
+    "@syncfusion/ej2-angular-grids": "^20.1.48",
+    "assert": "^2.0.0",
     "chart.js": "^3.6.0",
+    "crypto-browserify": "^3.12.0",
+    "https-browserify": "^1.0.0",
     "jspdf": "^2.5.1",
     "jspdf-autotable": "^3.5.23",
     "libsodium-wrappers": "^0.7.9",
     "ng2-charts": "^3.0.9",
     "ngx-cookie-service": "^13.2.0",
     "ngx-socket-io": "^4.2.0",
+    "ngx-skeleton-loader": "^5.0.0",
+    "node-polyfill-webpack-plugin": "^1.1.4",
+    "os-browserify": "^0.3.0",
     "path": "^0.12.7",
     "rxjs": "~7.4.0",
     "stream": "^0.0.2",
+    "stream-browserify": "^3.0.0",
+    "stream-http": "^3.2.0",
     "tslib": "^2.3.0",
     "zone.js": "~0.11.4"
   },

+ 114 - 0
sistema-mantenimiento-front/src/assets/i18n/en.json

@@ -0,0 +1,114 @@
+{
+  "required": "The field is required",
+  "datos.vacios": "No data recorded",
+  "datos.seleccionados": "No versions selected",
+  "buscador": "Search",
+  "buscador.placeholder": "Enter what you need to search",
+
+  "texto.dialog.registrar": "Register",
+  "texto.dialog.modificar": "Modify",
+
+  "paginador": [
+    "Data per page",
+    "First page",
+    "Last page",
+    "Next page",
+    "Previous page"
+  ],
+  "of": "de",
+
+  "tooltip.modificar": "Modify",
+  "tooltip.registrar": "Register New",
+  "tooltip.boton.dialog.confirmar": "Confirm",
+  "tooltip.boton.dialog.cerrar": "Close",
+  "tooltip.boton.regresar": "Return to the previous window",
+
+  "titulo.workflow": "WorkFlow",
+  "filtro.workflow.radio.1": "Active",
+  "filtro.workflow.radio.2": "Inactive",
+  "modulos": [
+    {
+      "nombre_modulo": "Intervention Request"
+    },
+    {
+      "nombre_modulo": "Purchase request"
+    },
+    {
+      "nombre_modulo": "Order request"
+    },
+    {
+      "nombre_modulo": "Work order"
+    },
+    {
+      "nombre_modulo": "Billing"
+    },
+    {
+      "nombre_modulo": "Stock"
+    }
+  ],
+  "workflow.nombre.form": "Workflow Name",
+  "workflow.nombre.form.placeholder": "Enter the name of the workflow",
+  "workflow.descripcion.form": "Workflow description",
+  "workflow.descripcion.form.placeholder": "Enter a description of the workflow",
+  "workflow.modulos.form": "Modules",
+  "workflow.modulos.form.placeholder": "Select the module to which the workflow will belong",
+  "workflow.pregunta.reglas": "Do you want to add a rule to absent users?",
+  "workflow.pregunta.checkbox": "Add",
+  "workflow.cards.menu-item.detalle": "Workflow detail",
+  "workflow.cards.menu-item.historial": "History",
+  "workflow.cards.menu-item.historial.notificaciones": "Notification history",
+  "workflow.cards.menu-item.historial.versiones": "Workflow version history",
+  "workflow.cards.menu-item.historial.solicitudes": "Request history",
+  "workflow.cards.menu-item.modificar": "Edit workflow",
+
+  "workflow.detalle.guardar.tooltip": "Save Workflow",
+  "workflow.detalle.diagrama.tooltip": "See working diagram",
+  "workflow.detalle.cambio.activo.tooltip": "Activate workflow",
+  "workflow.detalle.cambio.inactivo.tooltip": "Inactive workflow",
+  "workflow.detalle.tabla.secuencia": "Sequence",
+  "workflow.detalle.tabla.estatus": "Status",
+  "workflow.detalle.tabla.tareas": "Tasks",
+  "workflow.detalle.tabla.campos": "Fields",
+  "workflow.detalle.tabla.notificar": "Notify",
+  "workflow.detalle.tabla.acciones": "Actions",
+  "workflow.detalle.tabla.acciones.usuarios.tootltip": "View users",
+  "workflow.detalle.tabla.acciones.inhabilitar.tootltip": "Disable",
+  "workflow.detalle.tabla.acciones.habilitar.tootltip": "Enable",
+  "workflow.detalle.tabla.acciones.eliminar.tootltip": "Delete",
+
+  "workflow.detalle.pasos.form.accion": "Task",
+  "workflow.detalle.pasos.form.condicional.label": "Select the process for a positive and negative case",
+  "workflow.detalle.pasos.form.condicional.si": "Yes",
+  "workflow.detalle.pasos.form.condicional.no": "No",
+  "workflow.detalle.pasos.form.posicion.label": "Select the location to which the action belongs",
+  "workflow.detalle.pasos.form.radio.antes": "Before",
+  "workflow.detalle.pasos.form.radio.despues": "After",
+  "workflow.detalle.pasos.form.posicion.paso": "Tasks",
+  "workflow.detalle.pasos.form.notificacion": "Do you want to send a notification?",
+  "workflow.detalle.pasos.form.notificacion.placeholder": "Select users to notify (optional)",
+  "workflow.detalle.pasos.form.notificacion.select": "All",
+  "workflow.detalle.pasos.form.validadores.placeholder": "Select the users or the user that will fill the field",
+  "workflow.detalle.campos.form.campo-formulario": "Select the field of the form to register",
+
+  "workflow.historial.notificaciones.titulo": "Notification history",
+  "workflow.historial.notificaciones.busqueda.avanzada": "Advanced search",
+  "workflow.historial.notificaciones.tabla.fecha.envio": "Send date",
+  "workflow.historial.notificaciones.tabla.task": "Task",
+  "workflow.historial.notificaciones.tabla.workflow": "Workflow",
+  "workflow.historial.notificaciones.tabla.detalle": "Notification detail",
+  "workflow.historial.notificaciones.busqueda.usuarios.placeholder": "Users",
+  "workflow.historial.notificaciones.busqueda.usuarios": "Select the users to consult",
+  "workflow.historial.notificaciones.busqueda.fecha": "Enter the desired date",
+  "workdlow.historial.notificaciones.busqueda.placeholder": "Send date",
+
+  "workflow.historial.solicitudes.titulo": "History of Tasks Performed",
+  "workflow.historial.solicitudes.tabla.detalle": "Request detail",
+
+  "workflow.historial.versiones.titulo": "Version history",
+  "workflow.historial.versiones.subtitulo": "Compare workflow versions",
+  "workflow.historial.versiones.select": "Select version",
+  "workflow.historial.versiones.tarea": "Tarea",
+  "workflow.historial.versiones.secuencia": "Secuencia",
+  "workflow.historial.versiones.isValidated": "Validated",
+  "workflow.historial.versiones.isAvailable": "Enable"
+}

+ 115 - 0
sistema-mantenimiento-front/src/assets/i18n/es.json

@@ -0,0 +1,115 @@
+{
+  "required": "El campo es obligatorio.",
+  "datos.vacios": "No hay datos registrados",
+  "datos.seleccionados": "No hay version seleccionada",
+  "buscador": "Buscador",
+  "buscador.placeholder": "Ingrese lo que necesite buscar",
+  "of": "de",
+  "texto.dialog.registrar": "Registrar",
+  "texto.dialog.modificar": "Modificar",
+
+  "paginador": [
+    "Datos por página",
+    "Primera Página",
+    "Última Página",
+    "Siguiente Página",
+    "Anterior Página"
+  ],
+  "tooltip.modificar": "Modificar",
+  "tooltip.registrar": "Registrar Nuevo",
+  "tooltip.boton.dialog.confirmar": "Confirmar",
+  "tooltip.boton.dialog.cerrar": "Cerrar",
+  "tooltip.boton.regresar": "Regresar a la ventana anterior",
+  "tooltip.boton.eliminar": "Eliminar",
+
+  "titulo.workflow": "Flujos de trabajo",
+  "filtro.workflow.radio.1": "Activo",
+  "filtro.workflow.radio.2": "Inactivo",
+  "modulos": [
+    {
+      "nombre_modulo": "Solicitud de intervención"
+    },
+    {
+      "nombre_modulo": "Solicitud de compras"
+    },
+    {
+      "nombre_modulo": "Solicitud de pedido"
+    },
+    {
+      "nombre_modulo": "Orden de trabajo"
+    },
+    {
+      "nombre_modulo": "Facturación"
+    },
+    {
+      "nombre_modulo": "Stock"
+    }
+  ],
+  "workflow.nombre.form": "Nombre workflow",
+  "workflow.nombre.form.placeholder": "Ingrese el nombre del workflow",
+  "workflow.descripcion.form": "Descripción workflow",
+  "workflow.descripcion.form.placeholder": "Ingrese una descripción ",
+  "workflow.modulos.form": "Modulos",
+  "workflow.modulos.form.placeholder": "Seleccione el modulo al que pertenece el workflow",
+  "workflow.pregunta.reglas": "¿Desea agregar una regla a los usuarios ausentes?",
+  "workflow.pregunta.checkbox": "Agregar",
+  "workflow.cards.menu-item.detalle": "Detalle workflow",
+  "workflow.cards.menu-item.historial": "Historial",
+  "workflow.cards.menu-item.historial.notificaciones": "Historial notificaciones",
+  "workflow.cards.menu-item.historial.versiones": "Historial versiones workflow",
+  "workflow.cards.menu-item.historial.solicitudes": "Historial solicitudes",
+  "workflow.cards.menu-item.modificar": "Modificar workflow",
+
+  "workflow.detalle.guardar.tooltip": "Guardar workflow",
+  "workflow.detalle.diagrama.tooltip": "Ver diagrama de trabajo",
+  "workflow.detalle.cambio.activo.tooltip": "Activar workflow",
+  "workflow.detalle.cambio.inactivo.tooltip": "Desactivar workflow",
+  "workflow.detalle.tabla.secuencia": "Secuencia",
+  "workflow.detalle.tabla.estatus": "Estatus",
+  "workflow.detalle.tabla.tareas": "Tareas",
+  "workflow.detalle.tabla.campos": "Campos",
+  "workflow.detalle.tabla.notificar": "Notificar",
+  "workflow.detalle.tabla.acciones": "Acciones",
+  "workflow.detalle.tabla.acciones.usuarios.tootltip": "Ver usuarios",
+  "workflow.detalle.tabla.acciones.inhabilitar.tootltip": "Inhabilitar",
+  "workflow.detalle.tabla.acciones.habilitar.tootltip": "Habilitar",
+  "workflow.detalle.tabla.acciones.eliminar.tootltip": "Eliminar",
+
+  "workflow.detalle.pasos.form.accion": "Tareas",
+  "workflow.detalle.pasos.form.condicional.label": "Seleccione el proceso para un caso positivo y negativo",
+  "workflow.detalle.pasos.form.condicional.si": "Si",
+  "workflow.detalle.pasos.form.condicional.no": "No",
+  "workflow.detalle.pasos.form.posicion.label": "Seleccione la ubicación a la que pertenecera la acción",
+  "workflow.detalle.pasos.form.radio.antes": "Antes de",
+  "workflow.detalle.pasos.form.radio.despues": "Despues de",
+  "workflow.detalle.pasos.form.posicion.paso": "Tareas",
+  "workflow.detalle.pasos.form.notificacion": "¿Desea notificar a algunos usuarios?",
+  "workflow.detalle.pasos.form.validadores.placeholder": "Seleccionar los usuarios o el usuario que llenara el campo",
+  "workflow.detalle.pasos.form.notificacion.placeholder": "Seleccionar los usuarios a notificar ",
+  "workflow.detalle.pasos.form.notificacion.select": "Todos",
+  "workflow.detalle.campos.form.campo-formulario": "Seleccione el campo del formulario a registrar",
+  "workflow.detalle.campos.form.notificar": "¿Desea que se notifique?",
+
+  "workflow.historial.notificaciones.titulo": "Historial de Notificaciones",
+  "workflow.historial.notificaciones.busqueda.avanzada": "Busqueda avanzada",
+  "workflow.historial.notificaciones.tabla.fecha.envio": "Fecha envio",
+  "workflow.historial.notificaciones.tabla.usuario": "Usuario receptor",
+  "workflow.historial.notificaciones.tabla.workflow": "Flujo de trabajo",
+  "workflow.historial.notificaciones.tabla.detalle": "Detalle notificación",
+  "workflow.historial.notificaciones.tabla.task": "Tarea",
+  "workflow.historial.notificaciones.busqueda.usuarios.placeholder": "Usuarios",
+  "workflow.historial.notificaciones.busqueda.usuarios": "Seleccione los usuarios a consultar",
+  "workflow.historial.notificaciones.busqueda.fecha": "Ingrese la fecha deseada",
+  "workdlow.historial.notificaciones.busqueda.placeholder": "Fecha envìo",
+
+  "workflow.historial.solicitudes.titulo": "Historial de Tareas Realizadas",
+  "workflow.historial.solicitudes.tabla.detalle": "Detalle solicitud",
+
+  "workflow.historial.versiones.titulo": "Historial de versiones",
+  "workflow.historial.versiones.subtitulo": "Comparar versiones del workflow",
+  "workflow.historial.versiones.select": "Seleccionar version",
+  "workflow.historial.versiones.tarea": "Tarea",
+  "workflow.historial.versiones.secuencia": "Secuencia",
+  "workflow.historial.versiones.isValidated": "Validada",
+  "workflow.historial.versiones.isAvailable": "Disponible"
+}

+ 9 - 6
sistema-mantenimiento-front/src/environments/environment.ts

@@ -3,15 +3,18 @@
 // The list of file replacements can be found in `angular.json`.
 
 export const environment = {
-  production: false
+  production: false,
 };
 
-export const apiUriQA = "http://127.0.0.1:8000/api/";
-export const apiUriJean = "http://192.168.100.154:8000/api/";
-export const apiTemp = "https://qasirh.ittec.mx/sam/public/api/";
+export const apiUriQA = 'http://127.0.0.1:8000/api/';
+//export const apiUriJean = 'http://127.0.0.1:8000/api';
+export const apiUriJean = 'http://192.168.100.154:8000/api';
+export const apiTemp = 'https://qasirh.ittec.mx/sam/public/api/';
+//export const apiTemp = 'http://127.0.0.1:8000/api/';
 
-export const public_key = "WrBEGoJnMnMhC/2hiaYypcmPwP9Z4p4/bNex0T/WUWA=";
-export const secret_key = "CEIBkv7QG1WoAoBO7Ny5cqzyJ5yCUwBMhnFYUBbCeTk=";
+export const apiUriWorkflow = 'http://192.168.100.148:8004/api';
+export const public_key = 'WrBEGoJnMnMhC/2hiaYypcmPwP9Z4p4/bNex0T/WUWA=';
+export const secret_key = 'CEIBkv7QG1WoAoBO7Ny5cqzyJ5yCUwBMhnFYUBbCeTk=';
 
 /*
  * For easier debugging in development mode, you can import the following file

+ 210 - 26
sistema-mantenimiento-front/src/styles.css

@@ -14,12 +14,138 @@ body {
   font-family: Roboto, "Helvetica Neue", sans-serif;
 }
 
-.card-container {
+/* Alertas */
+.alerts {
+  text-align: center;
+  padding: 80px;
+}
+.is-loading {
+  text-align: center;
+  padding: 100px;
+}
+.is-loading mat-spinner {
+  margin-right: auto;
+  margin-left: auto;
+  margin-bottom: 20px;
+}
+.data-empty {
+  width: 100%;
+  padding: 25px;
+  text-align: center;
+}
+
+/* Stepper */
+.mat-step-header {
+  pointer-events: none !important;
+}
+
+/* Nuevos Colores */
+.mat-success {
+  color: #fff !important;
+  background-color: #00897b !important;
+}
+.mat-info {
+  color: #fff !important;
+  background-color: #00acc1 !important;
+}
+.mat-danger {
+  color: #fff !important;
+  background-color: #ffca2c !important;
+}
+.mat-success[disabled],
+.mat-info[disabled],
+.mat-danger[disabled] {
+  background-color: #0000001f !important;
+  color: #00000042 !important;
+  box-shadow: 0 0 #0003, 0 0 #00000024, 0 0 #0000001f;
+}
+
+/* Estilo de tablas Dinámicas*/
+table {
+  width: 100%;
+}
+tr.mat-header-row {
+  height: 56px;
+}
+tr.mat-row,
+tr.mat-footer-row {
+  height: 48px;
+}
+mat-row,
+mat-header-row,
+mat-footer-row,
+th.mat-header-cell,
+td.mat-cell,
+td.mat-footer-cell {
+  border-bottom-color: #0000001f;
+}
+th.mat-header-cell,
+td.mat-cell,
+td.mat-footer-cell {
+  padding: 0;
+  border-bottom-width: 1px;
+  border-bottom-style: solid;
+}
+.button-accion {
+  margin: 0 2px !important;
+  box-shadow: none !important;
+}
+
+/* Cards */
+.card-size-normal {
+  width: 80%;
+  margin-left: auto;
+  margin-right: auto;
+  padding-top: 20px;
+}
+
+.card-size-small {
+  padding: 3%;
+}
+.card-content-container {
   height: calc(100vh - 320px);
   width: 100%;
   padding: 16px;
   box-sizing: border-box;
 }
+.main-container {
+  padding-top: 2%;
+  padding-bottom: 2%;
+}
+.title-card {
+  text-align: center;
+  font-weight: 500;
+}
+
+/* Formularios */
+.mat-grid-tile-content {
+  padding: 3px !important;
+}
+
+/* Animaciones */
+.animated {
+  -webkit-animation-duration: 1s;
+  animation-duration: 1s;
+  -webkit-animation-fill-mode: both;
+  animation-fill-mode: both;
+}
+.fast {
+  -webkit-animation-duration: 0.4s;
+  animation-duration: 0.4s;
+  -webkit-animation-fill-mode: both;
+  animation-fill-mode: both;
+}
+.fadeIn {
+  animation-name: fadeIn;
+}
+@keyframes fadeIn {
+  from {
+    opacity: 0;
+  }
+  to {
+    opacity: 1;
+  }
+}
 
 .icon-error{
   color: #e53935; 
@@ -29,10 +155,10 @@ body {
 }
 
 .table-header {
-  background-color: #EEE;
+  background-color: #eee;
   padding: 8px 16px;
   border-radius: 8px 8px 0 0;
-  border-color: #CCC;
+  border-color: #ccc;
   border-width: 1px;
   border-style: solid;
   display: flex;
@@ -41,7 +167,7 @@ body {
 
 .table-row-white {
   padding: 8px 16px;
-  border-color: #CCC;
+  border-color: #ccc;
   border-width: 0 1px 1px 1px;
   border-style: solid;
   display: flex;
@@ -50,12 +176,12 @@ body {
 
 .table-row-gray {
   padding: 8px 16px;
-  border-color: #CCC;
+  border-color: #ccc;
   border-width: 0 1px 1px 1px;
   border-style: solid;
   display: flex;
   flex-direction: row;
-  background-color: #EEE;
+  background-color: #eee;
 }
 
 .table-cell-header {
@@ -114,6 +240,18 @@ body {
   justify-content: center;
 }
 
+.mat-chip-list-wrapper {
+  display: inline !important;
+}
+
+.mat-drawer-content {
+  position: static !important;
+  z-index: 1;
+  display: block;
+  height: 100%;
+  overflow: auto;
+}
+
 .full-width {
   width: 100%;
 }
@@ -163,7 +301,7 @@ body {
   align-items: center;
 }
 
-.headers-align .mat-form-field+.mat-form-field {
+.headers-align .mat-form-field + .mat-form-field {
   margin-left: 8px;
 }
 
@@ -181,7 +319,8 @@ body {
 }
 
 .mat-input-element:disabled,
-.mat-form-field-type-mat-native-select.mat-form-field-disabled .mat-form-field-infix::after {
+.mat-form-field-type-mat-native-select.mat-form-field-disabled
+  .mat-form-field-infix::after {
   color: rgb(71, 71, 71) !important;
 }
 
@@ -322,20 +461,6 @@ body {
   padding: 10px 10px 30px 10px;
 }
 
-/* Estilos para las tablas y sus complementos */
-
-table {
-  width: 100%;
-}
-
-.table-action {
-  width: 300px;
-}
-
-mat-paginator {
-  padding: 15px 0 0 0;
-}
-
 /* Estilo para los botones de "Registrar y Cancelar"*/
 .divBotones {
   margin: 5px;
@@ -347,7 +472,8 @@ mat-paginator {
 
 /* Disabled */
 .mat-input-element:disabled,
-.mat-form-field-type-mat-native-select.mat-form-field-disabled .mat-form-field-infix::after {
+.mat-form-field-type-mat-native-select.mat-form-field-disabled
+  .mat-form-field-infix::after {
   color: rgb(71, 71, 71) !important;
 }
 
@@ -368,9 +494,9 @@ footer {
 }
 
 /* Toolbar */
-mat-toolbar-row, .mat-toolbar-single-row{
+mat-toolbar-row,
+.mat-toolbar-single-row {
   height: 100% !important;
-
 }
 .mat-toolbar-multiple-rows {
   min-height: 6vh;
@@ -399,4 +525,62 @@ mat-toolbar-row, .mat-toolbar-single-row{
   text-align: center;
   margin-top: 4px;
   font-size: 14px;
-}
+}
+/* Workflow */
+
+.searcher {
+  width: 90% !important;
+  font-size: 16px !important;
+}
+
+.data-empty {
+  position: relative;
+  background-color: #ddc8a2;
+  color: white;
+  font-size: 16pt;
+  text-align: center;
+  padding: 20px;
+  margin: 5px;
+}
+
+.info {
+  background-color: #0288d1 !important;
+  color: white;
+}
+
+.info:disabled {
+  background-color: #dfdfdf !important;
+  color: rgba(0, 0, 0, 0.26);
+}
+
+.secondary {
+  background-color: #071d49 !important;
+  color: white;
+}
+
+.secondary:disabled {
+  background-color: #dfdfdf !important;
+  color: rgba(0, 0, 0, 0.26);
+}
+
+.success {
+  background-color: #1faf71 !important;
+  color: white !important;
+}
+
+.success:disabled {
+  background-color: #dfdfdf !important;
+  color: rgba(0, 0, 0, 0.26);
+}
+
+.m-2 {
+  margin-right: 6px !important;
+}
+
+.mr-1 {
+  margin-right: 4px;
+}
+
+.btnMarginRight {
+  margin-right: 10px !important;
+}

+ 8 - 0
sistema-mantenimiento-front/tsconfig.json

@@ -2,6 +2,14 @@
 {
   "compileOnSave": false,
   "compilerOptions": {
+    "paths":{
+      "crypto": ["./node_modules/crypto-browserify"],
+      "stream": ["./node_modules/stream-browserify"],
+      "assert": ["./node_modules/assert"],
+      "http": ["./node_modules/stream-http"],
+      "https": ["./node_modules/https-browserify"],
+      "os": ["./node_modules/os-browserify"],
+    },
     "baseUrl": "./",
     "outDir": "./dist/out-tsc",
     "forceConsistentCasingInFileNames": true,

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio