Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h2 mat-dialog-title>Añadir Validaciones</h2>
- <mat-dialog-content [style.max-height.px]="parent=='validacion'?490:650">
- <mat-horizontal-stepper linear="true" #stepper>
- <mat-step [stepControl]="categoryFormGroup">
- <form [formGroup]="categoryFormGroup">
- <ng-template matStepLabel>Tipo de validación</ng-template>
- <div class="row justify-content-center">
- <div class="col-8">
- <mat-form-field class="w-100">
- <input type="text" placeholder="Selecciona una categoría de validación" aria-label="Number" matInput formControlName="catVal" [matAutocomplete]="auto" [(ngModel)]="value">
- <button mat-button *ngIf="value" matSuffix mat-icon-button aria-label="Clear" (click)="value=' '">
- <mat-icon>close</mat-icon>
- </button>
- <mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
- <mat-option *ngFor="let option of filteredOptions | async" [value]="option">
- {{ option }}
- </mat-option>
- </mat-autocomplete>
- </mat-form-field>
- </div>
- </div> <!-- row -->
- <div class="mt-4">
- <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
- </div>
- </form>
- </mat-step>
- <mat-step *ngIf="typeValidation.type === 'logic_constant'" [stepControl]="logicConstantFormGroup">
- <form [formGroup]="logicConstantFormGroup">
- <ng-template matStepLabel>Detalles de Validación</ng-template>
- <div class="row justify-content-center">
- <div class="col-8">
- <h4 class="subtitle-form">Descripción de la validación</h4>
- <mat-form-field class="w-100">
- <input type="text" placeholder="Descripción de validación" matInput
- formControlName="descVal" required>
- </mat-form-field>
- </div>
- </div>
- <div class="row justify-content-center">
- <div class="col-8">
- <h4 class="subtitle-form mt-4 mb-2">Crear la expresión</h4>
- </div>
- <div class="col-8">
- <mat-form-field class="w-100">
- <input type="text" matInput placeholder="Selecciona un campo" required
- [matAutocomplete]="autoGroupConstant" formControlName="fieldVal">
- <button mat-button *ngIf="logicConstantFormGroup.get('fieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicConstantFormGroup.get('fieldVal').setValue(' ')">
- <mat-icon>close</mat-icon>
- </button>
- <mat-autocomplete #autoGroupConstant="matAutocomplete">
- <mat-optgroup *ngFor="let block of filteredBlocksOptionsConstant | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
- <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
- {{ block.codFilRegs }} - {{ name.desFldDesc }}
- </mat-option>
- </mat-optgroup>
- </mat-autocomplete>
- </mat-form-field>
- </div>
- <div class="col-8">
- <mat-form-field class="w-100">
- <mat-select placeholder="Selecciona un operador" required formControlName="operatorVal">
- <mat-option *ngFor="let operator of filteredtipoValoLogic; let i = index" [value]="i">
- {{ operator.desc }}
- </mat-option>
- </mat-select>
- </mat-form-field>
- </div>
- <div class="col-8" >
- <mat-form-field class="w-100" *ngIf="constantType !== 'date'">
- <input formControlName="constantVal" matInput placeholder="Establece un valor constante" [type]="constantType">
- </mat-form-field>
- <mat-form-field class="w-100" *ngIf="constantType === 'date'">
- <input formControlName="constantValDate" matInput [matDatepicker]="dp3" placeholder="Selecciona una fecha" disabled>
- <mat-datepicker-toggle matSuffix [for]="dp3"></mat-datepicker-toggle>
- <mat-datepicker #dp3 disabled="false"></mat-datepicker>
- </mat-form-field>
- </div>
- </div>
- <div class="mt-4">
- <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
- <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
- </div>
- </form>
- </mat-step>
- <mat-step *ngIf="typeValidation.type === 'logic_field'" [stepControl]="logicFieldFormGroup">
- <form [formGroup]="logicFieldFormGroup">
- <ng-template matStepLabel>Detalles de Validación</ng-template>
- <div class="row justify-content-center">
- <div class="col-8">
- <h4 class="subtitle-form">Descripción de la validación</h4>
- <mat-form-field class="w-100">
- <input type="text" placeholder="Descripción de validación" matInput
- formControlName="descVal" required>
- </mat-form-field>
- </div>
- </div>
- <div class="row justify-content-center">
- <div class="col-8">
- <h4 class="subtitle-form mt-4 mb-2">Crear la expresión</h4>
- </div>
- <div class="col-8">
- <mat-form-field class="w-100">
- <input type="text" matInput placeholder="Selecciona un campo" required
- [matAutocomplete]="autoGroup1" formControlName="fieldVal">
- <button mat-button *ngIf="logicFieldFormGroup.get('fieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicFieldFormGroup.get('fieldVal').setValue(' ')">
- <mat-icon>close</mat-icon>
- </button>
- <mat-autocomplete #autoGroup1="matAutocomplete">
- <mat-optgroup *ngFor="let block of filteredBlocksOptions | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
- <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
- {{ block.codFilRegs }} - {{ name.desFldDesc }}
- </mat-option>
- </mat-optgroup>
- </mat-autocomplete>
- </mat-form-field>
- </div>
- <div class="col-8">
- <mat-form-field class="w-100">
- <mat-select placeholder="Selecciona un operador" required formControlName="operatorVal">
- <mat-option *ngFor="let operator of filteredtipoValoLogic; let i = index" [value]="i">
- {{ operator.desc }}
- </mat-option>
- </mat-select>
- </mat-form-field>
- </div>
- <div class="col-8" >
- <mat-form-field class="w-100">
- <input type="text" matInput placeholder="Selecciona un campo" required
- [matAutocomplete]="autoGroup" formControlName="secondFieldVal">
- <button mat-button *ngIf="logicFieldFormGroup.get('secondFieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicFieldFormGroup.get('secondFieldVal').setValue(' ')">
- <mat-icon>close</mat-icon>
- </button>
- <mat-autocomplete #autoGroup="matAutocomplete">
- <mat-optgroup *ngFor="let block of filteredBlocksOptions2 | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
- <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
- {{ block.codFilRegs }} - {{ name.desFldDesc }}
- </mat-option>
- </mat-optgroup>
- </mat-autocomplete>
- </mat-form-field>
- </div>
- </div>
- <div *ngIf="!logicFieldFormGroup.get('secondFieldVal').pristine && logicFieldFormGroup.get('secondFieldVal').invalid" class="row justify-content-center">
- <mat-error>Los tipos de campo no son comparables</mat-error>
- </div>
- <div class="mt-4">
- <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
- <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
- </div>
- </form>
- </mat-step>
- <mat-step [stepControl]="errorsFormGroup">
- <form [formGroup]="errorsFormGroup">
- <ng-template matStepLabel>Códigos de Error</ng-template>
- <div class="row">
- <div class="col-12">
- <mat-form-field class="w-100">
- <mat-select placeholder="Tipo de error" formControlName="tipoErr">
- <mat-option *ngFor="let error of errorsList" [value]="error">
- {{ error }}
- </mat-option>
- </mat-select>
- </mat-form-field>
- </div>
- </div>
- <div class="mt-4">
- <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
- <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
- </div>
- </form>
- </mat-step>
- <mat-step>
- <ng-template matStepLabel>Validación Generada</ng-template>
- <div class="recuadro-validacion text-left">
- <h4 class="font-weight-bold">Validación Generada</h4>
- <p>val_permitido(expresion)</p>
- </div>
- <div class="mt-4">
- <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
- <!-- <button mat-button mat-raised-button color="accent" (click)="stepper.reset()">Reset</button> -->
- <button mat-button mat-raised-button color="accent" class="mr-2">Guardar</button>
- </div>
- </mat-step>
- </mat-horizontal-stepper>
- </mat-dialog-content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement