combobox
# 一、属性
# value
string | number | boolean
当前输入组件的值。
# columns
object
输入组件配置对象。
默认值: {}
提示
combobox 是基于 <a-select />
封装的组件。这意味着它除了文档中提到的 API 外,还可以支持 官方文档 (opens new window) 中的 API【若发现暂不支持的属性,请及时反馈!!!】。
# columns.xtype
string
该输入组件需要将其指定为 'combobox'
。
# columns.allowClear 不支持修改
boolean
是否允许点击清除图标删除内容。
默认值: false
# columns.clearable 不支持修改
boolean
与 allowClear 功能相同,优先取 allowClear。
默认值: false
# columns.placeholder
string
占位符,提示文字。
# columns.defaultValue
string | number | boolean
默认值。
可选值: 系统预设默认值
# columns.disabled
boolean | (typeParams: Object) => boolean
是否禁用状态。
默认值: false
# columns.readOnly
boolean
与 disabled 功能相同,优先取 disabled。
默认值: false
# columns.showArrow
boolean
是否显示下拉小箭头。
默认值: true
# columns.mode
boolean
设置 Select 的模式为多选或标签。
默认值: default
可选值: 'default'
、'multiple'
# columns.maxTagTextLength
boolean
最多显示多少个 tag。
默认值: number
# columns.storeConfig
object | array<{ code, name, hidden?, disabled? }>
下拉选项配置。
object 属性说明:
findUrl: string
: 加载数据的请求地址 必填项isPage: boolean
: 是否分页,默认false
isSelfPage: boolean
: 是否前端分页,默认false
code: string
: 指定将结果集中的哪个字段作为该输入组件的值 必填项name: string
: 指定将结果集中的哪个字段显示在输入框中 必填项getData: (params) => primose
: 用于手动请求组件数据getDataBefore: (params) => void
: 请求组件数据前的回调事件getDataAfter: (params) => void
: 请求组件数据后的回调事件setBaseParams: (params) => void
: 动态修改请求参数
array 属性说明:
code: string | number | boolean
: 取值字段 必填项name: string
: 显示字段 必填项hidden: boolean | (typeParams) => boolean
: 是否隐藏选项,可选,默认false
disabled: boolean | (typeParams) => boolean
: 是否禁用选项,可选,默认false
# columns.allResult
array
所有的数据集,包括分页数据。
# columns.dataResult
array
每页展示的数据集。
提示
可以通过配置此属性,自定义数据集。
# columns.tempResult
array
临时的数据集。
提示
- 可以通过配置此数据,修复渲染数据集加载失败,导致的无法渲染问题。
- 渲染数据集 = allResult || dataResult || tempResult
# columns.needDefault
array
是否需要将数据集中的第一条数据作为默认值。
# columns.editable
boolean
是否允许编辑。
默认值: true
# columns.forceSelection
boolean
是否强制选择。
默认值: true
提示
非强制选择,则可以将任意内容作为该输入组件的值。
# columns.modalIntercept
boolean | ({ row }) => boolean
是否弹窗拦截选中事件。当某行记录不允许选中时,可能会用到。
默认值: false
# columns.addEmptyAtTop
boolean
在下拉列表的头部,添加空选项。
默认值: false
# columns.addEmptyAtBottom
boolean
在下拉列表的尾部,添加空选项。
默认值: false
# columns.rendererName
string
渲染器名称。
默认值: undefined
可选值: 'user'
、'dept'
、'employee'
、'role'
、'roleGroup'
、'secclass'
。
# columns.selCols
array<string>
选中的列字段数组。
提示
- 在 BasicForm、AppGrid、AppFind、AppFindBar 中使用此组件时有效
- 请结合 [columns-retcols] 使用
# columns.retCols
array<string>
重置列字段数组。
提示
- 在 BasicForm、AppGrid、AppFind、AppFindBar 中使用此组件时有效
- 请结合 [columns-selcols] 使用
# size
String
控件大小。
默认值: 'small'
可选值: 'large'
、'default'
、'samll'
提示
该属性可直接挂载至 columns 下。
columns: {
// ...
size: 'small'
}
2
3
4
# typeParams
object
类型参数,可以为其传递任意属性,在各回调事件中,会将其按原样返回。
默认值: {}
# isForm
boolean
是否在表单中使用。
默认值: false
# reseal
boolean
是否重新封装。
默认值: false
# 二、事件
# valueChange
({ that, columns, value, oldValue, typeParams }) => void
当值改变后触发。
参数说明:
- obj
提示
该方法可直接挂载至 columns 下。
columns: {
// ...
valueChange: ({ that, columns, value, oldValue, typeParams }) => {}
}
2
3
4
# showDropDownBefore
({ that, columns, typeParams, back }) => void
下拉选择前触发。
参数说明:
- obj
提示
该方法可直接挂载至 columns 下。
columns: {
// ...
showDropDownBefore: ({ that, columns, typeParams, back }) => {}
}
2
3
4
# comboboxChangeBefore
(optionData, typeParams) => void
值改变前触发。
参数说明:
optionData: object
: 选中的数据项typeParams: object
: 类型参数
提示
该方法可直接挂载至 columns 下。
columns: {
// ...
comboboxChangeBefore: (optionData, typeParams) => {}
}
2
3
4