fix: action buttons align right

This commit is contained in:
chenos 2020-12-30 11:22:06 +08:00
parent c20494d99b
commit c20d3a91de
5 changed files with 21 additions and 5 deletions

View File

@ -28,7 +28,7 @@ const api = Api.create({
charset: 'utf8mb4', charset: 'utf8mb4',
collate: 'utf8mb4_unicode_ci', collate: 'utf8mb4_unicode_ci',
}, },
logging: false, // logging: false,
define: {}, define: {},
sync, sync,
}, },

View File

@ -14,7 +14,7 @@ export function Destroy(props) {
console.log('destroy', onTrigger); console.log('destroy', onTrigger);
onTrigger && onTrigger(); onTrigger && onTrigger();
}}> }}>
<Button icon={<DeleteOutlined />} type={'primary'} danger>{title}</Button> <Button icon={<DeleteOutlined />} type={'ghost'} danger>{title}</Button>
</Popconfirm> </Popconfirm>
</> </>
) )

View File

@ -62,7 +62,16 @@ export const DrawerForm = forwardRef((props: any, ref) => {
setVisible(false); setVisible(false);
}} }}
title={title} title={title}
footer={[ footer={(
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={() => {
setVisible(false);
}}></Button>
<span style={{display: 'inline-block', width: 8}}> </span>
<Button type={'primary'} onClick={async () => { <Button type={'primary'} onClick={async () => {
const { values = {} } = await actions.submit(); const { values = {} } = await actions.submit();
console.log(values); console.log(values);
@ -83,7 +92,8 @@ export const DrawerForm = forwardRef((props: any, ref) => {
window.routesReload && window.routesReload(); window.routesReload && window.routesReload();
onFinish && onFinish(values); onFinish && onFinish(values);
}}></Button> }}></Button>
]} </div>
)}
> >
{loading ? <Spin/> : ( {loading ? <Spin/> : (
<SchemaForm <SchemaForm

View File

@ -52,7 +52,7 @@ export function FilterForm(props: any) {
}, },
}} }}
> >
<FormButtonGroup> <FormButtonGroup align={'end'}>
<Reset></Reset> <Reset></Reset>
<Submit></Submit> <Submit></Submit>
</FormButtonGroup> </FormButtonGroup>

View File

@ -23,4 +23,10 @@
.ant-page-header-footer { .ant-page-header-footer {
margin-top: 5px; margin-top: 5px;
}
.button-group {
display: flex;
justify-content: flex-end;
width: 100%;
} }