파워볼 수정

This commit is contained in:
이담 정 2022-07-25 08:14:21 +00:00
parent b5d9930616
commit a857a6735a
5 changed files with 177 additions and 244 deletions

View File

@ -33,7 +33,7 @@ export class GamePowerballMockApi {
.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);
@ -42,7 +42,7 @@ export class GamePowerballMockApi {
let powerballs: any[] | null = cloneDeep(this._powerballs);
// Sort the powerballs
if (sort === 'sku' || sort === 'name' || sort === 'active') {
if (sort === 'signinId' || sort === 'nickname' || sort === 'result') {
powerballs.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase();

View File

@ -2,15 +2,10 @@
export const powerballs = [
{
id: 'dsa01233',
startDate: '2022-01-01 00:00',
finishDate: '2022-06-21 23:59',
totalBetting: 800000,
winningMoney: 390000,
proceedingMoney: 0,
calculate: 410000,
index: '4',
way: '단식',
id: '7eb7c859-1347-4317-96b6-9476a7e2ba3c',
signinId: 'dsa01233',
idx: '4',
bettingType: '단식',
rank: '회원',
nickname: '아메리카노',
bettingProgress: '1166031회 일반볼 오버',
@ -20,4 +15,46 @@ export const powerballs = [
bettingTime: '2022-04-24 22:36',
result: '실패',
},
{
id: '00b0292f-3d50-4669-a0c4-7a9d85efc98d',
signinId: 'dsa01233',
idx: '3',
bettingType: '단식',
rank: '회원',
nickname: '아메리카노',
bettingProgress: '1166030회 파워볼 오버',
odds: 1.95,
bettingMoney: 200000,
hitMoney: 390000,
bettingTime: '2022-04-24 22:30',
result: '실패',
},
{
id: 'b899ec30-b85a-40ab-bb1f-18a596d5c6de',
signinId: 'dsa01233',
idx: '2',
bettingType: '단식',
rank: '회원',
nickname: '아메리카노',
bettingProgress: '1166029회 파워볼 오버',
odds: 1.95,
bettingMoney: 200000,
hitMoney: 390000,
bettingTime: '2022-04-24 22:28',
result: '적중',
},
{
id: '8fcce528-d878-4cc8-99f7-bd3451ed5405',
signinId: 'dsa01233',
idx: '1',
bettingType: '단식',
rank: '회원',
nickname: '아메리카노',
bettingProgress: '1166028회 일반볼 오버',
odds: 1.95,
bettingMoney: 200000,
hitMoney: 390000,
bettingTime: '2022-04-24 22:23',
result: '실패',
},
];

View File

@ -10,65 +10,78 @@
<mat-progress-bar [mode]="'indeterminate'"></mat-progress-bar>
</div>
<!-- Title -->
<div class="text-4xl font-extrabold tracking-tight">Powerball</div>
<div class="text-4xl font-extrabold tracking-tight">파워볼</div>
<!-- Actions -->
<div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4">
<!-- Memo -->
<!-- <mat-form-field>
<ng-container *ngIf="powerballs$ | async as powerballs">
<ng-container
*ngFor="let powerball of powerballs; trackBy: __trackByFn"
>
<div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
>
<fieldset>
{{ powerball.startDate }}~{{ powerball.finishDate }}까지의 총
배팅금액:{{ powerball.totalBetting }}원, 당첨금액:{{
powerball.totalWinning
}}원, 진행중금액:{{ powerball.proceedingMoney }}원, 정산:{{
powerball.calculate
}}원
</fieldset>
</div>
</ng-container>
</ng-container>
</mat-form-field> -->
<!-- Search -->
<div>
<span style="color: blue">2022-01-01 00:00</span><span>~</span>
<span style="color: blue">2022-06-21 23:59</span>
<span>까지의 총 베팅금액:<span style="color: red">800,000</span></span
>&nbsp;&nbsp;
<span>당첨금액:<span style="color: red">390,000</span></span
>&nbsp;&nbsp;
<span>진행중금액:<span style="color: red">0</span></span>&nbsp;&nbsp;
<span>정산:<span style="color: red">410,000</span></span>
</div>
<button mat-icon-button (click)="__onClickSearch()">
<mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
</button>
</div>
</div>
<!-- Memo -->
<div
class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-4 px-6 md:px-8 border-b"
>
<!-- <mat-form-field
class="bet-mat-form-field-wrapper-mb-0 mr-2"
style="width: 100%"
>
<textarea matInput cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
<button mat-flat-button [color]="'primary'">메모저장</button> -->
</div>
<!-- Search -->
<div
*ngIf="__isSearchOpened"
class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-4 px-6 md:px-8 border-b"
>
<!-- Actions -->
<div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0">
<!-- SelectBox -->
<mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<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 fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="파워볼">
<mat-option value="">파워볼</mat-option>
<mat-option value="">카지노</mat-option>
<mat-option value="">슬롯</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="전체">
<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="">40</mat-option>
<mat-option value="">60</mat-option>
<mat-option value="">80</mat-option>
<mat-option value="">100</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="전체금액">
<mat-option value="">전체금액</mat-option>
<mat-option value="">100-50만미만</mat-option>
<mat-option value="">50만-100만미만</mat-option>
<mat-option value="">100만-200만이하</mat-option>
<mat-option value="">300만초과</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="전체목록">
<mat-option value="">진행목록</mat-option>
<mat-option value="">당첨</mat-option>
@ -79,7 +92,7 @@
<mat-option value="">전체목록</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="검색항목">
<mat-option value="">아이디</mat-option>
<mat-option value="">닉네임</mat-option>
@ -89,7 +102,8 @@
</mat-form-field>
<!-- Search -->
<mat-form-field
class="fuse-mat-dense fuse-mat-no-subscript fuse-mat-rounded min-w-64"
fxFlex
class="fuse-mat-rounded min-w-64 bet-mat-form-field-wrapper-mb-0 mr-2"
>
<mat-icon
class="icon-size-5"
@ -100,18 +114,19 @@
matInput
[formControl]="searchInputControl"
[autocomplete]="'off'"
[placeholder]="'Search'"
[placeholder]="'Search user'"
/>
</mat-form-field>
<!-- Search button -->
<!-- Add user button -->
<button
class="ml-4"
fxFlex
mat-flat-button
style="position: fixed; margin-top: 4px"
[color]="'primary'"
(click)="__createProduct()"
>
<!-- <mat-icon [svgIcon]="'heroicons_outline:plus'"></mat-icon> -->
<span class="ml-2 mr-1">검색하기</span>
<mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
<span class="ml-2 mr-1">Search</span>
</button>
</div>
</div>
@ -128,38 +143,21 @@
<!-- Header -->
<div
class="inventory-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5"
matSort
matSortDisableClear
>
<div></div>
<div class="hidden sm:block">번호</div>
<div class="hidden sm:block">구분</div>
<div class="hidden sm:block">등급</div>
<div class="hidden sm:block">아이디</div>
<div
class="hidden sm:block"
[mat-sort-header]="'bettingProgress'"
>
배팅진행내역
<div>번호</div>
<div>구분</div>
<div>
아이디
<hr style="margin: 7px 0px" />
닉네임
</div>
<div class="hidden sm:block">배당률</div>
<div class="hidden sm:block">배팅액</div>
<div class="hidden sm:block">배당적중금</div>
<div class="hidden sm:block">배팅시간</div>
<div class="hidden sm:block">결과</div>
<div class="hidden sm:block">취소/삭제 여부</div>
<!-- <div class="hidden md:block" [mat-sort-header]="'sku'">SKU</div>
<div [mat-sort-header]="'name'">Name</div>
<div class="hidden sm:block" [mat-sort-header]="'price'">
Price
</div>
<div class="hidden lg:block" [mat-sort-header]="'stock'">
Stock
</div>
<div class="hidden lg:block" [mat-sort-header]="'active'">
Active
</div>
<div class="hidden sm:block">Details</div> -->
<div>등급</div>
<div class="hidden sm:block">배당율</div>
<div class="hidden md:block">베팅액</div>
<div class="hidden md:block">배당적중금</div>
<div class="hidden md:block">베팅시간</div>
<div class="hidden lg:block">결과</div>
<div class="hidden lg:block">취소/삭제여부</div>
</div>
<!-- Rows -->
<ng-container *ngIf="powerballs$ | async as powerballs">
@ -169,163 +167,53 @@
<div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
>
<!-- index -->
<div class="hidden sm:block truncate">
{{ powerball.index }}
<div>{{ powerball.idx }}</div>
<div>{{ powerball.bettingType }}</div>
<div>
{{ powerball.signinId }}
<hr style="margin: 7px 0px" />
{{ powerball.nickname }}
</div>
<!-- division -->
<div class="hidden sm:block truncate">
LV.{{ powerball.way }}
<div>
{{ powerball.rank }}
</div>
<!-- rank -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
{{ powerball.rank }}
</button>
</div>
<!-- id, nickname -->
<ng-container *ngIf="users$ | async as users">
<ng-container
*ngFor="let user of users; trackBy: __trackByFn"
>
<div class="hidden sm:block truncate">
{{ powerball.id }}
({{ powerball.nickname }})
</div>
</ng-container>
</ng-container>
<!-- bettingProgress -->
<div class="hidden sm:block truncate">
{{ powerball.bettingProgress }}
</div>
<!-- odds -->
<div class="hidden sm:block truncate">
<div class="hidden sm:block">
{{ powerball.odds }}
</div>
<!-- bettingMoney -->
<div class="hidden sm:block truncate">
{{ powerball.bettingMoney }}원
<div class="hidden md:block">
{{ powerball.bettingMoney }}
</div>
<!-- hitMoney -->
<div class="hidden sm:block truncate">
{{ powerball.hitMoney }}원
<div class="hidden md:block">
{{ powerball.hitMoney }}
</div>
<!-- bettingTime -->
<div class="hidden sm:block truncate">
<div class="hidden md:block">
{{ powerball.bettingTime }}
</div>
<!-- result -->
<div class="hidden sm:block truncate">
<div class="hidden lg:block">
{{ powerball.result }}
</div>
<!-- delete -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">삭제</button>
<button mat-flat-button [color]="'primary'">취소</button>
<button mat-flat-button [color]="'primary'">정보</button>
</div>
<!-- Image -->
<!-- <div class="flex items-center">
<div
class="relative flex flex-0 items-center justify-center w-12 h-12 mr-6 rounded overflow-hidden border"
>
<img
class="w-8"
*ngIf="user.thumbnail"
[alt]="'Product thumbnail image'"
[src]="user.thumbnail"
/>
<div
class="flex items-center justify-center w-full h-full text-xs font-semibold leading-none text-center uppercase"
*ngIf="!user.thumbnail"
>
NO THUMB
</div>
</div>
</div> -->
<!-- SKU -->
<!-- <div class="hidden md:block truncate">
{{ user.sku }}
</div> -->
<!-- Name -->
<!-- <div class="truncate">
{{ user.name }}
</div> -->
<!-- Price -->
<!-- <div class="hidden sm:block">
{{ user.price | currency: "USD":"symbol":"1.2-2" }}
</div> -->
<!-- Stock -->
<!-- <div class="hidden lg:flex items-center">
<div class="min-w-4">{{ user.stock }}</div> -->
<!-- Low stock -->
<!-- <div
class="flex items-end ml-2 w-1 h-4 bg-red-200 rounded overflow-hidden"
*ngIf="user.stock < 20"
>
<div class="flex w-full h-1/3 bg-red-600"></div>
</div> -->
<!-- Medium stock -->
<!-- <div
class="flex items-end ml-2 w-1 h-4 bg-orange-200 rounded overflow-hidden"
*ngIf="user.stock >= 20 && user.stock < 30"
>
<div class="flex w-full h-2/4 bg-orange-400"></div>
</div> -->
<!-- High stock -->
<!-- <div
class="flex items-end ml-2 w-1 h-4 bg-green-100 rounded overflow-hidden"
*ngIf="user.stock >= 30"
>
<div class="flex w-full h-full bg-green-400"></div>
</div>
</div> -->
<!-- Active -->
<!-- <div class="hidden lg:block">
<ng-container *ngIf="user.active">
<mat-icon
class="text-green-400 icon-size-5"
[svgIcon]="'heroicons_solid:check'"
></mat-icon>
</ng-container>
<ng-container *ngIf="!user.active">
<mat-icon
class="text-gray-400 icon-size-5"
[svgIcon]="'heroicons_solid:x'"
></mat-icon>
</ng-container>
</div> -->
<!-- Details button -->
<!-- <div>
<div class="hidden lg:block">
<button
class="min-w-10 min-h-7 h-7 px-2 leading-6"
mat-stroked-button
(click)="__toggleDetails(user.id)"
mat-flat-button
class="bet-mat-small-8"
[color]="'warn'"
>
<mat-icon
class="icon-size-5"
[svgIcon]="
selectedUser?.id === user.id
? 'heroicons_solid:chevron-up'
: 'heroicons_solid:chevron-down'
"
></mat-icon>
삭제
</button>
</div> -->
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
취소</button
><button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
정보
</button>
</div>
</div>
</ng-container>
</ng-container>
@ -347,7 +235,7 @@
<div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
>
There are no powerball!
There are no Data!
</div>
</ng-template>
</div>

View File

@ -41,18 +41,22 @@ import { PowerballService } from '../services/powerball.service';
/* language=SCSS */
`
.inventory-grid {
grid-template-columns: 60px auto 40px;
/* 번호 구분 아이디 등급 배당율 */
grid-template-columns: 20px 40px auto 40px 40px;
@screen sm {
grid-template-columns: 60px auto 60px 72px;
/* 번호 구분 아이디 등급 배당율 배팅액 */
grid-template-columns: 20px 40px auto 40px 40px 100px;
}
@screen md {
grid-template-columns: 60px 60px auto 112px 72px;
/* 번호 구분 아이디 등급 배당율 배팅액 적중 시간*/
grid-template-columns: 20px 40px auto 40px 40px 100px 140px 140px;
}
@screen lg {
grid-template-columns: 60px 60px auto 112px 96px 96px 72px;
/* 번호 구분 아이디 등급 배당율 배팅액 적중 시간 결과 취소 */
grid-template-columns: 20px 40px auto 40px 40px 100px 140px 140px 140px 140px;
}
}
`,
@ -68,6 +72,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
powerballs$!: Observable<Powerball[] | undefined>;
users$!: Observable<User[] | undefined>;
__isSearchOpened = false;
isLoading = false;
searchInputControl = new FormControl();
selectedPowerball?: Powerball;
@ -180,6 +185,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/
__toggleDetails(productId: string): void {}
/**
* toggle the search
* Used in 'bar'
*/
__onClickSearch(): void {
this.__isSearchOpened = !this.__isSearchOpened;
}
/**
* Track by function for ngFor loops
*

View File

@ -1,19 +1,14 @@
export interface Powerball {
id?: string;
id: string;
idx?: number;
signinId?: string;
nickname?: string;
startDate?: string;
finishDate?: string;
totalBetting?: string;
totalWinning?: number;
proceedingMoney?: number;
calculate?: number;
index?: string;
way?: string;
rank?: string;
bettingType?: string; // 구분(단폴 or 다폴)
bettingProgress?: string;
odds?: number;
rank?: string;
bettingMoney?: number;
hitMoney?: number;
bettingTime?: string;
bettingTime?: Date;
result?: string;
}