dropdownbox
# 一、属性
# value
string | number | boolean
当前输入组件的值。
# columns
object
输入组件配置对象。
默认值: {}
提示
dropdownbox 是基于 <a-input />
封装的组件。这意味着它除了文档中提到的 API 外,还可以支持 官方文档 (opens new window) 中的 API【若发现暂不支持的属性,请及时反馈!!!】。
# columns.xtype
string
该输入组件需要将其指定为 'dropdownbox'
。
# 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.storeConfig
object
表格配置选项。
属性说明:
width: number
: 下拉窗口宽度。findUrl: string
: 加载数据的请求地址isPage: boolean
: 是否分页,默认false
ib_MultiRowSelected: boolean
: 是否多选columns: array
: 下拉/弹窗 表格列配置 必填项width: number
: 列宽度。
findForm: array
: 查询条件配置getData: (params) => primose
: 用于手动请求组件数据getDataBefore: (params) => void
: 请求组件数据前的回调事件getDataAfter: (params) => void
: 请求组件数据后的回调事件setBaseParams: (params) => void
: 动态修改请求参数
提示
- 因表格使用的是
<app-grid />
,故所有的表格配置都应该可以支持【若发现暂不支持的属性,请及时反馈!!!】 - 当 storeConfig 选项中,包含 findForm 属性时,dropdownbox 将显示为弹窗表格,否则是下拉表格
- 当未指定 storeConfig.width 时,将计算各列的宽度和作为下拉窗口的宽度。默认最小宽度为
400px
# columns.allResult
array
所有的数据集,包括分页数据。
# columns.dataResult
array
每页展示的数据集。
提示
可以通过配置此属性,自定义数据集。
# columns.tempResult
array
临时的数据集。
提示
- 可以通过配置此数据,修复渲染数据集加载失败,导致的无法渲染问题。
- 渲染数据集 = allResult || dataResult || tempResult
# columns.needDefault
array
是否需要将数据集中的第一条数据作为默认值。
# columns.displayField 必填项
string
指定将结果集中的哪个字段显示在输入框中。
# columns.valueField 必填项
string
指定将结果集中的哪个字段作为该输入组件的值。
# columns.editable
boolean
是否允许编辑。
默认值: true
# columns.forceSelection
boolean
是否强制选择。
默认值: true
提示
非强制选择,则可以将任意内容作为该输入组件的值。
# columns.enterSearch
boolean
是否启用回车查询。true,回车查询;false,输入后自动查询。
默认值: false
# columns.intercept
boolean | ({ row }) => boolean
是否拦截选中事件。当某行记录不允许选中时,可能会用到。
默认值: false
# columns.openQueryAll
boolean
下拉/打开 表格后,是否查所有数据。
默认值: true
# 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
# dropDownBoxChangeBefore
(row, typeParams) => void
值改变前触发。
参数说明:
row: object
: 选中的行记录typeParams: object
: 类型参数
提示
该方法可直接挂载至 columns 下。
columns: {
// ...
dropDownBoxChangeBefore: (row, typeParams) => {}
}
2
3
4