face bg issue and enitity field added

This commit is contained in:
venbainfotech 2022-05-18 18:54:20 +05:30
parent 852fc83db2
commit a24209c8d9
6 changed files with 80 additions and 37 deletions

View File

@ -317,7 +317,7 @@ drawRectangle(file)
for(let k=0;k<file.length;k++){ for(let k=0;k<file.length;k++){
console.log(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height']) console.log(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height'])
context.rect(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height']); // context.rect(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height']);
@ -363,21 +363,24 @@ drawRectangle(file)
context.font = "75px Times New Roman" context.font = "75px Times New Roman"
var width = context.measureText(this.similarity+'%').width; var width = context.measureText(this.similarity+'%').width;
var height = context.measureText(this.similarity+'%').height; var height = context.measureText(this.similarity+'%').height;
console.log(width,height)
context.fillStyle = 'rgb(255 255 255 / 70%)'; context.fillStyle = 'rgb(255 255 255 / 70%)';
/// draw text on top /// draw text on top
let heightValueCode = file[k]['Top_coordinate'] - 4 let heightValueCode = file[k]['Top_coordinate'] - 50
console.log(heightValueCode) console.log(heightValueCode)
// context.textAlign = "end"; // context.textAlign = "end";
// context.textAlign = 'center'; // context.textAlign = 'center';
context.fillText("\u23F9",file[k]['Left_coordinate'],heightValueCode,width,height); // context.fillText("\u23F9",file[k]['Left_coordinate'],heightValueCode,width,height);
context.rect(file[k]['Left_coordinate'],heightValueCode,50,50);
context.fill();
// ctx.fillText(txt, x, y); // ctx.fillText(txt, x, y);
// context.restore(); // context.restore();
console.log(file[k]['Top_coordinate']) console.log(file[k]['Top_coordinate'])
let heightValue = file[k]['Top_coordinate'] - 15 let heightValue = file[k]['Top_coordinate'] - 15
console.log(heightValue) console.log(heightValue)
let widthValue = file[k]['Left_coordinate'] + 10 let widthValue = file[k]['Left_coordinate'] + 7
context.fillStyle = this.color[k]['color'] context.fillStyle = this.color[k]['color']
// context.fill();
/// get width of text /// get width of text
// var width = context.measureText(this.similarity+'%').width; // var width = context.measureText(this.similarity+'%').width;

View File

@ -9,63 +9,85 @@
type="button" (click)="onNoClick()"><mat-icon>close</mat-icon></button> type="button" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</div> </div>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%">
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-select placeholder="Entity Type" formControlName="fk_entity_type_id"> <mat-form-field class="ml-xs" style="width:100%">
<mat-option *ngFor="let enti of entityOptions" [value]="enti.entity_type_id">{{ enti.name }}</mat-option> <mat-select placeholder="Entity Type" formControlName="fk_entity_type_id">
</mat-select> <mat-option *ngFor="let enti of entityOptions" [value]="enti.entity_type_id">{{ enti.name }}</mat-option>
<mat-error *ngIf="submitted && f.fk_entity_type_id.hasError('required')" class="mat-text-warn">Entity Type Required.</mat-error> </mat-select>
</mat-form-field> <mat-error *ngIf="submitted && f.fk_entity_type_id.hasError('required')" class="mat-text-warn">Entity Type Required.</mat-error>
</div> </mat-form-field>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> </div>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<input matInput placeholder="Full Name" formControlName="full_name"> <input matInput placeholder="Full Name" formControlName="full_name">
<mat-error *ngIf="submitted && f.full_name.hasError('required')" class="mat-text-warn">You must Include Full Name.</mat-error> <mat-error *ngIf="submitted && f.full_name.hasError('required')" class="mat-text-warn">You must Include Full Name.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<input matInput placeholder="Short Name" formControlName="short_name"> <input matInput placeholder="Short Name" formControlName="short_name">
<mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Short Name.</mat-error> <mat-error *ngIf="submitted && f.short_name.hasError('required')" class="mat-text-warn">You must Include Short Name.</mat-error>
</mat-form-field> </mat-form-field>
</div>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start"> <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%">
<mat-form-field fxFlex="1 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="Score Card (Yes/No)" formControlName="is_score_card_enabled"> <mat-select placeholder="Score Card (Yes/No)" formControlName="is_score_card_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.is_score_card_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_score_card_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field fxFlex="1 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="OTP (Yes/No)" formControlName="is_otp_enabled"> <mat-select placeholder="OTP (Yes/No)" formControlName="is_otp_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.is_otp_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_otp_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="SMS (Yes/No)" formControlName="is_sms_enabled"> <mat-select placeholder="SMS (Yes/No)" formControlName="is_sms_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.is_sms_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_sms_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field fxFlex="0 1 auto" class="ml-xs"> </div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%">
<div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="mail (Yes/No)" formControlName="is_mail_enabled"> <mat-select placeholder="mail (Yes/No)" formControlName="is_mail_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.is_mail_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_mail_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field fxFlex="1 1 auto" class="ml-xs"> <div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="App Notify (Yes/No)" formControlName="is_app_notify_enabled"> <mat-select placeholder="App Notify (Yes/No)" formControlName="is_app_notify_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="submitted && f.is_app_notify_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_app_notify_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div>
<div fxFlex="30%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="Facial Recognition Enabled" formControlName="is_face_api_enabled">
<mat-option *ngFor="let face of faceOption" [value]="face.face_option_value">{{face.face_name}}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.is_face_api_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field>
</div>
</div> </div>
<div class="row" style="text-align:right;"> <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>

View File

@ -43,6 +43,7 @@ export class EntityAddComponent implements OnInit {
public _addQuesFrom: FormGroup; public _addQuesFrom: FormGroup;
public submitted = false; public submitted = false;
public entityOptions: any = []; public entityOptions: any = [];
public faceOption: any = [{'face_name':'Yes','face_option_value':'1'},{'face_name':'No','face_option_value':'0'}];
public scoreCardOptions: any = [{'score_option_name':'Yes','score_option_value':'1'},{'score_option_name':'No','score_option_value':'0'}]; public scoreCardOptions: any = [{'score_option_name':'Yes','score_option_value':'1'},{'score_option_name':'No','score_option_value':'0'}];
errorMessage: string; errorMessage: string;
@ -71,6 +72,7 @@ export class EntityAddComponent implements OnInit {
fk_entity_type_id: [null, Validators.compose([Validators.required])], fk_entity_type_id: [null, Validators.compose([Validators.required])],
full_name: [null, Validators.compose([Validators.required])], full_name: [null, Validators.compose([Validators.required])],
short_name: [null, Validators.compose([Validators.required])], short_name: [null, Validators.compose([Validators.required])],
is_face_api_enabled: [null, Validators.compose([Validators.required])],
is_score_card_enabled: [null, Validators.compose([Validators.required])], is_score_card_enabled: [null, Validators.compose([Validators.required])],
is_otp_enabled: [null, Validators.compose([Validators.required])], is_otp_enabled: [null, Validators.compose([Validators.required])],
is_sms_enabled: [null, Validators.compose([Validators.required])], is_sms_enabled: [null, Validators.compose([Validators.required])],
@ -120,7 +122,7 @@ export class EntityAddComponent implements OnInit {
//To Remove The "Null" With Key also //To Remove The "Null" With Key also
Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]); Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]);
console.log(entityFormValues)
//Add BRANCH data with help Service File //Add BRANCH data with help Service File
this.entityService.addEntityMasterDetails(entityFormValues).subscribe( this.entityService.addEntityMasterDetails(entityFormValues).subscribe(
dataresult => { dataresult => {

View File

@ -239,7 +239,9 @@
<mat-error *ngIf="submitted && f.is_mail_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_mail_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="30%"> </div>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<div fxFlex="40%">
<mat-form-field class="ml-xs" style="width:100%"> <mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="App Notify (Yes/No)" formControlName="is_app_notify_enabled"> <mat-select placeholder="App Notify (Yes/No)" formControlName="is_app_notify_enabled">
<mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option> <mat-option *ngFor="let opt of scoreCardOptions" [value]="opt.score_option_value">{{ opt.score_option_name }}</mat-option>
@ -247,6 +249,14 @@
<mat-error *ngIf="submitted && f.is_app_notify_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error> <mat-error *ngIf="submitted && f.is_app_notify_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40%">
<mat-form-field class="ml-xs" style="width:100%">
<mat-select placeholder="Facial Recognition" formControlName="is_face_api_enabled">
<mat-option *ngFor="let face of faceOption" [value]="face.face_option_value">{{face.face_name}}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && f.is_face_api_enabled.hasError('required')" class="mat-text-warn">Field Required.</mat-error>
</mat-form-field>
</div>
</div> </div>
<div></div> <div></div>

View File

@ -35,6 +35,8 @@ import { EntityListComponent } from './../entity-list/entity.list.component';
export class EntityEditComponent implements OnInit, OnDestroy { export class EntityEditComponent implements OnInit, OnDestroy {
@Input() public childMessage: any; @Input() public childMessage: any;
public faceOption: any = [{'face_name':'Yes','face_option_value':'1'},{'face_name':'No','face_option_value':'0'}];
public scoreCardOptions: any = [{'score_option_name':'Yes','score_option_value':'1'},{'score_option_name':'No','score_option_value':'0'}]; public scoreCardOptions: any = [{'score_option_name':'Yes','score_option_value':'1'},{'score_option_name':'No','score_option_value':'0'}];
public entity_id: number; public entity_id: number;
@ -98,6 +100,7 @@ export class EntityEditComponent implements OnInit, OnDestroy {
entity_id: [this.entityNameRecord.entity_id], entity_id: [this.entityNameRecord.entity_id],
full_name: [this.entityNameRecord.full_name, Validators.compose([Validators.required]) ], full_name: [this.entityNameRecord.full_name, Validators.compose([Validators.required]) ],
short_name: [this.entityNameRecord.short_name, Validators.compose([Validators.required]) ], short_name: [this.entityNameRecord.short_name, Validators.compose([Validators.required]) ],
is_face_api_enabled: [this.entityNameRecord.is_face_api_enabled, Validators.compose([Validators.required])],
is_score_card_enabled:[this.entityNameRecord.is_score_card_enabled || '',Validators.compose([Validators.required])], is_score_card_enabled:[this.entityNameRecord.is_score_card_enabled || '',Validators.compose([Validators.required])],
is_otp_enabled:[this.entityNameRecord.is_otp_enabled || '',Validators.compose([Validators.required])], is_otp_enabled:[this.entityNameRecord.is_otp_enabled || '',Validators.compose([Validators.required])],
is_sms_enabled:[this.entityNameRecord.is_sms_enabled || '',Validators.compose([Validators.required])], is_sms_enabled:[this.entityNameRecord.is_sms_enabled || '',Validators.compose([Validators.required])],
@ -130,7 +133,7 @@ export class EntityEditComponent implements OnInit, OnDestroy {
var entityFormValues = this._editEntityNameFrom.value; var entityFormValues = this._editEntityNameFrom.value;
Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]); Object.keys(entityFormValues).forEach((key) => (entityFormValues[key] == null) && delete entityFormValues[key]);
console.log(entityFormValues)
this.entityService.updateEntityMasterDetails(entityFormValues).subscribe( this.entityService.updateEntityMasterDetails(entityFormValues).subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if (dataresult.status == 200) {

View File

@ -180,7 +180,10 @@ export class EntityListComponent implements OnInit {
addNewEntity(): void { addNewEntity(): void {
const dialogRef = this.dialog.open(EntityAddComponent, { const dialogRef = this.dialog.open(EntityAddComponent, {
disableClose: true, disableClose: true,
data: { } data: { },
minWidth: '70%',
maxWidth: '70%',
height: '80%',
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {