-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(queryTable): visibleFieldsCount为true时,显示所有过滤条件
- Loading branch information
Showing
10 changed files
with
222 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** | ||
* title: ctxGetter | ||
* desc: | | ||
* 通过 ctxGetter 扩展 ctx | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Button } from 'antd'; | ||
import { ModalForm } from 'sula'; | ||
|
||
export default () => { | ||
const ref = React.useRef(null); | ||
return ( | ||
<div> | ||
<Button | ||
onClick={() => { | ||
ref.current | ||
.show({ | ||
title: '弹窗表单', | ||
fields: [ | ||
{ | ||
name: 'input1', | ||
label: 'Input1', | ||
field: 'input', | ||
}, | ||
], | ||
submitButtonProps: { | ||
icon: 'appstore', | ||
}, | ||
submit: { | ||
url: 'https://www.mocky.io/v2/5185415ba171ea3a00704eed', | ||
method: 'POST', | ||
}, | ||
}) | ||
.then((result) => { | ||
console.log('result', result); | ||
}); | ||
}} | ||
> | ||
抽屉表单 | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
ref.current | ||
.show({ | ||
ctxGetter: () => { | ||
return { | ||
extraName: 'sula', | ||
}; | ||
}, | ||
title: '弹窗表单', | ||
fields: [ | ||
{ | ||
name: 'input1', | ||
label: 'Input1', | ||
field: 'input', | ||
}, | ||
], | ||
actionsRender: [ | ||
{ | ||
type: 'button', | ||
props: { | ||
children: '自定义提交', | ||
type: 'primary', | ||
}, | ||
action: (ctx) => { | ||
console.log('ctx: ', ctx); | ||
ctx.form.validateFields().then((values) => { | ||
ctx.modal.modalOk(values); | ||
}); | ||
}, | ||
}, | ||
{ | ||
type: 'button', | ||
props: { | ||
children: '自定义返回', | ||
}, | ||
action: (ctx) => { | ||
ctx.modal.modalCancel(); | ||
}, | ||
}, | ||
], | ||
}) | ||
.then((result) => { | ||
console.log('result', result); | ||
}); | ||
}} | ||
> | ||
自定义操作按钮 | ||
</Button> | ||
<ModalForm | ||
type="drawer" | ||
ref={ref} | ||
/> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.