From 42c02fcd560bc8b400949cc5fa366e5506af48b1 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Thu, 25 Aug 2022 08:37:51 +0000 Subject: [PATCH 1/2] member-settlement, member-game create resolver --- .../user/components/view.component.html | 13 ++- .../member/user/components/view.component.ts | 16 ++++ .../resolvers/member-game-setting.resolver.ts | 86 ++++++++++++++++++ .../member-settlement-setting.resolver.ts | 87 +++++++++++++++++++ .../modules/admin/member/user/user.routing.ts | 4 + .../services/member_game_setting.service.ts | 5 +- .../member_settlement_setting.service.ts | 5 +- 7 files changed, 213 insertions(+), 3 deletions(-) create mode 100644 src/app/modules/admin/member/user/resolvers/member-game-setting.resolver.ts create mode 100644 src/app/modules/admin/member/user/resolvers/member-settlement-setting.resolver.ts diff --git a/src/app/modules/admin/member/user/components/view.component.html b/src/app/modules/admin/member/user/components/view.component.html index e7b4f2b..9ea1113 100644 --- a/src/app/modules/admin/member/user/components/view.component.html +++ b/src/app/modules/admin/member/user/components/view.component.html @@ -447,6 +447,7 @@ type="text" matInput [formControlName]="'bacaraRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) @@ -458,6 +459,7 @@ type="text" matInput [formControlName]="'rulletRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) @@ -469,6 +471,7 @@ type="text" matInput [formControlName]="'dragonRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) @@ -479,7 +482,12 @@
기타 게임 요율 - +
%(최소 0 ~ 최대 0.2)
@@ -490,6 +498,7 @@ type="text" matInput [formControlName]="'slotRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) @@ -501,6 +510,7 @@ type="text" matInput [formControlName]="'casinoRusingRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) @@ -514,6 +524,7 @@ type="text" matInput [formControlName]="'slotRusingRate'" + style="width: 40%" />
%(최소 0 ~ 최대 0.2) diff --git a/src/app/modules/admin/member/user/components/view.component.ts b/src/app/modules/admin/member/user/components/view.component.ts index a196139..3783410 100644 --- a/src/app/modules/admin/member/user/components/view.component.ts +++ b/src/app/modules/admin/member/user/components/view.component.ts @@ -62,6 +62,11 @@ import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_accou import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb'; import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb'; import { ListSitesResponse } from 'app/modules/proto/c2se/site_pb'; +import { + GetMemberSettlementSettingResponse, + ListMemberSettlementSettingsResponse, +} from 'app/modules/proto/c2se/member_settlement_setting_pb'; +import { MemberSettlementSetting } from 'app/modules/proto/models/member_settlement_setting_pb'; @Component({ selector: 'user-view', @@ -142,6 +147,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { selectedPanel: string = 'accountInfo'; memberLevels!: MemberLevel[]; + memberSettlement!: MemberSettlementSetting; + banks!: Bank[]; sites!: Site[]; @@ -306,6 +313,15 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { let listSitesResult: ListSitesResponse.Result = data['listSites']; this.sites = listSitesResult.getSitesList(); + /* + let memberSettlementResult: GetMemberSettlementSettingResponse.Result = + data['memberSettlement']; + const memberSettlement = + memberSettlementResult.getMemberSettlementSetting(); + + if (!!memberSettlement) { + this.memberSettlement = memberSettlement; + } */ this.memberDefaultForm.patchValue({ username: this.currentMember?.getUsername(), diff --git a/src/app/modules/admin/member/user/resolvers/member-game-setting.resolver.ts b/src/app/modules/admin/member/user/resolvers/member-game-setting.resolver.ts new file mode 100644 index 0000000..92f5460 --- /dev/null +++ b/src/app/modules/admin/member/user/resolvers/member-game-setting.resolver.ts @@ -0,0 +1,86 @@ +import { Injectable } from '@angular/core'; +import { + ActivatedRouteSnapshot, + Resolve, + Router, + RouterStateSnapshot, +} from '@angular/router'; +import { MemberGameSettingService } from 'app/modules/polyglot/member_game_setting/services/member_game_setting.service'; +import { + GetMemberGameSettingResponse, + ListMemberGameSettingsResponse, +} from 'app/modules/proto/c2se/member_game_setting_pb'; + +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class ListMemberGameResolver implements Resolve { + /** + * Constructor + */ + constructor( + private _router: Router, + private __memberGameSettingService: MemberGameSettingService + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMemberGameSettingsResponse.Result { + return this.__memberGameSettingService.listMemberGameSettings(); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class MemberGameSettingResolver implements Resolve { + /** + * Constructor + */ + constructor( + private _router: Router, + private __memberGameSettingService: MemberGameSettingService + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | GetMemberGameSettingResponse.Result { + let memberId = route.paramMap.get('id'); + if (!memberId) { + console.error('user.resolver memberId is null'); + } + return this.__memberGameSettingService.getMemberGameSetting(memberId!); + } +} diff --git a/src/app/modules/admin/member/user/resolvers/member-settlement-setting.resolver.ts b/src/app/modules/admin/member/user/resolvers/member-settlement-setting.resolver.ts new file mode 100644 index 0000000..055b2b6 --- /dev/null +++ b/src/app/modules/admin/member/user/resolvers/member-settlement-setting.resolver.ts @@ -0,0 +1,87 @@ +import { Injectable } from '@angular/core'; +import { + ActivatedRouteSnapshot, + Resolve, + Router, + RouterStateSnapshot, +} from '@angular/router'; +import { MemberSettlementSettingService } from 'app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service'; +import { + GetMemberSettlementSettingResponse, + ListMemberSettlementSettingsResponse, +} from 'app/modules/proto/c2se/member_settlement_setting_pb'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class ListMemberSettlementsResolver implements Resolve { + /** + * Constructor + */ + constructor( + private _router: Router, + private __memberSettlementSettingService: MemberSettlementSettingService + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMemberSettlementSettingsResponse.Result { + return this.__memberSettlementSettingService.listMemberSettlementSettings(); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class MemberSettlementResolver implements Resolve { + /** + * Constructor + */ + constructor( + private _router: Router, + private __memberSettlementSettingService: MemberSettlementSettingService + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | GetMemberSettlementSettingResponse.Result { + let memberId = route.paramMap.get('id'); + if (!memberId) { + console.error('user.resolver memberId is null'); + } + return this.__memberSettlementSettingService.getMemberSettlementSetting( + memberId! + ); + } +} diff --git a/src/app/modules/admin/member/user/user.routing.ts b/src/app/modules/admin/member/user/user.routing.ts index 28b9909..0953b8a 100644 --- a/src/app/modules/admin/member/user/user.routing.ts +++ b/src/app/modules/admin/member/user/user.routing.ts @@ -5,7 +5,9 @@ import { ViewComponent } from 'app/modules/admin/member/user/components/view.com import { SiteResolver } from 'app/shared/resolvers/site.resolver'; import { ListMemberBanksResolver } from './resolvers/member-bank.resolver'; import { ListMemberClassesResolver } from './resolvers/member-class.resolver'; +import { MemberGameSettingResolver } from './resolvers/member-game-setting.resolver'; import { ListMemberLevelsResolver } from './resolvers/member-level.resolver'; +import { MemberSettlementResolver } from './resolvers/member-settlement-setting.resolver'; import { MemberResolver, ListMemberResolver } from './resolvers/user.resolver'; @@ -27,6 +29,8 @@ export const userRoutes: Route[] = [ listMemberLevels: ListMemberLevelsResolver, listMemberBanks: ListMemberBanksResolver, listSites: SiteResolver, + // memberSettlement: MemberSettlementResolver, + // memberGame: MemberGameSettingResolver, }, }, ]; diff --git a/src/app/modules/polyglot/member_game_setting/services/member_game_setting.service.ts b/src/app/modules/polyglot/member_game_setting/services/member_game_setting.service.ts index ca607ae..600012e 100644 --- a/src/app/modules/polyglot/member_game_setting/services/member_game_setting.service.ts +++ b/src/app/modules/polyglot/member_game_setting/services/member_game_setting.service.ts @@ -87,10 +87,13 @@ export class MemberGameSettingService { ); } - getMemberGameSetting(): Promise { + getMemberGameSetting( + id: string + ): Promise { return new Promise( (resolve, reject) => { let req = new GetMemberGameSettingRequest(); + req.setId(id); this.__natsService .request( diff --git a/src/app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service.ts b/src/app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service.ts index 884e9c3..a553d32 100644 --- a/src/app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service.ts +++ b/src/app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service.ts @@ -91,10 +91,13 @@ export class MemberSettlementSettingService { ); } - getMemberSettlementSetting(): Promise { + getMemberSettlementSetting( + id: string + ): Promise { return new Promise( (resolve, reject) => { let req = new GetMemberSettlementSettingRequest(); + req.setId(id); this.__natsService .request( From 69fa77baef385e2a8125ba729ebf21a16db41b4b Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Thu, 25 Aug 2022 09:40:16 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/deposit-history.component.html | 19 ++++ .../components/deposit-history.component.ts | 106 ++++++++++++++++++ .../admin/member/user/components/index.ts | 13 ++- .../partner-sign-in-history.component.html | 19 ++++ .../partner-sign-in-history.component.ts | 106 ++++++++++++++++++ .../user/components/view.component.html | 41 ++++++- .../web-sign-in-history.component.html | 19 ++++ .../web-sign-in-history.component.ts | 106 ++++++++++++++++++ .../withdraw-history.component.html | 19 ++++ .../components/withdraw-history.component.ts | 106 ++++++++++++++++++ 10 files changed, 551 insertions(+), 3 deletions(-) create mode 100644 src/app/modules/admin/member/user/components/deposit-history.component.html create mode 100644 src/app/modules/admin/member/user/components/deposit-history.component.ts create mode 100644 src/app/modules/admin/member/user/components/partner-sign-in-history.component.html create mode 100644 src/app/modules/admin/member/user/components/partner-sign-in-history.component.ts create mode 100644 src/app/modules/admin/member/user/components/web-sign-in-history.component.html create mode 100644 src/app/modules/admin/member/user/components/web-sign-in-history.component.ts create mode 100644 src/app/modules/admin/member/user/components/withdraw-history.component.html create mode 100644 src/app/modules/admin/member/user/components/withdraw-history.component.ts diff --git a/src/app/modules/admin/member/user/components/deposit-history.component.html b/src/app/modules/admin/member/user/components/deposit-history.component.html new file mode 100644 index 0000000..b9a42bc --- /dev/null +++ b/src/app/modules/admin/member/user/components/deposit-history.component.html @@ -0,0 +1,19 @@ +
+
+
+
+ +
+
+ 검색 +
+
+ 입금정보 테이블 +
+
+
+
+
+
diff --git a/src/app/modules/admin/member/user/components/deposit-history.component.ts b/src/app/modules/admin/member/user/components/deposit-history.component.ts new file mode 100644 index 0000000..447fe3d --- /dev/null +++ b/src/app/modules/admin/member/user/components/deposit-history.component.ts @@ -0,0 +1,106 @@ +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { fuseAnimations } from '@fuse/animations'; +import { Subject } from 'rxjs'; + +@Component({ + selector: 'deposit-history', + templateUrl: './deposit-history.component.html', + styles: [ + /* language=SCSS */ + ` + .deposit-history-grid { + grid-template-columns: 60px auto 40px; + + @screen sm { + grid-template-columns: 100px auto 60px 60px; + } + + @screen md { + grid-template-columns: 100px 100px auto 60px 60px; + } + + @screen lg { + grid-template-columns: 100px 100px 100px 60px 60px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class DepositHistoryComponent + implements OnInit, AfterViewInit, OnDestroy +{ + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor(private _changeDetectorRef: ChangeDetectorRef) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void {} + + /** + * After view init + */ + ngAfterViewInit(): void {} + + /** + * On destroy + */ + ngOnDestroy(): void { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(null); + this._unsubscribeAll.complete(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + // ----------------------------------------------------------------------------------------------------- + // @ Private methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Create product + */ + __createProduct(): void {} + + /** + * Toggle product details + * + * @param productId + */ + __toggleDetails(productId: string): void {} + + /** + * Track by function for ngFor loops + * + * @param index + * @param item + */ + __trackByFn(index: number, item: any): any { + return item.id || index; + } +} diff --git a/src/app/modules/admin/member/user/components/index.ts b/src/app/modules/admin/member/user/components/index.ts index 4e9e32b..277abd2 100644 --- a/src/app/modules/admin/member/user/components/index.ts +++ b/src/app/modules/admin/member/user/components/index.ts @@ -1,4 +1,15 @@ +import { DepositHistoryComponent } from './deposit-history.component'; import { ListComponent } from './list.component'; +import { PartnerSignInHistoryComponent } from './partner-sign-in-history.component'; import { ViewComponent } from './view.component'; +import { WebSignInHistoryComponent } from './web-sign-in-history.component'; +import { WithdrawHistoryComponent } from './withdraw-history.component'; -export const COMPONENTS = [ListComponent, ViewComponent]; +export const COMPONENTS = [ + ListComponent, + ViewComponent, + DepositHistoryComponent, + WithdrawHistoryComponent, + WebSignInHistoryComponent, + PartnerSignInHistoryComponent, +]; diff --git a/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html new file mode 100644 index 0000000..c75a8e9 --- /dev/null +++ b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html @@ -0,0 +1,19 @@ +
+
+
+
+ +
+
+ 검색 +
+
+ 파트너로그인내역 테이블 +
+
+
+
+
+
diff --git a/src/app/modules/admin/member/user/components/partner-sign-in-history.component.ts b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.ts new file mode 100644 index 0000000..14a4dcd --- /dev/null +++ b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.ts @@ -0,0 +1,106 @@ +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { fuseAnimations } from '@fuse/animations'; +import { Subject } from 'rxjs'; + +@Component({ + selector: 'partner-sign-in-history', + templateUrl: './partner-sign-in-history.component.html', + styles: [ + /* language=SCSS */ + ` + .partner-sign-in-history-grid { + grid-template-columns: 60px auto 40px; + + @screen sm { + grid-template-columns: 100px auto 60px 60px; + } + + @screen md { + grid-template-columns: 100px 100px auto 60px 60px; + } + + @screen lg { + grid-template-columns: 100px 100px 100px 60px 60px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class PartnerSignInHistoryComponent + implements OnInit, AfterViewInit, OnDestroy +{ + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor(private _changeDetectorRef: ChangeDetectorRef) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void {} + + /** + * After view init + */ + ngAfterViewInit(): void {} + + /** + * On destroy + */ + ngOnDestroy(): void { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(null); + this._unsubscribeAll.complete(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + // ----------------------------------------------------------------------------------------------------- + // @ Private methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Create product + */ + __createProduct(): void {} + + /** + * Toggle product details + * + * @param productId + */ + __toggleDetails(productId: string): void {} + + /** + * Track by function for ngFor loops + * + * @param index + * @param item + */ + __trackByFn(index: number, item: any): any { + return item.id || index; + } +} diff --git a/src/app/modules/admin/member/user/components/view.component.html b/src/app/modules/admin/member/user/components/view.component.html index 9ea1113..3d6655f 100644 --- a/src/app/modules/admin/member/user/components/view.component.html +++ b/src/app/modules/admin/member/user/components/view.component.html @@ -604,8 +604,45 @@ -
내역
+ +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/src/app/modules/admin/member/user/components/web-sign-in-history.component.html b/src/app/modules/admin/member/user/components/web-sign-in-history.component.html new file mode 100644 index 0000000..4ebe771 --- /dev/null +++ b/src/app/modules/admin/member/user/components/web-sign-in-history.component.html @@ -0,0 +1,19 @@ +
+
+
+
+ +
+
+ 검색 +
+
+ 웹로그인내역 테이블 +
+
+
+
+
+
diff --git a/src/app/modules/admin/member/user/components/web-sign-in-history.component.ts b/src/app/modules/admin/member/user/components/web-sign-in-history.component.ts new file mode 100644 index 0000000..f740eed --- /dev/null +++ b/src/app/modules/admin/member/user/components/web-sign-in-history.component.ts @@ -0,0 +1,106 @@ +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { fuseAnimations } from '@fuse/animations'; +import { Subject } from 'rxjs'; + +@Component({ + selector: 'web-sign-in-history', + templateUrl: './web-sign-in-history.component.html', + styles: [ + /* language=SCSS */ + ` + .web-sign-in-history-grid { + grid-template-columns: 60px auto 40px; + + @screen sm { + grid-template-columns: 100px auto 60px 60px; + } + + @screen md { + grid-template-columns: 100px 100px auto 60px 60px; + } + + @screen lg { + grid-template-columns: 100px 100px 100px 60px 60px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class WebSignInHistoryComponent + implements OnInit, AfterViewInit, OnDestroy +{ + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor(private _changeDetectorRef: ChangeDetectorRef) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void {} + + /** + * After view init + */ + ngAfterViewInit(): void {} + + /** + * On destroy + */ + ngOnDestroy(): void { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(null); + this._unsubscribeAll.complete(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + // ----------------------------------------------------------------------------------------------------- + // @ Private methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Create product + */ + __createProduct(): void {} + + /** + * Toggle product details + * + * @param productId + */ + __toggleDetails(productId: string): void {} + + /** + * Track by function for ngFor loops + * + * @param index + * @param item + */ + __trackByFn(index: number, item: any): any { + return item.id || index; + } +} diff --git a/src/app/modules/admin/member/user/components/withdraw-history.component.html b/src/app/modules/admin/member/user/components/withdraw-history.component.html new file mode 100644 index 0000000..1867d17 --- /dev/null +++ b/src/app/modules/admin/member/user/components/withdraw-history.component.html @@ -0,0 +1,19 @@ +
+
+
+
+ +
+
+ 검색 +
+
+ 출금내역 테이블 +
+
+
+
+
+
diff --git a/src/app/modules/admin/member/user/components/withdraw-history.component.ts b/src/app/modules/admin/member/user/components/withdraw-history.component.ts new file mode 100644 index 0000000..b57844c --- /dev/null +++ b/src/app/modules/admin/member/user/components/withdraw-history.component.ts @@ -0,0 +1,106 @@ +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { fuseAnimations } from '@fuse/animations'; +import { Subject } from 'rxjs'; + +@Component({ + selector: 'withdraw-history', + templateUrl: './withdraw-history.component.html', + styles: [ + /* language=SCSS */ + ` + .withdraw-history-grid { + grid-template-columns: 60px auto 40px; + + @screen sm { + grid-template-columns: 100px auto 60px 60px; + } + + @screen md { + grid-template-columns: 100px 100px auto 60px 60px; + } + + @screen lg { + grid-template-columns: 100px 100px 100px 60px 60px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class WithdrawHistoryComponent + implements OnInit, AfterViewInit, OnDestroy +{ + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor(private _changeDetectorRef: ChangeDetectorRef) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void {} + + /** + * After view init + */ + ngAfterViewInit(): void {} + + /** + * On destroy + */ + ngOnDestroy(): void { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(null); + this._unsubscribeAll.complete(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + // ----------------------------------------------------------------------------------------------------- + // @ Private methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Create product + */ + __createProduct(): void {} + + /** + * Toggle product details + * + * @param productId + */ + __toggleDetails(productId: string): void {} + + /** + * Track by function for ngFor loops + * + * @param index + * @param item + */ + __trackByFn(index: number, item: any): any { + return item.id || index; + } +}