page-user.component.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { Component, OnInit, ViewChild } from '@angular/core';
  2. import { ActivatedRoute, RouterOutlet } from '@angular/router';
  3. import { CompTableListComponent } from '../../../app/comp-table/comp-table-list/comp-table-list.component';
  4. // import _User from '../../../schemas/_User';
  5. import * as Parse from 'parse';
  6. import { CommonModule } from '@angular/common';
  7. import { NzPageHeaderModule } from 'ng-zorro-antd/page-header';
  8. import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
  9. import { NzSpaceModule } from 'ng-zorro-antd/space';
  10. import { CommonCompModule } from '../../../services/common.modules';
  11. import { Profile } from '../../../schemas/Profile-list';
  12. @Component({
  13. selector: 'app-page-user',
  14. templateUrl: './page-user.component.html',
  15. styleUrls: ['./page-user.component.scss'],
  16. imports: [
  17. CommonModule,
  18. RouterOutlet,
  19. NzSpaceModule,
  20. NzPageHeaderModule,
  21. CompTableListComponent,
  22. NzBreadCrumbModule,
  23. CommonCompModule,
  24. ],
  25. standalone: true,
  26. })
  27. export class PageUserComponent implements OnInit {
  28. @ViewChild(CompTableListComponent) list: CompTableListComponent | undefined;
  29. // _User = _User;
  30. ProfileList = Profile;
  31. user: Parse.User | undefined;
  32. className: string | undefined;
  33. queryParams: any | undefined;
  34. fieldsArray: Array<any> | undefined;
  35. constructor(
  36. private route: ActivatedRoute,
  37. private activeRoute: ActivatedRoute // private translate:TranslateService,
  38. ) {
  39. this.user = Parse.User.current();
  40. this.className = this.ProfileList.className;
  41. this.fieldsArray = this.ProfileList.fieldsArray;
  42. this.queryParams = {
  43. where: {
  44. // user:this.user?.toPointer(),
  45. isDeleted: { $ne: true },
  46. },
  47. };
  48. }
  49. ngOnInit(): void {
  50. this.activeRoute.paramMap.subscribe(async (params) => {
  51. let isDeleted = params.get('isDeleted');
  52. if (isDeleted) {
  53. this.queryParams.where['isDeleted'] = { $eq: true };
  54. } else {
  55. this.queryParams.where['isDeleted'] = { $ne: true };
  56. }
  57. this.list?.ngOnInit();
  58. });
  59. }
  60. createUser() {}
  61. }