diff --git a/src/app/mock-api/apps/report/loosing/api.ts b/src/app/mock-api/apps/report/loosing/api.ts index b1c751f..c44541c 100644 --- a/src/app/mock-api/apps/report/loosing/api.ts +++ b/src/app/mock-api/apps/report/loosing/api.ts @@ -33,29 +33,14 @@ export class ReportLoosingMockApi { .reply(({ request }) => { // Get available queries const search = request.params.get('search'); - const sort = request.params.get('sort') || 'name'; - const order = request.params.get('order') || 'asc'; + // const sort = request.params.get('sort') || 'name'; + // const order = request.params.get('order') || 'asc'; const page = parseInt(request.params.get('page') ?? '1', 10); const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the loosings let loosings: any[] | null = cloneDeep(this._loosings); - // Sort the loosings - if (sort === 'sku' || sort === 'name' || sort === 'active') { - loosings.sort((a, b) => { - const fieldA = a[sort].toString().toUpperCase(); - const fieldB = b[sort].toString().toUpperCase(); - return order === 'asc' - ? fieldA.localeCompare(fieldB) - : fieldB.localeCompare(fieldA); - }); - } else { - loosings.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } - // If search exists... if (search) { // Filter the loosings diff --git a/src/app/mock-api/apps/report/loosing/data.ts b/src/app/mock-api/apps/report/loosing/data.ts index a57e1ac..c8fcf26 100644 --- a/src/app/mock-api/apps/report/loosing/data.ts +++ b/src/app/mock-api/apps/report/loosing/data.ts @@ -2,32 +2,27 @@ export const loosings = [ { - id: 'on00', - totalPartnerCount: '5', - totalHoldingMoney: 303675, - totalComp: 108933, - total: 412608, - branchCount: 1, - divisionCount: 1, - officeCount: 1, - storeCount: 1, - memberCount: 1, - nickname: 'on00', - accountHolder: '11', - phoneNumber: '010-1111-1111', - calculateType: '롤링', - ownCash: 50000, - ownComp: 1711, - ownCoupon: 50000, - gameMoney: 0, - todayComp: 0, - totalDeposit: 0, - totalWithdraw: 0, - balance: 0, + id: '1', + startDate: '2022-06-01 15:38', + endDate: '2022-06-12 15:38', registDate: '2022-06-12 15:38', - finalSigninDate: '', - ip: '', - state: '정상', - note: '', + defaultCount: '15', + loosingCount: '15', + }, + { + id: '2', + startDate: '2022-06-01 15:38', + endDate: '2022-06-12 15:38', + registDate: '2022-06-12 15:38', + defaultCount: '14', + loosingCount: '16', + }, + { + id: '3', + startDate: '2022-06-01 15:38', + endDate: '2022-06-12 15:38', + registDate: '2022-06-12 15:38', + defaultCount: '12', + loosingCount: '11', }, ]; diff --git a/src/app/modules/admin/board/popup/components/list.component.html b/src/app/modules/admin/board/popup/components/list.component.html index 376bda2..0ecc8a2 100644 --- a/src/app/modules/admin/board/popup/components/list.component.html +++ b/src/app/modules/admin/board/popup/components/list.component.html @@ -9,6 +9,7 @@
팝업 관리
+
; - users$!: Observable; isLoading = false; searchInputControl = new FormControl(); diff --git a/src/app/modules/admin/board/popup/popup.module.ts b/src/app/modules/admin/board/popup/popup.module.ts index 2e38a79..ee8ad45 100644 --- a/src/app/modules/admin/board/popup/popup.module.ts +++ b/src/app/modules/admin/board/popup/popup.module.ts @@ -15,6 +15,8 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatTableModule } from '@angular/material/table'; import { MatDividerModule } from '@angular/material/divider'; import { MatMenuModule } from '@angular/material/menu'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatMomentDateModule } from '@angular/material-moment-adapter'; import { TranslocoModule } from '@ngneat/transloco'; @@ -45,6 +47,8 @@ import { popupRoutes } from './popup.routing'; MatTableModule, MatDividerModule, MatMenuModule, + MatDatepickerModule, + MatMomentDateModule, ], }) export class PopupModule {} diff --git a/src/app/modules/admin/report/loosing/components/list.component.html b/src/app/modules/admin/report/loosing/components/list.component.html index d570cd0..cb999c1 100644 --- a/src/app/modules/admin/report/loosing/components/list.component.html +++ b/src/app/modules/admin/report/loosing/components/list.component.html @@ -1,355 +1,189 @@ -
- -
- -
- -
- -
루징관리
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
+
+
+
+
+ +
+
+ 팝업 관리
- - - + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+
- -
- There are no loosing datas! +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
번호 + + {{ i + 1 }} + + 시작일 + + {{ info.startDate }} + + 종료일 + + {{ info.endDate }} + + + 기본데이터 + + {{ + info.defaultCount + }} + + + + 루징데이터 + + {{ + info.loosingCount + }} + + + 삭제 + +
+
- + diff --git a/src/app/modules/admin/report/loosing/components/list.component.ts b/src/app/modules/admin/report/loosing/components/list.component.ts index 1d0addc..d8b34b5 100644 --- a/src/app/modules/admin/report/loosing/components/list.component.ts +++ b/src/app/modules/admin/report/loosing/components/list.component.ts @@ -8,32 +8,18 @@ import { ViewChild, ViewEncapsulation, } from '@angular/core'; -import { - FormBuilder, - FormControl, - FormGroup, - Validators, -} from '@angular/forms'; -import { MatCheckboxChange } from '@angular/material/checkbox'; + import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; -import { - debounceTime, - map, - merge, - Observable, - Subject, - switchMap, - takeUntil, -} from 'rxjs'; +import { map, merge, Observable, Subject, switchMap, takeUntil } from 'rxjs'; import { fuseAnimations } from '@fuse/animations'; import { FuseConfirmationService } from '@fuse/services/confirmation'; -import { User } from '../../../member/user/models/user'; import { Loosing } from '../models/loosing'; -import { LoosingPagination } from '../models/loosing-pagination'; + import { LoosingService } from '../services/loosing.service'; import { Router } from '@angular/router'; +import { MatTableDataSource } from '@angular/material/table'; @Component({ selector: 'loosing-list', @@ -67,22 +53,39 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatSort) private _sort!: MatSort; loosings$!: Observable; - users$!: Observable; isLoading = false; - searchInputControl = new FormControl(); - selectedLoosing?: Loosing; - pagination?: LoosingPagination; + + loosingDataSource: MatTableDataSource = new MatTableDataSource(); private _unsubscribeAll: Subject = new Subject(); + headerTableColumns: string[] = [ + 'index', + 'startDate', + 'endDate', + 'defaultDataTotalCount', + 'loosingDataTotalCount', + 'removeBtn', + ]; + + displayedTableColumns: string[] = [ + 'index', + 'startDate', + 'endDate', + 'defaultDataTotalCount', + 'defaultDataViewBtn', + 'loosingDataTotalCount', + 'loosingDataViewBtn', + 'removeBtn', + ]; + /** * Constructor */ constructor( private _changeDetectorRef: ChangeDetectorRef, private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, private _loosingService: LoosingService, private router: Router ) {} @@ -95,63 +98,24 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { * On init */ ngOnInit(): void { - // Get the pagination - this._loosingService.pagination$ + // Get the products + this._loosingService.loosings$ .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: LoosingPagination | undefined) => { - // Update the pagination - this.pagination = pagination; + .subscribe((loosings: Loosing[] | undefined) => { + if (!loosings) { + return; + } + this.loosingDataSource.data = loosings; // Mark for check this._changeDetectorRef.markForCheck(); }); - - // Get the products - this.loosings$ = this._loosingService.loosings$; } /** * After view init */ - ngAfterViewInit(): void { - if (this._sort && this._paginator) { - // Set the initial sort - this._sort.sort({ - id: 'name', - start: 'asc', - disableClear: true, - }); - - // Mark for check - this._changeDetectorRef.markForCheck(); - - // If the loosing changes the sort order... - this._sort.sortChange - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe(() => { - // Reset back to the first page - this._paginator.pageIndex = 0; - }); - - // Get products if sort or page changes - merge(this._sort.sortChange, this._paginator.page) - .pipe( - switchMap(() => { - this.isLoading = true; - return this._loosingService.getLoosings( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } + ngAfterViewInit(): void {} /** * On destroy @@ -166,10 +130,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // @ Public methods // ----------------------------------------------------------------------------------------------------- - viewUserDetail(id: string): void { + /* viewUserDetail(id: string): void { let url: string = 'member/user/' + id; this.router.navigateByUrl(url); - } + } */ // ----------------------------------------------------------------------------------------------------- // @ Private methods // ----------------------------------------------------------------------------------------------------- diff --git a/src/app/modules/admin/report/loosing/loosing.module.ts b/src/app/modules/admin/report/loosing/loosing.module.ts index c4c6d07..09fe6c9 100644 --- a/src/app/modules/admin/report/loosing/loosing.module.ts +++ b/src/app/modules/admin/report/loosing/loosing.module.ts @@ -15,6 +15,9 @@ import { MatGridListModule } from '@angular/material/grid-list'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MatRadioModule } from '@angular/material/radio'; import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatMomentDateModule } from '@angular/material-moment-adapter'; +import { MatTableModule } from '@angular/material/table'; import { TranslocoModule } from '@ngneat/transloco'; @@ -45,6 +48,9 @@ import { loosingRoutes } from './loosing.routing'; MatSlideToggleModule, MatRadioModule, MatCheckboxModule, + MatDatepickerModule, + MatMomentDateModule, + MatTableModule, ], }) export class LoosingModule {} diff --git a/src/app/modules/admin/report/loosing/models/loosing.ts b/src/app/modules/admin/report/loosing/models/loosing.ts index 6432397..03909f5 100644 --- a/src/app/modules/admin/report/loosing/models/loosing.ts +++ b/src/app/modules/admin/report/loosing/models/loosing.ts @@ -21,7 +21,11 @@ export interface Loosing { totalDeposit?: number; totalWithdraw?: number; balance?: number; + startDate?: string; + endDate?: string; registDate?: string; + defaultCount?: string; + loosingCount?: string; finalSigninDate?: string; ip?: string; state?: string;