This commit is contained in:
wangshiming
2022-02-17 19:44:46 +08:00
parent 7e330ba2df
commit e3f19fb9ff
15 changed files with 502 additions and 67 deletions

View File

@ -185,6 +185,9 @@ resourceStatus: any;
return of([]);
}
},
change: (q: any) => {
this.getRegionCode(q);
}
} as SFSelectWidgetSchema,
},
enterpriseProjectId: {
@ -193,13 +196,10 @@ resourceStatus: any;
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getEnterpriseProject(),
visibleIf: {
_$expand: (value: boolean) => value
}
},
default: ''
},
} as SFSelectWidgetSchema
},
loadingPlace: {
type: 'string',
@ -521,6 +521,27 @@ resourceStatus: any;
className: 'text-center' }
];
}
// 获取城市列表
getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe(
map(res =>
res.map((item: any) => ({
label: item.projectName,
value: item.id
}))
)
)
.subscribe(res => {
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
// if (this.enterpriseProjectIds) {
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
// }
});
}
/**
* 查询字段个数
*/