From 84ee61beea6067f62e7aff55d513bcd61388a0e2 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 12 Aug 2022 07:16:28 +0000 Subject: [PATCH 1/3] dialog bug fixed --- .../partner/components/list.component.html | 2 +- .../partner/components/list.component.ts | 9 +++-- .../compose/regist-compose.component.html | 11 +++--- .../compose/regist-compose.component.ts | 34 +++++-------------- .../admin/member/partner/partner.module.ts | 2 ++ 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index cdf7201..53e99bc 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -167,7 +167,7 @@ mat-flat-button class="bet-mat-small-8" [color]="'primary'" - (click)="__onClickRegist($event)" + (click)="__onClickRegist($event, partner)" > 대본등록 diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index 52d8ea3..732f5ec 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -14,13 +14,16 @@ import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { debounceTime, + delay, map, merge, Observable, of, + startWith, Subject, switchMap, takeUntil, + timer, } from 'rxjs'; import { fuseAnimations } from '@fuse/animations'; import { FuseConfirmationService } from '@fuse/services/confirmation'; @@ -158,7 +161,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { }); // Mark for check - this._changeDetectorRef.markForCheck(); + this._changeDetectorRef.detectChanges(); // If the partner changes the sort order... this._sort.sortChange @@ -234,9 +237,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { return item.id || index; } - __onClickRegist(event: MouseEvent): void { + __onClickRegist(event: MouseEvent, partner: MemberModel): void { const dialogRef = this._matDialog.open(RegistComposeComponent, { - data: { title: '대본', parentId: 'kgon2', sites: this.sites }, + data: { title: '대본 등록하기', parent: partner, sites: this.sites }, }); dialogRef.afterClosed().subscribe((result) => { diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.html b/src/app/modules/admin/member/partner/compose/regist-compose.component.html index d8c9e7a..bc2548e 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.html +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.html @@ -25,25 +25,26 @@ - + - + diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts index 6c60772..74d4491 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts @@ -10,10 +10,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; import { Site } from 'app/modules/protobuf/models/domain/site_pb'; +import { MemberModel } from 'app/modules/protobuf/models/member/member_pb'; export interface RegistComposeData { title: string; - parentId: string; + parent: MemberModel; sites: Site[]; } export interface RegistComposeResult { @@ -56,10 +57,7 @@ export class RegistComposeComponent implements OnInit { private _identityService: IdentityService, private _changeDetectorRef: ChangeDetectorRef ) { - this.data.sites.map((v) => { - const a = v.toObject(); - this.sites.push(a); - }); + this.data.sites.forEach((v) => console.log(v.getUrl())); } // ----------------------------------------------------------------------------------------------------- @@ -72,7 +70,7 @@ export class RegistComposeComponent implements OnInit { ngOnInit(): void { // Create the form this.composeForm = this._formBuilder.group({ - partnerId: [{ value: this.data.parentId, disabled: true }], + partnerId: [{ value: this.data.parent.getUsername(), disabled: true }], siteName: ['', [Validators.required]], signinId: ['', [Validators.required]], password: ['', [Validators.required]], @@ -114,7 +112,9 @@ export class RegistComposeComponent implements OnInit { /** * Send the message */ - send(): void {} + send(): void { + console.log(this.composeForm.value); + } __checkSigninId(event: FocusEvent): void { const signinId = this.composeForm.get('signinId')?.value; @@ -127,7 +127,7 @@ export class RegistComposeComponent implements OnInit { .get('signinId') ?.setErrors({ signinIdDuplicate: true }); } - this._changeDetectorRef.markForCheck(); + // this._changeDetectorRef.markForCheck(); }); } @@ -142,23 +142,7 @@ export class RegistComposeComponent implements OnInit { .get('nickname') ?.setErrors({ nicknameDuplicate: true }); } - this._changeDetectorRef.markForCheck(); + // this._changeDetectorRef.markForCheck(); }); } - - // checkSameName(): ValidatorFn { - // return (control: AbstractControl): { [key: string]: any } | null => { - // if ( - // !control || - // !control.value || - // !this.groupList || - // 0 === this.groupList.length - // ) { - // return null; - // } - // const v = (control.value as string).trim(); - // const ban = -1 < this.groupList.findIndex((g) => g.name === v); - // return ban ? { groupNameSamed: { value: control.value } } : null; - // }; - // } } diff --git a/src/app/modules/admin/member/partner/partner.module.ts b/src/app/modules/admin/member/partner/partner.module.ts index 1f83f7d..70ee63b 100644 --- a/src/app/modules/admin/member/partner/partner.module.ts +++ b/src/app/modules/admin/member/partner/partner.module.ts @@ -24,6 +24,7 @@ import { COMPONENTS } from './components'; import { COMPOSE } from './compose'; import { partnerRoutes } from './partner.routing'; +import { MatDialogModule } from '@angular/material/dialog'; @NgModule({ declarations: [COMPONENTS, COMPOSE], @@ -35,6 +36,7 @@ import { partnerRoutes } from './partner.routing'; ReactiveFormsModule, FormsModule, + MatDialogModule, MatButtonModule, MatFormFieldModule, MatIconModule, From f841e1ad8bfcfe026efa5813daf969ddc66cb266 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Fri, 12 Aug 2022 07:41:33 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=EC=A7=84=ED=96=89=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partner/components/list.component.html | 4 +- .../partner/components/list.component.ts | 10 ++ .../compose/cash-compose.component.html | 88 +++++++++++++++++ .../partner/compose/cash-compose.component.ts | 94 +++++++++++++++++++ .../admin/member/partner/compose/index.ts | 3 +- .../admin/member/partner/partner.module.ts | 2 + 6 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 src/app/modules/admin/member/partner/compose/cash-compose.component.html create mode 100644 src/app/modules/admin/member/partner/compose/cash-compose.component.ts diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index d4e86c4..cdf3d29 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -90,7 +90,9 @@ 관리 - + diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index a828fd2..0324833 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -34,6 +34,7 @@ import { PartnerPagination } from '../models/partner-pagination'; import { PartnerService } from '../services/partner.service'; import { Router } from '@angular/router'; import { RegistComposeComponent } from '../compose/regist-compose.component'; +import { CashComposeComponent } from '../compose/cash-compose.component'; import { MatDialog } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; @@ -226,6 +227,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { console.log('Compose dialog was closed!'); }); } + __onClickCash(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CashComposeComponent, { + data: { price: '', memo: '' }, + }); + + dialogRef.afterClosed().subscribe((result) => { + console.log('Compose dialog was closed!'); + }); + } __getRateTooltop(): string { const tempRate = 0; diff --git a/src/app/modules/admin/member/partner/compose/cash-compose.component.html b/src/app/modules/admin/member/partner/compose/cash-compose.component.html new file mode 100644 index 0000000..603d2bb --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/cash-compose.component.html @@ -0,0 +1,88 @@ +
+ +
+
캐쉬 충환전
+ +
+ + +
+
+ 캐쉬구분 + + + 캐쉬 + + +
+
+ 추가/삭제 + + + 지급 + + + 회수 + + +
+ + + 입력금액 + + + + + + + 메모 + + + + + + + +
+
+ + + + +
+
+
+
diff --git a/src/app/modules/admin/member/partner/compose/cash-compose.component.ts b/src/app/modules/admin/member/partner/compose/cash-compose.component.ts new file mode 100644 index 0000000..3771b23 --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/cash-compose.component.ts @@ -0,0 +1,94 @@ +import { + ChangeDetectorRef, + Component, + Inject, + OnInit, + ViewEncapsulation, +} from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; +import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; +import { Site } from 'app/modules/protobuf/models/domain/site_pb'; + +export interface CashComposeData { + price: string; + memo: string; +} +export interface RegistComposeResult { + price: string; + memo: string; +} + +@Component({ + selector: 'app-cash-compose', + templateUrl: './cash-compose.component.html', + encapsulation: ViewEncapsulation.None, +}) +export class CashComposeComponent implements OnInit { + composeForm!: FormGroup; + sites: any[] = []; + // quillModules: any = { + // toolbar: [ + // ['bold', 'italic', 'underline'], + // [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], + // ['clean'], + // ], + // }; + + /** + * Constructor + */ + constructor( + public matDialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: CashComposeData, + private _formBuilder: FormBuilder, + private _identityService: IdentityService, + private _changeDetectorRef: ChangeDetectorRef + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + // Create the form + this.composeForm = this._formBuilder.group({ + price: ['', [Validators.required]], + memo: ['', [Validators.required]], + }); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Save and close + */ + saveAndClose(): void { + // Save the message as a draft + this.saveAsDraft(); + + // Close the dialog + this.matDialogRef.close(); + } + + /** + * Discard the message + */ + discard(): void {} + + /** + * Save the message as a draft + */ + saveAsDraft(): void {} + + /** + * Send the message + */ + send(): void {} +} diff --git a/src/app/modules/admin/member/partner/compose/index.ts b/src/app/modules/admin/member/partner/compose/index.ts index 593e5ce..5ebd8ef 100644 --- a/src/app/modules/admin/member/partner/compose/index.ts +++ b/src/app/modules/admin/member/partner/compose/index.ts @@ -1,3 +1,4 @@ import { RegistComposeComponent } from './regist-compose.component'; +import { CashComposeComponent } from './cash-compose.component'; -export const COMPOSE = [RegistComposeComponent]; +export const COMPOSE = [RegistComposeComponent, CashComposeComponent]; diff --git a/src/app/modules/admin/member/partner/partner.module.ts b/src/app/modules/admin/member/partner/partner.module.ts index 1f83f7d..2c56246 100644 --- a/src/app/modules/admin/member/partner/partner.module.ts +++ b/src/app/modules/admin/member/partner/partner.module.ts @@ -15,6 +15,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatMenuModule } from '@angular/material/menu'; +import { MatRadioModule } from '@angular/material/radio'; import { TranslocoModule } from '@ngneat/transloco'; @@ -47,6 +48,7 @@ import { partnerRoutes } from './partner.routing'; MatTooltipModule, MatGridListModule, MatMenuModule, + MatRadioModule, ], }) export class PartnerModule {} From 27caf1469f73a3f0a95321ca6ea94a227af2c36c Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Fri, 12 Aug 2022 07:56:00 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=EA=B4=80=EB=A6=AC-=EB=B3=B4=EC=9C=A0?= =?UTF-8?q?=EA=B8=88=EC=A7=80=EA=B8=89=ED=9A=8C=EC=88=98=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/member/partner/compose/cash-compose.component.ts | 2 +- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/modules/admin/member/partner/compose/cash-compose.component.ts b/src/app/modules/admin/member/partner/compose/cash-compose.component.ts index 3771b23..da7965b 100644 --- a/src/app/modules/admin/member/partner/compose/cash-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/cash-compose.component.ts @@ -15,7 +15,7 @@ export interface CashComposeData { price: string; memo: string; } -export interface RegistComposeResult { +export interface CashComposeResult { price: string; memo: string; } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 16298ab..b05c7e4 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,7 +4,7 @@ export const environment: Environment = { production: true, nats: { connectionOptions: { - servers: ['ws://192.168.50.200:8088'], + servers: ['ws://192.168.50.208:8088'], }, }, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ed141e9..f38e7dd 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -8,7 +8,7 @@ export const environment: Environment = { production: false, nats: { connectionOptions: { - servers: ['ws://192.168.50.200:8088'], + servers: ['ws://192.168.50.208:8088'], }, }, };