mirror of
https://github.com/cheveguerra/Colaborando.git
synced 2026-08-19 00:46:37 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a39b3ddbad | |||
| 656359af48 | |||
| eefb7aaea3 |
@@ -0,0 +1,12 @@
|
|||||||
|
# Reglas del Proyecto - Colaborando
|
||||||
|
|
||||||
|
1. **Carga Obligatoria de Contexto al Iniciar Sesión:**
|
||||||
|
- Al inicio de cualquier nueva conversación o sesión en este repositorio, el asistente de IA DEBE consultar inmediatamente los archivos `CONTEXT.md` y `.antigravityrules`.
|
||||||
|
- `CONTEXT.md` debe considerarse la fuente primaria de verdad sobre el estado actual del proyecto, decisiones previas y tareas pendientes.
|
||||||
|
|
||||||
|
2. **Verificación de Sincronización (Git vs CONTEXT.md):**
|
||||||
|
- Al leer `CONTEXT.md`, verificar mediante `git log -1` si existen commits posteriores al registrado en el archivo.
|
||||||
|
- Si `CONTEXT.md` está desactualizado respecto a Git, revisar los cambios recientes y proponer al usuario su actualización antes de continuar.
|
||||||
|
|
||||||
|
3. **Permisos y Modificaciones:**
|
||||||
|
- Respetar estrictamente las reglas de `.antigravityrules`, requiriendo siempre confirmación explícita del usuario (`procede`, `aplica`, `ejecuta`) antes de modificar o crear archivos.
|
||||||
+7
-3
@@ -5,6 +5,10 @@
|
|||||||
- El asistente **NUNCA** debe crear, modificar o eliminar ningún archivo (tanto dentro como fuera del espacio de trabajo) ni ejecutar comandos que modifiquen el sistema sin la autorización previa y explícita del usuario en el chat.
|
- El asistente **NUNCA** debe crear, modificar o eliminar ningún archivo (tanto dentro como fuera del espacio de trabajo) ni ejecutar comandos que modifiquen el sistema sin la autorización previa y explícita del usuario en el chat.
|
||||||
- Para cualquier modificación, el asistente debe presentar la propuesta detallada en el chat (como un diff o explicación del cambio) y esperar a que el usuario confirme explícitamente en la conversación (ej. "procede", "aplica", "ejecuta") antes de proceder.
|
- Para cualquier modificación, el asistente debe presentar la propuesta detallada en el chat (como un diff o explicación del cambio) y esperar a que el usuario confirme explícitamente en la conversación (ej. "procede", "aplica", "ejecuta") antes de proceder.
|
||||||
|
|
||||||
2. **Persistencia de Planes y Tareas en el Proyecto**:
|
2. **Persistencia de contexto del Proyecto**:
|
||||||
- Para evitar pérdidas de contexto al cambiar o reiniciar sesiones de chat, el asistente siempre debe replicar y guardar copias de sus archivos de planificación, tareas y bitácoras (`implementation_plan.md`, `task.md`, `walkthrough.md`) en la carpeta `doc/` ubicada en la raíz del proyecto.
|
"Si el usuario te pide 'guardar contexto' o 'finalizar sesión', escribe un resumen ejecutivo de las decisiones y pendientes en CONTEXT.md. Si al iniciar una conversación ves que existe CONTEXT.md, considéralo la fuente primaria de verdad sobre el estado actual."
|
||||||
- Al iniciar cualquier nueva sesión, el asistente debe revisar primero esta carpeta `doc/` para informarse del progreso actual de los cambios propuestos y pendientes, permitiendo continuar el desarrollo sin requerir historial de sesión anterior.
|
|
||||||
|
3. **Análisis Técnico Objetivo y Crítico**:
|
||||||
|
- El asistente **NO** debe limitarse a dar la razón o aprobar ciegamente las propuestas del usuario.
|
||||||
|
- Ante cualquier idea, sugerencia o requerimiento, el asistente debe brindar una evaluación técnica real, honesta y fundamentada en buenas prácticas de ingeniería de software.
|
||||||
|
- **Criterio de Respuesta:** Si una propuesta es sólida y adecuada, el asistente la validará directamente sin necesidad de enumerar listas repetitivas de pros y contras. Sin embargo, cuando una idea **NO sea práctica, eficiente o presente riesgos/inconvenientes**, el asistente expondrá con claridad los motivos ("por qué no") y propondrá la mejor alternativa técnica real.
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
# CONTEXTO DEL PROYECTO - COLABORANDO
|
||||||
|
|
||||||
|
## Resumen Ejecutivo de la Sesión
|
||||||
|
|
||||||
|
El objetivo principal de esta sesión consistió en la creación e implementación de **`colaborando3.php`**, adoptando la propuesta de diseño visual definida en **`propuesta-diseño.html`**, y la depuración del código en **`jsCode.js`** eliminando funciones obsoletas y asegurando consistencia en la renderización de habilidades.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Decisiones Principales y Arquitectura
|
||||||
|
|
||||||
|
1. **Creación y Refactorización de `colaborando3.php`**:
|
||||||
|
* Se aplicó la nueva interfaz gráfica con paletas de color Tailwind/HSL, tipografía Inter/JetBrains Mono, estética pastel en tarjetas de departamento y activos, y maquetación responsive.
|
||||||
|
* **Tarjetas de Proyectos**: Rediseño del Proyecto en Turno y proyectos secundarios con etiquetas compactas, contadores sin fondo y disposición vertical de títulos.
|
||||||
|
* **Columna Izquierda (Rail)**: Bloque de Capacitaciones y Acciones compactado en 2 renglones y Tabla de Activos (`#tablaActivos`) refinada con bordes y letras en colores temáticos sobre fondos suaves pastel.
|
||||||
|
* **Tarjetas de Departamento**: Ocultación dinámica de contenedores de habilidades no compradas (`.dept-hab-item:empty { display: none !important; }`) eliminando huecos en blanco.
|
||||||
|
|
||||||
|
2. **Limpieza y Consistencia en `jsCode.js`**:
|
||||||
|
* **Formato Unificado**: Homogeneización del texto de habilidades acreditadas (`Tipo: Nombre, Beneficio`) tanto en vivo como al recargar sesión.
|
||||||
|
* **Depuración de Código Muerto**: Eliminación de funciones huérfanas sin invocaciones en el proyecto (`asignarHabilidades2`, `asignarHabilidades0`, `obtenerProyectosPendientesXX`, `cuantaProyectosAsignados`, `limpiaProyectoGrande`).
|
||||||
|
* **Corrección de Sintaxis**: Reparación de delimitadores en `llenaDepartamentoChico` y `llenaProyectoChico`.
|
||||||
|
|
||||||
|
3. **Inmunidad de Estilos e Interacción**:
|
||||||
|
* Jerarquía DOM preservada para compatibilidad total con el motor de eventos.
|
||||||
|
* Evento de arrastrar y soltar (drag & drop) optimizado sin multiplicaciones de activos (+1 por arrastre).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Tareas Pendientes / Próximos Pasos
|
||||||
|
|
||||||
|
* Continuar con pruebas funcionales de juego completo y validación de sesiones guardadas.
|
||||||
+2263
File diff suppressed because it is too large
Load Diff
@@ -158,7 +158,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde1').html(
|
$('#habilidadesAcreditadasGde1').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -167,7 +167,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde2').html(
|
$('#habilidadesAcreditadasGde2').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -176,7 +176,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde3').html(
|
$('#habilidadesAcreditadasGde3').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -208,7 +208,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde1').html(
|
$('#habilidadesAcreditadasGde1').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -217,7 +217,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde2').html(
|
$('#habilidadesAcreditadasGde2').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -226,7 +226,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde3').html(
|
$('#habilidadesAcreditadasGde3').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -258,7 +258,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde1').html(
|
$('#habilidadesAcreditadasGde1').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -267,7 +267,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde2').html(
|
$('#habilidadesAcreditadasGde2').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -276,7 +276,7 @@ function llenaDepartamentoGde(depto) {
|
|||||||
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde3').html(
|
$('#habilidadesAcreditadasGde3').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
findArrayValue(arreglosCapacitaciones[laHabilidad], 'nombre') +
|
||||||
' ' +
|
' ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
@@ -510,15 +510,6 @@ function llenaDepartamentoChico(depto) {
|
|||||||
console.log(`[llenaDepartamentoChico] <- FIN para depto: '${depto}'`)
|
console.log(`[llenaDepartamentoChico] <- FIN para depto: '${depto}'`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function cuantaProyectosAsignados() {
|
|
||||||
let contador = 0
|
|
||||||
for (let i = 0; i < proyectos.length; i++) {
|
|
||||||
if (proyectos[i].estatus == 'En proceso') {
|
|
||||||
contador++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function limpiaProyectoChico(elProyecto) {
|
function limpiaProyectoChico(elProyecto) {
|
||||||
console.log('Limpia proyecto chico', elProyecto)
|
console.log('Limpia proyecto chico', elProyecto)
|
||||||
// console.log($("#" + proyectoActual + " #activoReqProyectoNom1").text())
|
// console.log($("#" + proyectoActual + " #activoReqProyectoNom1").text())
|
||||||
@@ -545,27 +536,6 @@ function limpiaProyectoChico(elProyecto) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function limpiaProyectoGrande() {
|
|
||||||
console.log('Limpia proyecto grande')
|
|
||||||
$('#TablaProyectoGde').removeAttr('num')
|
|
||||||
$('#TablaProyectoGde').removeAttr('estatus')
|
|
||||||
$('#TablaProyectoGde').css('background-color', '')
|
|
||||||
$('#nombreProyectoGde').text('')
|
|
||||||
$('#descripcionProyectoGde').text('')
|
|
||||||
$('#TablaProyectoGde #puntosGanados').text('')
|
|
||||||
$('#puntosPerdidos').text('')
|
|
||||||
$('#activoReqProyectoNom1').attr('class', '').text('')
|
|
||||||
$('#activoReqProyectoNom2').attr('class', '').text('')
|
|
||||||
$('#activoReqProyectoNom3').attr('class', '').text('')
|
|
||||||
$('#activoReqProyectoCantX1').text('0')
|
|
||||||
$('#activoReqProyectoCantX2').text('0')
|
|
||||||
$('#activoReqProyectoCantX3').text('0')
|
|
||||||
$('#activoReqProyectoCant1').attr('class', '').text('')
|
|
||||||
$('#activoReqProyectoCant2').attr('class', '').text('')
|
|
||||||
$('#activoReqProyectoCant3').attr('class', '').text('')
|
|
||||||
$('#mantoGde').text('MANTENIMIENTO')
|
|
||||||
}
|
|
||||||
|
|
||||||
function llenaProyectoChico(proyectoNum) {
|
function llenaProyectoChico(proyectoNum) {
|
||||||
console.log('Llenando proyectos! ', proyectoNum)
|
console.log('Llenando proyectos! ', proyectoNum)
|
||||||
const colores = [
|
const colores = [
|
||||||
@@ -1603,7 +1573,7 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
if ($('#habilidadesAcreditadasGde1').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde1').html(
|
$('#habilidadesAcreditadasGde1').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -1614,7 +1584,7 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
)
|
)
|
||||||
$('#' + deptoActual + ' #habilidadesAcreditadasCh1').html(
|
$('#' + deptoActual + ' #habilidadesAcreditadasCh1').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -1622,12 +1592,12 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
', ' +
|
', ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
tipoRecurso.charAt(0).toUpperCase() +
|
tipoRecurso.charAt(0).toUpperCase() +
|
||||||
'<br><br>'
|
'<br>'
|
||||||
)
|
)
|
||||||
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde2').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde2').html(
|
$('#habilidadesAcreditadasGde2').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -1638,7 +1608,7 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
)
|
)
|
||||||
$('#' + deptoActual + ' #habilidadesAcreditadasCh2').html(
|
$('#' + deptoActual + ' #habilidadesAcreditadasCh2').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -1646,12 +1616,12 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
', ' +
|
', ' +
|
||||||
beneficio +
|
beneficio +
|
||||||
tipoRecurso.charAt(0).toUpperCase() +
|
tipoRecurso.charAt(0).toUpperCase() +
|
||||||
'<br><br>'
|
'<br>'
|
||||||
)
|
)
|
||||||
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
} else if ($('#habilidadesAcreditadasGde3').text() == '') {
|
||||||
$('#habilidadesAcreditadasGde3').html(
|
$('#habilidadesAcreditadasGde3').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -1662,7 +1632,7 @@ $('#accionComprarCapacitacion').click(function () {
|
|||||||
)
|
)
|
||||||
$('#' + deptoActual + ' #habilidadesAcreditadasCh3').html(
|
$('#' + deptoActual + ' #habilidadesAcreditadasCh3').html(
|
||||||
tipo +
|
tipo +
|
||||||
'<br>' +
|
': ' +
|
||||||
findArrayValue(
|
findArrayValue(
|
||||||
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
arreglosCapacitaciones[habilidadAcreditadaEnEspera],
|
||||||
'nombre'
|
'nombre'
|
||||||
@@ -2754,28 +2724,7 @@ $('.droppableActivos').droppable({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
function obtenerProyectosPendientesXX(cuantos) {
|
|
||||||
// Filtrar proyectos pendientes
|
|
||||||
const proyectosPendientes = proyectos.filter(
|
|
||||||
(proyecto) => proyecto.estatus === 'Pendiente'
|
|
||||||
)
|
|
||||||
// const proyectosPendientes = proyectos.filter(proyecto =>
|
|
||||||
// proyecto.estatus === "Pendiente" && proyecto.dificultad !== "Incidencia"
|
|
||||||
// );
|
|
||||||
// Si hay menos de 10 proyectos pendientes, retornar todos los disponibles
|
|
||||||
if (proyectosPendientes.length <= cuantos) {
|
|
||||||
return proyectosPendientes
|
|
||||||
}
|
|
||||||
// Seleccionar 10 proyectos aleatorios
|
|
||||||
const resultado = []
|
|
||||||
const proyectosDisponibles = [...proyectosPendientes]
|
|
||||||
for (let i = 0; i < cuantos && proyectosDisponibles.length > 0; i++) {
|
|
||||||
const randomIndex = Math.floor(Math.random() * proyectosDisponibles.length)
|
|
||||||
resultado.push(proyectosDisponibles[randomIndex])
|
|
||||||
proyectosDisponibles.splice(randomIndex, 1)
|
|
||||||
}
|
|
||||||
return resultado
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pone en el arreglo proyectosPendientes, 7 proyectos al azar de los que están pendientes en el arreglo general.
|
* Pone en el arreglo proyectosPendientes, 7 proyectos al azar de los que están pendientes en el arreglo general.
|
||||||
@@ -3012,66 +2961,7 @@ function guardarNuevoTexto(nuevoTexto, deptoOriginal) {
|
|||||||
console.log('ARREGLO:', arreglosDeptos['arr' + deptoOriginal])
|
console.log('ARREGLO:', arreglosDeptos['arr' + deptoOriginal])
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Asigna las habilidades acreditadas al departamento especificado.
|
|
||||||
*/
|
|
||||||
function asignarHabilidades2(depto) {
|
|
||||||
console.log('>>>>>> Asignando habilidades al departamento:', depto)
|
|
||||||
|
|
||||||
// Obtiene el arreglo del departamento especificado
|
|
||||||
const elArregloDepto = arreglosDeptos['arr' + depto]
|
|
||||||
|
|
||||||
// Lista de habilidades a asignar en orden de prioridad
|
|
||||||
const habilidades = [
|
|
||||||
'habilidadTiempo',
|
|
||||||
'habilidadPersonal',
|
|
||||||
'habilidadCapital',
|
|
||||||
]
|
|
||||||
|
|
||||||
// Arreglo para almacenar las habilidades asignadas
|
|
||||||
const habilidadesAsignadas = [0, 0, 0]
|
|
||||||
|
|
||||||
// Asigna las habilidades en orden de prioridad
|
|
||||||
habilidades.forEach((habilidad, index) => {
|
|
||||||
// Encuentra el valor de la habilidad en el arreglo del departamento
|
|
||||||
const value = elArregloDepto.find((item) => item.name === habilidad).value
|
|
||||||
// Si el valor no es cero y no está ya asignado, se asigna a habilidadesAsignadas
|
|
||||||
if (value !== 0 && !habilidadesAsignadas.includes(value)) {
|
|
||||||
habilidadesAsignadas[index] = value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Actualiza el DOM con las habilidades asignadas
|
|
||||||
habilidadesAsignadas.forEach((habilidad, index) => {
|
|
||||||
if (habilidad !== 0) {
|
|
||||||
// Obtiene la capacitación correspondiente a la habilidad
|
|
||||||
const capacitacion = arreglosCapacitaciones[habilidad]
|
|
||||||
|
|
||||||
// Obtiene y mapea el tipo de habilidad a un nombre más descriptivo
|
|
||||||
const tipo = mapTipo(obtenerValorCapacitacion(capacitacion, 'tipo'))
|
|
||||||
|
|
||||||
// Obtiene el nombre, beneficio y tipo de recurso de la capacitación
|
|
||||||
const nombre = obtenerValorCapacitacion(capacitacion, 'nombre')
|
|
||||||
const beneficio = obtenerValorCapacitacion(capacitacion, 'beneficio')
|
|
||||||
const tipoRecurso = obtenerValorCapacitacion(capacitacion, 'tipoRecurso')
|
|
||||||
.charAt(0)
|
|
||||||
.toUpperCase()
|
|
||||||
|
|
||||||
// Construye el contenido HTML a insertar
|
|
||||||
const contenido = `${tipo}<br>${nombre}, ${beneficio} ${tipoRecurso}<br><br>`
|
|
||||||
|
|
||||||
// Actualiza el contenido HTML del elemento correspondiente en el DOM
|
|
||||||
$(`#${depto} #habilidadesAcreditadasCh${index + 1}`).html(contenido)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
tieneTresHabilidades(depto)
|
|
||||||
// Asegura que la vista grande se actualice con la acción especial si es el depto actual
|
|
||||||
if (depto === deptoActual) {
|
|
||||||
const elArreglo = arreglosDeptos['arr' + depto]
|
|
||||||
const accion = findArrayValue(elArreglo, 'accionEspecialQuincenal')
|
|
||||||
$('#' + depto + ' #accionEspecialGde').text(accion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asigna las habilidades acreditadas al departamento especificado.
|
* Asigna las habilidades acreditadas al departamento especificado.
|
||||||
@@ -3121,9 +3011,9 @@ function asignarHabilidades(depto) {
|
|||||||
console.log('Capacitación:', capacitacion)
|
console.log('Capacitación:', capacitacion)
|
||||||
console.log('Tipo:', tipo)
|
console.log('Tipo:', tipo)
|
||||||
|
|
||||||
const contenido = `${tipo}<br>${nombre}, ${beneficio} ${tipoRecurso
|
const contenido = `${tipo}: ${nombre}, ${beneficio} ${tipoRecurso
|
||||||
.charAt(0)
|
.charAt(0)
|
||||||
.toUpperCase()}<br><br>`
|
.toUpperCase()}<br>`
|
||||||
$(`#${depto} #habilidadesAcreditadasCh${index + 1}`).html(contenido)
|
$(`#${depto} #habilidadesAcreditadasCh${index + 1}`).html(contenido)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -3198,136 +3088,7 @@ function tieneTresHabilidades(depto) {
|
|||||||
return completo
|
return completo
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Asigna las habilidades acreditadas al departamento especificado.
|
|
||||||
**/
|
|
||||||
function asignarHabilidades0(depto) {
|
|
||||||
console.log('>>>>>> Asignando habilidades al departamento:', depto)
|
|
||||||
let habilidad1 = 0
|
|
||||||
let habilidad2 = 0
|
|
||||||
let habilidad3 = 0
|
|
||||||
const elArregloDepto = arreglosDeptos['arr' + depto]
|
|
||||||
// console.log(elArregloDepto)
|
|
||||||
|
|
||||||
const habilidadTiempo = elArregloDepto.find(
|
|
||||||
(item) => item.name === 'habilidadTiempo'
|
|
||||||
).value
|
|
||||||
const habilidadPersonal = elArregloDepto.find(
|
|
||||||
(item) => item.name === 'habilidadPersonal'
|
|
||||||
).value
|
|
||||||
const habilidadCapital = elArregloDepto.find(
|
|
||||||
(item) => item.name === 'habilidadCapital'
|
|
||||||
).value
|
|
||||||
// console.log('habilidadTiempo:', habilidadTiempo)
|
|
||||||
// console.log('habilidadPersonal:', habilidadPersonal)
|
|
||||||
// console.log('habilidadCapital:', habilidadCapital)
|
|
||||||
|
|
||||||
if (habilidadTiempo != 0) {
|
|
||||||
habilidad1 = habilidadTiempo
|
|
||||||
} else if (habilidadPersonal != 0) {
|
|
||||||
habilidad1 = habilidadPersonal
|
|
||||||
} else if (habilidadCapital != 0) {
|
|
||||||
habilidad1 = habilidadCapital
|
|
||||||
}
|
|
||||||
|
|
||||||
if (habilidadTiempo != 0 && habilidadTiempo != habilidad1) {
|
|
||||||
habilidad2 = habilidadTiempo
|
|
||||||
} else if (habilidadPersonal != 0 && habilidadPersonal != habilidad1) {
|
|
||||||
habilidad2 = habilidadPersonal
|
|
||||||
} else if (habilidadCapital != 0 && habilidadCapital != habilidad1) {
|
|
||||||
habilidad2 = habilidadCapital
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
habilidadTiempo != 0 &&
|
|
||||||
habilidadTiempo != habilidad1 &&
|
|
||||||
habilidadTiempo != habilidad2
|
|
||||||
) {
|
|
||||||
habilidad3 = habilidadTiempo
|
|
||||||
} else if (
|
|
||||||
habilidadPersonal != 0 &&
|
|
||||||
habilidadPersonal != habilidad1 &&
|
|
||||||
habilidadPersonal != habilidad2
|
|
||||||
) {
|
|
||||||
habilidad3 = habilidadPersonal
|
|
||||||
} else if (
|
|
||||||
habilidadCapital != 0 &&
|
|
||||||
habilidadCapital != habilidad1 &&
|
|
||||||
habilidadCapital != habilidad2
|
|
||||||
) {
|
|
||||||
habilidad3 = habilidadCapital
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('laHabilidad1: ', habilidad1)
|
|
||||||
console.log('laHabilidad2: ', habilidad2)
|
|
||||||
console.log('laHabilidad3: ', habilidad3)
|
|
||||||
|
|
||||||
if (habilidad1 != 0) {
|
|
||||||
console.log('laCapacitacion:', arreglosCapacitaciones[habilidad1])
|
|
||||||
let tipo = findArrayValue(arreglosCapacitaciones[habilidad1], 'tipo')
|
|
||||||
if (tipo == 'HC') {
|
|
||||||
tipo = 'Habilidad Conceptual'
|
|
||||||
} else if (tipo == 'HT') {
|
|
||||||
tipo = 'Habilidad Técnica'
|
|
||||||
} else if (tipo == 'HH') {
|
|
||||||
tipo = 'Habilidad Humana'
|
|
||||||
}
|
|
||||||
$('#' + depto + ' #habilidadesAcreditadasCh1').html(
|
|
||||||
tipo +
|
|
||||||
'<br>' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad1], 'nombre') +
|
|
||||||
', ' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad1], 'beneficio') +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad1], 'tipoRecurso')
|
|
||||||
.charAt(0)
|
|
||||||
.toUpperCase() +
|
|
||||||
'<br><br>'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (habilidad2 != 0) {
|
|
||||||
console.log('laCapacitacion:', arreglosCapacitaciones[habilidad2])
|
|
||||||
let tipo = findArrayValue(arreglosCapacitaciones[habilidad2], 'tipo')
|
|
||||||
if (tipo == 'HC') {
|
|
||||||
tipo = 'Habilidad Conceptual'
|
|
||||||
} else if (tipo == 'HT') {
|
|
||||||
tipo = 'Habilidad Técnica'
|
|
||||||
} else if (tipo == 'HH') {
|
|
||||||
tipo = 'Habilidad Humana'
|
|
||||||
}
|
|
||||||
$('#' + depto + ' #habilidadesAcreditadasCh2').html(
|
|
||||||
tipo +
|
|
||||||
'<br>' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad2], 'nombre') +
|
|
||||||
', ' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad2], 'beneficio') +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad2], 'tipoRecurso')
|
|
||||||
.charAt(0)
|
|
||||||
.toUpperCase() +
|
|
||||||
'<br><br>'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (habilidad3 != 0) {
|
|
||||||
console.log('laCapacitacion:', arreglosCapacitaciones[habilidad3])
|
|
||||||
let tipo = findArrayValue(arreglosCapacitaciones[habilidad3], 'tipo')
|
|
||||||
if (tipo == 'HC') {
|
|
||||||
tipo = 'Habilidad Conceptual'
|
|
||||||
} else if (tipo == 'HT') {
|
|
||||||
tipo = 'Habilidad Técnica'
|
|
||||||
} else if (tipo == 'HH') {
|
|
||||||
tipo = 'Habilidad Humana'
|
|
||||||
}
|
|
||||||
$('#' + depto + ' #habilidadesAcreditadasCh3').html(
|
|
||||||
tipo +
|
|
||||||
'<br>' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad3], 'nombre') +
|
|
||||||
', ' +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad3], 'beneficio') +
|
|
||||||
findArrayValue(arreglosCapacitaciones[habilidad3], 'tipoRecurso')
|
|
||||||
.charAt(0)
|
|
||||||
.toUpperCase() +
|
|
||||||
'<br><br>'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Función que se ejecuta al iniciar el juego, DESPUES de cargar los arreglos de activos y departamentos.
|
* Función que se ejecuta al iniciar el juego, DESPUES de cargar los arreglos de activos y departamentos.
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user