Commit 0a462242 authored by afc163's avatar afc163

Fix FooterToolbar width

parent 5acd5e7a
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
background: #fff; background: #fff;
border-top: 1px solid @border-color-split; border-top: 1px solid @border-color-split;
padding: 0 24px; padding: 0 24px;
transition: all .3s;
z-index: 9; z-index: 9;
&:after { &:after {
......
...@@ -42,6 +42,22 @@ const tableData = [{ ...@@ -42,6 +42,22 @@ const tableData = [{
}]; }];
class AdvancedForm extends PureComponent { class AdvancedForm extends PureComponent {
state = {
width: '100%',
};
componentDidMount() {
window.addEventListener('resize', this.resizeFooterToolbar);
}
componentWillUnmount() {
window.removeEventListener('resize', this.resizeFooterToolbar);
}
resizeFooterToolbar = () => {
const sider = document.querySelectorAll('.ant-layout-sider')[0];
const width = `calc(100% - ${sider.style.width})`;
if (this.state.width !== width) {
this.setState({ width });
}
}
render() { render() {
const { form, dispatch, submitting } = this.props; const { form, dispatch, submitting } = this.props;
const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form; const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form;
...@@ -257,7 +273,7 @@ class AdvancedForm extends PureComponent { ...@@ -257,7 +273,7 @@ class AdvancedForm extends PureComponent {
initialValue: tableData, initialValue: tableData,
})(<TableForm />)} })(<TableForm />)}
</Card> </Card>
<FooterToolbar> <FooterToolbar style={{ width: this.state.width }}>
{getErrorInfo()} {getErrorInfo()}
<Button type="primary" onClick={validate} loading={submitting}> <Button type="primary" onClick={validate} loading={submitting}>
提亀 提亀
......
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