출금관리 리스트 완료

This commit is contained in:
Park Byung Eun 2022-08-17 05:05:36 +00:00
parent 6bb671d3a5
commit 7c89e9f1ab
4 changed files with 102 additions and 25 deletions

View File

@ -113,8 +113,8 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="withdraws$ | async as withdraws"> <ng-container *ngIf="bankWithdraw$ | async as bankWithdraw">
<ng-container *ngIf="withdraws.length > 0; else noWithdraw"> <ng-container *ngIf="bankWithdraw.length > 0; else noWithdraw">
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -164,9 +164,13 @@
<div class="hidden lg:block">삭제</div> <div class="hidden lg:block">삭제</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="withdraws$ | async as withdraws"> <ng-container *ngIf="bankWithdraw$ | async as bankWithdraw">
<ng-container <ng-container
*ngFor="let withdraw of withdraws; trackBy: __trackByFn" *ngFor="
let withdraw of bankWithdraw;
trackBy: __trackByFn;
let idx = index
"
> >
<div <div
class="withdraw-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" class="withdraw-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
@ -176,44 +180,50 @@
</div> </div>
<div> <div>
{{ withdraw.highRank }} 회원
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
<div <div
(click)="viewUserDetail(withdraw.id!)" (click)="viewUserDetail(withdraw.getMemberId())"
style="cursor: pointer" style="cursor: pointer"
> >
{{ withdraw.signinId }} test {{ idx }}
</div> </div>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ withdraw.nickname }} test {{ idx }}
</div> </div>
<!--환전신청금액--> <!--환전신청금액-->
<div>{{ withdraw.exchangeApplicationAmount }}</div> <div>{{ withdraw.getAccountNumber() }}</div>
<!--정산종류--> <!--정산종류-->
<div>{{ withdraw.calculateType }}</div> <div>{{ idx % 2 === 0 ? "롤링" : "콤프" }}</div>
<div> <div>
<!-- 은행명, 계좌번호, 예금주--> <!-- 은행명, 계좌번호, 예금주-->
{{ withdraw.rank }} {{ withdraw.getBankName() }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
LV{{ withdraw.level }} LV{{ withdraw.getAccountNumber() }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ withdraw.accountHolder }} {{ withdraw.getName() }}
</div> </div>
<!-- 비고 --> <!-- 비고 -->
<div>{{ withdraw.note }}</div> <div [matTooltip]="__getMemoTooltop(withdraw)">@</div>
<!-- 등록날짜/처리날짜-->
<div class="hidden md:block"> <div class="hidden md:block">
{{ withdraw.registrationDate }} {{ withdraw.getCreatedAt() | date: "yyyy-MM-dd HH:mm" }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ withdraw.processDate }} {{
withdraw.getStateChangedAt() | date: "yyyy-MM-dd HH:mm"
}}
</div> </div>
<!-- 입금/출금/보유금-->
<div class="hidden md:block"> <div class="hidden md:block">
{{ withdraw.deposit }} <span>41,200,000원</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ withdraw.withdraw }} <span>19,000,000원</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ withdraw.totalMoney }} <span>22,200,000원</span>
</div> </div>
<div class="hidden lg:block"> <div class="hidden lg:block">
<button <button
@ -221,7 +231,7 @@
class="bet-mat-small-8" class="bet-mat-small-8"
[color]="'primary'" [color]="'primary'"
> >
{{ withdraw.highRank }} [매장]kgon5
</button> </button>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
<button <button

View File

@ -22,6 +22,7 @@ import {
map, map,
merge, merge,
Observable, Observable,
of,
Subject, Subject,
switchMap, switchMap,
takeUntil, takeUntil,
@ -32,7 +33,9 @@ import { FuseConfirmationService } from '@fuse/services/confirmation';
import { Withdraw } from '../models/withdraw'; import { Withdraw } from '../models/withdraw';
import { WithdrawPagination } from '../models/withdraw-pagination'; import { WithdrawPagination } from '../models/withdraw-pagination';
import { WithdrawService } from '../services/withdraw.service'; import { WithdrawService } from '../services/withdraw.service';
import { Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { ListMemberBankWithdrawsResponse } from 'app/modules/proto/c2se/member_bank_withdraw_pb';
import { MemberBankWithdraw } from 'app/modules/proto/models/member_bank_withdraw_pb';
@Component({ @Component({
selector: 'withdraw-list', selector: 'withdraw-list',
@ -55,6 +58,10 @@ import { Router } from '@angular/router';
grid-template-columns: 40px 140px auto 80px 140px 40px 120px 120px 120px 40px 40px; grid-template-columns: 40px 140px auto 80px 140px 40px 120px 120px 120px 40px 40px;
} }
} }
.mat-tooltip {
white-space: pre-line;
}
`, `,
], ],
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
@ -65,7 +72,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
withdraws$!: Observable<Withdraw[] | undefined>; bankWithdraw$!: Observable<MemberBankWithdraw[] | undefined>;
__isSearchOpened = false; __isSearchOpened = false;
isLoading = false; isLoading = false;
@ -79,6 +86,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
* Constructor * Constructor
*/ */
constructor( constructor(
private _activatedRoute: ActivatedRoute,
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
@ -106,7 +114,22 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.withdraws$ = this._withdrawService.withdraws$;
this._activatedRoute.data.subscribe((data) => {
let listBankWithdrawResult: ListMemberBankWithdrawsResponse.Result =
data['bankWithdraw'];
this.bankWithdraw$ = of(
listBankWithdrawResult.getMemberBankWithdrawsList()
);
console.log(
'bankWithdraw: ',
listBankWithdrawResult.getMemberBankWithdrawsList()
);
// Mark for check
this._changeDetectorRef.markForCheck();
});
} }
/** /**
@ -202,4 +225,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__trackByFn(index: number, item: any): any { __trackByFn(index: number, item: any): any {
return item.id || index; return item.id || index;
} }
__getMemoTooltop(withdraw: MemberBankWithdraw): string {
if (!withdraw.getMemo() || withdraw.getMemo() === '') {
return '메모없음';
}
const resultMemoTooltip = withdraw.getMemo();
return resultMemoTooltip;
}
} }

View File

@ -5,6 +5,8 @@ import {
Router, Router,
RouterStateSnapshot, RouterStateSnapshot,
} from '@angular/router'; } from '@angular/router';
import { MemberBankWithdrawService } from 'app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service';
import { ListMemberBankWithdrawsResponse } from 'app/modules/proto/c2se/member_bank_withdraw_pb';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { Withdraw } from '../models/withdraw'; import { Withdraw } from '../models/withdraw';
@ -85,3 +87,33 @@ export class WithdrawsResolver implements Resolve<any> {
return this._withdrawService.getWithdraws(); return this._withdrawService.getWithdraws();
} }
} }
@Injectable({
providedIn: 'root',
})
export class BankWithdrawResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _bankWithdrawService: MemberBankWithdrawService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberBankWithdrawsResponse.Result>
| Promise<ListMemberBankWithdrawsResponse.Result>
| ListMemberBankWithdrawsResponse.Result {
return this._bankWithdrawService.listMemberBankWithdraws();
}
}

View File

@ -3,7 +3,10 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../../member/user/components/view.component'; import { ViewComponent } from '../../member/user/components/view.component';
import { WithdrawsResolver } from './resolvers/withdraw.resolver'; import {
BankWithdrawResolver,
WithdrawsResolver,
} from './resolvers/withdraw.resolver';
import { UserResolver } from '../../dashboards/user/user.resolvers'; import { UserResolver } from '../../dashboards/user/user.resolvers';
export const withdrawRoutes: Route[] = [ export const withdrawRoutes: Route[] = [
@ -11,7 +14,7 @@ export const withdrawRoutes: Route[] = [
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
withdraws: WithdrawsResolver, bankWithdraw: BankWithdrawResolver,
}, },
}, },
{ {