site.resolver 위치 변경

This commit is contained in:
Park Byung Eun 2022-08-25 07:15:50 +00:00
parent 3b71dd1fe3
commit 9762e257e8
4 changed files with 15 additions and 40 deletions

View File

@ -61,6 +61,7 @@ import {
import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service'; import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service';
import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb'; import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb';
import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb'; import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb';
import { ListSitesResponse } from 'app/modules/proto/c2se/site_pb';
@Component({ @Component({
selector: 'user-view', selector: 'user-view',
@ -291,39 +292,21 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
this._siteService.listSites().then((result) => {
this.sites = result
.getSitesList()
.filter((v) => !!v.getShow() && !!v.getCanUse());
this.memberDefaultForm
.get('siteUrl')
?.setValue(this.currentMember?.getSite()?.getUrl());
this._changeDetectorRef.markForCheck();
});
/* this._bankService.listBanks().then((result) => {
this.memberBankForm.get('bankName')?.value;
this.memberBankForm.patchValue({
bankName: this.currentMember?.getBankAccount()?.getBank()?.getName(),
accountNumber: this.currentMember?.getBankAccount()?.getAccountNumber(),
accountHolder: this.currentMember?.getBankAccount()?.getName(),
description: this.currentMember?.getBankAccount()?.getMemo(),
});
this._changeDetectorRef.markForCheck();
this.banks = result.getBanksList();
}); */
this._activatedRoute.data.subscribe((data) => { this._activatedRoute.data.subscribe((data) => {
let member: GetMemberResponse.Result = data['member']; let member: GetMemberResponse.Result = data['member'];
this.currentMember = member.getMember(); this.currentMember = member.getMember();
console.log(this.currentMember?.getState()); let listMemberLevelsResult: ListMemberLevelsResponse.Result =
data['listMemberLevels'];
this.memberLevels = listMemberLevelsResult.getMemberLevelsList();
let listbanksResult: ListBanksResponse.Result = data['listMemberBanks'];
this.banks = listbanksResult.getBanksList();
let listSitesResult: ListSitesResponse.Result = data['listSites'];
this.sites = listSitesResult.getSitesList();
/* console.log('dddd', listMemberResult.getMembersList()); */
this.memberDefaultForm.patchValue({ this.memberDefaultForm.patchValue({
username: this.currentMember?.getUsername(), username: this.currentMember?.getUsername(),
signinPw: '', signinPw: '',
@ -332,18 +315,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
levelName: this.currentMember?.getMemberLevel()?.getName(), levelName: this.currentMember?.getMemberLevel()?.getName(),
state: this.currentMember?.getState(), state: this.currentMember?.getState(),
nickname: this.currentMember?.getNickname(), nickname: this.currentMember?.getNickname(),
siteUrl: this.currentMember?.getSite()?.getUrl(),
}); });
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
data['listMemberLevels'];
this.memberLevels = listMemberLevelsResult.getMemberLevelsList();
let listMemberClassesResult: ListMemberClassesResponse.Result =
data['listMemberClasses'];
let listbanksResult: ListBanksResponse.Result = data['listMemberBanks'];
this.banks = listbanksResult.getBanksList();
this.memberBankForm.patchValue({ this.memberBankForm.patchValue({
bankName: this.currentMember?.getBankAccount()?.getBank()?.getName(), bankName: this.currentMember?.getBankAccount()?.getBank()?.getName(),
accountNumber: this.currentMember?.getBankAccount()?.getAccountNumber(), accountNumber: this.currentMember?.getBankAccount()?.getAccountNumber(),

View File

@ -2,6 +2,7 @@ import { Route } from '@angular/router';
import { ListComponent } from 'app/modules/admin/member/user/components/list.component'; import { ListComponent } from 'app/modules/admin/member/user/components/list.component';
import { ViewComponent } from 'app/modules/admin/member/user/components/view.component'; import { ViewComponent } from 'app/modules/admin/member/user/components/view.component';
import { SiteResolver } from 'app/shared/resolvers/site.resolver';
import { ListMemberBanksResolver } from './resolvers/member-bank.resolver'; import { ListMemberBanksResolver } from './resolvers/member-bank.resolver';
import { ListMemberClassesResolver } from './resolvers/member-class.resolver'; import { ListMemberClassesResolver } from './resolvers/member-class.resolver';
import { ListMemberLevelsResolver } from './resolvers/member-level.resolver'; import { ListMemberLevelsResolver } from './resolvers/member-level.resolver';
@ -16,7 +17,6 @@ export const userRoutes: Route[] = [
listmembers: ListMemberResolver, listmembers: ListMemberResolver,
listMemberClasses: ListMemberClassesResolver, listMemberClasses: ListMemberClassesResolver,
listMemberLevels: ListMemberLevelsResolver, listMemberLevels: ListMemberLevelsResolver,
listMemberBanks: ListMemberBanksResolver,
}, },
}, },
{ {
@ -25,6 +25,8 @@ export const userRoutes: Route[] = [
resolve: { resolve: {
member: MemberResolver, member: MemberResolver,
listMemberLevels: ListMemberLevelsResolver, listMemberLevels: ListMemberLevelsResolver,
listMemberBanks: ListMemberBanksResolver,
listSites: SiteResolver,
}, },
}, },
]; ];

View File

@ -1,9 +1,8 @@
import { Route } from '@angular/router'; import { Route } from '@angular/router';
import { SiteResolver } from 'app/shared/resolvers/site.resolver';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { SiteResolver } from './resolvers/site.resolver';
export const domainRoutes: Route[] = [ export const domainRoutes: Route[] = [
{ {
path: '', path: '',