From 628a6630378394ce4e2edff3fb84e28a9f1cd76f Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Thu, 1 Sep 2022 00:35:22 +0000 Subject: [PATCH] bug fix --- .../components/list.component.html | 13 +++++++-- .../unconnected/components/list.component.ts | 29 ++++++++++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/app/modules/admin/member/unconnected/components/list.component.html b/src/app/modules/admin/member/unconnected/components/list.component.html index 37269fe..6496d5b 100644 --- a/src/app/modules/admin/member/unconnected/components/list.component.html +++ b/src/app/modules/admin/member/unconnected/components/list.component.html @@ -35,6 +35,7 @@
@@ -61,7 +62,9 @@ class="unconnected-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" >
- +
상부
@@ -100,8 +103,12 @@
-
- +
+
최상부{{ unconnected.highstRank }} diff --git a/src/app/modules/admin/member/unconnected/components/list.component.ts b/src/app/modules/admin/member/unconnected/components/list.component.ts index a0e9730..a10ed3b 100644 --- a/src/app/modules/admin/member/unconnected/components/list.component.ts +++ b/src/app/modules/admin/member/unconnected/components/list.component.ts @@ -5,7 +5,9 @@ import { Component, OnDestroy, OnInit, + QueryList, ViewChild, + ViewChildren, ViewEncapsulation, } from '@angular/core'; import { @@ -14,7 +16,7 @@ import { FormGroup, Validators, } from '@angular/forms'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { @@ -71,6 +73,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatSort) private _sort!: MatSort; + @ViewChildren('chkUsers') chkUsers!: QueryList; + unconnecteds$!: Observable; __isSearchOpened = false; @@ -79,6 +83,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { selectedUnconnected?: Unconnected; pagination?: UnconnectedPagination; + __checkedUsers: string[] = []; + private _unsubscribeAll: Subject = new Subject(); /** @@ -180,6 +186,27 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // @ Private methods // ----------------------------------------------------------------------------------------------------- + __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); + } + }); + } + /** * Create product */