Commit 4f874244 authored by 卢均锐's avatar 卢均锐

feat: NiceForm/Search 增加只输入整数控制

parent cb7ffa5d
...@@ -19,6 +19,7 @@ const Search = props => { ...@@ -19,6 +19,7 @@ const Search = props => {
align, align,
advanced = true, // 是否展示高级筛选 advanced = true, // 是否展示高级筛选
tip, // 搜索框悬浮提示 tip, // 搜索框悬浮提示
onlyNumber = false, //只输入整数
...rest ...rest
} = props.props['x-component-props']; } = props.props['x-component-props'];
const justifyAlign = align || 'flex-end'; const justifyAlign = align || 'flex-end';
...@@ -39,7 +40,7 @@ const Search = props => { ...@@ -39,7 +40,7 @@ const Search = props => {
<Tooltip title={tip}> <Tooltip title={tip}>
<Input.Search <Input.Search
value={props.value || ''} value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)} onChange={e => props.mutators.change(onlyNumber ? e.target.value.replace(/\D/g,'') : e.target.value)}
onSearch={(_, e) => { onSearch={(_, e) => {
e.preventDefault(); e.preventDefault();
props.form.submit(); props.form.submit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment