public static get schema(): ISchemaModel {
const schema = {
formTitle: 'process-stream-parameter',
type: 'object',
readOnly: false,
properties: {
name: {
type: 'string',
description: 'gl.process-stream-parameter.schema.name',
widget: '_string',
},
processStreamCategoryId: {
type: 'object',
description: 'gl.process-stream-parameter.schema.processStreamCategoryId',
serviceName: 'processStreamCategoryListService',
widget: '_select',
help: 'gl.process-stream-parameter.schema.help.processStreamCategoryId',
titleKey: 'name',
properties: {
id: {
type: 'number'
},
title: {
type: 'string'
},
_title: {
type: 'string'
}
}
},
unitGroupSelective: {
type: 'string',
description: '',
widget: '_empty',
},
unitId: {
type: 'object',
description: 'gl.attribute.schema.unitId',
widget: '_couple-autocomplete',
properties: {
id: {
type: 'number'
},
title: {
type: 'string'
},
_title: {
type: 'string'
}
},
primitiveAutocomplete: {
serviceName: 'unitGroupListService',
help: 'gl.attribute.schema.unitGroup',
description: 'gl.attribute.schema.unitGroup',
fieldName: 'unitGroupSelective',
foreignKey: 'title',
params: {
titleKey: 'title'
},
properties: {
id: {
type: 'number'
},
title: {
type: 'string'
},
_title: {
type: 'string'
}
},
},
associateAutocomplete: {
serviceName: 'unitListService',
help: 'gl.attribute.schema.unitId',
description: 'gl.attribute.schema.unitId',
fieldName: 'unitSelective',
methodName: 'units',
params: {
titleKey: 'title'
},
properties: {
id: {
type: 'number'
},
title: {
type: 'string'
},
_title: {
type: 'string'
}
},
}
},
},
required: ['name']
} as ISchemaModel;
return schema;
}
这是获取架构属性的代码:我想获取小部件中primitiveAutocomplete
中的associateAutocomplete
和unitId
:
console.log(this.formProperty.findRoot().getProperty('associateAutocomplete'));
两者都返回undefined
,但是当我写这篇文章时:
console.log(this.formProperty.findRoot().getProperty('unitId'));
它返回其属性
我该怎么办?
您可以使用它:
this.formProperty.findRoot().getProperty('unitId').properties['your prop'].value
或使用此方法:
searchProperty('your prop')