@eqproject/eqp-dynamic-module 2.8.35 → 2.8.36
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/esm2020/lib/components/private/dynamic-module-field-fix/dynamic-module-field.component.mjs +95 -41
- package/esm2020/lib/models/endPointConfiguration.model.mjs +38 -1
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +131 -40
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +131 -40
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/models/endPointConfiguration.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -291,6 +291,43 @@ class EndPointConfiguration {
|
|
|
291
291
|
constructor(baseUrl = null, userToken = null) {
|
|
292
292
|
if (baseUrl != null) {
|
|
293
293
|
this.Records = {
|
|
294
|
+
GetWithContextualizationByFormCodeEndPoint: {
|
|
295
|
+
Token: userToken,
|
|
296
|
+
Url: baseUrl + "/v1/GetWithContextualizationByFormCodeEndPoint",
|
|
297
|
+
RequestMethod: RequestMethodEnum.GET,
|
|
298
|
+
Params: [
|
|
299
|
+
{
|
|
300
|
+
ParamName: "FormCode",
|
|
301
|
+
ParamValue: "TESTFORMCODE",
|
|
302
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
ParamName: "mode",
|
|
306
|
+
ParamValue: 0,
|
|
307
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
ParamName: "UserID",
|
|
311
|
+
ParamValue: 0,
|
|
312
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
ParamName: "OrgaID",
|
|
316
|
+
ParamValue: 0,
|
|
317
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
ParamName: "ContestualizationParam",
|
|
321
|
+
ParamValue: "FK_Something",
|
|
322
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
ParamName: "ContestualizationId",
|
|
326
|
+
ParamValue: 0,
|
|
327
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
},
|
|
294
331
|
GetByFormCodeEndPoint: {
|
|
295
332
|
Token: userToken,
|
|
296
333
|
Url: baseUrl + "/v1/GetSerializedValuesByFormCode",
|
|
@@ -5537,16 +5574,23 @@ class DynamicModuleFieldFixComponent {
|
|
|
5537
5574
|
}
|
|
5538
5575
|
manageDMGetter() {
|
|
5539
5576
|
const dynamicModuleParams = new Array();
|
|
5577
|
+
let contestualizationParam = null;
|
|
5578
|
+
let contestualizationId = null;
|
|
5579
|
+
if (this.field.DataGetter.DataGetterContestualization != null &&
|
|
5580
|
+
this.field.DataGetter.DataGetterContestualization.entityDMAdditionalParam != null &&
|
|
5581
|
+
this.configurations != null &&
|
|
5582
|
+
this.configurations.additionalParams != null) {
|
|
5583
|
+
contestualizationParam = this.field.DataGetter.DataGetterContestualization.entityDMAdditionalParam; // Esempio: 'FK_MedicalExamination'
|
|
5584
|
+
contestualizationId = this.configurations.additionalParams[contestualizationParam] != null ? this.configurations.additionalParams[contestualizationParam] : null; // Esempio: 1351
|
|
5585
|
+
console.log("contestualizationParam", contestualizationParam);
|
|
5586
|
+
console.log("this.configurations", this.configurations);
|
|
5587
|
+
console.log("contestualizationId", contestualizationId);
|
|
5588
|
+
}
|
|
5540
5589
|
dynamicModuleParams.push({
|
|
5541
5590
|
ParamName: "FormCode",
|
|
5542
5591
|
ParamValue: this.field.DataGetter.DataGetterValue,
|
|
5543
5592
|
ParamType: ParamTypeEnum["Query param"],
|
|
5544
5593
|
});
|
|
5545
|
-
dynamicModuleParams.push({
|
|
5546
|
-
ParamName: "mode",
|
|
5547
|
-
ParamValue: 2,
|
|
5548
|
-
ParamType: ParamTypeEnum["Query param"],
|
|
5549
|
-
});
|
|
5550
5594
|
dynamicModuleParams.push({
|
|
5551
5595
|
ParamName: "UserID",
|
|
5552
5596
|
ParamValue: this.userID,
|
|
@@ -5557,49 +5601,96 @@ class DynamicModuleFieldFixComponent {
|
|
|
5557
5601
|
ParamValue: this.form.OrgaID,
|
|
5558
5602
|
ParamType: ParamTypeEnum["Query param"],
|
|
5559
5603
|
});
|
|
5560
|
-
|
|
5561
|
-
|
|
5604
|
+
if (contestualizationId) {
|
|
5605
|
+
// lavoro in modalità constestualizzata
|
|
5606
|
+
dynamicModuleParams.push({
|
|
5607
|
+
ParamName: "mode",
|
|
5608
|
+
ParamValue: 2,
|
|
5609
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
5610
|
+
});
|
|
5611
|
+
dynamicModuleParams.push({
|
|
5612
|
+
ParamName: "ContestualizationParam",
|
|
5613
|
+
ParamValue: contestualizationParam,
|
|
5614
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
5615
|
+
});
|
|
5616
|
+
dynamicModuleParams.push({
|
|
5617
|
+
ParamName: "ContestualizationId",
|
|
5618
|
+
ParamValue: contestualizationId,
|
|
5619
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
5620
|
+
});
|
|
5621
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetWithContextualizationByFormCodeEndPoint, dynamicModuleParams, (res) => {
|
|
5622
|
+
if (res == null || res.length == 0) {
|
|
5623
|
+
this.dmloaded = true;
|
|
5624
|
+
return;
|
|
5625
|
+
}
|
|
5626
|
+
var answers = res;
|
|
5627
|
+
// Filtro cardinalità
|
|
5628
|
+
var answer = null;
|
|
5629
|
+
if (answers.length == 1) {
|
|
5630
|
+
answer = answers[0];
|
|
5631
|
+
}
|
|
5632
|
+
else if (this.field.DataGetter.DataGetterCardinality == DataGetterCardinalityEnum['PIU RECENTE']) {
|
|
5633
|
+
answer = answers[0];
|
|
5634
|
+
}
|
|
5635
|
+
else {
|
|
5636
|
+
answer = answers[1];
|
|
5637
|
+
}
|
|
5638
|
+
// Non dovrebbe succedere, ma se non trova neanche una risposta, allora usciamo
|
|
5639
|
+
if (answer == null) {
|
|
5640
|
+
return;
|
|
5641
|
+
}
|
|
5642
|
+
var answerObj = JSON.parse(answer.SerializedValues);
|
|
5643
|
+
this.record[this.field.Name] = answerObj[this.field.DataGetter.DataGetterColumnForce];
|
|
5562
5644
|
this.dmloaded = true;
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
//
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5645
|
+
}, (err) => { });
|
|
5646
|
+
}
|
|
5647
|
+
else {
|
|
5648
|
+
// lavoro in modalità non contestualizzata
|
|
5649
|
+
dynamicModuleParams.push({
|
|
5650
|
+
ParamName: "mode",
|
|
5651
|
+
ParamValue: 2,
|
|
5652
|
+
ParamType: ParamTypeEnum["Query param"],
|
|
5653
|
+
});
|
|
5654
|
+
this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormCodeEndPoint, dynamicModuleParams, (res) => {
|
|
5655
|
+
if (res == null || res.Answers.length == 0) {
|
|
5656
|
+
this.dmloaded = true;
|
|
5657
|
+
return;
|
|
5658
|
+
}
|
|
5659
|
+
var answers = [];
|
|
5573
5660
|
if (contestualizationId != null) {
|
|
5661
|
+
// Filtro contestualizzazione
|
|
5574
5662
|
// Esiste sia FK_MedicalExamination sia 1351
|
|
5575
5663
|
answers = [];
|
|
5576
|
-
res.Answers.forEach((answer,
|
|
5577
|
-
|
|
5578
|
-
if (
|
|
5664
|
+
res.Answers.forEach((answer, i) => {
|
|
5665
|
+
const additionalParams = JSON.parse(res.AdditionalParams[i]);
|
|
5666
|
+
if (additionalParams[contestualizationParam] == contestualizationId) {
|
|
5579
5667
|
answers.push(answer);
|
|
5580
5668
|
}
|
|
5581
5669
|
});
|
|
5582
5670
|
}
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
answer =
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5671
|
+
else {
|
|
5672
|
+
answers = res.Answers;
|
|
5673
|
+
}
|
|
5674
|
+
// Filtro cardinalità
|
|
5675
|
+
var answer = null;
|
|
5676
|
+
if (answers.length == 1) {
|
|
5677
|
+
answer = answers[0].Answer;
|
|
5678
|
+
}
|
|
5679
|
+
else if (this.field.DataGetter.DataGetterCardinality == DataGetterCardinalityEnum['PIU RECENTE']) {
|
|
5680
|
+
answer = answers[0].Answer;
|
|
5681
|
+
}
|
|
5682
|
+
else {
|
|
5683
|
+
answer = answers[0].Answer;
|
|
5684
|
+
}
|
|
5685
|
+
// Non dovrebbe succedere, ma se non trova neanche una risposta, allora usciamo
|
|
5686
|
+
if (answer == null) {
|
|
5687
|
+
return;
|
|
5688
|
+
}
|
|
5689
|
+
var answerObj = JSON.parse(answer);
|
|
5690
|
+
this.record[this.field.Name] = answerObj[this.field.DataGetter.DataGetterColumnForce];
|
|
5691
|
+
this.dmloaded = true;
|
|
5692
|
+
}, (err) => { });
|
|
5693
|
+
}
|
|
5603
5694
|
}
|
|
5604
5695
|
}
|
|
5605
5696
|
DynamicModuleFieldFixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicModuleFieldFixComponent, deps: [{ token: i1$3.MatDialog }, { token: UtilityHelperService }], target: i0.ɵɵFactoryTarget.Component });
|