This commit is contained in:
Park Byung Eun 2022-08-15 07:58:12 +00:00
parent 3eda379160
commit b1d1889210
2 changed files with 88 additions and 34 deletions

View File

@ -111,9 +111,9 @@
<mat-form-field class="w-1/3 pr-2">
<mat-label>아이디</mat-label>
<input
id="signinId"
id="username"
matInput
[formControlName]="'signinId'"
[formControlName]="'username'"
/>
</mat-form-field>
<mat-form-field class="w-1/3 pr-2">
@ -155,9 +155,9 @@
<mat-form-field class="w-1/3 pr-2">
<mat-label>핸드폰</mat-label>
<input
id="phoneNumber"
id="mobilePhoneNumber"
matInput
[formControlName]="'phoneNumber'"
[formControlName]="'mobilePhoneNumber'"
/>
</mat-form-field>
</div>
@ -166,17 +166,22 @@
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>레벨</mat-label>
<mat-select id="level" [formControlName]="'level'">
<!-- <ng-container *ngFor="let category of categories"> -->
<mat-option value="level">
cartegory option
<mat-select
[formControlName]="'levelId'"
placeholder="레벨 선택"
>
<mat-option
*ngFor="let level of memberLevels"
[value]="'level.getId()'"
>
{{ level.getName() }}
</mat-option>
<!-- </ng-container> -->
<!-- <mat-option [value]="'0'"> 국민은행 </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field class="w-1/3 pr-2">
<mat-label>상태</mat-label>
<mat-select id="state" [formControlName]="'status'">
<mat-select id="state" [formControlName]="'state'">
<!-- <ng-container *ngFor="let brand of brands"> -->
<mat-option value="brand.id">
brand option
@ -200,14 +205,28 @@
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>은행명</mat-label>
<mat-select [formControlName]="'bankname'">
<!-- <ng-container *ngFor="let brand of brands"> -->
<mat-option value="brand.id">
brand option
<mat-select
[formControlName]="'bankId'"
placeholder="은행 선택"
>
<mat-option
*ngFor="let bank of banks"
[value]="bank.getId()"
>
{{ bank.getName() }}
</mat-option>
<!-- </ng-container> -->
<!-- <mat-option [value]="'0'"> 국민은행 </mat-option> -->
</mat-select>
<!-- <mat-error
*ngIf="
composeForm.get('bankId')?.hasError('required')
"
>
은행명은 필수 입력입니다.
</mat-error> -->
</mat-form-field>
<mat-form-field class="w-1/3 pr-2">
<mat-label>계좌번호</mat-label>
<input
@ -257,14 +276,23 @@
<div class="flex">
<mat-form-field class="w-2/3 pr-2">
<mat-label>사이트변경</mat-label>
<mat-select [formControlName]="'changeSite'">
<!-- <ng-container *ngFor="let vendor of vendors"> -->
<mat-option value="vendor.id">
vendor option
<mat-select
[formControlName]="'changeSite'"
placeholder="사이트 선택"
>
<mat-option
*ngFor="let site of sites"
[value]="site.getId()"
>
{{ site.getUrl() }}
</mat-option>
<!-- </ng-container> -->
</mat-select>
<!-- <mat-error *ngIf="composeForm.get('siteId')?.hasError('required')">
사이트명은 필수 입력입니다.
</mat-error> -->
</mat-form-field>
<mat-form-field class="w-1/3 pr-2">
<mat-label>추천횟수</mat-label>
<input

View File

@ -35,6 +35,12 @@ import { ActivatedRoute } from '@angular/router';
import { GetMemberResponse } from 'app/modules/proto/c2se/member_pb';
import { MemberModel } from 'app/modules/proto/models/member_pb';
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
import { MemberLevelService } from 'app/modules/polyglot/member_level/services/member_level.service';
import { BankService } from 'app/modules/polyglot/bank/services/bank.service';
import { MemberLevel } from 'app/modules/proto/models/member_level_pb';
import { Bank } from 'app/modules/proto/models/bank_pb';
import { SiteService } from 'app/modules/polyglot/site/services/site.service';
import { Site } from 'app/modules/proto/models/site_pb';
@Component({
selector: 'user-view',
@ -73,6 +79,10 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
/* selectedUser?: User; */
selectedUser?: MemberModel;
memberLevels!: MemberLevel[];
banks!: Bank[];
sites!: Site[];
private _unsubscribeAll: Subject<any> = new Subject<any>();
/**
@ -84,7 +94,10 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder,
private _userService: UserService,
private _memberService: MemberService
private _memberService: MemberService,
private _memberLevelService: MemberLevelService,
private _bankService: BankService,
private _siteService: SiteService
) {}
// -----------------------------------------------------------------------------------------------------
@ -97,18 +110,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
ngOnInit(): void {
this.memberViewForm = this._formBuilder.group({
id: [''],
signinId: [{ value: '', disabled: true }],
username: [{ value: '', disabled: true }],
signinPw: [{ value: '' }],
exchangePw: [''],
description: [''],
tags: [[]],
nickname: [{ value: '', disabled: true }],
ownCash: [''],
phoneNumber: [''],
mobilePhoneNumber: [''],
level: [''],
status: [''],
state: [''],
isExcahngeMoney: [''],
bankname: [''],
bankId: [''],
accountNumber: [''],
accountHolder: [''],
comp: [''],
@ -143,6 +156,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
/* this.user$ = this._userService.user$; */
this._siteService
.listSites()
.then((result) => (this.sites = result.getSitesList()));
this._memberLevelService.listMemberLevels().then((result) => {
this.memberLevels = result
.getMemberLevelsList()
.filter((v) => !!v.getShow());
});
this._bankService
.listBanks()
.then((result) => (this.banks = result.getBanksList()));
this._activatedRoute.data.subscribe((data) => {
let member: GetMemberResponse.Result = data['member'];
@ -150,13 +175,14 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
/* console.log('dddd', listMemberResult.getMembersList()); */
this.memberViewForm.patchValue({
signinId: this.selectedUser?.getUsername(),
signinPw: '1234',
exchangePw: '1234',
phoneNumber: this.selectedUser?.getMobilePhoneNumber(),
level: this.selectedUser?.getMemberLevel()?.getName(),
status: this.selectedUser?.getState(),
username: this.selectedUser?.getUsername(),
signinPw: '',
exchangePw: '',
mobilePhoneNumber: this.selectedUser?.getMobilePhoneNumber(),
levelId: this.selectedUser?.getMemberLevel()?.getId(),
state: this.selectedUser?.getState(),
nickname: this.selectedUser?.getNickname(),
bankId: this.selectedUser?.getBankAccount()?.getId(),
});
// Mark for check
this._changeDetectorRef.markForCheck();
@ -210,12 +236,12 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
__modifyMember(): void {
const valueForm = this.memberViewForm.value;
console.log('v: ', valueForm);
this._memberService.updateMember(
/* this._memberService.updateMember(
this.selectedUser!.getId(),
this.selectedUser!.getSite()!.getId(),
this.selectedUser!.getMemberLevel()!.getId(),
'beteran',
valueForm.phoneNumber
);
valueForm.mobilePhoneNumber
); */
}
}