기본설정 수정

This commit is contained in:
Park Byung Eun 2022-07-13 11:18:14 +00:00
parent 34f87467b1
commit c8b5293f7e
5 changed files with 170 additions and 166 deletions

View File

@ -7,7 +7,7 @@ import { basicSetting as basicSettingData } from './data';
providedIn: 'root', providedIn: 'root',
}) })
export class BasicSettingMockApi { export class BasicSettingMockApi {
private _basicSetting: any[] = basicSettingData; private _basicSetting: any = basicSettingData;
/** /**
* Constructor * Constructor

View File

@ -2,131 +2,101 @@
import { SiteStatusType } from 'app/modules/admin/settings/basic/types/site-status.type'; import { SiteStatusType } from 'app/modules/admin/settings/basic/types/site-status.type';
export const basicSetting = [ export const basicSetting = {
{ infos: [
siteStatus: SiteStatusType.joinAvailable, {
memo: '메모 테스트', name: '사이트 ON/OFF 설정',
earnSettings: [ content: SiteStatusType.joinAvailable,
{ },
lv1: [ {
{ name: '메모',
earnFirst: { content: '메모 테스트',
rate: '15', },
isUse: true, ],
maxEarnMoney: '10000', earnSettings: [
}, {
}, level: 'LV1',
{ firstRate: '15',
earnEvery: { firstIsUse: true,
rate: '15', firstMaxEarnMoney: '10000',
isUse: true, everyRate: '15',
maxEarnMoney: '10000', everyIsUse: true,
}, everyMaxEarnMoney: '10000',
}, },
], {
}, level: 'LV2',
{ firstRate: '15',
lv2: [ firstIsUse: true,
{ firstMaxEarnMoney: '10000',
earnFirst: { everyRate: '15',
rate: '15', everyIsUse: true,
isUse: true, everyMaxEarnMoney: '10000',
maxEarnMoney: '10000', },
}, {
}, level: 'LV3',
{ firstRate: '15',
earnEvery: { firstIsUse: true,
rate: '15', firstMaxEarnMoney: '10000',
isUse: true, everyRate: '15',
maxEarnMoney: '10000', everyIsUse: true,
}, everyMaxEarnMoney: '10000',
}, },
], {
}, level: 'LV4',
{ firstRate: '15',
lv3: [ firstIsUse: true,
{ firstMaxEarnMoney: '10000',
earnFirst: { everyRate: '15',
rate: '15', everyIsUse: true,
isUse: true, everyMaxEarnMoney: '10000',
maxEarnMoney: '10000', },
}, ],
}, gameSetting: [
{ {
earnEvery: { name: '스포츠게임 가져오기',
rate: '15', isUse: true,
isUse: true, memo: '슬롯 사이트 메모',
maxEarnMoney: '10000', description: '다른서버에서 경기가져오고 있음(5분)',
}, },
}, {
], name: '스포츠게임 결과 가져오기',
}, isUse: false,
{ memo: '슬롯 사이트 메모',
lv4: [ description: '다른서버에서 경기결과 가져오고 있음(5분)',
{ },
earnFirst: { {
rate: '15', name: '실시간게임 가져오기',
isUse: true, isUse: true,
maxEarnMoney: '10000', memo: '슬롯 사이트 메모',
}, description: '하루한번 21시50분에 가져옴',
}, },
{ {
earnEvery: { name: '실시간게임 결과처리/정산',
rate: '15', isUse: true,
isUse: true, memo: '슬롯 사이트 메모',
maxEarnMoney: '10000', description: '5분 단위로 체크(4분35초, 40초, 54초, 50초, 55초 정각)',
}, },
}, {
], name: '스포츠실시간 포인트 정산',
}, isUse: true,
], memo: '슬롯 사이트 메모',
gameSetting: [ description: '10초마다 완료된 경기 포인트 정산',
{ },
name: '스포츠게임 가져오기', {
isUse: true, name: '카지노 로그 가져오기',
memo: '슬롯 사이트 메모', isUse: true,
description: '다른서버에서 경기가져오고 있음(5분)', memo: '슬롯 사이트 메모',
}, description: '20초마다 마지막 로그 가져옴',
{ },
name: '스포츠게임 결과 가져오기', {
isUse: false, name: '카지노 포인트 정산',
memo: '슬롯 사이트 메모', isUse: true,
description: '다른서버에서 경기결과 가져오고 있음(5분)', memo: '슬롯 사이트 메모',
}, description: '5분마다 정산내용 DB저장',
{ },
name: '실시간게임 가져오기', ],
isUse: true, };
memo: '슬롯 사이트 메모', // siteStatus?: SiteStatusType;
description: '하루한번 21시50분에 가져옴', // memo?: string;
}, // earnSetting?: any;
{ // gameSetting?: any;
name: '실시간게임 결과처리/정산',
isUse: true,
memo: '슬롯 사이트 메모',
description: '5분 단위로 체크(4분35초, 40초, 54초, 50초, 55초 정각)',
},
{
name: '스포츠실시간 포인트 정산',
isUse: true,
memo: '슬롯 사이트 메모',
description: '10초마다 완료된 경기 포인트 정산',
},
{
name: '카지노 로그 가져오기',
isUse: true,
memo: '슬롯 사이트 메모',
description: '20초마다 마지막 로그 가져옴',
},
{
name: '카지노 포인트 정산',
isUse: true,
memo: '슬롯 사이트 메모',
description: '5분마다 정산내용 DB저장',
},
],
},
// siteStatus?: SiteStatusType;
// memo?: string;
// earnSetting?: any;
// gameSetting?: any;
];

View File

@ -10,6 +10,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatRippleModule } from '@angular/material/core'; import { MatRippleModule } from '@angular/material/core';
import { MatSortModule } from '@angular/material/sort'; import { MatSortModule } from '@angular/material/sort';
import { MatSelectModule } from '@angular/material/select'; import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { MatTableModule } from '@angular/material/table'; import { MatTableModule } from '@angular/material/table';
import { MatMenuModule } from '@angular/material/menu'; import { MatMenuModule } from '@angular/material/menu';
@ -43,6 +44,7 @@ import { basicSettingRoutes } from './basic.routing';
MatTableModule, MatTableModule,
MatMenuModule, MatMenuModule,
MatDividerModule, MatDividerModule,
MatSlideToggleModule,
], ],
}) })
export class BasicModule {} export class BasicModule {}

View File

@ -13,14 +13,14 @@
<table <table
class="min-w-240 overflow-y-visible" class="min-w-240 overflow-y-visible"
mat-table mat-table
[dataSource]="currentUserDataSource" [dataSource]="basicInfoSettingDataSource"
> >
<!-- Total --> <!-- Total -->
<ng-container matColumnDef="info"> <ng-container matColumnDef="info">
<th mat-header-cell *matHeaderCellDef>정보</th> <th mat-header-cell *matHeaderCellDef>정보</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let info">
<span class="font-medium text-right"> <span class="font-medium text-right">
{{ user.highRank }} {{ info.name }}
</span> </span>
</td> </td>
</ng-container> </ng-container>
@ -28,16 +28,16 @@
<!-- Expenses amount --> <!-- Expenses amount -->
<ng-container matColumnDef="description"> <ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>내용</th> <th mat-header-cell *matHeaderCellDef>내용</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let info">{{ info.content }}</td>
{{ user.rank }}
</td>
</ng-container> </ng-container>
<!-- Expenses amount --> <!-- Expenses amount -->
<ng-container matColumnDef="updateBtn"> <ng-container matColumnDef="updateBtn">
<th mat-header-cell *matHeaderCellDef>수정</th> <th mat-header-cell *matHeaderCellDef>수정</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let basicSetting">
{{ user.rank }} <div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">수정</button>
</div>
</td> </td>
</ng-container> </ng-container>
@ -63,14 +63,14 @@
<table <table
class="min-w-240 overflow-y-visible" class="min-w-240 overflow-y-visible"
mat-table mat-table
[dataSource]="currentUserDataSource" [dataSource]="basicEarnSettingDataSource"
> >
<!-- Type --> <!-- Type -->
<ng-container matColumnDef="level" sticky> <ng-container matColumnDef="level" sticky>
<th mat-header-cell *matHeaderCellDef>레벨</th> <th mat-header-cell *matHeaderCellDef>레벨</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
<span class="flex items-center"> <span class="flex items-center">
{{ user.level }} {{ earn.level }}
</span> </span>
</td> </td>
</ng-container> </ng-container>
@ -78,9 +78,9 @@
<!-- Total --> <!-- Total -->
<ng-container matColumnDef="firstRate"> <ng-container matColumnDef="firstRate">
<th mat-header-cell *matHeaderCellDef>요율</th> <th mat-header-cell *matHeaderCellDef>요율</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
<span class="font-medium text-right"> <span class="font-medium text-right">
{{ user.highRank }} {{ earn.firstRate }}
</span> </span>
</td> </td>
</ng-container> </ng-container>
@ -88,39 +88,47 @@
<!-- Expenses amount --> <!-- Expenses amount -->
<ng-container matColumnDef="firstIsUse"> <ng-container matColumnDef="firstIsUse">
<th mat-header-cell *matHeaderCellDef>사용여부</th> <th mat-header-cell *matHeaderCellDef>사용여부</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
{{ user.rank }} <div class="sm:col-span-4 flex items-center justify-between">
<mat-slide-toggle
class="ml-4"
[color]="'primary'"
[formControlName]="'twoStep'"
#twoStepToggle
>
</mat-slide-toggle>
</div>
</td> </td>
</ng-container> </ng-container>
<!-- Expenses percentage --> <!-- Expenses percentage -->
<ng-container matColumnDef="firstMaxMoney"> <ng-container matColumnDef="firstMaxMoney">
<th mat-header-cell *matHeaderCellDef>최대금액</th> <th mat-header-cell *matHeaderCellDef>최대금액</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
{{ user.level }} {{ earn.firstMaxEarnMoney }}
</td> </td>
</ng-container> </ng-container>
<!-- Remaining amount --> <!-- Remaining amount -->
<ng-container matColumnDef="everyRate"> <ng-container matColumnDef="everyRate">
<th mat-header-cell *matHeaderCellDef>요율</th> <th mat-header-cell *matHeaderCellDef>요율</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
{{ user.signinId }} {{ earn.everyRate }}
</td> </td>
</ng-container> </ng-container>
<!-- Remaining percentage --> <!-- Remaining percentage -->
<ng-container matColumnDef="everyIsUse"> <ng-container matColumnDef="everyIsUse">
<th mat-header-cell *matHeaderCellDef>사용여부</th> <th mat-header-cell *matHeaderCellDef>사용여부</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
{{ user.nickname }} {{ earn.everyIsUse }}
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="everyMaxMoney"> <ng-container matColumnDef="everyMaxMoney">
<th mat-header-cell *matHeaderCellDef>최대금액</th> <th mat-header-cell *matHeaderCellDef>최대금액</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let earn">
{{ user.currentLocation }} {{ earn.everyMaxEarnMoney }}
</td> </td>
</ng-container> </ng-container>
@ -155,15 +163,15 @@
<table <table
class="min-w-240 overflow-y-visible" class="min-w-240 overflow-y-visible"
mat-table mat-table
[dataSource]="currentUserDataSource" [dataSource]="basicGameSettingDataSource"
> >
<!-- Type --> <!-- Type -->
<ng-container matColumnDef="title" sticky> <ng-container matColumnDef="title" sticky>
<th mat-header-cell *matHeaderCellDef>제목</th> <th mat-header-cell *matHeaderCellDef>제목</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let game">
<span class="flex items-center"> <span class="flex items-center">
<span class="w-2 h-2 rounded-full"></span> <span class="w-2 h-2 rounded-full"></span>
<span class="ml-3 leading-4">{{ user.signinId }}</span> <span class="ml-3 leading-4">{{ game.name }}</span>
</span> </span>
</td> </td>
</ng-container> </ng-container>
@ -171,34 +179,42 @@
<!-- Total --> <!-- Total -->
<ng-container matColumnDef="isUse"> <ng-container matColumnDef="isUse">
<th mat-header-cell *matHeaderCellDef>사용여부</th> <th mat-header-cell *matHeaderCellDef>사용여부</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let game">
<span class="font-medium text-right"> <div class="sm:col-span-4 flex items-center justify-between">
{{ user.highRank }} <mat-slide-toggle
</span> class="ml-4"
[color]="'primary'"
[formControlName]="'twoStep'"
#twoStepToggle
>
</mat-slide-toggle>
</div>
</td> </td>
</ng-container> </ng-container>
<!-- Expenses amount --> <!-- Expenses amount -->
<ng-container matColumnDef="memo"> <ng-container matColumnDef="memo">
<th mat-header-cell *matHeaderCellDef>메모</th> <th mat-header-cell *matHeaderCellDef>메모</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let game">
{{ user.rank }} {{ game.memo }}
</td> </td>
</ng-container> </ng-container>
<!-- Expenses percentage --> <!-- Expenses percentage -->
<ng-container matColumnDef="description"> <ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>내용</th> <th mat-header-cell *matHeaderCellDef>내용</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let game">
{{ user.level }} {{ game.description }}
</td> </td>
</ng-container> </ng-container>
<!-- Remaining amount --> <!-- Remaining amount -->
<ng-container matColumnDef="updateBtn"> <ng-container matColumnDef="updateBtn">
<th mat-header-cell *matHeaderCellDef>수정</th> <th mat-header-cell *matHeaderCellDef>수정</th>
<td mat-cell *matCellDef="let user"> <td mat-cell *matCellDef="let game">
{{ user.signinId }} <div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">수정</button>
</div>
</td> </td>
</ng-container> </ng-container>

View File

@ -89,7 +89,12 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
'updateBtn', 'updateBtn',
]; ];
currentUserDataSource: MatTableDataSource<any> = new MatTableDataSource(); basicInfoSettingDataSource: MatTableDataSource<any> =
new MatTableDataSource();
basicEarnSettingDataSource: MatTableDataSource<any> =
new MatTableDataSource();
basicGameSettingDataSource: MatTableDataSource<any> =
new MatTableDataSource();
basicSetting$!: Observable<BasicSetting | undefined>; basicSetting$!: Observable<BasicSetting | undefined>;
@ -115,6 +120,17 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
* On init * On init
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the products
this._basicService.basicSetting$
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((basicSetting: any | undefined) => {
this.basicInfoSettingDataSource = basicSetting.infos;
this.basicEarnSettingDataSource = basicSetting.earnSettings;
this.basicGameSettingDataSource = basicSetting.gameSetting;
// Mark for check
this._changeDetectorRef.markForCheck();
});
// Get the products // Get the products
this.basicSetting$ = this._basicService.basicSetting$; this.basicSetting$ = this._basicService.basicSetting$;
} }