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 { 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