This commit is contained in:
wangshiming
2022-05-06 16:29:27 +08:00
parent 306bdf95b9
commit a6f7d87d65

View File

@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { SFComponent, SFSchema, SFValue } from '@delon/form'; import { SFComponent, SFSchema, SFValue } from '@delon/form';
import { ModalHelper } from '@delon/theme'; import { ModalHelper } from '@delon/theme';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
import { PartnerListService } from '../../services/partner-list.service'; import { PartnerListService } from '../../services/partner-list.service';
@Component({ @Component({
@ -22,6 +23,7 @@ export class PartnerAuditModalComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
console.log(this.info); console.log(this.info);
this.initSF(this.info); this.initSF(this.info);
// asyncData: () => this.service.getChannel(),
if(this.info.channelId) { if(this.info.channelId) {
const value = [{ const value = [{
@ -30,14 +32,30 @@ export class PartnerAuditModalComponent implements OnInit {
}] }]
setTimeout(() => { setTimeout(() => {
if(this.sf) { 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); 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: { ui: {
hidden: true hidden: true
}, },
// default: this.info.isPass default: this.info.isPass
}, },
staffName: { staffName: {
title: '合伙人名称', title: '合伙人名称',
type: 'string', type: 'string',
ui: { widget: 'text' }, ui: { widget: 'text' },
// default: user.enterpriseName default: user.enterpriseName
}, },
status: { status: {
title: '审核结果', title: '审核结果',
@ -78,7 +96,6 @@ export class PartnerAuditModalComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true,
asyncData: () => this.service.getChannel(),
hidden: this.info.isPass === false, hidden: this.info.isPass === false,
visibleIf: { visibleIf: {
status: value => value status: value => value