diff --git a/src/app/mock-api/apps/member/partner-mainoffice/api.ts b/src/app/mock-api/apps/member/partner-mainoffice/api.ts index 86a96dd..9ac868e 100644 --- a/src/app/mock-api/apps/member/partner-mainoffice/api.ts +++ b/src/app/mock-api/apps/member/partner-mainoffice/api.ts @@ -33,7 +33,7 @@ export class MemberPartnerMainofficeMockApi { .reply(({ request }) => { // Get available queries const search = request.params.get('search'); - const sort = request.params.get('sort') || 'name'; + const sort = request.params.get('sort') || 'signinId'; 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); @@ -44,7 +44,7 @@ export class MemberPartnerMainofficeMockApi { ); // Sort the partnerMainoffices - if (sort === 'sku' || sort === 'name' || sort === 'active') { + if (sort === 'signinId' || sort === 'nickname' || sort === 'state') { partnerMainoffices.sort((a, b) => { const fieldA = a[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase(); diff --git a/src/app/mock-api/apps/member/partner-mainoffice/data.ts b/src/app/mock-api/apps/member/partner-mainoffice/data.ts index 9ae712c..bb55432 100644 --- a/src/app/mock-api/apps/member/partner-mainoffice/data.ts +++ b/src/app/mock-api/apps/member/partner-mainoffice/data.ts @@ -2,16 +2,118 @@ export const partnerMainoffices = [ { - id: 'on00', - totalPartnerCount: '5', - totalHoldingMoney: 303675, - totalComp: 108933, - total: 412608, + id: '7eb7c859-1347-4317-96b6-9476a7e2ba3c', + signinId: 'on00', branchCount: 1, divisionCount: 1, officeCount: 1, storeCount: 1, memberCount: 1, + ownMemberCount: 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, + registDate: '2022-06-12 15:38', + finalSigninDate: '', + ip: '', + state: '정상', + }, + { + id: '00b0292f-3d50-4669-a0c4-7a9d85efc98d', + signinId: 'zxcv1234', + branchCount: 1, + divisionCount: 1, + officeCount: 1, + storeCount: 1, + memberCount: 2, + ownMemberCount: 1, + nickname: 'zxcv1234', + accountHolder: '테스트', + phoneNumber: '010-0000-0000', + calculateType: '롤링', + ownCash: 0, + ownComp: 0, + ownCoupon: 0, + gameMoney: 0, + todayComp: 0, + totalDeposit: 0, + totalWithdraw: 0, + balance: 0, + registDate: '2022-06-08 01:35', + finalSigninDate: '', + ip: '', + state: '정상', + }, + { + id: 'b899ec30-b85a-40ab-bb1f-18a596d5c6de', + signinId: 'qwe123', + branchCount: 1, + divisionCount: 1, + officeCount: 1, + storeCount: 1, + memberCount: 1, + ownMemberCount: 1, + nickname: '테스트55', + accountHolder: '테스트', + phoneNumber: '010-1234-1234', + calculateType: '롤링', + ownCash: 50000, + ownComp: 1711, + ownCoupon: 50000, + gameMoney: 0, + todayComp: 0, + totalDeposit: 0, + totalWithdraw: 0, + balance: 0, + registDate: '2022-06-12 15:38', + finalSigninDate: '', + ip: '', + state: '정상', + }, + { + id: '8fcce528-d878-4cc8-99f7-bd3451ed5405', + signinId: 'on00', + branchCount: 1, + divisionCount: 1, + officeCount: 1, + storeCount: 1, + memberCount: 1, + ownMemberCount: 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, + registDate: '2022-06-12 15:38', + finalSigninDate: '', + ip: '', + state: '정상', + }, + { + id: '8fcce528-d878-4cc8-99f7-bd3451ed5406', + signinId: 'on00', + branchCount: 1, + divisionCount: 1, + officeCount: 1, + storeCount: 1, + memberCount: 1, + ownMemberCount: 1, nickname: 'on00', accountHolder: '11', phoneNumber: '010-1111-1111', @@ -28,6 +130,5 @@ export const partnerMainoffices = [ finalSigninDate: '', ip: '', state: '정상', - note: '대본등록', }, ]; diff --git a/src/app/mock-api/common/navigation/data.ts b/src/app/mock-api/common/navigation/data.ts index 719f187..409a8b9 100644 --- a/src/app/mock-api/common/navigation/data.ts +++ b/src/app/mock-api/common/navigation/data.ts @@ -68,61 +68,18 @@ export const defaultNavigation: FuseNavigationItem[] = [ link: '/member/current-user', }, { - id: 'apps.ecommerce', - title: 'partner-management', - type: 'collapsable', - icon: 'heroicons_outline:shopping-cart', - children: [ - { - id: 'member.partner', - title: 'All Partner', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/all', - }, - { - id: 'member.partner-mainoffice', - title: 'Partner Mainoffice', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/main-office', - }, - { - id: 'member.partner-branch', - title: 'Partner Branch', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/branch', - }, - { - id: 'member.partner-division', - title: 'Partner Division', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/division', - }, - { - id: 'member.partner-office', - title: 'Partner Office', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/office', - }, - { - id: 'member.partner-store', - title: 'Partner Store', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/store', - }, - { - id: 'member.partner-recommendation', - title: 'Partner Recommendation', - type: 'basic', - icon: 'heroicons_outline:academic-cap', - link: '/member/partner/recommendation', - }, - ], + id: 'member.partner', + title: 'Partner', + type: 'basic', + icon: 'heroicons_outline:academic-cap', + link: '/member/partner', + }, + { + id: 'member.partner-recommendation', + title: 'Partner Recommendation', + type: 'basic', + icon: 'heroicons_outline:academic-cap', + link: '/member/partner/recommendation', }, { diff --git a/src/app/modules/admin/member/partner/components/branch-list.component.html b/src/app/modules/admin/member/partner/components/branch-list.component.html deleted file mode 100644 index 8f5304a..0000000 --- a/src/app/modules/admin/member/partner/components/branch-list.component.html +++ /dev/null @@ -1,364 +0,0 @@ -
- -
- -
- -
- -
대본
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no partnerbranchs! -
-
-
-
-
diff --git a/src/app/modules/admin/member/partner/components/branch-list.component.ts b/src/app/modules/admin/member/partner/components/branch-list.component.ts deleted file mode 100644 index f753d71..0000000 --- a/src/app/modules/admin/member/partner/components/branch-list.component.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - 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 { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from '../../user/models/user'; - -import { Partner as PartnerBranch } from '../models/partner'; -import { PartnerPagination as PartnerBranchPagination } from '../models/partner-pagination'; -import { PartnerService as PartnerBranchService } from '../services/partner.service'; -import { MatDialog } from '@angular/material/dialog'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; - -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-partner-branch-list', - templateUrl: './branch-list.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 60px auto 40px; - - @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; - } - - @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; - } - - @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class BranchListComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - partnerBranchs$!: Observable; - - users$!: Observable; - - isLoading = false; - searchInputControl = new FormControl(); - selectedPartnerBranch?: PartnerBranch; - pagination?: PartnerBranchPagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _partnerBranchService: PartnerBranchService, - private router: Router, - private _matDialog: MatDialog - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._partnerBranchService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PartnerBranchPagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.partnerBranchs$ = this._partnerBranchService.partners$; - } - - /** - * 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 partnerBranch 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._partnerBranchService.getPartners( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } - // ----------------------------------------------------------------------------------------------------- - // @ 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; - } - - __onClickRegist(event: MouseEvent): void { - const dialogRef = this._matDialog.open(RegistComposeComponent); - - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); - } -} diff --git a/src/app/modules/admin/member/partner/components/division-list.component.html b/src/app/modules/admin/member/partner/components/division-list.component.html deleted file mode 100644 index 9e1dba8..0000000 --- a/src/app/modules/admin/member/partner/components/division-list.component.html +++ /dev/null @@ -1,366 +0,0 @@ -
- -
- -
- -
- -
부본
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no partnerdivisions! -
-
-
-
-
diff --git a/src/app/modules/admin/member/partner/components/division-list.component.ts b/src/app/modules/admin/member/partner/components/division-list.component.ts deleted file mode 100644 index 364e269..0000000 --- a/src/app/modules/admin/member/partner/components/division-list.component.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - 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 { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from '../../user/models/user'; -import { Partner as PartnerDivision } from '../models/partner'; -import { PartnerPagination as PartnerDivisionPagination } from '../models/partner-pagination'; -import { PartnerService as PartnerDivisionService } from '../services/partner.service'; - -import { MatDialog } from '@angular/material/dialog'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; - -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-partner-division-list', - templateUrl: './division-list.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 60px auto 40px; - - @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; - } - - @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; - } - - @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class DivisionListComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - partnerDivisions$!: Observable; - users$!: Observable; - - isLoading = false; - searchInputControl = new FormControl(); - selectedPartnerDivision?: PartnerDivision; - pagination?: PartnerDivisionPagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _partnerDivisionService: PartnerDivisionService, - private router: Router, - private _matDialog: MatDialog - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._partnerDivisionService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PartnerDivisionPagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.partnerDivisions$ = this._partnerDivisionService.partners$; - } - - /** - * 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 partnerDivision 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._partnerDivisionService.getPartners( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } - // ----------------------------------------------------------------------------------------------------- - // @ 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; - } - __onClickRegist(event: MouseEvent): void { - const dialogRef = this._matDialog.open(RegistComposeComponent); - - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); - } -} diff --git a/src/app/modules/admin/member/partner/components/index.ts b/src/app/modules/admin/member/partner/components/index.ts index 9e58cef..49b691e 100644 --- a/src/app/modules/admin/member/partner/components/index.ts +++ b/src/app/modules/admin/member/partner/components/index.ts @@ -1,17 +1,4 @@ -import { AllListComponent } from './all-list.component'; -import { MainOfficeListComponent } from './main-office-list.component'; -import { BranchListComponent } from './branch-list.component'; -import { DivisionListComponent } from './division-list.component'; -import { OfficeListComponent } from './office-list.component'; +import { ListComponent } from './list.component'; import { RecommendationListComponent } from './recommendation-list.component'; -import { StoreListComponent } from './store-list.component'; -export const COMPONENTS = [ - AllListComponent, - MainOfficeListComponent, - OfficeListComponent, - BranchListComponent, - DivisionListComponent, - RecommendationListComponent, - StoreListComponent, -]; +export const COMPONENTS = [ListComponent, RecommendationListComponent]; diff --git a/src/app/modules/admin/member/partner/components/all-list.component.html b/src/app/modules/admin/member/partner/components/list.component.html similarity index 100% rename from src/app/modules/admin/member/partner/components/all-list.component.html rename to src/app/modules/admin/member/partner/components/list.component.html diff --git a/src/app/modules/admin/member/partner/components/all-list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts similarity index 97% rename from src/app/modules/admin/member/partner/components/all-list.component.ts rename to src/app/modules/admin/member/partner/components/list.component.ts index 5dc9b39..eca42cc 100644 --- a/src/app/modules/admin/member/partner/components/all-list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -38,8 +38,8 @@ import { RegistComposeComponent } from '../compose/regist-compose.component'; import { MatDialog } from '@angular/material/dialog'; @Component({ - selector: 'app-partner-list', - templateUrl: './all-list.component.html', + selector: 'partner-list', + templateUrl: './list.component.html', styles: [ /* language=SCSS */ ` @@ -68,7 +68,7 @@ import { MatDialog } from '@angular/material/dialog'; changeDetection: ChangeDetectionStrategy.OnPush, animations: fuseAnimations, }) -export class AllListComponent implements OnInit, AfterViewInit, OnDestroy { +export class ListComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatSort) private _sort!: MatSort; @@ -124,7 +124,7 @@ export class AllListComponent implements OnInit, AfterViewInit, OnDestroy { if (this._sort && this._paginator) { // Set the initial sort this._sort.sort({ - id: 'name', + id: 'signinId', start: 'asc', disableClear: true, }); diff --git a/src/app/modules/admin/member/partner/components/main-office-list.component.html b/src/app/modules/admin/member/partner/components/main-office-list.component.html deleted file mode 100644 index efc914b..0000000 --- a/src/app/modules/admin/member/partner/components/main-office-list.component.html +++ /dev/null @@ -1,369 +0,0 @@ -
- -
- -
- -
- -
본사
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no partner mainoffices! -
-
-
-
-
diff --git a/src/app/modules/admin/member/partner/components/main-office-list.component.ts b/src/app/modules/admin/member/partner/components/main-office-list.component.ts deleted file mode 100644 index 0ccfe67..0000000 --- a/src/app/modules/admin/member/partner/components/main-office-list.component.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - 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 { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from '../../user/models/user'; -import { Partner as PartnerMainoffice } from '../models/partner'; -import { PartnerPagination as PartnerMainofficePagination } from '../models/partner-pagination'; -import { PartnerService as PartnerMainofficeService } from '../services/partner.service'; -import { Router } from '@angular/router'; - -import { MatDialog } from '@angular/material/dialog'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; - -@Component({ - selector: 'app-partner-main-office-list', - templateUrl: './main-office-list.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 60px auto 40px; - - @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; - } - - @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; - } - - @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class MainOfficeListComponent - implements OnInit, AfterViewInit, OnDestroy -{ - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - partnerMainoffices$!: Observable; - users$!: Observable; - - isLoading = false; - searchInputControl = new FormControl(); - selectedPartnerMainoffice?: PartnerMainoffice; - pagination?: PartnerMainofficePagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _partnerMainofficeService: PartnerMainofficeService, - private router: Router, - private _matDialog: MatDialog - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._partnerMainofficeService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PartnerMainofficePagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.partnerMainoffices$ = this._partnerMainofficeService.partners$; - } - - /** - * 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 partnerMainoffice 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._partnerMainofficeService.getPartners( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } - // ----------------------------------------------------------------------------------------------------- - // @ 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; - } - - __onClickRegist(event: MouseEvent): void { - const dialogRef = this._matDialog.open(RegistComposeComponent); - - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); - } -} diff --git a/src/app/modules/admin/member/partner/components/office-list.component.html b/src/app/modules/admin/member/partner/components/office-list.component.html deleted file mode 100644 index 83a451b..0000000 --- a/src/app/modules/admin/member/partner/components/office-list.component.html +++ /dev/null @@ -1,364 +0,0 @@ -
- -
- -
- -
- -
총판
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no partner offices! -
-
-
-
-
diff --git a/src/app/modules/admin/member/partner/components/office-list.component.ts b/src/app/modules/admin/member/partner/components/office-list.component.ts deleted file mode 100644 index d3b7277..0000000 --- a/src/app/modules/admin/member/partner/components/office-list.component.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - 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 { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from '../../user/models/user'; - -import { Partner as PartnerOffice } from '../models/partner'; -import { PartnerPagination as PartnerOfficePagination } from '../models/partner-pagination'; -import { PartnerService as PartnerOfficeService } from '../services/partner.service'; - -import { Router } from '@angular/router'; - -import { MatDialog } from '@angular/material/dialog'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; - -@Component({ - selector: 'app-partner-office-list', - templateUrl: './office-list.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 60px auto 40px; - - @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; - } - - @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; - } - - @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class OfficeListComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - partnerOffices$!: Observable; - users$!: Observable; - - isLoading = false; - searchInputControl = new FormControl(); - selectedPartnerOffice?: PartnerOffice; - pagination?: PartnerOfficePagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _partnerOfficeService: PartnerOfficeService, - private router: Router, - private _matDialog: MatDialog - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._partnerOfficeService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PartnerOfficePagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.partnerOffices$ = this._partnerOfficeService.partners$; - } - - /** - * 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 partnerOffice 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._partnerOfficeService.getPartners( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } - // ----------------------------------------------------------------------------------------------------- - // @ 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; - } - - __onClickRegist(event: MouseEvent): void { - const dialogRef = this._matDialog.open(RegistComposeComponent); - - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); - } -} diff --git a/src/app/modules/admin/member/partner/components/recommendation-list.component.ts b/src/app/modules/admin/member/partner/components/recommendation-list.component.ts index c67465a..7e05f5b 100644 --- a/src/app/modules/admin/member/partner/components/recommendation-list.component.ts +++ b/src/app/modules/admin/member/partner/components/recommendation-list.component.ts @@ -40,7 +40,7 @@ import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; import { RegistComposeComponent } from '../compose/regist-compose.component'; @Component({ - selector: 'app-partner-recommendation-list', + selector: 'recommendation-list', templateUrl: './recommendation-list.component.html', styles: [ /* language=SCSS */ diff --git a/src/app/modules/admin/member/partner/components/store-list.component.html b/src/app/modules/admin/member/partner/components/store-list.component.html deleted file mode 100644 index 7d076f0..0000000 --- a/src/app/modules/admin/member/partner/components/store-list.component.html +++ /dev/null @@ -1,361 +0,0 @@ -
- -
- -
- -
- -
매장
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no partner stores! -
-
-
-
-
diff --git a/src/app/modules/admin/member/partner/components/store-list.component.ts b/src/app/modules/admin/member/partner/components/store-list.component.ts deleted file mode 100644 index 656da84..0000000 --- a/src/app/modules/admin/member/partner/components/store-list.component.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - 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 { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from '../../user/models/user'; -import { Partner as PartnerStore } from '../models/partner'; -import { PartnerPagination as PartnerStorePagination } from '../models/partner-pagination'; -import { PartnerService as PartnerStoreService } from '../services/partner.service'; - -import { Router } from '@angular/router'; - -import { MatDialog } from '@angular/material/dialog'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; -@Component({ - selector: 'app-partner-store-list', - templateUrl: './store-list.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 60px auto 40px; - - @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; - } - - @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; - } - - @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class StoreListComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - partnerStores$!: Observable; - users$!: Observable; - - isLoading = false; - searchInputControl = new FormControl(); - selectedPartnerStore?: PartnerStore; - pagination?: PartnerStorePagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _partnerStoreService: PartnerStoreService, - private router: Router, - private _matDialog: MatDialog - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._partnerStoreService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PartnerStorePagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.partnerStores$ = this._partnerStoreService.partners$; - } - - /** - * 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 partnerStore 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._partnerStoreService.getPartners( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } - // ----------------------------------------------------------------------------------------------------- - // @ 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; - } - - __onClickRegist(event: MouseEvent): void { - const dialogRef = this._matDialog.open(RegistComposeComponent); - - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); - } -} diff --git a/src/app/modules/admin/member/partner/models/partner.ts b/src/app/modules/admin/member/partner/models/partner.ts index cec5b3f..be056eb 100644 --- a/src/app/modules/admin/member/partner/models/partner.ts +++ b/src/app/modules/admin/member/partner/models/partner.ts @@ -10,6 +10,7 @@ export interface Partner { officeCount?: number; storeCount?: number; memberCount?: number; + ownMemberCount?: number; level?: string; calculateType?: string; holdingMoney?: number; diff --git a/src/app/modules/admin/member/partner/partner.routing.ts b/src/app/modules/admin/member/partner/partner.routing.ts index 950b85d..302a340 100644 --- a/src/app/modules/admin/member/partner/partner.routing.ts +++ b/src/app/modules/admin/member/partner/partner.routing.ts @@ -1,68 +1,28 @@ import { Route } from '@angular/router'; -import { AllListComponent } from './components/all-list.component'; -import { MainOfficeListComponent } from './components/main-office-list.component'; -import { OfficeListComponent } from './components/office-list.component'; -import { BranchListComponent } from './components/branch-list.component'; -import { DivisionListComponent } from './components/division-list.component'; +import { ListComponent } from './components/list.component'; import { RecommendationListComponent } from './components/recommendation-list.component'; -import { StoreListComponent } from './components/store-list.component'; import { PartnersResolver } from './resolvers/partner.resolver'; export const partnerRoutes: Route[] = [ + // { + // path: '', + // pathMatch: 'full', + // redirectTo: 'all', + // }, { path: '', - pathMatch: 'full', - redirectTo: 'all', - }, - { - path: 'all', - component: AllListComponent, + component: ListComponent, resolve: { Partners: PartnersResolver, }, }, { - path: 'main-office', - component: MainOfficeListComponent, - resolve: { - Partners: PartnersResolver, - }, - }, - { - path: 'branch', - component: BranchListComponent, - resolve: { - Partners: PartnersResolver, - }, - }, - { - path: 'division', - component: DivisionListComponent, - resolve: { - Partners: PartnersResolver, - }, - }, - { - path: 'recommendation', + path: '', component: RecommendationListComponent, resolve: { Partners: PartnersResolver, }, }, - { - path: 'office', - component: OfficeListComponent, - resolve: { - Partners: PartnersResolver, - }, - }, - { - path: 'store', - component: StoreListComponent, - resolve: { - Partners: PartnersResolver, - }, - }, ]; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 64b9a29..0f919dc 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -6,12 +6,7 @@ "Casino Money": "Casino Money", "Unconnected": "Unconnected", "Project": "Project", - "All Partner": "All Partner", - "Partner Mainoffice": "Partner Mainoffice", - "Partner Branch": "Partner Branch", - "Partner Division": "Partner Division", - "Partner Office": "Partner Office", - "Partner Store": "Partner Store", + "Partner": "Partner", "Partner Recommendation": "Partner Recommendation", "Coupon": "Coupon", "Coupon Money Log": "Coupon Money Log", diff --git a/src/assets/i18n/ko.json b/src/assets/i18n/ko.json index 7ccdaf3..8352274 100644 --- a/src/assets/i18n/ko.json +++ b/src/assets/i18n/ko.json @@ -7,12 +7,7 @@ "Unconnected": "장기미접속회원", "Project": "프로젝트", "partner-management": "파트너관리", - "All Partner": "전체파트너", - "Partner Mainoffice": "본사", - "Partner Branch": "대본", - "Partner Division": "부본", - "Partner Office": "총판", - "Partner Store": "매장", + "Partner": "파트너", "Partner Recommendation": "추천코드등록", "Coupon": "쿠폰발행리스트", "Coupon Money Log": "쿠폰발행머니로그",