@@ -8,10 +8,10 @@ import { ServiceRest } from 'src/app/service/serviceRest';
88import { ServiceWipf } from 'src/app/service/serviceWipf' ;
99
1010@Component ( {
11- selector : 'app-checkliste' ,
12- templateUrl : './checkliste.component.html' ,
13- styleUrls : [ './checkliste.component.less' ] ,
14- standalone : false
11+ selector : 'app-checkliste' ,
12+ templateUrl : './checkliste.component.html' ,
13+ styleUrls : [ './checkliste.component.less' ] ,
14+ standalone : false
1515} )
1616export class ChecklisteComponent implements OnInit {
1717
@@ -34,6 +34,8 @@ export class ChecklisteComponent implements OnInit {
3434 public lastNewPrio : number = 0 ;
3535 public offeneItems : number = 0 ;
3636 public sFilter : string = "" ;
37+ public bFilterDone : boolean = false ;
38+ public verkListBackupForFilter ;
3739 private selectedClID : number ;
3840
3941 @ViewChild ( MatSort , { static : true } ) sort : MatSort ;
@@ -365,6 +367,8 @@ export class ChecklisteComponent implements OnInit {
365367 }
366368
367369 public checkItemVerkn ( iverk : CheckListeVerkn ) : void {
370+ this . bFilterDone = false ;
371+ this . verkListBackupForFilter = [ ] ;
368372 iverk . checked = ! iverk . checked ;
369373 this . rest . postNoWartenDialog ( 'checkliste/verkn/save' , iverk ) . then ( ( res : any ) => {
370374 this . ladeChecklistenView ( this . viewCL ) ;
@@ -379,12 +383,31 @@ export class ChecklisteComponent implements OnInit {
379383 } ) ;
380384 }
381385
386+ public filterDone ( ) : void {
387+ this . bFilterDone = ! this . bFilterDone ;
388+
389+ if ( this . bFilterDone ) {
390+ this . verkListBackupForFilter = [ ...this . dataSourceCheckListeVerkn . data ] ;
391+ // this.dataSourceCheckListeVerkn.data = this.dataSourceCheckListeVerkn.data.filter((clv: CheckListeVerkn) => {
392+ // !clv.checked;
393+ // });
394+ this . dataSourceCheckListeVerkn . data =
395+ this . dataSourceCheckListeVerkn . data . filter (
396+ clv => ! clv . checked
397+ ) ;
398+ }
399+ else {
400+ this . dataSourceCheckListeVerkn . data = [ ...this . verkListBackupForFilter ] ;
401+ }
402+
403+ this . applyFilter ( ) ;
404+ }
382405}
383406
384407@Component ( {
385- selector : 'app-checklisteliste-dialog' ,
386- templateUrl : './checkliste.dialog.checkliste.html' ,
387- standalone : false
408+ selector : 'app-checklisteliste-dialog' ,
409+ templateUrl : './checkliste.dialog.checkliste.html' ,
410+ standalone : false
388411} )
389412export class CheckListeDialogCheckListe implements OnInit {
390413 constructor ( public dialog : MatDialog , private rest : ServiceRest , public dialogRef : MatDialogRef < CheckListeDialogCheckListe > , @Inject ( MAT_DIALOG_DATA ) public data : CheckListeListe ) {
@@ -424,9 +447,9 @@ export class CheckListeDialogCheckListe implements OnInit {
424447}
425448
426449@Component ( {
427- selector : 'app-checklistetypes-dialog' ,
428- templateUrl : './checkliste.dialog.type.html' ,
429- standalone : false
450+ selector : 'app-checklistetypes-dialog' ,
451+ templateUrl : './checkliste.dialog.type.html' ,
452+ standalone : false
430453} )
431454export class CheckListeDialogType {
432455 constructor ( public dialog : MatDialog , public dialogRef : MatDialogRef < CheckListeDialogType > , @Inject ( MAT_DIALOG_DATA ) public data : CheckListeType ) {
@@ -444,9 +467,9 @@ export class CheckListeDialogType {
444467}
445468
446469@Component ( {
447- selector : 'app-checklisteitem-dialog' ,
448- templateUrl : './checkliste.dialog.item.html' ,
449- standalone : false
470+ selector : 'app-checklisteitem-dialog' ,
471+ templateUrl : './checkliste.dialog.item.html' ,
472+ standalone : false
450473} )
451474export class CheckListeDialogItem {
452475 constructor ( public dialog : MatDialog , private rest : ServiceRest , public dialogRef : MatDialogRef < CheckListeDialogItem > , @Inject ( MAT_DIALOG_DATA ) public data : CheckListeItem ) {
0 commit comments