table default row set

This commit is contained in:
Surendiran 2023-05-19 18:34:59 +05:30
parent 3bf39e2f44
commit 80e95b3f91
23 changed files with 12570 additions and 8463 deletions

20597
ng-seed/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@
"dragula": "^3.7.3",
"firebase": "^8.10.0",
"font-awesome": "4.7.0",
"get-google-fonts": "^1.2.2",
"google-calendar": "^1.3.1",
"hammerjs": "^2.0.8",
"html2pdf.js": "^0.10.1",

View File

@ -21,7 +21,6 @@
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
@ -29,6 +28,7 @@
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<ng-scrollbar class="scrollHV">
<table mat-table [dataSource]="appointmentListSource" #mytable class="my-table mat-elevation-z8 len-table" *ngIf="!recordStatus">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef class="font-color mat-no"> S.No</th>
@ -75,65 +75,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!-- <table mat-table [dataSource]="appointmentListSource" matSort *ngIf="appointmentListLength > 0" class="my-table mat-elevation-z8 len-table"> -->
<!-- ID Column -->
<!-- <ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef mat-sort-header> S.No </mat-header-cell>
<mat-cell *matCellDef="let row; let i = index;"> {{row.index+1}} </mat-cell>
</ng-container> -->
<!--
<ng-container matColumnDef="ClientName">
<mat-header-cell *matHeaderCellDef mat-sort-header> Client Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.customer[0].cusName || null }}</mat-cell>
</ng-container>
<ng-container matColumnDef="datetime">
<mat-header-cell *matHeaderCellDef mat-sort-header> Date and Time </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots[0] | date:'shortTime'}} </mat-cell>
</ng-container>
<ng-container matColumnDef="phoneNo">
<mat-header-cell *matHeaderCellDef mat-sort-header> Mobile No </mat-header-cell>
<mat-cell *matCellDef="let row" > {{row.customer[0].phoneNo}} </mat-cell>
</ng-container>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef mat-sort-header> Email </mat-header-cell>
<mat-cell *matCellDef="let row" > {{row.customer[0].email}} </mat-cell>
</ng-container>
<ng-container matColumnDef="address">
<mat-header-cell *matHeaderCellDef mat-sort-header> Client Address </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.customer[0].address_1}} <br> {{row.customer[0].city}} <br> {{row.customer[0].state}} </mat-cell>
</ng-container >
<ng-container matColumnDef="status">
<mat-header-cell *matHeaderCellDef mat-sort-header> Status </mat-header-cell>
<mat-cell *matCellDef="let row"> <span style="font-weight: 700;" [ngStyle] = "{'color':row.status == '0' ? '#4caf50' : '#ffd740'}">{{row.status == 0 ? 'Booked':'Cancelled'}} </span> </mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef mat-sort-header> Action </mat-header-cell>
<mat-cell *matCellDef="let row">
<a (click)="openDialog('Update',row)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</table> -->
</ng-scrollbar>
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
@ -157,6 +99,5 @@
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>
<notifier-container></notifier-container>

View File

@ -2,7 +2,7 @@
width: 100%;
}
.scrollHV {
height: calc(100vh - 0px);
height: calc(100vh - 280px);
}
.button{
float: right;

View File

@ -43,7 +43,7 @@ export class AppoinmentsListComponent implements OnInit {
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 5;
pageSize = 10;
pageEvent: PageEvent;
appoinmentsList: any = [];
private apiUrl = environment.apiEndpoint;

View File

@ -126,6 +126,7 @@ export class AddBusinessComponent implements OnInit {
}
// this.formData=[];
this.formData.append('image', file, file.name);
this.formData.append('logo', '1');
console.log(this.currentFileUpload)
}
} else {

View File

@ -7,7 +7,7 @@
<button mat-button (click)="openDialog('Add',{})" class="button">Add Business</button>
<!-- <div class="example-container mat-elevation-z8 "> -->
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
@ -15,7 +15,7 @@
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<ng-scrollbar class="scrollHV">
<table mat-table [dataSource]="businessListSource" #mytable class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
@ -46,74 +46,31 @@
<ng-container matColumnDef="address">
<th mat-header-cell *matHeaderCellDef class="font-color"> Address </th>
<td mat-cell *matCellDef="let row" class="element-spc"> {{row.address}}, {{row.state.name}}, {{row.city.name}}</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef class="font-color"> Status </th>
<!-- <td mat-cell *matCellDef="let element"> {{row.isActive}} </td> -->
<td mat-cell *matCellDef="let row" [ngClass]="{'active' :row.isActive == 1,'inActive' : row.isActive == 0}">{{row.isActive == 1 ? 'Active' : 'Inactive'}}</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef class="font-color mat-action"> Action </th>
<td mat-cell *matCellDef="let row" class="action-link">
<a (click)="openDialog('Update',row)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a>
<mat-slide-toggle class="example-margin"
[checked]="row.isActive == 1 ? true : false " [color]="color"
[matTooltip]="row.isActive == 1 ? 'Active': 'Deactive'" matTooltipPosition="above"
(click)="isactive(row)"></mat-slide-toggle>
<!-- <a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a> -->
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr>
</table>
<!-- <table mat-table [dataSource]="businessListSource" matSort *ngIf="businessListLength > 0" class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef mat-sort-header> S.No </mat-header-cell>
<mat-cell *matCellDef="let row; let i = index;"> {{row.id}} </mat-cell>
</ng-container>
<ng-container matColumnDef="logo">
<mat-header-cell *matHeaderCellDef mat-sort-header> Logo </mat-header-cell>
<mat-cell *matCellDef="let row"> <img [src]="image_view(row.logo)" /> </mat-cell>
</ng-container>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.busName}} </mat-cell>
</ng-container>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef mat-sort-header> Email </mat-header-cell>
<mat-cell *matCellDef="let row" > {{row.email}} </mat-cell>
</ng-container>
<ng-container matColumnDef="phone">
<mat-header-cell *matHeaderCellDef mat-sort-header> Mobile No </mat-header-cell>
<mat-cell *matCellDef="let row" > {{row.contactNo}} </mat-cell>
</ng-container>
<ng-container matColumnDef="address">
<mat-header-cell *matHeaderCellDef mat-sort-header> Address </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.address}} <br> {{row.city}} <br> {{row.state}} </mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef mat-sort-header> Action </mat-header-cell>
<mat-cell *matCellDef="let row">
<a (click)="openDialog('Update',row)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</table> -->
</ng-scrollbar>
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
@ -137,7 +94,6 @@
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>
<notifier-container></notifier-container>

View File

@ -2,7 +2,7 @@
width: 100%;
}
.scrollHV {
height: calc(100vh - 0px);
height: calc(100vh - 250px);
}
.button{
float: right;
@ -132,4 +132,15 @@ img {
.mat-action{
width: 10%;
}
.bgRowColor{
background-color: #e7eaed !important;
}
.active {
color: green;
font-weight: bold;
}
.inActive {
color: red;
font-weight: bold;
}

View File

@ -20,7 +20,7 @@ export class BusinessListComponent implements OnInit {
push: any;
public businessListLength: number;
public businessListSource = new MatTableDataSource();
displayedColumns: string[] = ['id','logo', 'name', 'email','phone', 'address', 'action'];
displayedColumns: string[] = ['id','logo', 'name', 'email','phone', 'address', 'status', 'action'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
recordStatus: boolean;
@ -55,6 +55,41 @@ export class BusinessListComponent implements OnInit {
this.businessListSource.filter = filterValue;
}
isactive(value: any) {
console.log(value)
let formValue=[]
let val;
if(value.isActive == 1){
val = {
isActive:0,
id: value.id
}
}else{
val = {
isActive:1,
id: value.id
}
}
formValue.push(val);
this._bus.addFormDetails(formValue[0]).subscribe(res => {
if (res.status == 200) {
this.getBusinessList()
if(value.isActive == 1){
this.notifierService.notify('success', 'User Deactive Successfully');
}else{
this.notifierService.notify('success', 'User Active Successfully');
}
}
})
}
getBusinessList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._bus.getBusinessListDetails().subscribe(res => {

View File

@ -11,7 +11,7 @@
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
@ -19,6 +19,7 @@
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<ng-scrollbar class="scrollHV">
<table mat-table [dataSource]="customersListSource" #mytable class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
@ -56,57 +57,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!-- <table mat-table [dataSource]="customersListSource" matSort *ngIf="customersListLength > 0" class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef mat-sort-header> S.No </mat-header-cell>
<mat-cell *matCellDef="let row; let i = index;"> {{row.index+1}} </mat-cell>
</ng-container>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.cusName}}</mat-cell>
</ng-container>
<ng-container matColumnDef="email">
<mat-header-cell *matHeaderCellDef mat-sort-header> Email </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.email}} </mat-cell>
</ng-container>
<ng-container matColumnDef="phone">
<mat-header-cell *matHeaderCellDef mat-sort-header> Mobile No </mat-header-cell>
<mat-cell *matCellDef="let row" > {{row.phoneNo}} </mat-cell>
</ng-container>
<ng-container matColumnDef="address">
<mat-header-cell *matHeaderCellDef mat-sort-header> Address </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.address_1}} <br> {{row.city}} <br> {{row.state}} </mat-cell>
</ng-container >
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef mat-sort-header> Action </mat-header-cell>
<mat-cell *matCellDef="let row">
<a (click)="openDialog('Update',row)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</table> -->
</ng-scrollbar>
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
@ -130,6 +81,5 @@
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>
<notifier-container></notifier-container>

View File

@ -2,8 +2,8 @@
width: 100%;
}
.scrollHV {
height: calc(100vh - 0px);
}
height: calc(100vh - 250px);
}
.button{
float: right;
background-color: #4caf50;

View File

@ -53,7 +53,7 @@ export class CustomersListComponent implements OnInit {
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 5;
pageSize = 10;
pageEvent: PageEvent;
customersList: any[] = [];

View File

@ -5,10 +5,11 @@
</mat-form-field>
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
<mat-accordion *ngIf="!recordStatus">
<!-- <ng-scrollbar class="scrollHV"> -->
<table mat-table [dataSource]="mailLogListSource" #mytable class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
@ -44,19 +45,25 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!-- <mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<!-- </ng-scrollbar> -->
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
mode="indeterminate">
</mat-progress-spinner>
</mat-card> -->
</mat-card>
<div [hidden]="recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="mailLogListLength" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>
</mat-accordion>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">No Data Available</h5>
</mat-card-content>
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>

View File

@ -1,6 +1,6 @@
.scrollHV {
height: calc(100vh - 0px);
}
// .scrollHV {
// height: calc(100vh - 250px);
// }
.fullscreen{
position: absolute !important;
height: auto !important;

View File

@ -31,7 +31,7 @@ export class MailLogComponent implements OnInit {
dataSource = ELEMENT_DATA;
length = 5;
pageIndex = 0;
pageSize = 5;
pageSize = 10;
pageEvent: PageEvent;
customersList: any[] = [];
isLoading = true
@ -68,8 +68,7 @@ export class MailLogComponent implements OnInit {
console.log(this.mailLogList)
this.mailLogListLength = res.data.length;
this.mailLogList.forEach((element, index) => {
element.index = index
element.index = index
});
this.mailLogListSource['data'] = this.mailLogList;

View File

@ -15,7 +15,6 @@
<button mat-button *ngIf="user_role != 'FRONTDESK'" (click)="openDialog('Add',{})" class="button">Add Services</button>
<!-- <div class="example-container mat-elevation-z8 "> -->
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
@ -23,7 +22,7 @@
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<ng-scrollbar class="scrollHV">
<table mat-table [dataSource]="servicesListSource" #mytable class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="serviceId">
@ -62,49 +61,7 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!-- <table mat-table [dataSource]="servicesListSource" matSort *ngIf="servicesListLength > 0" class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="serviceId">
<mat-header-cell *matHeaderCellDef mat-sort-header> S.No </mat-header-cell>
<mat-cell *matCellDef="let row; let i = index;"> {{row.serviceId}} </mat-cell>
</ng-container>
<ng-container matColumnDef="servicesName">
<mat-header-cell *matHeaderCellDef mat-sort-header> Service Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.servicesName}} </mat-cell>
</ng-container>
<ng-container matColumnDef="duration">
<mat-header-cell *matHeaderCellDef mat-sort-header> Duration </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.duration}} Mins</mat-cell>
</ng-container>
<ng-container matColumnDef="fees">
<mat-header-cell *matHeaderCellDef mat-sort-header> Fees </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.fees}} </mat-cell>
</ng-container>
<ng-container matColumnDef="description">
<mat-header-cell *matHeaderCellDef mat-sort-header> Description </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef mat-sort-header> Action </mat-header-cell>
<mat-cell *matCellDef="let row">
<a (click)="openDialog('Update',row)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',row)"><span class="material-icons edit-color2 delete">delete</span></a>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</table> -->
</ng-scrollbar>
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
@ -128,7 +85,6 @@
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>
<notifier-container></notifier-container>

View File

@ -2,8 +2,8 @@
width: 100%;
}
.scrollHV {
height: calc(100vh - 0px);
}
height: calc(100vh - 250px);
}
.button{
float: right;
background-color: #4caf50;

View File

@ -31,7 +31,7 @@ export class ServiceListComponent implements OnInit {
// pagination variable details
length = 5;
pageIndex = 0;
pageSize = 5;
pageSize = 10;
pageEvent: PageEvent;
servicesList: any[] = [];
isLoading = true;

View File

@ -270,6 +270,8 @@ export class AddUserComponent implements OnInit {
// this.formData=[];
this.formData= new FormData();
this.formData.append('image', file, file.name);
this.formData.append('logo', '1');
// this.formData.append('file', file, file.name);
}
} else {

View File

@ -1,4 +1,4 @@
<h3>Users Details</h3>
<mat-form-field style="width:30%">
<mat-label>Filter</mat-label>
@ -26,15 +26,18 @@
</mat-form-field> -->
<button mat-button (click)="openDialog('Add',{})" class="button">Add Users</button>
<!-- <div class="example-container mat-elevation-z8 "> -->
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<ng-scrollbar class="scrollHV">
<div class="main-content" fxLayout="row" fxLayoutAlign="center start">
<div fxFlex.gt-sm="90" fxFlex.gt-xs="95" fxFlex="100">
<div class="messages-list material fullscreen">
<mat-accordion *ngIf="!recordStatus">
<mat-accordion *ngIf="!recordStatus">
<!-- <mat-expansion-panel>
<mat-expansion-panel-header > -->
<!-- <div class="example-container mat-elevation-z8 "> -->
<ng-scrollbar class="scrollHV">
<table mat-table [dataSource]="usersList" #mytable class="my-table mat-elevation-z8 len-table">
<ng-container matColumnDef="id">
@ -91,17 +94,29 @@
<th mat-header-cell *matHeaderCellDef class="font-color"> City </th>
<td mat-cell *matCellDef="let element"> {{element.city}} </td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef class="font-color"> Status </th>
<!-- <td mat-cell *matCellDef="let element"> {{element.isActive}} </td> -->
<td mat-cell *matCellDef="let element" [ngClass]="{'active' :element.isActive == 1,'inActive' : element.isActive == 0}">{{element.isActive == 1 ? 'Active' : 'Inactive'}}</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef class="font-color"> Action </th>
<td mat-cell *matCellDef="let element" class="action-link">
<a (click)="openDialog('Update',element)"><span class="material-icons edit-color">edit</span></a>
<a (click)="confirmBox('Delete',element)"><span class="material-icons edit-color2 delete">delete</span></a>
<a (click)="openDialog('Update',element)" style="margin-right: 2px;"><span class="material-icons edit-color">edit</span></a>
<mat-slide-toggle class="example-margin"
[checked]="element.isActive == 1 ? true : false " [color]="color"
[matTooltip]="element.isActive == 1 ? 'Active': 'Deactive'" matTooltipPosition="above"
(click)="isactive(element)"></mat-slide-toggle>
<!-- <a (click)="confirmBox('Delete',element)"><span class="material-icons edit-color2 delete">delete</span></a> -->
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr>
</table>
</ng-scrollbar>
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
<mat-progress-spinner
color="primary"
@ -124,7 +139,7 @@
</mat-card-content>
</div>
</div>
</div>
</ng-scrollbar>
</mat-sidenav-container>
</div>
</mat-sidenav-container>
<notifier-container></notifier-container>

View File

@ -2,7 +2,7 @@
width: 100%;
}
.scrollHV {
height: calc(100vh - 0px);
height: calc(100vh - 250px);
}
.button{
float: right;
@ -217,4 +217,17 @@ img {
.th-mat{
width: 18%;
}
.bgRowColor{
background-color: #e7eaed !important;
}
.active {
color: green;
font-weight: bold;
}
.inActive {
color: red;
font-weight: bold;
}

View File

@ -11,6 +11,7 @@ import { environment } from 'environments/environment';
import { BusinessService } from 'app/appoinment/business/business-service/business.service';
import { PractAssignServiceComponent } from '../pract-assign-service/pract-assign-service.component';
import { filter } from 'd3';
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
export interface UsersData {
id: number;
@ -46,12 +47,12 @@ const ELEMENT_DATA: UsersData[] = [
})
export class UserListComponent implements OnInit {
push: any;
displayedColumns: string[] = ['id','logo', 'role', 'busId','Username', 'mobile_no', 'email', 'action'];
displayedColumns: string[] = ['id','logo', 'role', 'busId','Username', 'mobile_no', 'email', 'status', 'action'];
dataSource: any;
addFormData: any;
length = 5;
pageIndex = 0;
pageSize = 5;
pageSize = 10;
pageEvent: PageEvent;
public usersList = new MatTableDataSource();
@ -73,7 +74,7 @@ export class UserListComponent implements OnInit {
}
ngOnInit(): void {
this.recordStatus=false;
this.recordStatus = false;
// this.dataSource = new MatTableDataSource(ELEMENT_DATA)
this.getUsersList()
this.getBusinessList()
@ -96,6 +97,42 @@ export class UserListComponent implements OnInit {
console.log(this.usersList)
}
isactive(value: any) {
console.log(value)
let formValue=[]
let val;
if(value.isActive == 1){
val = {
isActive:0,
id: value.id
}
}else{
val = {
isActive:1,
id: value.id
}
}
formValue.push(val);
this._use.addFormDetails(formValue[0]).subscribe(res => {
if (res.status == 200) {
this.getUsersList()
if(value.isActive == 1){
this.notifierService.notify('success', 'User Deactive Successfully');
}else{
this.notifierService.notify('success', 'User Active Successfully');
}
}
})
}
getUsersList() {
let userRole = localStorage.getItem('user_role')
let userID = localStorage.getItem('user_id')
@ -127,7 +164,7 @@ export class UserListComponent implements OnInit {
else{
// this.usersList=[];
// this.dataSource = null;
this.recordStatus=true;
this.recordStatus=true;
}
},error => this.isLoading = false);