long profile emp photo

This commit is contained in:
mashfiq 2025-07-28 18:13:24 +06:00
parent 19fd4dc92a
commit ae98d60cd9
5 changed files with 157 additions and 164 deletions

View File

@ -14,7 +14,7 @@ export class ApiService {
public isSSO = false;
public versionDeployement = false;
// public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01";
public versionNumber = `V-20250721-`+"01";
public versionNumber = `V-20250724-`+"01";
public static BASE_URL = '';
public base_url = '';
// public currentLink = '';

View File

@ -200,6 +200,7 @@ export class EmployeeProfileComponent implements OnInit {
checkValue(value: any) {
debugger
if (value === true) {
this.hrEmployeeProfile = new HrEmployee();
@ -221,6 +222,7 @@ export class EmployeeProfileComponent implements OnInit {
}
else {
this.employeeService.hrEmployee.employeeNo = undefined;
this.employeeService.Employee_Get_Completed.next(new HrEmployee());
}
}

View File

@ -11,7 +11,11 @@
<div style="position: relative; display: inline-block;">
<img id="imgProfilePicture" [src]="employeePhoto"
style="height: 180px; width: 180px; border-radius: 50%; border: 1px solid #52527A;" />
<button class="editImage" (click)="fileInput.click()"
<!-- <button class="editImage" (click)="fileInput.click()"
style="position: absolute; bottom: 18px; right: 18px;">
<span class="editIcon">&#9998;</span>
</button> -->
<button class="editImage" (click)="triggerUploadClick()"
style="position: absolute; bottom: 18px; right: 18px;">
<span class="editIcon">&#9998;</span>
</button>
@ -25,8 +29,16 @@
</div>
</div>
<div class="p-col-12 p-md-12 p-lg-12" align="center">
<input formControlName="empPhoto" id="fupEmpPhoto" #fileInput
(change)="selectFile($event)" type="file" style="display: none;">
<!-- <input formControlName="empPhoto" id="fupEmpPhoto" #fileInput
(change)="selectProfilePhoto($event)" type="file" style="display: none;"> -->
<!-- <kendo-upload #fileInput formControlName="empPhoto" id="fupEmpPhoto"
[autoUpload]="false" [multiple]="false" [saveUrl]="'noop'" [removeUrl]="'noop'"
(select)="selectProfilePhoto($event)" style="width: 100%;display: none;">
</kendo-upload> -->
<kendo-upload #uploadPhoto formControlName="empPhoto" id="fupEmpPhoto" [autoUpload]="false"
[multiple]="false" [saveUrl]="'noop'" [removeUrl]="'noop'"
(select)="selectProfilePhoto($event)" style="width: 100%; display: none;">
</kendo-upload>
</div>
<div class="p-col-12 p-md-12 p-lg-12" style="height: 76px;">
@ -179,8 +191,7 @@
</div>
<div class="p-col-12 p-lg-12" align="right" style="margin-top: 20px;">
<button class="k-button k-primary" kendoButton icon="save"
(click)="SavePersonalInfo()">
<button class="k-button k-primary" kendoButton icon="save" (click)="SavePersonalInfo()">
<!-- (click)="SavePersonalInfo()"> -->
Save
</button>
@ -213,12 +224,8 @@
<!-- <button class="k-button k-primary" kendoButton icon="k-i-attachment-45 k-i-clip-45"
style="width: 15.5%; vertical-align: bottom; padding: 16px;" [disabled]="!active"
(click)="popUpAttachment('DLN')"></button> -->
<kendo-upload #uploadDL
[autoUpload]="false"
[multiple]="false"
[saveUrl]="'noop'"
[removeUrl]="'noop'"
(select)="selectFileDrivingLicense($event)"
<kendo-upload #uploadDL [autoUpload]="false" [multiple]="false" [saveUrl]="'noop'"
[removeUrl]="'noop'" (select)="selectFileDrivingLicense($event)"
style="width: 100%;">
</kendo-upload>
</div>
@ -248,18 +255,14 @@
<label for="empSignaturePhotoId">Signature</label>
</div>
<div class="p-col-12 p-md-12 p-lg-8">
<input id="empSignaturePhotoId" pInputText style="width:100%" type="text" [readonly]="true">
<input id="empSignaturePhotoId" pInputText style="width:100%" type="text"
[readonly]="true">
<!-- style="width: 84%" -->
<!-- <button class="k-button k-primary" kendoButton icon="k-i-attachment-45 k-i-clip-45"
style="width: 15.5%; vertical-align: bottom; padding: 16px;" [disabled]="!active"
(click)="popUpAttachment('Signature')"></button> -->
<kendo-upload #uploadSig
[autoUpload]="false"
[multiple]="false"
[saveUrl]="'noop'"
[removeUrl]="'noop'"
(select)="selectSignature($event)"
style="width: 100%;">
<kendo-upload #uploadSig [autoUpload]="false" [multiple]="false" [saveUrl]="'noop'"
[removeUrl]="'noop'" (select)="selectSignature($event)" style="width: 100%;">
</kendo-upload>
</div>
</div>
@ -295,13 +298,8 @@
[removeUrl]="'noop'"
(select)="onFileSelect($event)">
</kendo-upload> -->
<kendo-upload #uploadNID
[autoUpload]="false"
[multiple]="false"
[saveUrl]="'noop'"
[removeUrl]="'noop'"
(select)="selectFileNationalId($event)"
style="width: 100%;">
<kendo-upload #uploadNID [autoUpload]="false" [multiple]="false" [saveUrl]="'noop'"
[removeUrl]="'noop'" (select)="selectFileNationalId($event)" style="width: 100%;">
</kendo-upload>
</div>
<div class="p-col-12 p-md-12 p-lg-4">
@ -314,13 +312,8 @@
<!-- <button class="k-button k-primary" kendoButton icon="k-i-attachment-45 k-i-clip-45"
style="width: 15.5%; vertical-align: bottom; padding: 16px;" [disabled]="!active"
(click)="popUpAttachment('PNo')"></button> -->
<kendo-upload #uploadPassPort
[autoUpload]="false"
[multiple]="false"
[saveUrl]="'noop'"
[removeUrl]="'noop'"
(select)="selectPassport($event)"
style="width: 100%;">
<kendo-upload #uploadPassPort [autoUpload]="false" [multiple]="false" [saveUrl]="'noop'"
[removeUrl]="'noop'" (select)="selectPassport($event)" style="width: 100%;">
</kendo-upload>
</div>
<div class="p-col-12 p-md-12 p-lg-4">
@ -349,7 +342,8 @@
<label for="">Bangla Information</label>
</div>
<div class="p-col-12 p-md-12 p-lg-8">
<button class="k-button k-primary" style="width: 100%;" kendoButton icon="info" (click)="DisplayBanglaInformation()">
<button class="k-button k-primary" style="width: 100%;" kendoButton icon="info"
(click)="DisplayBanglaInformation()">
View & Update
</button>
</div>
@ -372,13 +366,8 @@
style="width: 15.5%; vertical-align: bottom; padding: 16px;" [disabled]="!active"
(click)="popUpAttachment('TIN')"></button> -->
<kendo-upload #uploadTIN
[autoUpload]="false"
[multiple]="false"
[saveUrl]="'noop'"
[removeUrl]="'noop'"
(select)="selectFileTin($event)"
style="width: 100%;">
<kendo-upload #uploadTIN [autoUpload]="false" [multiple]="false" [saveUrl]="'noop'"
[removeUrl]="'noop'" (select)="selectFileTin($event)" style="width: 100%;">
</kendo-upload>
</div>
<div class="p-col-12 p-md-12 p-lg-4">
@ -422,14 +411,13 @@
</div>
<div class="p-col-12 p-md-12 p-lg-4"></div>
<div class="p-col-12 p-md-12 p-lg-4" style="margin-top: 11px;">
<button class="k-button k-primary" kendoButton icon="add"
(click)="AddAccessCard()" [disabled]="!active">
<button class="k-button k-primary" kendoButton icon="add" (click)="AddAccessCard()"
[disabled]="!active">
Add Access Card
</button>
</div>
<div class="p-col-12 p-md-12 p-lg-4" style="margin-top: 11px;" align="right">
<button class="k-button k-primary" kendoButton icon="save"
(click)="SavePersonalInfo()">
<button class="k-button k-primary" kendoButton icon="save" (click)="SavePersonalInfo()">
<!-- (click)="SavePersonalInfo()"> -->
Save
</button>
@ -523,8 +511,8 @@
</p-tabView>
<kendo-dialog class="blur-background" *ngIf="nidPopUp||tinPopUp||dlnoPopUp||passnoPopUp||signaturePopUp" (close)="close()"
[width]="450">
<kendo-dialog class="blur-background" *ngIf="nidPopUp||tinPopUp||dlnoPopUp||passnoPopUp||signaturePopUp"
(close)="close()" [width]="450">
<app-loading-panel></app-loading-panel>
<kendo-dialog-titlebar>
<div style="font-size: 18px; line-height: 1.3em;"><span class=""></span>Attcahment</div>
@ -575,23 +563,23 @@
<label for="txtSpouseNameBangla">Spouse Name</label>
</div>
<div class="p-col-12 p-md-6 p-lg-3" style="margin: auto;">
<input class="bangla-font" formControlName="spouseNameBangla"
[(ngModel)]="hrEmployee.spouseNameBangla" pInputText style="width:100%" type="text">
<input class="bangla-font" formControlName="spouseNameBangla" [(ngModel)]="hrEmployee.spouseNameBangla"
pInputText style="width:100%" type="text">
</div>
<div class="p-col-12 p-md-6 p-lg-3" style="margin: auto;">
<label for="txtFatherNameBangla">Father's Name</label>
</div>
<div class="p-col-12 p-md-6 p-lg-3" style="margin: auto;">
<input class="bangla-font" formControlName="fatherNameBangla"
[(ngModel)]="hrEmployee.fatherNameBangla" pInputText style="width:100%" type="text">
<input class="bangla-font" formControlName="fatherNameBangla" [(ngModel)]="hrEmployee.fatherNameBangla"
pInputText style="width:100%" type="text">
</div>
<div class="p-col-12 p-md-6 p-lg-3" style="margin: auto;">
<label for="txtMotherNameBangla">Mother's Name</label>
</div>
<div class="p-col-12 p-md-6 p-lg-3" style="margin: auto;">
<input formControlName="motherNameBangla" [(ngModel)]="hrEmployee.motherNameBangla"
class="bangla-font" pInputText style="width:100%" type="text">
<input formControlName="motherNameBangla" [(ngModel)]="hrEmployee.motherNameBangla" class="bangla-font"
pInputText style="width:100%" type="text">
</div>
<!-- <div class="p-col-12 p-md-12 p-lg-12" style="margin: auto;" align="right">
@ -656,8 +644,7 @@
</div>
</div>
<div class="p-col-12 p-md-12 p-lg-12" style="margin: auto;" align="right">
<button class="k-button k-primary" kendoButton icon="save"
(click)="saveBanglaInfo()">
<button class="k-button k-primary" kendoButton icon="save" (click)="saveBanglaInfo()">
Save
</button>
</div>

View File

@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { DataTransferService } from '../../../data.transfer.service';
import { EmployeeServices } from '../../../_services/employee/employee.service';
@ -83,6 +83,8 @@ export class GeneralComponent implements OnInit {
@ViewChild('uploadNID') uploadNID: UploadComponent;
@ViewChild('uploadPassPort') uploadPassPort: UploadComponent;
@ViewChild('uploadTIN') uploadTIN: UploadComponent;
// @ViewChild('uploadPhoto') uploadPhoto: UploadComponent;
@ViewChild('uploadPhoto', { read: ElementRef }) uploadPhotoRef!: ElementRef;
active: boolean = false;
@ -99,6 +101,7 @@ export class GeneralComponent implements OnInit {
selectedDlFiles: File[] = [];
selectedPassportFiles: File[] = [];
selectedSignature: File[] = [];
selectedFiles: File[] = [];
departmentPicker: DynamicPicker;
gradePicker: DynamicPicker;
religionPicker: DynamicPicker;
@ -127,7 +130,7 @@ export class GeneralComponent implements OnInit {
employeeTypes: Category[];
religions: Religion[];
public userRoleselectableSettings: SelectableSettings;
selectedFiles?: FileList;
// selectedFiles?: FileList;
currentFile?: File;
employeePhoto: any;
empSigneture: any;
@ -431,7 +434,7 @@ export class GeneralComponent implements OnInit {
this.empSigneture = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp}`);
} else {
this.employeePhoto = this.defaultPhoto;
// this.employeePhoto = this.defaultPhoto;
}
},
@ -543,6 +546,25 @@ export class GeneralComponent implements OnInit {
this.notificationService.showSuccess("Signature Uploaded Successfully!")
});
}
if (this.selectedFiles !== null && this.selectedFiles !== undefined && this.selectedFiles.length > 0) {
const file: File | null = this.selectedFiles[0];
this.currentFile = file;
debugger;
this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
(resp: any) => {
console.log('image data');
// console.log(resp.body);
//this.employeePhoto = resp;
this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
},
(err: any) => {
this.notificationService.showError(err.error);
this.currentFile = undefined;
});
this.selectedFiles = undefined;
}
}
);
}
@ -750,53 +772,53 @@ export class GeneralComponent implements OnInit {
});
}
selectFile(event: any): void {
if (this.hrEmployee.id == 0) {
this.notificationService.showWarning('select an employee to change the profile picture');
return;
}
// selectFile(event: any): void {
// if (this.hrEmployee.id == 0) {
// this.notificationService.showWarning('select an employee to change the profile picture');
// return;
// }
if (confirm('Are you sure change the profile picture? selected picture will be store in database as well as will be used as profile picture.') == false) {
return;
}
debugger;
this.selectedFiles = event.target.files;
// if (confirm('Are you sure change the profile picture? selected picture will be store in database as well as will be used as profile picture.') == false) {
// return;
// }
// debugger;
// this.selectedFiles = event.target.files;
if (this.selectedFiles.length > 0) {
const file: File | null = this.selectedFiles.item(0);
this.currentFile = file;
debugger;
this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
(resp: any) => {
console.log('image data');
// console.log(resp.body);
//this.employeePhoto = resp;
this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
},
(err: any) => {
this.notificationService.showError(err.error);
this.currentFile = undefined;
});
// if (this.selectedFiles.length > 0) {
// const file: File | null = this.selectedFiles.item(0);
// this.currentFile = file;
// debugger;
// this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
// (resp: any) => {
// console.log('image data');
// // console.log(resp.body);
// //this.employeePhoto = resp;
// this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
// },
// (err: any) => {
// this.notificationService.showError(err.error);
// this.currentFile = undefined;
// });
this.selectedFiles = undefined;
}
}
// this.selectedFiles = undefined;
// }
// }
upload(): void {
if (this.selectedFiles.length > 0) {
const file: File | null = this.selectedFiles.item(0);
this.currentFile = file;
this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
(event: any) => {
},
(err: any) => {
this.notificationService.showError(err.error);
this.currentFile = undefined;
});
this.selectedFiles = undefined;
}
}
// upload(): void {
// if (this.selectedFiles.length > 0) {
// const file: File | null = this.selectedFiles.item(0);
// this.currentFile = file;
// this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
// (event: any) => {
// },
// (err: any) => {
// this.notificationService.showError(err.error);
// this.currentFile = undefined;
// });
// this.selectedFiles = undefined;
// }
// }
RolePermission() {
console.log('Role Permission');
@ -1050,39 +1072,22 @@ export class GeneralComponent implements OnInit {
// const file = this.selectedPassportFiles[0];
}
selectSignature(event: { files: FileInfo[] }): void {
// if (this.hrEmployee.id == 0) {
// this.notificationService.showWarning('select an employee to change the profile picture');
// return;
// }
// if (confirm('Are you sure change the signature picture? selected picture will be store in database as well as will be used as signature picture.') == false) {
// return;
// }
this.selectedSignature = event.files
.map(f => f.rawFile)
.filter((f): f is File => f instanceof File);;
// if (this.selectedSignature.length > 0) {
// const file: File | null = this.selectedSignature[0];
// this.currentFile = file;
// this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe(
// (resp: any) => {
// this.empSigneture = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
// // console.log(resp.body);
// //this.Sigfiles = resp;// this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
// },
// (err: any) => {
// this.notificationService.showError(err.error);
// this.currentFile = undefined;
// }, () => {
// this.signaturePopUp = false;
// this.notificationService.showSuccess("Signature Uploaded Successfully!")
// });
// this.selectedFiles = undefined;
// }
.filter((f): f is File => f instanceof File);
}
selectProfilePhoto(event: { files: FileInfo[] }): void {
debugger
this.selectedFiles = event.files
.map(f => f.rawFile)
.filter((f): f is File => f instanceof File);;
}
triggerUploadClick(): void {
const input = this.uploadPhotoRef.nativeElement.querySelector('input[type="file"]');
if (input) {
input.click();
}
}
changePassword() {
if (this.userPassword == '') {

View File

@ -331,7 +331,6 @@ export class LifeCycleEntryComponent implements OnInit {
var emp: Employee = new Employee();
str = emp.getStatusString(this._employee.status);
}
debugger
this._statusString = str;
return str;
}