From e453a7ba7efaa2e38ada9e8bea552917fd569f45 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Wed, 24 Aug 2022 08:56:38 +0000 Subject: [PATCH] ux is changed --- .../user/components/list.component.html | 89 ++++++++----------- .../member/user/components/list.component.ts | 27 ++++++ 2 files changed, 65 insertions(+), 51 deletions(-) diff --git a/src/app/modules/admin/member/user/components/list.component.html b/src/app/modules/admin/member/user/components/list.component.html index 66297c6..87d31ec 100644 --- a/src/app/modules/admin/member/user/components/list.component.html +++ b/src/app/modules/admin/member/user/components/list.component.html @@ -10,7 +10,19 @@ -
User
+
+ User + + + + + + +
@@ -21,9 +33,6 @@ >   총 콤프:394,860   총 합계:21,832,733 -
@@ -38,15 +47,6 @@ -
- - -
-
- + +
+ + + + + + + + + +
@@ -194,7 +210,9 @@ class="user-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5" >
- +
관리
요율
@@ -246,7 +264,11 @@ class="user-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" >
- +
diff --git a/src/app/modules/admin/member/user/components/list.component.ts b/src/app/modules/admin/member/user/components/list.component.ts index 44a17b0..6764676 100644 --- a/src/app/modules/admin/member/user/components/list.component.ts +++ b/src/app/modules/admin/member/user/components/list.component.ts @@ -5,7 +5,9 @@ import { Component, OnDestroy, OnInit, + QueryList, ViewChild, + ViewChildren, ViewEncapsulation, } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; @@ -39,6 +41,7 @@ import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb'; import { MemberClass } from 'app/modules/proto/models/member_class_pb'; import { MemberClassService } from 'app/modules/polyglot/member_class/services/member_class.service'; import { result } from 'lodash'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; @Component({ selector: 'user-list', @@ -79,6 +82,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatSort) private _sort!: MatSort; + @ViewChildren('chkUsers') chkUsers!: QueryList; + listMembers$!: Observable; __isSearchOpened = false; @@ -88,6 +93,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { pagination?: UserPagination; memberClasses!: MemberClass[]; + __checkedUsers: string[] = []; signoutBlockConfigForm!: FormGroup; @@ -327,6 +333,27 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { ); } + __onChangeChkUsersAll(event: MatCheckboxChange): void { + let checked = event.checked; + this.chkUsers.forEach((c, i) => { + c.checked = checked; + }); + this.__updateCheckedUsers(); + } + + __onChangeChkUsers(event: MatCheckboxChange): void { + this.__updateCheckedUsers(); + } + + __updateCheckedUsers(): void { + this.__checkedUsers = []; + this.chkUsers.forEach((c, i) => { + if (c.checked) { + this.__checkedUsers.push(c.value); + } + }); + } + __getParentUsername(member: MemberModel): string { if (!member.getParentMember()) { return '';