selectObject
FxUI.objectUIAction.selectObject(objectApiName:String, options:Object)
# 功能描述
该方法允许开发人员选择对象数据。
# 参数
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
objectApiName | 业务对象apiName(必填) | string | — | — |
options | 其他参数 | object | — | — |
options(其他参数)参数说明
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
target_related_list_name | 关联列表api_name(可在后台管理当前字段的设置界面差看到) | string | — | — |
single | 是否单选 | boolean | — | false |
maxNum | 最大数量限制 | number | — | — |
wheres | 查关联数据时的筛选条件 | object | — | — |
selected | 已选数据 | array | — | — |
lookup_field_api_name | 对应的lookup字段的api_name | string | — | — |
target_related_list_name | lookup字段创建时生成的关联对象列表的api_name | number | — | — |
# 参数代码示例
{
single: true,
maxNum: 6,
selected: [{_id: "6577c0d0b4e20a000120a8bd"}] //需要回填的数据id
}
# 返回结果
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
objectApiName | 返回该对象名称 | object | — | value |
objectList | 返回所选对象数据 | object | — | value |
# 代码示例
该方法返回一个 Promise对象
,示例如下:
import FxUI from 'fxui-mobile';
FxUI.objectUIAction.selectObject('AccountObj').then(res => {
// todo what you want
})
FxUI.objectUIAction.selectObject('AccountObj', {
single: true,
maxNum: 6
}).then(res => {
// todo what you want
})