multiplicity
This commit is contained in:
parent
30d136e634
commit
b9fa3d1dac
|
@ -3,7 +3,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label>Title</label>
|
<label>Title</label>
|
||||||
<input type="text" class="form-control" formControlName="title">
|
<input data-toggle="tooltip" title="tooltip on second input!" type="text" class="form-control" formControlName="title">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label>Id</label>
|
<label>Id</label>
|
||||||
|
|
|
@ -23,7 +23,6 @@ export class FieldFormComponent {
|
||||||
constructon() { }
|
constructon() { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log("init field")
|
|
||||||
// this.addNewRule();
|
// this.addNewRule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ export class GroupFieldFormComponent {
|
||||||
constructor(){}
|
constructor(){}
|
||||||
|
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
console.log("init group");
|
|
||||||
//this.addNewField();
|
//this.addNewField();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,13 @@
|
||||||
<i>{{group.extendedDescription}}</i>
|
<i>{{group.extendedDescription}}</i>
|
||||||
</h5> -->
|
</h5> -->
|
||||||
<div *ngFor="let compositeField of group.compositeFields; let i = index;">
|
<div *ngFor="let compositeField of group.compositeFields; let i = index;">
|
||||||
|
<div *ngIf="visibilityRulesService.isElementVisible(null,compositeField.id)">
|
||||||
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)">
|
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)">
|
||||||
<a (click)="addMultipleField(i)" style="cursor: pointer">
|
<a (click)="addMultipleField(i)" style="cursor: pointer">
|
||||||
Add one more field +
|
Add one more field +
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<df-composite-field [compositeField]="compositeField" [form]="form.get('compositeFields').get(''+i)" [path]="path" [pathName]="pathName+'.compositeFields.'+i"></df-composite-field>
|
<df-composite-field [compositeField]="compositeField" [form]="form.get('compositeFields').get(''+i)" [path]="path" [pathName]="pathName+'.compositeFields.'+i"></df-composite-field>
|
||||||
<div *ngFor="let multipleCompositeField of compositeField.multiplicityItems; let j = index;">
|
<div *ngFor="let multipleCompositeField of compositeField.multiplicityItems; let j = index;">
|
||||||
<df-composite-field [compositeField]="multipleCompositeField" [form]="form.get('compositeFields').get(''+i).get('multiplicityItems').get(''+j)"
|
<df-composite-field [compositeField]="multipleCompositeField" [form]="form.get('compositeFields').get(''+i).get('multiplicityItems').get(''+j)"
|
||||||
|
|
|
@ -16,10 +16,10 @@ export class CompositeField extends BaseModel implements Serializable<CompositeF
|
||||||
this.fields = new JsonSerializer<Field>().fromJSONArray(item.fields, Field);
|
this.fields = new JsonSerializer<Field>().fromJSONArray(item.fields, Field);
|
||||||
this.ordinal = item.ordinal;
|
this.ordinal = item.ordinal;
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
//this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||||
this.multiplicity = new Multiplicity();
|
//this.multiplicity = new Multiplicity();
|
||||||
//this.multiplicity.max = 2;
|
//this.multiplicity.max = 2;
|
||||||
this.multiplicityItems = new JsonSerializer<CompositeField>().fromJSONArray(item.multiplicityItems, CompositeField);
|
if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer<CompositeField>().fromJSONArray(item.multiplicityItems, CompositeField);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,12 @@ export class Field extends BaseModel implements Serializable<Field>, FormGenerat
|
||||||
this.viewStyle = item.viewStyle;
|
this.viewStyle = item.viewStyle;
|
||||||
this.defaultVisibility = item.defaultVisibility;
|
this.defaultVisibility = item.defaultVisibility;
|
||||||
this.page = item.page;
|
this.page = item.page;
|
||||||
//this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||||
this.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
|
this.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
|
||||||
this.value = this.defaultValue.value && !item.value ? this.defaultValue.value : item.value;
|
this.value = this.defaultValue.value && !item.value ? this.defaultValue.value : item.value;
|
||||||
this.multiplicity = new Multiplicity();
|
//this.multiplicity = new Multiplicity();
|
||||||
//this.multiplicity.max = 2;
|
//this.multiplicity.max = 2;
|
||||||
this.multiplicityItems = new JsonSerializer<Field>().fromJSONArray(item.multiplicityItems, Field);
|
if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer<Field>().fromJSONArray(item.multiplicityItems, Field);
|
||||||
this.data = item.data;
|
this.data = item.data;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue