This commit is contained in:
이담 정 2022-07-17 05:00:07 +00:00
parent cafcd1e838
commit 0f9d7148d9
12 changed files with 68 additions and 226 deletions

View File

@ -185,7 +185,7 @@ export class BoardNoticeMockApi {
// Update the notice // Update the notice
notices[index] = assign({}, notices[index], notice); notices[index] = assign({}, notices[index], notice);
// Store the updated notice // Store the updated Notice
updatedNotice = notices[index]; updatedNotice = notices[index];
} }
}); });

View File

@ -5,19 +5,10 @@ export const notices = [
idx: 80, idx: 80,
site: '', site: '',
title: title:
'**게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전,후 확인사항 대한 공지사항**', '게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전후 확인사항 대한 공지사항',
writer: '관리자', writer: '관리자',
writeDate: '2021-10-25 02:25', writeDate: '2021-10-25 02:25',
views: 135, views: 136,
state: '노출',
},
{
idx: 99,
site: 'All',
title: '-계좌등록안내-',
writer: '관리자',
writeDate: '2021-06-08 00:46',
views: 7,
state: '노출', state: '노출',
}, },
]; ];

View File

@ -36,6 +36,43 @@
</mat-form-field> --> </mat-form-field> -->
<!-- SelectBox --> <!-- SelectBox -->
<!-- <mat-form-field>
<mat-select placeholder="리스트수">
<mat-option value="40">40</mat-option>
<mat-option value="60">60</mat-option>
<mat-option value="80">80</mat-option>
<mat-option value="100">100</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="레벨">
<mat-option value="level1">LV.1</mat-option>
<mat-option value="level2">LV.2</mat-option>
<mat-option value="level3">LV.3</mat-option>
<mat-option value="level4">LV.4</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="상태">
<mat-option value="">정상</mat-option>
<mat-option value="">대기</mat-option>
<mat-option value="">탈퇴</mat-option>
<mat-option value="">휴면</mat-option>
<mat-option value="">블랙</mat-option>
<mat-option value="">정지</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="제한">
<mat-option value="">카지노제한</mat-option>
<mat-option value="">슬롯제한</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="입금">
<mat-option value="">계좌입금</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field> <mat-form-field>
<mat-select placeholder="검색어"> <mat-select placeholder="검색어">
<mat-option value="">작성자</mat-option> <mat-option value="">작성자</mat-option>
@ -139,7 +176,7 @@
> >
<!-- 선택 --> <!-- 선택 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
<mat-checkbox [color]="'primary'"></mat-checkbox> <mat-checkbox></mat-checkbox>
</div> </div>
<!-- 번호 --> <!-- 번호 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
@ -169,17 +206,19 @@
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ notice.state }} {{ notice.state }}
</div> </div>
</div>
<!-- 등록 --> <!-- 등록 -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">등록</button> <button mat-flat-button [color]="'primary'">등록</button>
</div>
<!-- 숨김 --> <!-- 숨김 -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">숨김</button> <button mat-flat-button [color]="'primary'">숨김</button>
</div>
<!-- 완전삭제 --> <!-- 완전삭제 -->
<button class="-ml-4" mat-button [color]="'warn'"> <div class="hidden sm:block truncate">
완전삭제 <button mat-flat-button [color]="'warn'">완전삭제</button>
</button> </div>
</div>
</ng-container> </ng-container>
</ng-container> </ng-container>
</div> </div>

View File

@ -32,7 +32,7 @@ import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../../../member/user/models/user'; import { User } from '../../../member/user/models/user';
import { Notice } from '../models/notice'; import { Notice } from '../models/notice';
import { NoticePagination } from '../models/notice-pagination'; import { NoticePagination } from '../models/notice-pagination';
import { NoticeService } from '../service/notice.service'; import { NoticeService } from '../services/notice.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({

View File

@ -1,2 +0,0 @@
<!-- Title -->
<div class="text-4xl font-extrabold tracking-tight">공지사항 등록</div>

View File

@ -1,183 +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 '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<any> = new Subject<any>();
/**
* 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;
}
}

View File

@ -1,2 +1,2 @@
<!-- Title --> <!-- Title -->
<div class="text-4xl font-extrabold tracking-tight">팝업-상세page</div> <div class="text-4xl font-extrabold tracking-tight">고객센터-상세page</div>

View File

@ -1,4 +1,5 @@
export interface Notice { export interface Notice {
id?: string;
idx?: number; idx?: number;
site?: string; site?: string;
title?: string; title?: string;

View File

@ -9,7 +9,7 @@ import { catchError, Observable, throwError } from 'rxjs';
import { Notice } from '../models/notice'; import { Notice } from '../models/notice';
import { NoticePagination } from '../models/notice-pagination'; import { NoticePagination } from '../models/notice-pagination';
import { NoticeService } from '../service/notice.service'; import { NoticeService } from '../services/notice.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -34,7 +34,7 @@ export class NoticeResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<Notice | undefined> { ): Observable<Notice | undefined> {
return this._noticeService.getNoticeById(route.paramMap.get('title')).pipe( return this._noticeService.getNoticeById(route.paramMap.get('id')).pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
// Log the error // Log the error

View File

@ -104,14 +104,12 @@ export class NoticeService {
/** /**
* Get product by id * Get product by id
*/ */
getNoticeById(title: string | null): Observable<Notice> { getNoticeById(id: string | null): Observable<Notice> {
return this.__notices.pipe( return this.__notices.pipe(
take(1), take(1),
map((notices) => { map((notices) => {
// Find the product // Find the product
const notice = const notice = notices?.find((item) => item.id === id) || undefined;
notices?.find((item) => !!item && !!item.title === !!title) ||
undefined;
// Update the product // Update the product
this.__notice.next(notice); this.__notice.next(notice);
@ -121,9 +119,7 @@ export class NoticeService {
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
return throwError( return throwError('Could not found product with id of ' + id + '!');
'Could not found product with id of ' + title + '!'
);
} }
return of(product); return of(product);

View File

@ -15,19 +15,19 @@
<div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4"> <div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4">
<!-- Memo --> <!-- Memo -->
<!-- <mat-form-field> <!-- <mat-form-field>
<ng-container *ngIf="dailys$ | async as dailys"> <ng-container *ngIf="popups$ | async as popups">
<ng-container <ng-container
*ngFor="let daily of dailys; trackBy: __trackByFn" *ngFor="let popup of popups; trackBy: __trackByFn"
> >
<div <div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
> >
<fieldset> <fieldset>
총 파트너수:{{ daily.totalPartnerCount }} 총 보유머니:{{ 총 파트너수:{{ popup.totalPartnerCount }} 총 보유머니:{{
daily.totalHoldingMoney popup.totalHoldingMoney
}} }}
총 콤프:{{ daily.totalComp }} 총 합계:{{ 총 콤프:{{ popup.totalComp }} 총 합계:{{
daily.total popup.total
}} }}
</fieldset> </fieldset>
</div> </div>

View File

@ -1,2 +1,2 @@
<!-- Title --> <!-- Title -->
<div class="text-4xl font-extrabold tracking-tight">공지사항-상세page</div> <div class="text-4xl font-extrabold tracking-tight">팝업-상세page</div>