현재접속자 쪽지전송 수정

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

View File

@ -3,54 +3,16 @@
export const currentUsers = [ export const currentUsers = [
{ {
id: '2bfa2be5-7688-48d5-b5ac-dc0d9ac97f14', id: '2bfa2be5-7688-48d5-b5ac-dc0d9ac97f14',
signinId: 'kgon01', signinId: 'aa100',
highRank: '[매장]kgon5',
rank: '회원',
level: 4,
nickname: 'aa100', nickname: 'aa100',
currentLocation: '메인', currentLocation: '메인',
cash: 0,
comp: 3111,
gameMoney: 0, gameMoney: 0,
siteAddress: 'web4nova114.com', highRank: 'kgon5',
}, index: 1,
{ level: '4',
id: '77a4383b-b5a5-4943-bc46-04c3431d1566', ownCash: 67131,
signinId: 'kgon02', ownComp: 3111,
highRank: '[매장]kgon5',
rank: '회원', 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', 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,163 +1,151 @@
<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 <div
class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden" class="sm:absolute sm:inset-0 flex flex-col flex-auto min-w-0 sm:overflow-hidden bg-card dark:bg-transparent"
> >
<div class="text-lg font-medium tracking-tight leading-6 truncate"> <!-- 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 class="flex flex-col flex-auto mt-2 overflow-x-auto"> </div>
<table </div>
class="min-w-240 overflow-y-visible"
mat-table <!-- Main -->
[dataSource]="currentUserDataSource" <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"
> >
<!-- Type --> <ng-container *ngIf="currentUsers$ | async as currentUsers">
<ng-container matColumnDef="id" sticky> <ng-container *ngIf="currentUsers.length > 0; else noCurrentUser">
<th mat-header-cell *matHeaderCellDef>번호</th> <div class="grid">
<td mat-cell *matCellDef="let user; let idx = index"> <!-- Header -->
<span class="flex items-center"> <div
<span class="w-2 h-2 rounded-full"></span> 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"
<span class="ml-3 leading-4">{{ idx + 1 }}</span> >
</span> <div>번호</div>
</td> <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>
<!-- 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> </ng-container>
<div>
<!-- Expenses amount --> {{ currentUser.rank }}
<ng-container matColumnDef="rank"> <hr style="margin: 7px 0px" />
<th mat-header-cell *matHeaderCellDef>등급</th> {{ currentUser.level }}
<td mat-cell *matCellDef="let user"> </div>
{{ user.rank }} <div class="hidden md:block">
</td> {{ currentUser.ownCash }}
</ng-container> <hr style="margin: 7px 0px" />
{{ currentUser.ownComp }}
<!-- Expenses percentage --> </div>
<ng-container matColumnDef="level"> <div class="hidden md:block">
<th mat-header-cell *matHeaderCellDef>레벨</th> {{ currentUser.gameMoney }}
<td mat-cell *matCellDef="let user"> </div>
{{ user.level }} <div class="hidden md:block">
</td> {{ currentUser.siteAddress }}
</ng-container> </div>
<div class="hidden lg:block">
<!-- Remaining amount --> <button
<ng-container matColumnDef="signinId"> mat-flat-button
<th mat-header-cell *matHeaderCellDef>아이디</th> class="bet-mat-small-8"
<td mat-cell *matCellDef="let user"> [color]="'primary'"
{{ user.signinId }} >
</td> <mat-icon svgIcon="email-outline"></mat-icon>
</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> </button>
</div> </div>
</td> <div class="hidden lg:block">
</ng-container> <button
mat-flat-button
<ng-container matColumnDef="comp"> class="bet-mat-small-8"
<th mat-header-cell *matHeaderCellDef>콤프</th> [color]="'primary'"
<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> </button>
</div> </div>
</td> <div class="hidden lg:block">
</ng-container> <button
<ng-container matColumnDef="forceSignOutBtn"> mat-flat-button
<th mat-header-cell *matHeaderCellDef>로그아웃</th> class="bet-mat-small-8"
<td mat-cell *matCellDef="let user"> [color]="'primary'"
<div class="hidden sm:block truncate"> >
<button mat-flat-button [color]="'primary'">
로그아웃 로그아웃
</button> </button>
</div> </div>
</td> </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-container>
<tr <ng-template #noCurrentUser>
mat-header-row <div
*matHeaderRowDef="currentUserTableColumns" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
></tr> >
<tr There are no current user!
mat-row </div>
*matRowDef="let row; columns: currentUserTableColumns" </ng-template>
></tr>
</table>
</div> </div>
</div> </div>
<!-- Budget details --> <!-- Budget details -->
<div>
<div <div
class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden" class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden"
> >
@ -167,8 +155,6 @@
<div class="flex flex-col flex-auto"> <div class="flex flex-col flex-auto">
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<!-- 구분 -->
<div class="flex"> <div class="flex">
<mat-form-field class="w-1/3 pr-2"> <mat-form-field class="w-1/3 pr-2">
<mat-label>제목</mat-label> <mat-label>제목</mat-label>
@ -197,6 +183,3 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>

View File

@ -42,18 +42,22 @@ import { Router } from '@angular/router';
/* language=SCSS */ /* language=SCSS */
` `
.inventory-grid { .inventory-grid {
grid-template-columns: 60px auto 40px; /* CB 관리 요율 상부 아이디 */
grid-template-columns: 20px 40px 40px 100px auto;
@screen sm { @screen sm {
grid-template-columns: 60px auto 60px 72px; /* CB 관리 요율 상부 아이디 등급 */
grid-template-columns: 20px 40px 40px 100px auto 40px 140px 140px;
} }
@screen md { @screen md {
grid-template-columns: 60px 60px auto 112px 72px; /* CB 관리 요율 상부 아이디 등급 예금주 보유금 게임중머니 총입출 */
grid-template-columns: 20px 40px 40px 100px auto 40px 140px 140px;
} }
@screen lg { @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>; currentUsers$!: Observable<CurrentUser[] | undefined>;
users$!: Observable<User[] | 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; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedCurrentUser?: CurrentUser; selectedCurrentUser?: CurrentUser;
@ -127,14 +111,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this._currentUserService.currentUsers$ this.currentUsers$ = 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$; */
} }
/** /**
@ -144,7 +121,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
if (this._sort && this._paginator) { if (this._sort && this._paginator) {
// Set the initial sort // Set the initial sort
this._sort.sort({ this._sort.sort({
id: 'name', id: 'signinId',
start: 'asc', start: 'asc',
disableClear: true, disableClear: true,
}); });

View File

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