Merge branch 'feature/BETERAN-BACKEND-APP-BROWSER-init' of https://gitlab.loafle.net/bet/beteran-backend-app-browser into feature/BETERAN-BACKEND-APP-BROWSER-init
This commit is contained in:
commit
62278134f6
|
@ -12,10 +12,6 @@
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<div class="text-4xl font-extrabold tracking-tight">
|
<div class="text-4xl font-extrabold tracking-tight">
|
||||||
<span>{{ title }}</span>
|
<span>{{ title }}</span>
|
||||||
<span
|
|
||||||
><button mat-icon-button (click)="__onClickLevel()">
|
|
||||||
<mat-icon [svgIcon]="'alpha-l-box-outline'"></mat-icon></button
|
|
||||||
></span>
|
|
||||||
</div>
|
</div>
|
||||||
<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">
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
|
@ -65,23 +61,32 @@
|
||||||
</div>
|
</div>
|
||||||
<hr style="margin: 7px 0px" />
|
<hr style="margin: 7px 0px" />
|
||||||
<div
|
<div
|
||||||
*ngIf="__isLevelOpened"
|
*ngIf="__checkedUsers.length > 0"
|
||||||
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"
|
class="relative flex flex-col sm:flex-row flex-0 sm:items-center py-4 px-6 md:px-8 border-b"
|
||||||
>
|
>
|
||||||
<div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0">
|
<button mat-button [matMenuTriggerFor]="menuChangeMemberState">
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
상태 변경
|
||||||
LV1
|
|
||||||
</button>
|
</button>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
<mat-menu #menuChangeMemberState="matMenu">
|
||||||
LV2
|
<button mat-menu-item>정상</button>
|
||||||
|
<button mat-menu-item>대기</button>
|
||||||
|
<button mat-menu-item>탈퇴</button>
|
||||||
|
<button mat-menu-item>휴면</button>
|
||||||
|
<button mat-menu-item>블랙</button>
|
||||||
|
<button mat-menu-item>정지</button>
|
||||||
|
</mat-menu>
|
||||||
|
<button mat-button [matMenuTriggerFor]="menuChangeMemberLevel">
|
||||||
|
레벨 변경
|
||||||
</button>
|
</button>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
<mat-menu #menuChangeMemberLevel="matMenu">
|
||||||
LV3
|
<ng-container *ngIf="listMemberLevels$ | async as memberLevels">
|
||||||
|
<ng-container *ngFor="let ml of memberLevels; let i = index">
|
||||||
|
<button mat-menu-item (click)="__onClickChangeLevel(ml.getId())">
|
||||||
|
{{ ml.getName() }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
</ng-container>
|
||||||
LV4
|
</ng-container>
|
||||||
</button>
|
</mat-menu>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-auto overflow-hidden">
|
<div class="flex flex-auto overflow-hidden">
|
||||||
<!-- Products list -->
|
<!-- Products list -->
|
||||||
|
@ -97,6 +102,11 @@
|
||||||
matSortDisableClear
|
matSortDisableClear
|
||||||
class="partner-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"
|
class="partner-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 style="text-align: center">
|
||||||
|
<mat-checkbox
|
||||||
|
(change)="__onChangeChkUsersAll($event)"
|
||||||
|
></mat-checkbox>
|
||||||
|
</div>
|
||||||
<div class="hidden lg:block">
|
<div class="hidden lg:block">
|
||||||
관리
|
관리
|
||||||
<hr style="margin: 7px 0px" />
|
<hr style="margin: 7px 0px" />
|
||||||
|
@ -138,6 +148,13 @@
|
||||||
<div
|
<div
|
||||||
class="partner-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
|
class="partner-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
|
||||||
>
|
>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<mat-checkbox
|
||||||
|
#chkUsers
|
||||||
|
[value]="partner.getId()"
|
||||||
|
(change)="__onChangeChkUsers($event)"
|
||||||
|
></mat-checkbox>
|
||||||
|
</div>
|
||||||
<div class="hidden lg:block">
|
<div class="hidden lg:block">
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -5,7 +5,9 @@ import {
|
||||||
Component,
|
Component,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
|
QueryList,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
|
ViewChildren,
|
||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||||
|
@ -47,13 +49,17 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SiteService } from 'app/modules/polyglot/site/services/site.service';
|
import { SiteService } from 'app/modules/polyglot/site/services/site.service';
|
||||||
import { Site } from 'app/modules/proto/models/site_pb';
|
import { Site } from 'app/modules/proto/models/site_pb';
|
||||||
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
||||||
import { MemberModel } from 'app/modules/proto/models/member_pb';
|
import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb';
|
||||||
import {
|
import {
|
||||||
ListMembersRequest,
|
ListMembersRequest,
|
||||||
ListMembersResponse,
|
ListMembersResponse,
|
||||||
} from 'app/modules/proto/c2se/member_pb';
|
} from 'app/modules/proto/c2se/member_pb';
|
||||||
|
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
|
||||||
|
import { ListMemberLevelsResponse } from 'app/modules/proto/c2se/member_level_pb';
|
||||||
|
import { MemberLevel } from 'app/modules/proto/models/member_level_pb';
|
||||||
import { Pagination } from 'app/modules/proto/protobuf/pagination_pb';
|
import { Pagination } from 'app/modules/proto/protobuf/pagination_pb';
|
||||||
import { VendorService } from 'app/modules/polyglot/api/services/vendor.service';
|
import { VendorService } from 'app/modules/polyglot/api/services/vendor.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'partner-list',
|
selector: 'partner-list',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
|
@ -92,9 +98,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||||
@ViewChild(MatSort) private _sort!: MatSort;
|
@ViewChild(MatSort) private _sort!: MatSort;
|
||||||
|
|
||||||
/* partners$!: Observable<Partner[] | undefined>; */
|
@ViewChildren('chkUsers') chkUsers!: QueryList<MatCheckbox>;
|
||||||
|
|
||||||
listPartner$!: Observable<MemberModel[] | undefined>;
|
listPartner$!: Observable<MemberModel[] | undefined>;
|
||||||
|
listMemberLevels$!: Observable<MemberLevel[] | undefined>;
|
||||||
|
|
||||||
__isLevelOpened = false;
|
__isLevelOpened = false;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
@ -103,6 +110,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
pagination?: PartnerPagination;
|
pagination?: PartnerPagination;
|
||||||
|
|
||||||
__members: MemberModel[] = [];
|
__members: MemberModel[] = [];
|
||||||
|
__checkedUsers: string[] = [];
|
||||||
|
|
||||||
title: string = '';
|
title: string = '';
|
||||||
btnTitle: string = '';
|
btnTitle: string = '';
|
||||||
|
@ -189,7 +197,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
|
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
|
||||||
this.listPartner$ = of(listMemberResult.getMembersList());
|
this.listPartner$ = of(listMemberResult.getMembersList());
|
||||||
|
|
||||||
/* console.log('dddd', listMemberResult.getMembersList()); */
|
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
|
||||||
|
data['listMemberLevels'];
|
||||||
|
this.listMemberLevels$ = of(listMemberLevelsResult.getMemberLevelsList());
|
||||||
|
|
||||||
// Mark for check
|
// Mark for check
|
||||||
this._changeDetectorRef.markForCheck();
|
this._changeDetectorRef.markForCheck();
|
||||||
|
@ -295,14 +305,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
*/
|
*/
|
||||||
__toggleDetails(productId: string): void {}
|
__toggleDetails(productId: string): void {}
|
||||||
|
|
||||||
/**
|
|
||||||
* toggle the search
|
|
||||||
* Used in 'bar'
|
|
||||||
*/
|
|
||||||
__onClickLevel(): void {
|
|
||||||
this.__isLevelOpened = !this.__isLevelOpened;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Track by function for ngFor loops
|
* Track by function for ngFor loops
|
||||||
*
|
*
|
||||||
|
@ -417,4 +419,62 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
this.signoutBlockConfigForm.value
|
this.signoutBlockConfigForm.value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__onChangeChkUsersAll(event: MatCheckboxChange): void {
|
||||||
|
let checked = event.checked;
|
||||||
|
this.chkUsers.forEach((c, i) => {
|
||||||
|
c.checked = checked;
|
||||||
|
});
|
||||||
|
this.__updateCheckedUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
__onChangeChkUsers(event: MatCheckboxChange): void {
|
||||||
|
this.__updateCheckedUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
__updateCheckedUsers(): void {
|
||||||
|
this.__checkedUsers = [];
|
||||||
|
this.chkUsers.forEach((c, i) => {
|
||||||
|
if (c.checked) {
|
||||||
|
this.__checkedUsers.push(c.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
__onClickChangeLevel(member_level_id: string): void {
|
||||||
|
console.log('member_level_id', member_level_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
__getMemberState(member: MemberModel): string {
|
||||||
|
const state = member.getState();
|
||||||
|
let resultStr = '';
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
case MemberState.NONE:
|
||||||
|
resultStr = '없음';
|
||||||
|
break;
|
||||||
|
case MemberState.NORMAL:
|
||||||
|
resultStr = '정상';
|
||||||
|
break;
|
||||||
|
case MemberState.PENDING:
|
||||||
|
resultStr = '대기';
|
||||||
|
break;
|
||||||
|
case MemberState.WITHDRAWAL:
|
||||||
|
resultStr = '탈퇴';
|
||||||
|
break;
|
||||||
|
case MemberState.DORMANCY:
|
||||||
|
resultStr = '휴면';
|
||||||
|
break;
|
||||||
|
case MemberState.BLACKLIST:
|
||||||
|
resultStr = '블랙리스트';
|
||||||
|
break;
|
||||||
|
case MemberState.SUSPENDED:
|
||||||
|
resultStr = '정지';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { MatSortModule } from '@angular/material/sort';
|
||||||
import { MatSelectModule } from '@angular/material/select';
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { MatGridListModule } from '@angular/material/grid-list';
|
import { MatGridListModule } from '@angular/material/grid-list';
|
||||||
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { MatRadioModule } from '@angular/material/radio';
|
import { MatRadioModule } from '@angular/material/radio';
|
||||||
import { MatDividerModule } from '@angular/material/divider';
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
|
@ -49,6 +50,7 @@ import { FuseAlertModule } from '@fuse/components/alert';
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatGridListModule,
|
MatGridListModule,
|
||||||
|
MatCheckboxModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatRadioModule,
|
MatRadioModule,
|
||||||
MatDividerModule,
|
MatDividerModule,
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
PartnerListResolver,
|
PartnerListResolver,
|
||||||
PartnersResolver,
|
PartnersResolver,
|
||||||
} from './resolvers/partner.resolver';
|
} from './resolvers/partner.resolver';
|
||||||
|
import { ListMemberLevelsResolver } from '../user/resolvers/member-level.resolver';
|
||||||
|
|
||||||
export const partnerRoutes: Route[] = [
|
export const partnerRoutes: Route[] = [
|
||||||
// {
|
// {
|
||||||
|
@ -23,6 +24,7 @@ export const partnerRoutes: Route[] = [
|
||||||
component: ListComponent,
|
component: ListComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
listPartner: PartnerListResolver,
|
listPartner: PartnerListResolver,
|
||||||
|
listMemberLevels: ListMemberLevelsResolver,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,11 +22,6 @@
|
||||||
<mat-icon [svgIcon]="'iconsmind:file_excel'"></mat-icon>
|
<mat-icon [svgIcon]="'iconsmind:file_excel'"></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
|
||||||
<button mat-icon-button (click)="__onClickLevel()">
|
|
||||||
<mat-icon [svgIcon]="'alpha-l-box-outline'"></mat-icon>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
|
@ -193,7 +188,7 @@
|
||||||
<!-- actions -->
|
<!-- actions -->
|
||||||
<div
|
<div
|
||||||
*ngIf="__checkedUsers.length > 0"
|
*ngIf="__checkedUsers.length > 0"
|
||||||
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"
|
class="relative flex flex-col sm:flex-row flex-0 sm:items-center py-4 px-6 md:px-8 border-b"
|
||||||
>
|
>
|
||||||
<button mat-button [matMenuTriggerFor]="menuChangeMemberState">
|
<button mat-button [matMenuTriggerFor]="menuChangeMemberState">
|
||||||
상태 변경
|
상태 변경
|
||||||
|
@ -206,25 +201,18 @@
|
||||||
<button mat-menu-item>블랙</button>
|
<button mat-menu-item>블랙</button>
|
||||||
<button mat-menu-item>정지</button>
|
<button mat-menu-item>정지</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
</div>
|
<button mat-button [matMenuTriggerFor]="menuChangeMemberLevel">
|
||||||
<div
|
레벨 변경
|
||||||
*ngIf="__isLevelOpened"
|
|
||||||
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"
|
|
||||||
>
|
|
||||||
<div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0">
|
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
|
||||||
LV1
|
|
||||||
</button>
|
</button>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
<mat-menu #menuChangeMemberLevel="matMenu">
|
||||||
LV2
|
<ng-container *ngIf="listMemberLevels$ | async as memberLevels">
|
||||||
|
<ng-container *ngFor="let ml of memberLevels; let i = index">
|
||||||
|
<button mat-menu-item (click)="__onClickChangeLevel(ml.getId())">
|
||||||
|
{{ ml.getName() }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
</ng-container>
|
||||||
LV3
|
</ng-container>
|
||||||
</button>
|
</mat-menu>
|
||||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
|
||||||
LV4
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Main -->
|
<!-- Main -->
|
||||||
<div class="flex flex-auto overflow-hidden">
|
<div class="flex flex-auto overflow-hidden">
|
||||||
|
|
|
@ -91,7 +91,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
listMemberLevels$!: Observable<MemberLevel[] | undefined>;
|
listMemberLevels$!: Observable<MemberLevel[] | undefined>;
|
||||||
|
|
||||||
__isSearchOpened = false;
|
__isSearchOpened = false;
|
||||||
__isLevelOpened = false;
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
searchInputControl = new FormControl();
|
searchInputControl = new FormControl();
|
||||||
selectedUser?: User;
|
selectedUser?: User;
|
||||||
|
@ -248,14 +247,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
this.__isSearchOpened = !this.__isSearchOpened;
|
this.__isSearchOpened = !this.__isSearchOpened;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* toggle the search
|
|
||||||
* Used in 'bar'
|
|
||||||
*/
|
|
||||||
__onClickLevel(): void {
|
|
||||||
this.__isLevelOpened = !this.__isLevelOpened;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Track by function for ngFor loops
|
* Track by function for ngFor loops
|
||||||
*
|
*
|
||||||
|
@ -388,6 +379,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
__onMatSortChangeUsers(sort: Sort): void {}
|
__onMatSortChangeUsers(sort: Sort): void {}
|
||||||
|
|
||||||
|
__onClickChangeLevel(member_level_id: string): void {
|
||||||
|
console.log('member_level_id', member_level_id);
|
||||||
|
}
|
||||||
|
|
||||||
__getMemberState(member: MemberModel): string {
|
__getMemberState(member: MemberModel): string {
|
||||||
const state = member.getState();
|
const state = member.getState();
|
||||||
let resultStr = '';
|
let resultStr = '';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user