bug fix
This commit is contained in:
parent
4007da31a2
commit
5601844055
|
@ -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">•</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">•</span>
|
||||
<span>0명</span>
|
||||
<span>{{ currentMember?.getChildMemberCount() }}명</span>
|
||||
</div>
|
||||
<div class="flex items-center text-secondary my-1">
|
||||
<span>총입금</span>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ export const userRoutes: Route[] = [
|
|||
component: ViewComponent,
|
||||
resolve: {
|
||||
member: MemberResolver,
|
||||
listmembers: ListMemberResolver,
|
||||
listMemberLevels: ListMemberLevelsResolver,
|
||||
listMemberBanks: ListMemberBanksResolver,
|
||||
listSites: SiteResolver,
|
||||
|
|
Loading…
Reference in New Issue
Block a user