diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts index 5c7ed101..d9b46fc3 100644 --- a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts @@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { SFComponent, SFSchema, SFValue } from '@delon/form'; import { ModalHelper } from '@delon/theme'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; +import { map } from 'rxjs/operators'; import { PartnerListService } from '../../services/partner-list.service'; @Component({ @@ -22,6 +23,7 @@ export class PartnerAuditModalComponent implements OnInit { ngOnInit(): void { console.log(this.info); this.initSF(this.info); + // asyncData: () => this.service.getChannel(), if(this.info.channelId) { const value = [{ @@ -30,14 +32,30 @@ export class PartnerAuditModalComponent implements OnInit { }] setTimeout(() => { if(this.sf) { - console.log('888'); - - // this.sf.getProperty('/channelId')!.schema.enum = value; - // this.sf.getProperty('/channelId')!.widget.reset(value); + this.sf.getProperty('/channelId')!.schema.enum = value; + this.sf.getProperty('/channelId')!.widget.reset(value); this.sf.setValue('/channelId', this.info.channelId); } }) + } else { + console.log() + this.service.getChannel().pipe(map(data => { + console.log(data); + + })) + this.service.getChannel().subscribe((res) => { + console.log(res); + const value :any= res; + setTimeout(() => { + if(this.sf) { + this.sf.getProperty('/channelId')!.schema.enum = value; + this.sf.getProperty('/channelId')!.widget.reset(value); + this.sf.setValue('/channelId', value); + } + }) + }) + } } @@ -49,13 +67,13 @@ export class PartnerAuditModalComponent implements OnInit { ui: { hidden: true }, - // default: this.info.isPass + default: this.info.isPass }, staffName: { title: '合伙人名称', type: 'string', ui: { widget: 'text' }, - // default: user.enterpriseName + default: user.enterpriseName }, status: { title: '审核结果', @@ -78,7 +96,6 @@ export class PartnerAuditModalComponent implements OnInit { widget: 'select', placeholder: '请选择', allowClear: true, - asyncData: () => this.service.getChannel(), hidden: this.info.isPass === false, visibleIf: { status: value => value