diff --git a/src/app/modules/admin/board/customer-template/components/registration.component.html b/src/app/modules/admin/board/customer-template/components/registration.component.html new file mode 100644 index 0000000..49fa156 --- /dev/null +++ b/src/app/modules/admin/board/customer-template/components/registration.component.html @@ -0,0 +1,2 @@ + +
고객센터 템플릿 등록
diff --git a/src/app/modules/admin/board/popup copy/components/list.component.ts b/src/app/modules/admin/board/customer-template/components/registration.component.ts similarity index 55% rename from src/app/modules/admin/board/popup copy/components/list.component.ts rename to src/app/modules/admin/board/customer-template/components/registration.component.ts index 9effff6..645b6d8 100644 --- a/src/app/modules/admin/board/popup copy/components/list.component.ts +++ b/src/app/modules/admin/board/customer-template/components/registration.component.ts @@ -29,31 +29,28 @@ import { import { fuseAnimations } from '@fuse/animations'; import { FuseConfirmationService } from '@fuse/services/confirmation'; -import { User } from '../../../member/user/models/user'; -import { Popup } from '../models/popup'; -import { PopupPagination } from '../models/popup-pagination'; -import { PopupService } from '../services/popup.service'; -import { Router } from '@angular/router'; +import { User } from 'app/modules/admin/member/user/models/user'; +import { UserService } from 'app/modules/admin/member/user/services/user.service'; @Component({ - selector: 'popup-list', - templateUrl: './list.component.html', + selector: 'customer-template-registration', + templateUrl: './registration.component.html', styles: [ /* language=SCSS */ ` .inventory-grid { - grid-template-columns: 60px auto 40px; + grid-template-columns: 48px auto 40px; @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; + grid-template-columns: 48px auto 112px 72px; } @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; + grid-template-columns: 48px 112px auto 112px 72px; } @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; + grid-template-columns: 48px 112px auto 112px 96px 96px 72px; } } `, @@ -62,17 +59,14 @@ import { Router } from '@angular/router'; changeDetection: ChangeDetectionStrategy.OnPush, animations: fuseAnimations, }) -export class ListComponent implements OnInit, AfterViewInit, OnDestroy { +export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatSort) private _sort!: MatSort; - popups$!: Observable; - users$!: Observable; - isLoading = false; searchInputControl = new FormControl(); - selectedPopup?: Popup; - pagination?: PopupPagination; + selectedProductForm!: FormGroup; + selectedUser?: User; private _unsubscribeAll: Subject = new Subject(); @@ -83,8 +77,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _changeDetectorRef: ChangeDetectorRef, private _fuseConfirmationService: FuseConfirmationService, private _formBuilder: FormBuilder, - private _popupService: PopupService, - private router: Router + private _userService: UserService ) {} // ----------------------------------------------------------------------------------------------------- @@ -95,63 +88,59 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { * On init */ ngOnInit(): void { - // Get the pagination - this._popupService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: PopupPagination | undefined) => { - // Update the pagination - this.pagination = pagination; + this.selectedProductForm = this._formBuilder.group({ + id: [''], + signinId: [{ value: '', disabled: true }], + signinPw: [{ value: '' }], + exchangePw: [''], + description: [''], + tags: [[]], + nickname: [{ value: '', disabled: true }], + ownCash: [''], + phoneNumber: [''], + level: [''], + status: [''], + isExcahngeMoney: [''], + bankname: [''], + accountNumber: [''], + accountHolder: [''], + comp: [''], + coupon: [''], + recommender: [{ value: '', disabled: true }], + changeSite: [''], + recommendCount: [''], + hodingGameMoney: [{ value: '0', disabled: true }], + memo: [''], + bacaraRate: [], + rulletRate: [], + dragonRate: [], + etcRate: [], + slotRate: [], + casinoRusingRate: [], + slotRusingRate: [], + }); + // Get the User + this._userService.user$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((user: User | undefined) => { + if (!user) { + return; + } + this.selectedUser = user; + + this.selectedProductForm.patchValue(user); // Mark for check this._changeDetectorRef.markForCheck(); }); - // Get the products - this.popups$ = this._popupService.popups$; + /* this.user$ = this._userService.user$; */ } /** * 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 popup 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._popupService.getPopups( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } + ngAfterViewInit(): void {} /** * On destroy @@ -166,10 +155,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // @ Public methods // ----------------------------------------------------------------------------------------------------- - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } // ----------------------------------------------------------------------------------------------------- // @ Private methods // ----------------------------------------------------------------------------------------------------- diff --git a/src/app/modules/admin/board/notice/components/registration.component.html b/src/app/modules/admin/board/notice/components/registration.component.html new file mode 100644 index 0000000..e13f190 --- /dev/null +++ b/src/app/modules/admin/board/notice/components/registration.component.html @@ -0,0 +1,2 @@ + +
공지사항 등록
diff --git a/src/app/modules/admin/board/notice/components/registration.component.ts b/src/app/modules/admin/board/notice/components/registration.component.ts new file mode 100644 index 0000000..a6c0c0c --- /dev/null +++ b/src/app/modules/admin/board/notice/components/registration.component.ts @@ -0,0 +1,183 @@ +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 'app/modules/admin/member/user/models/user'; +import { UserService } from 'app/modules/admin/member/user/services/user.service'; + +@Component({ + selector: 'notice-registration', + templateUrl: './registration.component.html', + styles: [ + /* language=SCSS */ + ` + .inventory-grid { + grid-template-columns: 48px auto 40px; + + @screen sm { + grid-template-columns: 48px auto 112px 72px; + } + + @screen md { + grid-template-columns: 48px 112px auto 112px 72px; + } + + @screen lg { + grid-template-columns: 48px 112px auto 112px 96px 96px 72px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + @ViewChild(MatSort) private _sort!: MatSort; + + isLoading = false; + searchInputControl = new FormControl(); + selectedProductForm!: FormGroup; + selectedUser?: User; + + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor( + private _changeDetectorRef: ChangeDetectorRef, + private _fuseConfirmationService: FuseConfirmationService, + private _formBuilder: FormBuilder, + private _userService: UserService + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + this.selectedProductForm = this._formBuilder.group({ + id: [''], + signinId: [{ value: '', disabled: true }], + signinPw: [{ value: '' }], + exchangePw: [''], + description: [''], + tags: [[]], + nickname: [{ value: '', disabled: true }], + ownCash: [''], + phoneNumber: [''], + level: [''], + status: [''], + isExcahngeMoney: [''], + bankname: [''], + accountNumber: [''], + accountHolder: [''], + comp: [''], + coupon: [''], + recommender: [{ value: '', disabled: true }], + changeSite: [''], + recommendCount: [''], + hodingGameMoney: [{ value: '0', disabled: true }], + memo: [''], + bacaraRate: [], + rulletRate: [], + dragonRate: [], + etcRate: [], + slotRate: [], + casinoRusingRate: [], + slotRusingRate: [], + }); + + // Get the User + this._userService.user$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((user: User | undefined) => { + if (!user) { + return; + } + this.selectedUser = user; + + this.selectedProductForm.patchValue(user); + // Mark for check + this._changeDetectorRef.markForCheck(); + }); + + /* this.user$ = this._userService.user$; */ + } + + /** + * 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/board/popup copy/components/index.ts b/src/app/modules/admin/board/popup copy/components/index.ts deleted file mode 100644 index 04759eb..0000000 --- a/src/app/modules/admin/board/popup copy/components/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ListComponent } from './list.component'; - -export const COMPONENTS = [ListComponent]; diff --git a/src/app/modules/admin/board/popup copy/components/list.component.html b/src/app/modules/admin/board/popup copy/components/list.component.html deleted file mode 100644 index 68c5687..0000000 --- a/src/app/modules/admin/board/popup copy/components/list.component.html +++ /dev/null @@ -1,353 +0,0 @@ -
- -
- -
- -
- -
팝업
- -
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - - - - - - -
-
- - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - -
-
- - -
- There are no popups! -
-
-
-
-
diff --git a/src/app/modules/admin/board/popup copy/models/popup-pagination.ts b/src/app/modules/admin/board/popup copy/models/popup-pagination.ts deleted file mode 100644 index 64182c5..0000000 --- a/src/app/modules/admin/board/popup copy/models/popup-pagination.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PopupPagination { - length: number; - size: number; - page: number; - lastPage: number; - startIndex: number; - endIndex: number; -} diff --git a/src/app/modules/admin/board/popup copy/models/popup.ts b/src/app/modules/admin/board/popup copy/models/popup.ts deleted file mode 100644 index 533f1bf..0000000 --- a/src/app/modules/admin/board/popup copy/models/popup.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface Popup { - id?: string; - totalPartnerCount?: number; - totalHoldingMoney?: number; - totalComp?: number; - total?: number; - branchCount?: number; - divisionCount?: number; - officeCount?: number; - storeCount?: number; - memberCount?: number; - nickname?: string; - accountHolder?: string; - phoneNumber?: string; - calculateType?: string; - ownCash?: number; - ownComp?: number; - ownCoupon?: number; - gameMoney?: number; - todayComp?: number; - totalDeposit?: number; - totalWithdraw?: number; - balance?: number; - registDate?: string; - finalSigninDate?: string; - ip?: string; - state?: string; - note?: string; -} diff --git a/src/app/modules/admin/board/popup copy/popup.module.ts b/src/app/modules/admin/board/popup copy/popup.module.ts deleted file mode 100644 index 0691ccc..0000000 --- a/src/app/modules/admin/board/popup copy/popup.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatPaginatorModule } from '@angular/material/paginator'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatRippleModule } from '@angular/material/core'; -import { MatSortModule } from '@angular/material/sort'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTooltipModule } from '@angular/material/tooltip'; -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 { TranslocoModule } from '@ngneat/transloco'; - -import { SharedModule } from 'app/shared/shared.module'; - -import { COMPONENTS } from './components'; - -import { popupRoutes } from './popup.routing'; - -@NgModule({ - declarations: [COMPONENTS], - imports: [ - TranslocoModule, - SharedModule, - RouterModule.forChild(popupRoutes), - - MatButtonModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - MatPaginatorModule, - MatProgressBarModule, - MatRippleModule, - MatSortModule, - MatSelectModule, - MatTooltipModule, - MatGridListModule, - MatSlideToggleModule, - MatRadioModule, - MatCheckboxModule, - ], -}) -export class PopupModule {} diff --git a/src/app/modules/admin/board/popup copy/popup.routing.ts b/src/app/modules/admin/board/popup copy/popup.routing.ts deleted file mode 100644 index 4a53e31..0000000 --- a/src/app/modules/admin/board/popup copy/popup.routing.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Route } from '@angular/router'; - -import { ListComponent } from './components/list.component'; -import { ViewComponent } from '../../member/user/components/view.component'; - -import { PopupsResolver } from './resolvers/popup.resolver'; -import { UserResolver } from '../../member/user/resolvers/user.resolver'; - -export const popupRoutes: Route[] = [ - { - path: '', - component: ListComponent, - resolve: { - popups: PopupsResolver, - }, - }, - { - path: ':id', - component: ViewComponent, - resolve: { - users: UserResolver, - }, - }, -]; diff --git a/src/app/modules/admin/board/popup copy/resolvers/popup.resolver.ts b/src/app/modules/admin/board/popup copy/resolvers/popup.resolver.ts deleted file mode 100644 index ebd8222..0000000 --- a/src/app/modules/admin/board/popup copy/resolvers/popup.resolver.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - ActivatedRouteSnapshot, - Resolve, - Router, - RouterStateSnapshot, -} from '@angular/router'; -import { catchError, Observable, throwError } from 'rxjs'; - -import { Popup } from '../models/popup'; -import { PopupPagination } from '../models/popup-pagination'; -import { PopupService } from '../services/popup.service'; - -@Injectable({ - providedIn: 'root', -}) -export class PopupResolver implements Resolve { - /** - * Constructor - */ - constructor(private _popupService: PopupService, private _router: Router) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Resolver - * - * @param route - * @param state - */ - resolve( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable { - return this._popupService.getPopupById(route.paramMap.get('id')).pipe( - // Error here means the requested product is not available - catchError((error) => { - // Log the error - console.error(error); - - // Get the parent url - const parentUrl = state.url.split('/').slice(0, -1).join('/'); - - // Navigate to there - this._router.navigateByUrl(parentUrl); - - // Throw an error - return throwError(error); - }) - ); - } -} - -@Injectable({ - providedIn: 'root', -}) -export class PopupsResolver implements Resolve { - /** - * Constructor - */ - constructor(private _popupService: PopupService) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Resolver - * - * @param route - * @param state - */ - resolve( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable<{ - pagination: PopupPagination; - popups: Popup[]; - }> { - return this._popupService.getPopups(); - } -} diff --git a/src/app/modules/admin/board/popup copy/services/popup.service.ts b/src/app/modules/admin/board/popup copy/services/popup.service.ts deleted file mode 100644 index b228337..0000000 --- a/src/app/modules/admin/board/popup copy/services/popup.service.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { - BehaviorSubject, - filter, - map, - Observable, - of, - switchMap, - take, - tap, - throwError, -} from 'rxjs'; - -import { Popup } from '../models/popup'; -import { PopupPagination } from '../models/popup-pagination'; - -@Injectable({ - providedIn: 'root', -}) -export class PopupService { - // Private - private __pagination = new BehaviorSubject( - undefined - ); - private __popup = new BehaviorSubject(undefined); - private __popups = new BehaviorSubject(undefined); - - /** - * Constructor - */ - constructor(private _httpClient: HttpClient) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Accessors - // ----------------------------------------------------------------------------------------------------- - - /** - * Getter for pagination - */ - get pagination$(): Observable { - return this.__pagination.asObservable(); - } - - /** - * Getter for popup - */ - get popup$(): Observable { - return this.__popup.asObservable(); - } - - /** - * Getter for popups - */ - get popups$(): Observable { - return this.__popups.asObservable(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Get Popups - * - * - * @param page - * @param size - * @param sort - * @param order - * @param search - */ - getPopups( - page: number = 0, - size: number = 10, - sort: string = 'name', - order: 'asc' | 'desc' | '' = 'asc', - search: string = '' - ): Observable<{ - pagination: PopupPagination; - popups: Popup[]; - }> { - return this._httpClient - .get<{ - pagination: PopupPagination; - popups: Popup[]; - }>('api/apps/board/popup/popups', { - params: { - page: '' + page, - size: '' + size, - sort, - order, - search, - }, - }) - .pipe( - tap((response) => { - this.__pagination.next(response.pagination); - this.__popups.next(response.popups); - }) - ); - } - - /** - * Get product by id - */ - getPopupById(id: string | null): Observable { - return this.__popups.pipe( - take(1), - map((popups) => { - // Find the product - const popup = popups?.find((item) => item.id === id) || undefined; - - // Update the product - this.__popup.next(popup); - - // Return the product - return popup; - }), - switchMap((product) => { - if (!product) { - return throwError('Could not found product with id of ' + id + '!'); - } - - return of(product); - }) - ); - } - - /** - * Create product - */ - createPopup(): Observable { - return this.popups$.pipe( - take(1), - switchMap((popups) => - this._httpClient.post('api/apps/board/popup/product', {}).pipe( - map((newPopup) => { - // Update the popups with the new product - if (!!popups) { - this.__popups.next([newPopup, ...popups]); - } - - // Return the new product - return newPopup; - }) - ) - ) - ); - } -}