현재접속자 쪽지전송 수정

This commit is contained in:
이담 정 2022-07-22 03:14:01 +00:00
parent 758d25b0f1
commit 00bc20dd0c
6 changed files with 219 additions and 515 deletions

View File

@ -33,7 +33,7 @@ export class MemberCurrentUserMockApi {
.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 MemberCurrentUserMockApi {
let currentUsers: any[] | null = cloneDeep(this._currentUsers);
// Sort the currentUsers
if (sort === 'id' || sort === 'signinId' || sort === 'nickname') {
if (sort === 'signinId' || sort === 'nickname' || sort === 'level') {
currentUsers.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase();
@ -139,24 +139,17 @@ export class MemberCurrentUserMockApi {
// Generate a new currentUser
const newCurrentUser = {
id: FuseMockApiUtils.guid(),
category: '',
name: 'A New User',
description: '',
tags: [],
sku: '',
barcode: '',
brand: '',
vendor: '',
stock: '',
reserved: '',
cost: '',
basePrice: '',
taxPercent: '',
price: '',
weight: '',
thumbnail: '',
images: [],
active: false,
signinId: '',
nickname: '',
currentLocation: '',
gameMoney: 0,
highRank: '',
index: 0,
level: '',
ownCash: 0,
ownComp: 0,
rank: '',
siteAddress: '',
};
// Unshift the new currentUser

View File

@ -3,54 +3,16 @@
export const currentUsers = [
{
id: '2bfa2be5-7688-48d5-b5ac-dc0d9ac97f14',
signinId: 'kgon01',
highRank: '[매장]kgon5',
rank: '회원',
level: 4,
signinId: 'aa100',
nickname: 'aa100',
currentLocation: '메인',
cash: 0,
comp: 3111,
gameMoney: 0,
siteAddress: 'web4nova114.com',
},
{
id: '77a4383b-b5a5-4943-bc46-04c3431d1566',
signinId: 'kgon02',
highRank: '[매장]kgon5',
highRank: 'kgon5',
index: 1,
level: '4',
ownCash: 67131,
ownComp: 3111,
rank: '회원',
level: 4,
nickname: 'aa100',
currentLocation: '메인',
cash: 0,
comp: 3111,
gameMoney: 0,
siteAddress: 'web4nova114.com',
},
{
id: '8bb0f597-673a-47ca-8c77-2f83219cb9af',
signinId: 'kgon03',
highRank: '[매장]kgon5',
rank: '회원',
level: 4,
nickname: 'aa100',
currentLocation: '메인',
cash: 0,
comp: 3111,
gameMoney: 0,
siteAddress: 'web4nova114.com',
},
{
id: '0a8bc517-631a-4a93-aacc-000fa2e8294c',
signinId: 'kgon04',
highRank: '[매장]kgon5',
rank: '회원',
level: 4,
nickname: 'aa100',
currentLocation: '메인',
cash: 0,
comp: 3111,
gameMoney: 0,
siteAddress: 'web4nova114.com',
},
];

View File

@ -1,212 +0,0 @@
<div
class="sm:absolute sm:inset-0 flex flex-col flex-auto min-w-0 sm:overflow-hidden bg-card dark:bg-transparent"
>
<!-- Header -->
<div
class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-8 px-6 md:px-8 border-b"
>
<!-- Loader -->
<div class="absolute inset-x-0 bottom-0" *ngIf="isLoading">
<mat-progress-bar [mode]="'indeterminate'"></mat-progress-bar>
</div>
<!-- Title -->
<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"></div>
</div>
<!-- Main -->
<div class="flex flex-auto overflow-hidden">
<!-- Products list -->
<div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
>
<ng-container *ngIf="currentUsers$ | async as currentUsers">
<ng-container *ngIf="currentUsers.length > 0; else noCurrentUser">
<div class="grid">
<!-- 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" [mat-sort-header]="'index'">
번호
</div>
<div class="hidden sm:block" [mat-sort-header]="'highRank'">
상위
</div>
<div class="hidden sm:block" [mat-sort-header]="'rank'">등급</div>
<div class="hidden sm:block" [mat-sort-header]="'level'">
레벨
</div>
<div class="hidden sm:block" [mat-sort-header]="'id'">아이디</div>
<div class="hidden sm:block" [mat-sort-header]="'nickname'">
닉네임
</div>
<div
class="hidden sm:block"
[mat-sort-header]="'currentLocation'"
>
현재위치
</div>
<div class="hidden sm:block" [mat-sort-header]="'cash'">캐쉬</div>
<div class="hidden sm:block" [mat-sort-header]="'gameMoney'">
게임중머니
</div>
<div class="hidden sm:block">카지노->캐쉬</div>
<div class="hidden sm:block" [mat-sort-header]="'comp'">콤프</div>
<div class="hidden sm:block" [mat-sort-header]="'siteAddress'">
사이트
</div>
<div class="hidden sm:block">쪽지보내기</div>
<div class="hidden sm:block">배팅내역</div>
<div class="hidden sm:block">로그아웃</div>
</div>
<!-- Rows -->
<ng-container *ngIf="currentUsers$ | async as currentUsers">
<ng-container
*ngFor="let currentUser of currentUsers; trackBy: __trackByFn"
>
<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">
{{ currentUser.index }}
</div>
<!-- highRank -->
<div class="hidden sm:block truncate">
{{ currentUser.highRank }}
</div>
<!-- rank -->
<div class="hidden sm:block truncate">
{{ currentUser.rank }}
</div>
<!-- level -->
<div class="hidden sm:block truncate">
LV.{{ currentUser.level }}
</div>
<!-- id -->
<div
class="hidden sm:block truncate"
(click)="viewUserDetail(currentUser.id!)"
>
{{ currentUser.id }}
</div>
<!-- nickname -->
<div class="hidden sm:block truncate">
{{ currentUser.nickname }}
</div>
<!-- currentLocation -->
<div class="hidden sm:block truncate">
{{ currentUser.currentLocation }}
</div>
<!-- cash -->
<div class="hidden sm:block truncate">
캐쉬{{ currentUser.cash }}
</div>
<!-- casinoCash -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
게임머니확인
</button>
<button mat-flat-button [color]="'primary'">
게임머니회수
</button>
</div>
<!-- comp -->
<div class="hidden sm:block truncate">
{{ currentUser.comp }}
</div>
<!-- site -->
<div class="hidden sm:block truncate">
{{ currentUser.siteAddress }}
</div>
<!-- message -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
<mat-icon svgIcon="heroicons_outline:mail"></mat-icon>
</button>
</div>
<!-- bettinglist -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
배팅리스트
</button>
</div>
<!-- logout -->
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
로그아웃
</button>
</div>
</div>
</ng-container>
</ng-container>
</div>
<mat-paginator
class="sm:absolute sm:inset-x-0 sm:bottom-0 border-b sm:border-t sm:border-b-0 z-10 bg-gray-50 dark:bg-transparent"
[ngClass]="{ 'pointer-events-none': isLoading }"
[length]="pagination?.length"
[pageIndex]="pagination?.page"
[pageSize]="pagination?.size"
[pageSizeOptions]="[5, 10, 25, 100]"
[showFirstLastButtons]="true"
></mat-paginator>
</ng-container>
</ng-container>
<ng-template #noCurrentUser>
<div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
>
There are no currentUser!
</div>
</ng-template>
</div>
</div>
</div>
<div>
<div class="flex flex-auto">
<mat-card>
<mat-card-header>
<span><b>현재 접속자 & 전체회원 쪽지보내기</b></span>
</mat-card-header>
<mat-card-content>
<!-- 구분 -->
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>제목</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>글쓴이</mat-label>
<input matInput placeholder="관리자" />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>내용</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<input matInput />
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
</div>
</div>

View File

@ -1,202 +1,185 @@
<div class="flex flex-col flex-auto min-w-0">
<div class="flex-auto border-t -mt-px pt-4 sm:pt-6">
<div class="w-full max-w-screen-xl mx-auto">
<div class="grid grid-cols-1 sm:grid-cols-6 gap-6 w-full min-w-0">
<!-- Budget distribution -->
<div
class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden"
>
<div class="text-lg font-medium tracking-tight leading-6 truncate">
현재접속자 & 쪽지전송
</div>
<div class="flex flex-col flex-auto mt-2 overflow-x-auto">
<table
class="min-w-240 overflow-y-visible"
mat-table
[dataSource]="currentUserDataSource"
>
<!-- Type -->
<ng-container matColumnDef="id" sticky>
<th mat-header-cell *matHeaderCellDef>번호</th>
<td mat-cell *matCellDef="let user; let idx = index">
<span class="flex items-center">
<span class="w-2 h-2 rounded-full"></span>
<span class="ml-3 leading-4">{{ idx + 1 }}</span>
</span>
</td>
</ng-container>
<!-- Total -->
<ng-container matColumnDef="highRank">
<th mat-header-cell *matHeaderCellDef>상위</th>
<td mat-cell *matCellDef="let user">
<span class="font-medium text-right">
{{ user.highRank }}
</span>
</td>
</ng-container>
<!-- Expenses amount -->
<ng-container matColumnDef="rank">
<th mat-header-cell *matHeaderCellDef>등급</th>
<td mat-cell *matCellDef="let user">
{{ user.rank }}
</td>
</ng-container>
<!-- Expenses percentage -->
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>레벨</th>
<td mat-cell *matCellDef="let user">
{{ user.level }}
</td>
</ng-container>
<!-- Remaining amount -->
<ng-container matColumnDef="signinId">
<th mat-header-cell *matHeaderCellDef>아이디</th>
<td mat-cell *matCellDef="let user">
{{ user.signinId }}
</td>
</ng-container>
<!-- Remaining percentage -->
<ng-container matColumnDef="nickname">
<th mat-header-cell *matHeaderCellDef>닉네임</th>
<td mat-cell *matCellDef="let user">
{{ user.nickname }}
</td>
</ng-container>
<ng-container matColumnDef="currentLocation">
<th mat-header-cell *matHeaderCellDef>현재위치</th>
<td mat-cell *matCellDef="let user">
{{ user.currentLocation }}
</td>
</ng-container>
<ng-container matColumnDef="cash">
<th mat-header-cell *matHeaderCellDef>캐쉬</th>
<td mat-cell *matCellDef="let user">
{{ user.cash }}
</td>
</ng-container>
<ng-container matColumnDef="gameMoney">
<th mat-header-cell *matHeaderCellDef>게임중머니</th>
<td mat-cell *matCellDef="let user">
{{ user.gameMoney }}
</td>
</ng-container>
<ng-container matColumnDef="casinoMoney">
<th mat-header-cell *matHeaderCellDef>카지노->캐쉬</th>
<td mat-cell *matCellDef="let user">
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
게임머니확인
</button>
<button mat-flat-button [color]="'primary'">
게임머니회수
</button>
</div>
</td>
</ng-container>
<ng-container matColumnDef="comp">
<th mat-header-cell *matHeaderCellDef>콤프</th>
<td mat-cell *matCellDef="let user">
{{ user.comp }}
</td>
</ng-container>
<ng-container matColumnDef="siteAddress">
<th mat-header-cell *matHeaderCellDef>사이트</th>
<td mat-cell *matCellDef="let user">
{{ user.siteAddress }}
</td>
</ng-container>
<ng-container matColumnDef="sendMessageBtn">
<th mat-header-cell *matHeaderCellDef>쪽지보내기</th>
<td mat-cell *matCellDef="let user">
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
쪽지보내기
</button>
</div>
</td>
</ng-container>
<ng-container matColumnDef="betHistoryBtn">
<th mat-header-cell *matHeaderCellDef>배팅내역</th>
<td mat-cell *matCellDef="let user">
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
배팅내역
</button>
</div>
</td>
</ng-container>
<ng-container matColumnDef="forceSignOutBtn">
<th mat-header-cell *matHeaderCellDef>로그아웃</th>
<td mat-cell *matCellDef="let user">
<div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'">
로그아웃
</button>
</div>
</td>
</ng-container>
<tr
mat-header-row
*matHeaderRowDef="currentUserTableColumns"
></tr>
<tr
mat-row
*matRowDef="let row; columns: currentUserTableColumns"
></tr>
</table>
</div>
</div>
<!-- Budget details -->
<div
class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden"
>
<div class="text-lg font-medium tracking-tight leading-6 truncate">
현재 접속자 & 전체회원 쪽지보내기
</div>
<div class="flex flex-col flex-auto">
<mat-card>
<mat-card-content>
<!-- 구분 -->
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>제목</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>글쓴이</mat-label>
<input matInput placeholder="관리자" />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>내용</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<input matInput />
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
<div
class="sm:absolute sm:inset-0 flex flex-col flex-auto min-w-0 sm:overflow-hidden bg-card dark:bg-transparent"
>
<!-- Header -->
<div
class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-8 px-6 md:px-8 border-b"
>
<!-- Loader -->
<div class="absolute inset-x-0 bottom-0" *ngIf="isLoading">
<mat-progress-bar [mode]="'indeterminate'"></mat-progress-bar>
</div>
<!-- Title -->
<div class="text-4xl font-extrabold tracking-tight">
현재접속자&쪽지전송
</div>
</div>
</div>
<!-- Main -->
<div class="flex flex-auto overflow-hidden">
<!-- Products list -->
<div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
>
<ng-container *ngIf="currentUsers$ | async as currentUsers">
<ng-container *ngIf="currentUsers.length > 0; else noCurrentUser">
<div class="grid">
<!-- 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"
>
<div>번호</div>
<div>상부</div>
<div>
아이디
<hr style="margin: 7px 0px" />
닉네임
<hr style="margin: 7px 0px" />
현재위치
</div>
<div>
등급
<hr style="margin: 7px 0px" />
레벨
</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 class="hidden lg:block">로그아웃</div>
</div>
<!-- Rows -->
<ng-container *ngIf="currentUsers$ | async as currentUsers">
<ng-container
*ngFor="let currentUser of currentUsers; trackBy: __trackByFn"
>
<div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
>
<div>{{ currentUser.index }}</div>
<div>{{ currentUser.highRank }}</div>
<ng-container *ngIf="users$ | async as users">
<ng-container
*ngFor="let user of users; trackBy: __trackByFn"
>
<div>
<div (click)="viewUserDetail(user.id!)">
{{ currentUser.signinId }}
</div>
<hr style="margin: 7px 0px" />
{{ currentUser.nickname }}
<hr style="margin: 7px 0px" />
{{ currentUser.currentLocation }}
</div>
</ng-container>
</ng-container>
<div>
{{ currentUser.rank }}
<hr style="margin: 7px 0px" />
{{ currentUser.level }}
</div>
<div class="hidden md:block">
{{ currentUser.ownCash }}
<hr style="margin: 7px 0px" />
{{ currentUser.ownComp }}
</div>
<div class="hidden md:block">
{{ currentUser.gameMoney }}
</div>
<div class="hidden md:block">
{{ currentUser.siteAddress }}
</div>
<div class="hidden lg:block">
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
<mat-icon svgIcon="email-outline"></mat-icon>
</button>
</div>
<div class="hidden lg:block">
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
배팅내역
</button>
</div>
<div class="hidden lg:block">
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
로그아웃
</button>
</div>
</div>
</ng-container>
</ng-container>
</div>
<mat-paginator
class="sm:absolute sm:inset-x-0 sm:bottom-0 border-b sm:border-t sm:border-b-0 z-10 bg-gray-50 dark:bg-transparent"
[ngClass]="{ 'pointer-events-none': isLoading }"
[length]="pagination?.length"
[pageIndex]="pagination?.page"
[pageSize]="pagination?.size"
[pageSizeOptions]="[5, 10, 25, 100]"
[showFirstLastButtons]="true"
></mat-paginator>
</ng-container>
</ng-container>
<ng-template #noCurrentUser>
<div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
>
There are no current user!
</div>
</ng-template>
</div>
</div>
<!-- Budget details -->
<div>
<div
class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden"
>
<div class="text-lg font-medium tracking-tight leading-6 truncate">
현재 접속자 & 전체회원 쪽지보내기
</div>
<div class="flex flex-col flex-auto">
<mat-card>
<mat-card-content>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>제목</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>글쓴이</mat-label>
<input matInput placeholder="관리자" />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>내용</mat-label>
<input matInput />
</mat-form-field>
</div>
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<input matInput />
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>

View File

@ -42,18 +42,22 @@ import { Router } from '@angular/router';
/* language=SCSS */
`
.inventory-grid {
grid-template-columns: 60px auto 40px;
/* CB 관리 요율 상부 아이디 */
grid-template-columns: 20px 40px 40px 100px auto;
@screen sm {
grid-template-columns: 60px auto 60px 72px;
/* CB 관리 요율 상부 아이디 등급 */
grid-template-columns: 20px 40px 40px 100px auto 40px 140px 140px;
}
@screen md {
grid-template-columns: 60px 60px auto 112px 72px;
/* CB 관리 요율 상부 아이디 등급 예금주 보유금 게임중머니 총입출 */
grid-template-columns: 20px 40px 40px 100px auto 40px 140px 140px;
}
@screen lg {
grid-template-columns: 60px 60px auto 112px 96px 96px 72px;
/* 번호 상부 아이디 등급 보유금 게임중머니 사이트 쪽지 배팅 로그아웃 */
grid-template-columns: 20px 100px auto 40px 140px 140px 140px 140px 140px 140px;
}
}
`,
@ -69,26 +73,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
currentUsers$!: Observable<CurrentUser[] | undefined>;
users$!: Observable<User[] | undefined>;
currentUserDataSource: MatTableDataSource<any> = new MatTableDataSource();
currentUserTableColumns: string[] = [
'id',
'highRank',
'rank',
'level',
'signinId',
'nickname',
'currentLocation',
'cash',
'gameMoney',
'casinoMoney',
'comp',
'siteAddress',
'sendMessageBtn',
'betHistoryBtn',
'forceSignOutBtn',
];
data: any;
isLoading = false;
searchInputControl = new FormControl();
selectedCurrentUser?: CurrentUser;
@ -127,14 +111,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
});
// Get the products
this._currentUserService.currentUsers$
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((currentUsers: any | undefined) => {
this.currentUserDataSource = currentUsers;
// Mark for check
this._changeDetectorRef.markForCheck();
});
/* this.currentUsers$ = this._currentUserService.currentUsers$; */
this.currentUsers$ = this._currentUserService.currentUsers$;
}
/**
@ -144,7 +121,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
if (this._sort && this._paginator) {
// Set the initial sort
this._sort.sort({
id: 'name',
id: 'signinId',
start: 'asc',
disableClear: true,
});

View File

@ -1,13 +1,14 @@
export interface CurrentUser {
id?: string;
index?: number;
id: string;
signinId?: string;
nickname?: string;
highRank?: string;
rank?: string;
level?: string;
currentLocation?: string;
cash?: number;
gameMoney?: number;
comp?: number;
highRank?: string;
index?: number;
level?: string;
ownCash?: number;
ownComp?: number;
rank?: string;
siteAddress?: string;
}