angular中基本获取下拉框的方法:
effInd: {
type: 'string',
title: '是否有效',
enum: [
{ label: '有效', value: '1' },
{ label: '无效', value: '0' },
],
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
},
},
自定义一个从CacheService缓存中获取字段映射的方法
//module:所属模块 attribute:属性名
public getMapping(module, attribute) {
let attributeTypeCd = this.dicts[module][attribute];
let attributeTypeCdEnum = [];
for (let key in attributeTypeCd) {
if (attributeTypeCd.hasOwnProperty(key)) {
attributeTypeCdEnum.push({
label: attributeTypeCd[key],
value: key,
});
}
}
return of(attributeTypeCdEnum);
}
调用过程例子