Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.67 KB | None | 0 0
  1. <h2 mat-dialog-title>Añadir Validaciones</h2>
  2. <mat-dialog-content [style.max-height.px]="parent=='validacion'?490:650">
  3. <mat-horizontal-stepper linear="true" #stepper>
  4. <mat-step [stepControl]="categoryFormGroup">
  5. <form [formGroup]="categoryFormGroup">
  6. <ng-template matStepLabel>Tipo de validación</ng-template>
  7. <div class="row justify-content-center">
  8. <div class="col-8">
  9. <mat-form-field class="w-100">
  10. <input type="text" placeholder="Selecciona una categoría de validación" aria-label="Number" matInput formControlName="catVal" [matAutocomplete]="auto" [(ngModel)]="value">
  11. <button mat-button *ngIf="value" matSuffix mat-icon-button aria-label="Clear" (click)="value=' '">
  12. <mat-icon>close</mat-icon>
  13. </button>
  14. <mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
  15. <mat-option *ngFor="let option of filteredOptions | async" [value]="option">
  16. {{ option }}
  17. </mat-option>
  18. </mat-autocomplete>
  19. </mat-form-field>
  20. </div>
  21. </div> <!-- row -->
  22.  
  23. <div class="mt-4">
  24. <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
  25. </div>
  26. </form>
  27. </mat-step>
  28. <mat-step *ngIf="typeValidation.type === 'logic_constant'" [stepControl]="logicConstantFormGroup">
  29. <form [formGroup]="logicConstantFormGroup">
  30. <ng-template matStepLabel>Detalles de Validación</ng-template>
  31. <div class="row justify-content-center">
  32. <div class="col-8">
  33. <h4 class="subtitle-form">Descripción de la validación</h4>
  34. <mat-form-field class="w-100">
  35. <input type="text" placeholder="Descripción de validación" matInput
  36. formControlName="descVal" required>
  37. </mat-form-field>
  38. </div>
  39. </div>
  40. <div class="row justify-content-center">
  41. <div class="col-8">
  42. <h4 class="subtitle-form mt-4 mb-2">Crear la expresión</h4>
  43. </div>
  44. <div class="col-8">
  45. <mat-form-field class="w-100">
  46. <input type="text" matInput placeholder="Selecciona un campo" required
  47. [matAutocomplete]="autoGroupConstant" formControlName="fieldVal">
  48. <button mat-button *ngIf="logicConstantFormGroup.get('fieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicConstantFormGroup.get('fieldVal').setValue(' ')">
  49. <mat-icon>close</mat-icon>
  50. </button>
  51. <mat-autocomplete #autoGroupConstant="matAutocomplete">
  52. <mat-optgroup *ngFor="let block of filteredBlocksOptionsConstant | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
  53. <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
  54. {{ block.codFilRegs }} - {{ name.desFldDesc }}
  55. </mat-option>
  56. </mat-optgroup>
  57. </mat-autocomplete>
  58. </mat-form-field>
  59. </div>
  60. <div class="col-8">
  61. <mat-form-field class="w-100">
  62. <mat-select placeholder="Selecciona un operador" required formControlName="operatorVal">
  63. <mat-option *ngFor="let operator of filteredtipoValoLogic; let i = index" [value]="i">
  64. {{ operator.desc }}
  65. </mat-option>
  66. </mat-select>
  67. </mat-form-field>
  68. </div>
  69. <div class="col-8" >
  70. <mat-form-field class="w-100" *ngIf="constantType !== 'date'">
  71. <input formControlName="constantVal" matInput placeholder="Establece un valor constante" [type]="constantType">
  72. </mat-form-field>
  73. <mat-form-field class="w-100" *ngIf="constantType === 'date'">
  74. <input formControlName="constantValDate" matInput [matDatepicker]="dp3" placeholder="Selecciona una fecha" disabled>
  75. <mat-datepicker-toggle matSuffix [for]="dp3"></mat-datepicker-toggle>
  76. <mat-datepicker #dp3 disabled="false"></mat-datepicker>
  77. </mat-form-field>
  78. </div>
  79. </div>
  80. <div class="mt-4">
  81. <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
  82. <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
  83. </div>
  84. </form>
  85. </mat-step>
  86. <mat-step *ngIf="typeValidation.type === 'logic_field'" [stepControl]="logicFieldFormGroup">
  87. <form [formGroup]="logicFieldFormGroup">
  88. <ng-template matStepLabel>Detalles de Validación</ng-template>
  89. <div class="row justify-content-center">
  90. <div class="col-8">
  91. <h4 class="subtitle-form">Descripción de la validación</h4>
  92. <mat-form-field class="w-100">
  93. <input type="text" placeholder="Descripción de validación" matInput
  94. formControlName="descVal" required>
  95. </mat-form-field>
  96. </div>
  97. </div>
  98. <div class="row justify-content-center">
  99. <div class="col-8">
  100. <h4 class="subtitle-form mt-4 mb-2">Crear la expresión</h4>
  101. </div>
  102. <div class="col-8">
  103. <mat-form-field class="w-100">
  104. <input type="text" matInput placeholder="Selecciona un campo" required
  105. [matAutocomplete]="autoGroup1" formControlName="fieldVal">
  106. <button mat-button *ngIf="logicFieldFormGroup.get('fieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicFieldFormGroup.get('fieldVal').setValue(' ')">
  107. <mat-icon>close</mat-icon>
  108. </button>
  109. <mat-autocomplete #autoGroup1="matAutocomplete">
  110. <mat-optgroup *ngFor="let block of filteredBlocksOptions | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
  111. <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
  112. {{ block.codFilRegs }} - {{ name.desFldDesc }}
  113. </mat-option>
  114. </mat-optgroup>
  115. </mat-autocomplete>
  116. </mat-form-field>
  117. </div>
  118. <div class="col-8">
  119. <mat-form-field class="w-100">
  120. <mat-select placeholder="Selecciona un operador" required formControlName="operatorVal">
  121. <mat-option *ngFor="let operator of filteredtipoValoLogic; let i = index" [value]="i">
  122. {{ operator.desc }}
  123. </mat-option>
  124. </mat-select>
  125. </mat-form-field>
  126. </div>
  127. <div class="col-8" >
  128. <mat-form-field class="w-100">
  129. <input type="text" matInput placeholder="Selecciona un campo" required
  130. [matAutocomplete]="autoGroup" formControlName="secondFieldVal">
  131. <button mat-button *ngIf="logicFieldFormGroup.get('secondFieldVal').value !== ''" matSuffix mat-icon-button aria-label="Clear" (click)="logicFieldFormGroup.get('secondFieldVal').setValue(' ')">
  132. <mat-icon>close</mat-icon>
  133. </button>
  134. <mat-autocomplete #autoGroup="matAutocomplete">
  135. <mat-optgroup *ngFor="let block of filteredBlocksOptions2 | async" [label]="block.codFilRegs + ' - ' + block.desRegLfil">
  136. <mat-option *ngFor="let name of block.txqahlays" [value]="block.codFilRegs + ' - ' + name.desFldDesc">
  137. {{ block.codFilRegs }} - {{ name.desFldDesc }}
  138. </mat-option>
  139. </mat-optgroup>
  140. </mat-autocomplete>
  141. </mat-form-field>
  142. </div>
  143. </div>
  144. <div *ngIf="!logicFieldFormGroup.get('secondFieldVal').pristine && logicFieldFormGroup.get('secondFieldVal').invalid" class="row justify-content-center">
  145. <mat-error>Los tipos de campo no son comparables</mat-error>
  146. </div>
  147. <div class="mt-4">
  148. <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
  149. <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
  150. </div>
  151. </form>
  152. </mat-step>
  153. <mat-step [stepControl]="errorsFormGroup">
  154. <form [formGroup]="errorsFormGroup">
  155. <ng-template matStepLabel>Códigos de Error</ng-template>
  156. <div class="row">
  157. <div class="col-12">
  158. <mat-form-field class="w-100">
  159. <mat-select placeholder="Tipo de error" formControlName="tipoErr">
  160. <mat-option *ngFor="let error of errorsList" [value]="error">
  161. {{ error }}
  162. </mat-option>
  163. </mat-select>
  164. </mat-form-field>
  165. </div>
  166. </div>
  167. <div class="mt-4">
  168. <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
  169. <button mat-button mat-raised-button color="accent" matStepperNext>Siguiente</button>
  170. </div>
  171. </form>
  172. </mat-step>
  173. <mat-step>
  174. <ng-template matStepLabel>Validación Generada</ng-template>
  175. <div class="recuadro-validacion text-left">
  176. <h4 class="font-weight-bold">Validación Generada</h4>
  177. <p>val_permitido(expresion)</p>
  178. </div>
  179. <div class="mt-4">
  180. <button mat-button mat-raised-button color="primary" matStepperPrevious class="mr-2">Atrás</button>
  181. <!-- <button mat-button mat-raised-button color="accent" (click)="stepper.reset()">Reset</button> -->
  182. <button mat-button mat-raised-button color="accent" class="mr-2">Guardar</button>
  183. </div>
  184. </mat-step>
  185. </mat-horizontal-stepper>
  186. </mat-dialog-content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement