This commit is contained in:
Park Byung Eun 2022-08-30 09:29:56 +00:00
parent 4007da31a2
commit 5601844055
3 changed files with 47 additions and 7 deletions

View File

@ -25,16 +25,17 @@
>on00, on01, on02</span
> -->
<mat-chip-list aria-label="Fish selection">
<mat-chip color="accent">on00</mat-chip>
<mat-chip color="accent">on01</mat-chip>
<mat-chip color="accent" selected>on02</mat-chip>
<mat-chip color="accent" selected>on03</mat-chip>
<mat-chip
*ngFor="let parent of parentMembers"
color="accent"
>{{ parent.getUsername() }}</mat-chip
>
</mat-chip-list>
</div>
<div class="flex items-center text-secondary my-1">
<span>사이트명</span>
<span class="mx-2">&bull;</span>
<span>test.com</span>
<span>{{ currentMember?.getSite()?.getUrl() }}</span>
</div>
<div class="flex items-center text-secondary my-1">
<span>가입일자</span>
@ -46,7 +47,7 @@
<div class="flex items-center text-secondary my-1">
<span>하부회원수</span>
<span class="mx-2">&bull;</span>
<span>0</span>
<span>{{ currentMember?.getChildMemberCount() }}</span>
</div>
<div class="flex items-center text-secondary my-1">
<span>총입금</span>

View File

@ -26,6 +26,7 @@ import { FuseConfirmationService } from '@fuse/services/confirmation';
import { ActivatedRoute } from '@angular/router';
import {
GetMemberResponse,
ListMembersResponse,
UpdateMemberForPasswordRequest,
UpdateMemberForStateRequest,
UpdateMemberRequest,
@ -132,7 +133,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
fuseAlertConfirmConfigForm!: FormGroup;
/* currentMember?: User; */
listMembers?: MemberModel[];
currentMember?: MemberModel;
parentMembers?: MemberModel[] = [];
panels: any[] = [];
selectedPanel: string = 'accountInfo';
@ -300,8 +303,10 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
});
this._activatedRoute.data.subscribe((data) => {
let member: GetMemberResponse.Result = data['member'];
let listMembers: ListMembersResponse.Result = data['listmembers'];
this.listMembers = listMembers.getMembersList();
let member: GetMemberResponse.Result = data['member'];
this.currentMember = member.getMember();
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
@ -356,6 +361,27 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
canBetSlot: memberGameSetting?.getCanBetSlot(),
});
const firstParent = this.currentMember?.getParentMember();
if (!!firstParent) {
const secondParent = this.listMembers.find(
(v) => v.getId() === firstParent?.getParentMemberId()
);
if (!!secondParent) {
const thirdParent = this.listMembers.find(
(v) => v.getId() === secondParent?.getParentMember()?.getId()
);
if (!!thirdParent) {
const fourParent = this.listMembers.find(
(v) => v.getId() === thirdParent?.getParentMember()?.getId()
);
}
}
}
this.getParentMembers(this.currentMember);
console.log(this.parentMembers);
// Mark for check
this._changeDetectorRef.markForCheck();
});
@ -803,4 +829,16 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
});
});
}
private getParentMembers(member: MemberModel | undefined): void {
const findMember = this.listMembers?.find(
(v) => v.getId() === member?.getParentMember()?.getId()
);
if (!!findMember) {
this.parentMembers?.push(findMember);
this.getParentMembers(findMember);
} else {
return;
}
}
}

View File

@ -28,6 +28,7 @@ export const userRoutes: Route[] = [
component: ViewComponent,
resolve: {
member: MemberResolver,
listmembers: ListMemberResolver,
listMemberLevels: ListMemberLevelsResolver,
listMemberBanks: ListMemberBanksResolver,
listSites: SiteResolver,