meta-enc 1.4.11 → 1.4.13
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/dist/server/app-meta-enc.d.ts +4 -358
- package/dist/server/procedures-meta-enc.d.ts +0 -1
- package/package.json +2 -2
- package/dist/client/meta-enc.d.ts.map +0 -1
- package/dist/client/meta-enc.ts +0 -334
- package/dist/server/app-meta-enc.d.ts.map +0 -1
- package/dist/server/app-meta-enc.ts +0 -96
- package/dist/server/def-config.d.ts.map +0 -1
- package/dist/server/def-config.ts +0 -59
- package/dist/server/procedures-meta-enc.d.ts.map +0 -1
- package/dist/server/procedures-meta-enc.ts +0 -398
- package/dist/server/server-meta-enc.d.ts.map +0 -1
- package/dist/server/server-meta-enc.ts +0 -7
- package/dist/server/table-casilleros.d.ts.map +0 -1
- package/dist/server/table-casilleros.ts +0 -88
- package/dist/server/table-casilleros_principales.d.ts.map +0 -1
- package/dist/server/table-casilleros_principales.ts +0 -10
- package/dist/server/table-formularios_json.d.ts.map +0 -1
- package/dist/server/table-formularios_json.ts +0 -15
- package/dist/server/table-tipoc.d.ts.map +0 -1
- package/dist/server/table-tipoc.ts +0 -25
- package/dist/server/table-tipoc_tipoc.d.ts.map +0 -1
- package/dist/server/table-tipoc_tipoc.ts +0 -20
- package/dist/server/table-unidad_analisis.d.ts.map +0 -1
- package/dist/server/table-unidad_analisis.ts +0 -29
- package/dist/server/types-meta-enc.d.ts.map +0 -1
- package/dist/server/types-meta-enc.ts +0 -2
- package/install/tipoc_tipoc.tab.bak +0 -23
package/dist/client/meta-enc.ts
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var PANTALLA_RESUMEN = false;
|
|
4
|
-
const MAIN_FORM_ID = 'main-form';
|
|
5
|
-
import * as formStructure from "rel-enc/dist/client/form-structure";
|
|
6
|
-
import { changing } from "best-globals";
|
|
7
|
-
var SurveyManager = formStructure.SurveyManager;
|
|
8
|
-
var FormManager = formStructure.FormManager;
|
|
9
|
-
|
|
10
|
-
function gotoInnerUrl(innerUrl:string){
|
|
11
|
-
history.pushState(null, null, innerUrl);
|
|
12
|
-
my.showPage();
|
|
13
|
-
}
|
|
14
|
-
function onclickUrl(event){
|
|
15
|
-
if(!event.ctrlKey){
|
|
16
|
-
gotoInnerUrl(this.href);
|
|
17
|
-
event.preventDefault();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
myOwn.wScreens.proc.result.goToEnc=function(result, div, opts){
|
|
21
|
-
my.ajax.preguntas_operativo_traer({operativo:result.operativo}).then(function(preguntas){
|
|
22
|
-
var idEnc_js=result.id_caso;
|
|
23
|
-
var idOp_js=result.operativo;
|
|
24
|
-
sessionStorage.setItem('surveyId', idEnc_js);
|
|
25
|
-
sessionStorage.setItem('operativo', idOp_js);
|
|
26
|
-
sessionStorage.setItem('innerPk' , JSON.stringify({}));
|
|
27
|
-
sessionStorage.setItem('formularioPrincipal', result.formulario);
|
|
28
|
-
sessionStorage.setItem('UAInfo', JSON.stringify(preguntas));
|
|
29
|
-
localStorage.setItem('survey_opts', JSON.stringify(opts || {buttons:{guardar:true,devolver:true}}));
|
|
30
|
-
localStorage.setItem(idOp_js + '_survey_' + idEnc_js, JSON.stringify(result.datos_caso));
|
|
31
|
-
div.textContent='Se cargará el caso ' + result.id_caso + '. Redirigiendo...';
|
|
32
|
-
div.style.backgroundColor='#5F5';
|
|
33
|
-
setTimeout(function(){
|
|
34
|
-
gotoInnerUrl('menu#w=formulario&operativo='+result.operativo + '&formulario='+ result.formulario)
|
|
35
|
-
},250);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
myOwn.wScreens.proc.result.desplegarFormulario=function(surveyStructure:formStructure.SurveyStructure, div:HTMLDivElement, surveyData:any, formId:string, formManager?:formStructure.FormManager, formElementsToDisplay?:HTMLElement){
|
|
39
|
-
var surveyOpts = JSON.parse(localStorage.getItem('survey_opts')) || {buttons:{guardar:true,devolver:true}};
|
|
40
|
-
var guardarButton;
|
|
41
|
-
var guardarBottomButton;
|
|
42
|
-
var devolverButton;
|
|
43
|
-
var devolverBottomButton;
|
|
44
|
-
if(surveyOpts.buttons.guardar){
|
|
45
|
-
guardarButton = html.button({id:'guardar-top-button', class:['rel_button', 'guardar']}, "Grabar").create();
|
|
46
|
-
guardarBottomButton = html.button({id:'guardar-bottom-button', class:['rel_button', 'guardar']}, "Grabar").create();
|
|
47
|
-
guardarButton.onclick=guardar;
|
|
48
|
-
guardarBottomButton.onclick=guardar;
|
|
49
|
-
}
|
|
50
|
-
if(surveyOpts.buttons.devolver){
|
|
51
|
-
devolverButton = html.button({id:'devolver-top-button', class:['rel_button', 'devolver']}, "Devolver").create();
|
|
52
|
-
devolverBottomButton = html.button({id:'devolver-bottom-button', class:['rel_button', 'devolver']}, "Devolver").create();
|
|
53
|
-
devolverButton.onclick=devolver;
|
|
54
|
-
devolverBottomButton.onclick=devolver;
|
|
55
|
-
}
|
|
56
|
-
if(PANTALLA_RESUMEN){
|
|
57
|
-
var resumenButton = html.button({id:'summary-button'}, "Resumen").create();
|
|
58
|
-
resumenButton.onclick=verResumen;
|
|
59
|
-
document.getElementById('total-layout').appendChild(resumenButton);
|
|
60
|
-
}
|
|
61
|
-
if(!formElementsToDisplay && !formManager){
|
|
62
|
-
var {formElementsToDisplay, formManager}=my.displayForm(surveyStructure, surveyData, formId, []);
|
|
63
|
-
}
|
|
64
|
-
div.appendChild(html.div({class:'prueba-despliegue'},[
|
|
65
|
-
html.p({id:'genericMsg'},['']),
|
|
66
|
-
]
|
|
67
|
-
.concat([guardarButton, devolverButton])
|
|
68
|
-
.concat([
|
|
69
|
-
html.p({id:'idCaso'},['N° Caso: ',surveyData.idCaso]),
|
|
70
|
-
formElementsToDisplay
|
|
71
|
-
])
|
|
72
|
-
.concat([guardarBottomButton, devolverBottomButton])
|
|
73
|
-
).create());
|
|
74
|
-
formManager.irAlSiguienteDespliegue(formManager.state.primeraVacia,devolverBottomButton);
|
|
75
|
-
SurveyManager.performCustomActionForLoadedFormManager(formManager);
|
|
76
|
-
}
|
|
77
|
-
function verResumen() {
|
|
78
|
-
var summaryDiv = document.getElementById('summary');
|
|
79
|
-
summaryDiv.innerHTML= '';
|
|
80
|
-
var summary = my.displaySummary(sessionStorage.getItem('operativo'), sessionStorage.getItem('surveyId'));
|
|
81
|
-
summaryDiv.appendChild(summary);
|
|
82
|
-
document.getElementById('main-form-wrapper').setAttribute('summary',true);
|
|
83
|
-
document.getElementById('summary-button').onclick = quitarResumen;
|
|
84
|
-
}
|
|
85
|
-
function quitarResumen() {
|
|
86
|
-
document.getElementById('main-form-wrapper').setAttribute('summary', false);
|
|
87
|
-
document.getElementById('summary-button').onclick = verResumen;
|
|
88
|
-
}
|
|
89
|
-
function devolver() {
|
|
90
|
-
guardar().then(function(result){
|
|
91
|
-
var surveyId = sessionStorage.getItem('surveyId');
|
|
92
|
-
var operativo = sessionStorage.getItem('operativo');
|
|
93
|
-
//sessionStorage.setItem('surveyId', ''); /* lo comento para que recuerde el anterior*/
|
|
94
|
-
sessionStorage.setItem('innerPk', '');
|
|
95
|
-
sessionStorage.setItem('operativo', '');
|
|
96
|
-
sessionStorage.setItem('UAInfo', '');
|
|
97
|
-
localStorage.setItem(operativo + '_survey_' + surveyId, '');
|
|
98
|
-
var idCaso = sessionStorage.getItem('surveyId');
|
|
99
|
-
gotoInnerUrl('menu#w=ingresarFormulario&consistir='+idCaso);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function guardar(){
|
|
103
|
-
var surveyId = sessionStorage.getItem('surveyId');
|
|
104
|
-
var operativo = sessionStorage.getItem('operativo');
|
|
105
|
-
var datosCaso = JSON.parse(localStorage.getItem(operativo + '_survey_' + surveyId));
|
|
106
|
-
return my.ajax.caso_guardar({operativo: operativo, id_caso: surveyId, datos_caso: datosCaso})
|
|
107
|
-
.then(function(result){
|
|
108
|
-
document.getElementById('genericMsg').textContent='Encuesta guardada';
|
|
109
|
-
return result;
|
|
110
|
-
})
|
|
111
|
-
.catch(function(error){
|
|
112
|
-
document.getElementById('genericMsg').textContent='Hubo un problema, intente nuevamente.';
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
myOwn.wScreens.formulario=function(addrParams){
|
|
116
|
-
var my=this;
|
|
117
|
-
main_layout.textContent='cargando...';
|
|
118
|
-
var operativo = addrParams.operativo || sessionStorage.getItem('operativo') || null;
|
|
119
|
-
var formulario = addrParams.formulario || sessionStorage.getItem('formularioPrincipal') || null;
|
|
120
|
-
if(operativo && formulario){
|
|
121
|
-
Promise.all([
|
|
122
|
-
my.ajax.operativo_estructura({operativo:operativo}),
|
|
123
|
-
myOwn.getSurveyData(),
|
|
124
|
-
]).then(function(all){
|
|
125
|
-
var structOperativo=all[0];
|
|
126
|
-
var surveyData=all[1];
|
|
127
|
-
if(surveyData.idCaso && surveyData.surveyContent){
|
|
128
|
-
main_layout.innerHTML='';
|
|
129
|
-
my.wScreens.proc.result.desplegarFormulario(structOperativo,main_layout,surveyData,formulario); //MODIFICADO
|
|
130
|
-
}else{
|
|
131
|
-
gotoInnerUrl('menu#w=ingresarFormulario');
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}else{
|
|
135
|
-
gotoInnerUrl('menu#w=ingresarFormulario');
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
};
|
|
140
|
-
myOwn.wScreens.cambio_for=function(addrParams){
|
|
141
|
-
// ******************* ANTES QUE NADA ************************
|
|
142
|
-
// ***** revisar si esta función se sigue usando *************
|
|
143
|
-
// ***********************************************************
|
|
144
|
-
var surveyId = sessionStorage.getItem('surveyId');
|
|
145
|
-
//TODO: s.especial https://github.com/codenautas/meta-enc/issues/1
|
|
146
|
-
// acá habría que parametriza el módulo poniendo cuál es la innerPK default y que '{"persona": 0}' vaya a ese parámetro
|
|
147
|
-
var innerPk = JSON.parse(sessionStorage.getItem('innerPk')||'{"persona": 0}');
|
|
148
|
-
//TODO: s.especial https://github.com/codenautas/meta-enc/issues/1
|
|
149
|
-
// acá habría que ver si nombre del atributo "persona" no se puede parametrizar
|
|
150
|
-
var delta = Number(addrParams.delta);
|
|
151
|
-
var newFormId = Number(innerPk.persona) + delta;
|
|
152
|
-
if(addrParams.absoluta){
|
|
153
|
-
newFormId = addrParams.absoluta - 1 || 0;
|
|
154
|
-
}
|
|
155
|
-
if(newFormId<0){
|
|
156
|
-
newFormId = 0;
|
|
157
|
-
}
|
|
158
|
-
if(delta>0){
|
|
159
|
-
var surveyData = JSON.parse(localStorage.getItem(operativo + '_survey_'+ surveyId)); //REVISAR si se puede sacar todo
|
|
160
|
-
if(newFormId>surveyData.forms.F2.length){
|
|
161
|
-
newFormId=surveyData.forms.F2.length;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
innerPk.persona=newFormId;
|
|
165
|
-
sessionStorage.setItem('innerPk', JSON.stringify(innerPk));
|
|
166
|
-
gotoInnerUrl('./menu?i=personas');
|
|
167
|
-
}
|
|
168
|
-
myOwn.displayForm = function displayForm(surveyStructure, surveyData, formId, pilaDeRetroceso){
|
|
169
|
-
var surveyMetadata = {
|
|
170
|
-
operative: sessionStorage.getItem('operativo'),
|
|
171
|
-
structure: surveyStructure,
|
|
172
|
-
mainForm: formId,
|
|
173
|
-
analysisUnitStructure: JSON.parse(sessionStorage.getItem('UAInfo'))
|
|
174
|
-
}
|
|
175
|
-
var surveyManager = new SurveyManager(surveyMetadata, surveyData.idCaso, surveyData.surveyContent);
|
|
176
|
-
var formManager = new FormManager(surveyManager, formId, surveyData.surveyContent, []);
|
|
177
|
-
var toDisplay = formManager.display();
|
|
178
|
-
formManager.validateDepot();
|
|
179
|
-
formManager.refreshState();
|
|
180
|
-
var pantallaResumen = PANTALLA_RESUMEN?html.div({id:'summary'}, my.displaySummary(surveyMetadata.operative, surveyData.idCaso)):null;
|
|
181
|
-
return {
|
|
182
|
-
formElementsToDisplay:html.div({id: 'main-form-wrapper'},[html.div({id: MAIN_FORM_ID}, [toDisplay]), pantallaResumen]),
|
|
183
|
-
formManager: formManager
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
myOwn.displaySummary = function displaySummary(operativo:string, surveyId:string){
|
|
187
|
-
var mySurvey = JSON.parse(localStorage.getItem(operativo +'_survey_'+surveyId));
|
|
188
|
-
//return html.img({id:'summary-img', src:my.path.img + 'local-resumen.png', alt:'imagen resumen'}).create();
|
|
189
|
-
var table = html.table({id:'summary-table'},[
|
|
190
|
-
html.tr({},[
|
|
191
|
-
html.th({},'año'),
|
|
192
|
-
html.th({},'edad'),
|
|
193
|
-
html.th({},'lugar'),
|
|
194
|
-
html.th({colspan:6},'vivienda'),
|
|
195
|
-
html.th({colspan:3},'educ'),
|
|
196
|
-
html.th({colspan:6},'trabajo'),
|
|
197
|
-
html.th({colspan:4},'conv')
|
|
198
|
-
])
|
|
199
|
-
]).create();
|
|
200
|
-
if(mySurvey.personas[0]){
|
|
201
|
-
var persona = mySurvey.personas[0];
|
|
202
|
-
if(persona.p3a){ //TODO: s.especial https://github.com/codenautas/meta-enc/issues/1
|
|
203
|
-
var fechaNac = persona.p3a;
|
|
204
|
-
var fechaNacArray = fechaNac.split('-');
|
|
205
|
-
var date = new Date();
|
|
206
|
-
var j=0;
|
|
207
|
-
for(var i=fechaNacArray[0];i<=date.getFullYear();i++){
|
|
208
|
-
var attrs = j%10==0?{'ten-years':true}:{}
|
|
209
|
-
table.appendChild(
|
|
210
|
-
html.tr(attrs,[
|
|
211
|
-
html.td({'is-first':true, 'is-last':true},i),
|
|
212
|
-
html.td({'is-first':true, 'is-last':true},j),
|
|
213
|
-
].concat(my.completarLugares(persona, i, j))
|
|
214
|
-
.concat(my.completarViviendas(persona, i, j))
|
|
215
|
-
.concat(my.completarEducacion(persona, i, j))
|
|
216
|
-
.concat(my.completarTrabajo(persona, i, j))
|
|
217
|
-
.concat(my.completarConvivencia(persona, i, j))
|
|
218
|
-
).create()
|
|
219
|
-
);
|
|
220
|
-
j++;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return table;
|
|
225
|
-
}
|
|
226
|
-
//TODO: s.especial https://github.com/codenautas/meta-enc/issues/1 Esta función debería estar afuera
|
|
227
|
-
myOwn.completarLugares = function completarLugares(persona, year, age){
|
|
228
|
-
if(age == 0){
|
|
229
|
-
return [html.td({},persona['2_1'])];
|
|
230
|
-
}else{
|
|
231
|
-
var result = persona['annios_personas'].find(function(annioPersona){
|
|
232
|
-
return annioPersona['2a'] == year || annioPersona['2b'] == age;
|
|
233
|
-
})
|
|
234
|
-
return [html.td({'is-first':true, 'is-last':true},result?result['2_3']:'')];
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
//TODO: s.especial https://github.com/codenautas/meta-enc/issues/1 Estas funciones "completar" deberían estar afuera
|
|
238
|
-
myOwn.completarViviendas = function completarViviendas(persona, year, age){
|
|
239
|
-
var result = persona['annios_personas'].find(function(annioPersona){
|
|
240
|
-
return annioPersona['3a'] == year || annioPersona['3b'] == age;
|
|
241
|
-
})
|
|
242
|
-
return [
|
|
243
|
-
html.td({'is-first':true},result?result['3_2']:''),
|
|
244
|
-
html.td({},result?result['3_3']:''),
|
|
245
|
-
html.td({},result?result['3_4']:''),
|
|
246
|
-
html.td({},result?result['3_5']:''),
|
|
247
|
-
html.td({},result?result['3_6']:''),
|
|
248
|
-
html.td({'is-last':true},result?result['3_7']:'')
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
myOwn.completarEducacion = function completarEducacion(persona, year, age){
|
|
252
|
-
var result = persona['annios_personas'].find(function(annioPersona){
|
|
253
|
-
return annioPersona['4a'] == year || annioPersona['4b'] == age;
|
|
254
|
-
})
|
|
255
|
-
return [
|
|
256
|
-
html.td({'is-first':true},result?result['4_2']:''),
|
|
257
|
-
html.td({},result?result['4_3']:''),
|
|
258
|
-
html.td({'is-last':true},result?result['4_4']:'')
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
myOwn.completarTrabajo = function completarTrabajo(persona, year, age){
|
|
262
|
-
var result = persona['annios_personas'].find(function(annioPersona){
|
|
263
|
-
return annioPersona['6a'] == year || annioPersona['6b'] == age;
|
|
264
|
-
})
|
|
265
|
-
return [
|
|
266
|
-
html.td({'is-first':true},result?result['6_2a']:''),
|
|
267
|
-
html.td({},result?result['6_2b']:''),
|
|
268
|
-
html.td({},result?result['6_2c']:''),
|
|
269
|
-
html.td({},result?result['6_2d']:''),
|
|
270
|
-
html.td({},result?result['6_2e']:''),
|
|
271
|
-
html.td({'is-last':true},result?result['6_3']:'')
|
|
272
|
-
]
|
|
273
|
-
}
|
|
274
|
-
myOwn.completarConvivencia = function completarConvivencia(persona, year, age){
|
|
275
|
-
var result = persona['annios_personas'].find(function(annioPersona){
|
|
276
|
-
return annioPersona['7a'] == year || annioPersona['7b'] == age;
|
|
277
|
-
})
|
|
278
|
-
return [
|
|
279
|
-
html.td({'is-first':true},result?result['7_3']:''),
|
|
280
|
-
html.td({},result?result['7_4']:''),
|
|
281
|
-
html.td({},result?result['7_5']:''),
|
|
282
|
-
html.td({'is-last':true},result?result['7_6']:''),
|
|
283
|
-
]
|
|
284
|
-
}
|
|
285
|
-
myOwn.surveyDataEmpty = function surveyDataEmpty(surveyId){
|
|
286
|
-
return JSON.stringify({
|
|
287
|
-
idCaso:surveyId,
|
|
288
|
-
surveyContent:{}
|
|
289
|
-
})
|
|
290
|
-
};
|
|
291
|
-
myOwn.getSurveyData = function getSurveyData(){
|
|
292
|
-
var my = this;
|
|
293
|
-
var surveyId = sessionStorage.getItem('surveyId');
|
|
294
|
-
var operativo = sessionStorage.getItem('operativo');
|
|
295
|
-
var surveyContent = JSON.parse(localStorage.getItem(operativo + '_survey_' + surveyId));
|
|
296
|
-
return {idCaso:surveyId, /*innerPk:innerPk,*/ surveyContent:surveyContent};
|
|
297
|
-
}
|
|
298
|
-
myOwn.wScreens.loadForm=async function(addrParams){
|
|
299
|
-
var idCaso = addrParams.idCaso;
|
|
300
|
-
var formId = addrParams.formId;
|
|
301
|
-
var formData = JSON.parse(addrParams.formData);
|
|
302
|
-
var operativo = addrParams.operativo;
|
|
303
|
-
var surveyStructure:formStructure.SurveyStructure = JSON.parse(localStorage.getItem('estructura-'+operativo));
|
|
304
|
-
var datosCaso:any = JSON.parse(localStorage.getItem(operativo+'_survey_'+idCaso));
|
|
305
|
-
if(!datosCaso){
|
|
306
|
-
var result:any = await my.ajax.caso_traer({operativo:operativo, id_caso: idCaso});
|
|
307
|
-
var preguntas:any = await my.ajax.preguntas_operativo_traer({operativo:result.operativo});
|
|
308
|
-
var idEnc_js=result.id_caso;
|
|
309
|
-
var idOp_js=result.operativo;
|
|
310
|
-
sessionStorage.setItem('surveyId', idEnc_js);
|
|
311
|
-
sessionStorage.setItem('operativo', idOp_js);
|
|
312
|
-
sessionStorage.setItem('innerPk' , JSON.stringify({}));
|
|
313
|
-
sessionStorage.setItem('formularioPrincipal', result.formulario);
|
|
314
|
-
sessionStorage.setItem('UAInfo', JSON.stringify(preguntas));
|
|
315
|
-
localStorage.setItem('survey_opts', JSON.stringify({buttons:{guardar:true,devolver:true}}));
|
|
316
|
-
localStorage.setItem(idOp_js + '_survey_' + idEnc_js, JSON.stringify(result.datos_caso));
|
|
317
|
-
}
|
|
318
|
-
var surveyData:formStructure.SurveyData = myOwn.getSurveyData();
|
|
319
|
-
if(!surveyStructure){
|
|
320
|
-
surveyStructure = await my.ajax.operativo_estructura({operativo:operativo});
|
|
321
|
-
localStorage.setItem('estructura-'+operativo, JSON.stringify(surveyStructure));
|
|
322
|
-
}
|
|
323
|
-
var surveyMetadata:formStructure.SurveyMetadata = {
|
|
324
|
-
operative: operativo,
|
|
325
|
-
structure: surveyStructure,
|
|
326
|
-
mainForm: sessionStorage.getItem('formularioPrincipal'),
|
|
327
|
-
analysisUnitStructure: JSON.parse(sessionStorage.getItem('UAInfo'))
|
|
328
|
-
}
|
|
329
|
-
var surveyManager = new SurveyManager(surveyMetadata, surveyData.idCaso, surveyData.surveyContent);
|
|
330
|
-
//FALTA REVISAR STACK, POSIBLEMENTE SE PUEDA METER EN SESSION STORAGE
|
|
331
|
-
var myForm = new FormManager(surveyManager, formId, formData, []);
|
|
332
|
-
var formElementsToDisplay = myForm.display()
|
|
333
|
-
my.wScreens.proc.result.desplegarFormulario(surveyStructure,main_layout,changing(surveyData,{surveyContent: formData}),formId, myForm, formElementsToDisplay); //MODIFICADO
|
|
334
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-meta-enc.d.ts","sourceRoot":"","sources":["../../src/server/app-meta-enc.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAMzE,oBAAY,WAAW,CAAC,CAAC,IAAI,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEtD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAC,CAAC;kBAExD,GAAG,EAAE;;mBAmBd,cAAc;;;;4BA0DN,OAAO,wBAAuB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMtE;AACD,eAAO,IAAI,UAAU;kBApFO,GAAG,EAAE;;mBAmBd,cAAc;;;;4BA0DN,OAAO,wBAAuB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAOe,CAAC;AACvF,oBAAY,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import * as relEnc from "rel-enc";
|
|
4
|
-
export * from "./types-meta-enc";
|
|
5
|
-
import {MenuDefinition, Request} from "./types-meta-enc";
|
|
6
|
-
import {ProceduresMetaEnc} from "./procedures-meta-enc";
|
|
7
|
-
import {defConfig} from "./def-config"
|
|
8
|
-
|
|
9
|
-
export type Constructor<T> = new(...args: any[]) => T;
|
|
10
|
-
|
|
11
|
-
export function emergeAppMetaEnc<T extends Constructor<relEnc.AppRelEncType>>(Base:T){
|
|
12
|
-
return class AppMetaEnc extends Base{
|
|
13
|
-
constructor(...args:any[]){
|
|
14
|
-
super(args);
|
|
15
|
-
this.sqls={
|
|
16
|
-
exprFieldUaPkPadre: `
|
|
17
|
-
coalesce((
|
|
18
|
-
with recursive uas(operativo, profundidad, padre, pk) as (
|
|
19
|
-
select ua.operativo, 1 as profundidad, ua.padre, null as pk
|
|
20
|
-
union all
|
|
21
|
-
select uas.operativo, profundidad+1, p.padre, p.pk_agregada
|
|
22
|
-
from uas left join unidad_analisis p on p.unidad_analisis = uas.padre and p.operativo = uas.operativo
|
|
23
|
-
where p.unidad_analisis is not null
|
|
24
|
-
) select array_agg(pk order by profundidad desc) from uas where pk is not null
|
|
25
|
-
),array[]::text[])`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
configStaticConfig(){
|
|
29
|
-
super.configStaticConfig();
|
|
30
|
-
this.setStaticConfig(defConfig);
|
|
31
|
-
}
|
|
32
|
-
getMenu(): MenuDefinition {
|
|
33
|
-
let menu: MenuDefinition =
|
|
34
|
-
{menu:[
|
|
35
|
-
{menuType:'menu', name:'metadatos', menuContent:[
|
|
36
|
-
{menuType:'table', name:'operativos'},
|
|
37
|
-
{menuType:'table', name:'normal' , table:'casilleros_principales'},
|
|
38
|
-
{menuType:'table', name:'plano' , table:'casilleros'},
|
|
39
|
-
]},
|
|
40
|
-
{menuType:'menu', name:'encuestas_de_prueba', menuContent:[
|
|
41
|
-
{menuType:'proc', name:'caso_traer', proc:'caso_traer', label:'traer caso' },
|
|
42
|
-
{menuType:'proc', name:'caso_nuevo' , proc:'caso_nuevo' , label:'nuevo caso' },
|
|
43
|
-
]},
|
|
44
|
-
{menuType:'menu', name:'configuracion', menuContent:[
|
|
45
|
-
{menuType:'menu', name:'elementos', menuContent:[
|
|
46
|
-
{menuType:'table', name:'tipoc', label:'tipos de celdas', selectedByDefault:true},
|
|
47
|
-
{menuType:'table', name:'tipoc_tipoc', label:'inclusiones de celdas'},
|
|
48
|
-
{menuType:'table', name:'tipovar', label:'tipos de variables'},
|
|
49
|
-
]},
|
|
50
|
-
{menuType:'table', name:'usuarios', selectedByDefault:true},
|
|
51
|
-
]},
|
|
52
|
-
{menuType:'proc', name:'generate_tabledef', proc:'tabledef_generate', label:'generar tablas' },
|
|
53
|
-
]};
|
|
54
|
-
return menu;
|
|
55
|
-
}
|
|
56
|
-
getTables(){
|
|
57
|
-
return super.getTables().concat([
|
|
58
|
-
{path:__dirname, name:'tipoc' },
|
|
59
|
-
{path:__dirname, name:'tipoc_tipoc' },
|
|
60
|
-
{path:__dirname, name:'unidad_analisis' },
|
|
61
|
-
{path:__dirname, name:'casilleros' },
|
|
62
|
-
{path:__dirname, name:'casilleros_principales'},
|
|
63
|
-
{path:__dirname, name:'formularios_json' },
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
getProcedures(){
|
|
67
|
-
var be = this;
|
|
68
|
-
return super.getProcedures().then(function(procedures){
|
|
69
|
-
return procedures.concat(
|
|
70
|
-
ProceduresMetaEnc.map(be.procedureDefCompleter, be)
|
|
71
|
-
)
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
prepareGetTables(){
|
|
75
|
-
super.prepareGetTables();
|
|
76
|
-
this.getTableDefinition={
|
|
77
|
-
...this.getTableDefinition,
|
|
78
|
-
}
|
|
79
|
-
this.appendToTableDefinition('operativos', function(tableDef){
|
|
80
|
-
tableDef.detailTables = tableDef.detailTables.concat([
|
|
81
|
-
{table:'casilleros_principales', fields:['operativo'], abr:'C' , label:'casilleros principales', refreshParent:true },
|
|
82
|
-
{table:'casilleros' , fields:['operativo'], abr:'P' , label:'casilleros (forma plana)', refreshParent:true },
|
|
83
|
-
{table:'unidad_analisis' , fields:['operativo'], abr:'UA', label:'unidades de análisis', refreshParent:true },
|
|
84
|
-
]);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
clientIncludes(req:Request, hideBEPlusInclusions:boolean){
|
|
89
|
-
return super.clientIncludes(req, hideBEPlusInclusions).concat([
|
|
90
|
-
{ type: 'js', module:'meta-enc', modPath: '../client', file: 'meta-enc.js', path:'client_modules' }
|
|
91
|
-
])
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
export var AppMetaEnc = emergeAppMetaEnc(relEnc.emergeAppRelEnc(relEnc.AppOperativos));
|
|
96
|
-
export type AppMetaEncType = InstanceType<typeof AppMetaEnc>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"def-config.d.ts","sourceRoot":"","sources":["../../src/server/def-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,2nDA4DrB,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export const defConfig=`
|
|
2
|
-
server:
|
|
3
|
-
port: 3055
|
|
4
|
-
base-url: /meta-enc
|
|
5
|
-
session-store: memory
|
|
6
|
-
db:
|
|
7
|
-
motor: postgresql
|
|
8
|
-
host: localhost
|
|
9
|
-
database: metaenc_db
|
|
10
|
-
schema: meta
|
|
11
|
-
user: meta_user
|
|
12
|
-
install:
|
|
13
|
-
dump:
|
|
14
|
-
db:
|
|
15
|
-
owner: meta_owner
|
|
16
|
-
scripts:
|
|
17
|
-
post-adapt:
|
|
18
|
-
- casilleros_orden_total_fun.sql
|
|
19
|
-
- casilleros_jerarquizados_fun.sql
|
|
20
|
-
- ../node_modules/pg-triggers/lib/recreate-his.sql
|
|
21
|
-
- ../node_modules/pg-triggers/lib/table-changes.sql
|
|
22
|
-
- ../node_modules/pg-triggers/lib/function-changes-trg.sql
|
|
23
|
-
- ../node_modules/pg-triggers/lib/enance.sql
|
|
24
|
-
skip-content: true
|
|
25
|
-
login:
|
|
26
|
-
table: usuarios
|
|
27
|
-
userFieldName: usuario
|
|
28
|
-
passFieldName: md5clave
|
|
29
|
-
rolFieldName: rol
|
|
30
|
-
infoFieldList: [usuario, rol]
|
|
31
|
-
activeClausule: activo
|
|
32
|
-
lockedClausule: not activo
|
|
33
|
-
plus:
|
|
34
|
-
allowHttpLogin: true
|
|
35
|
-
fileStore: false
|
|
36
|
-
skipCheckAlreadyLoggedIn: true
|
|
37
|
-
loginForm:
|
|
38
|
-
formTitle: metaEncuesta
|
|
39
|
-
usernameLabel: usuario
|
|
40
|
-
passwordLabel: clave
|
|
41
|
-
buttonLabel: entrar
|
|
42
|
-
formImg: img/login-lock-icon.png
|
|
43
|
-
chPassForm:
|
|
44
|
-
usernameLabel: usuario
|
|
45
|
-
oldPasswordLabel: clave anterior
|
|
46
|
-
newPasswordLabel: nueva clave
|
|
47
|
-
repPasswordLabel: repetir nueva clave
|
|
48
|
-
buttonLabel: Cambiar
|
|
49
|
-
formTitle: Cambio de clave
|
|
50
|
-
messages:
|
|
51
|
-
userOrPassFail: el nombre de usuario no existe o la clave no corresponde
|
|
52
|
-
lockedFail: el usuario se encuentra bloqueado
|
|
53
|
-
inactiveFail: es usuario está marcado como inactivo
|
|
54
|
-
client-setup:
|
|
55
|
-
cursors: true
|
|
56
|
-
lang: es
|
|
57
|
-
skin: ""
|
|
58
|
-
menu: true
|
|
59
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"procedures-meta-enc.d.ts","sourceRoot":"","sources":["../../src/server/procedures-meta-enc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAqdpF,QAAA,IAAI,iBAAiB;;;;;;;;;;;4BA7YmB,gBAAgB,cAAa,sBAAsB;GA8Z1F,CAAC;AACF,OAAO,EAAC,iBAAiB,EAAC,CAAC"}
|