; */
+ @ViewChildren('chkUsers') chkUsers!: QueryList;
listPartner$!: Observable;
+ listMemberLevels$!: Observable;
__isLevelOpened = false;
isLoading = false;
@@ -103,6 +110,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
pagination?: PartnerPagination;
__members: MemberModel[] = [];
+ __checkedUsers: string[] = [];
title: string = '';
btnTitle: string = '';
@@ -189,7 +197,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
this.listPartner$ = of(listMemberResult.getMembersList());
- /* console.log('dddd', listMemberResult.getMembersList()); */
+ let listMemberLevelsResult: ListMemberLevelsResponse.Result =
+ data['listMemberLevels'];
+ this.listMemberLevels$ = of(listMemberLevelsResult.getMemberLevelsList());
// Mark for check
this._changeDetectorRef.markForCheck();
@@ -295,14 +305,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/
__toggleDetails(productId: string): void {}
- /**
- * toggle the search
- * Used in 'bar'
- */
- __onClickLevel(): void {
- this.__isLevelOpened = !this.__isLevelOpened;
- }
-
/**
* Track by function for ngFor loops
*
@@ -417,4 +419,62 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
this.signoutBlockConfigForm.value
);
}
+
+ __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);
+ }
+ });
+ }
+
+ __onClickChangeLevel(member_level_id: string): void {
+ console.log('member_level_id', member_level_id);
+ }
+
+ __getMemberState(member: MemberModel): string {
+ const state = member.getState();
+ let resultStr = '';
+
+ switch (state) {
+ case MemberState.NONE:
+ resultStr = '없음';
+ break;
+ case MemberState.NORMAL:
+ resultStr = '정상';
+ break;
+ case MemberState.PENDING:
+ resultStr = '대기';
+ break;
+ case MemberState.WITHDRAWAL:
+ resultStr = '탈퇴';
+ break;
+ case MemberState.DORMANCY:
+ resultStr = '휴면';
+ break;
+ case MemberState.BLACKLIST:
+ resultStr = '블랙리스트';
+ break;
+ case MemberState.SUSPENDED:
+ resultStr = '정지';
+ break;
+ default:
+ break;
+ }
+
+ return resultStr;
+ }
}
diff --git a/src/app/modules/admin/member/partner/partner.module.ts b/src/app/modules/admin/member/partner/partner.module.ts
index 6215c49..90bb19f 100644
--- a/src/app/modules/admin/member/partner/partner.module.ts
+++ b/src/app/modules/admin/member/partner/partner.module.ts
@@ -13,6 +13,7 @@ import { MatSortModule } from '@angular/material/sort';
import { MatSelectModule } from '@angular/material/select';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatGridListModule } from '@angular/material/grid-list';
+import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatMenuModule } from '@angular/material/menu';
import { MatRadioModule } from '@angular/material/radio';
import { MatDividerModule } from '@angular/material/divider';
@@ -49,6 +50,7 @@ import { FuseAlertModule } from '@fuse/components/alert';
MatSelectModule,
MatTooltipModule,
MatGridListModule,
+ MatCheckboxModule,
MatMenuModule,
MatRadioModule,
MatDividerModule,
diff --git a/src/app/modules/admin/member/partner/partner.routing.ts b/src/app/modules/admin/member/partner/partner.routing.ts
index 2fa6302..95ccaee 100644
--- a/src/app/modules/admin/member/partner/partner.routing.ts
+++ b/src/app/modules/admin/member/partner/partner.routing.ts
@@ -11,6 +11,7 @@ import {
PartnerListResolver,
PartnersResolver,
} from './resolvers/partner.resolver';
+import { ListMemberLevelsResolver } from '../user/resolvers/member-level.resolver';
export const partnerRoutes: Route[] = [
// {
@@ -23,6 +24,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
{
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 46bdd9b..02ea8a1 100644
--- a/src/app/modules/admin/member/user/components/list.component.html
+++ b/src/app/modules/admin/member/user/components/list.component.html
@@ -22,11 +22,6 @@
-
-
-
@@ -193,7 +188,7 @@
0"
- class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-4 px-6 md:px-8 border-b"
+ class="relative flex flex-col sm:flex-row flex-0 sm:items-center py-4 px-6 md:px-8 border-b"
>
-
-
-
- LV1
-
-
- LV2
-
-
- LV3
-
-
- LV4
-
-
+
+ 레벨 변경
+
+
+
+
+
+ {{ ml.getName() }}
+
+
+
+
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 e638ef7..c6a8192 100644
--- a/src/app/modules/admin/member/user/components/list.component.ts
+++ b/src/app/modules/admin/member/user/components/list.component.ts
@@ -91,7 +91,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
listMemberLevels$!: Observable;
__isSearchOpened = false;
- __isLevelOpened = false;
isLoading = false;
searchInputControl = new FormControl();
selectedUser?: User;
@@ -248,14 +247,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
this.__isSearchOpened = !this.__isSearchOpened;
}
- /**
- * toggle the search
- * Used in 'bar'
- */
- __onClickLevel(): void {
- this.__isLevelOpened = !this.__isLevelOpened;
- }
-
/**
* Track by function for ngFor loops
*
@@ -388,6 +379,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__onMatSortChangeUsers(sort: Sort): void {}
+ __onClickChangeLevel(member_level_id: string): void {
+ console.log('member_level_id', member_level_id);
+ }
+
__getMemberState(member: MemberModel): string {
const state = member.getState();
let resultStr = '';