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..ba78492 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 @@ 관리 - + @@ -167,7 +169,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..584b05c 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'; @@ -30,6 +33,7 @@ import { PartnerPagination } from '../models/partner-pagination'; import { PartnerService } from '../services/partner.service'; import { ActivatedRoute, 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'; @@ -158,7 +162,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 +238,18 @@ 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) => { + console.log('Compose dialog was closed!'); + }); + } + __onClickCash(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CashComposeComponent, { + data: { price: '', memo: '' }, }); dialogRef.afterClosed().subscribe((result) => { 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..da7965b --- /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 CashComposeResult { + 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/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..6a10331 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'; @@ -24,6 +25,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 +37,7 @@ import { partnerRoutes } from './partner.routing'; ReactiveFormsModule, FormsModule, + MatDialogModule, MatButtonModule, MatFormFieldModule, MatIconModule, @@ -47,6 +50,7 @@ import { partnerRoutes } from './partner.routing'; MatTooltipModule, MatGridListModule, MatMenuModule, + MatRadioModule, ], }) export class PartnerModule {} 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'], }, }, };