Commit 420d1a4a authored by zhangwenshuai's avatar zhangwenshuai

删除按钮跟确定按钮分开控制

parent 8fb5d5cb
...@@ -55,12 +55,11 @@ ...@@ -55,12 +55,11 @@
.buttonWrap { .buttonWrap {
position: absolute; position: absolute;
bottom: 16px; bottom: 16px;
left: 26px;
right: 45px; right: 45px;
.delBtnCls { .delBtnCls {
color: @errorColor; color: @errorColor;
position: relative;
left: -303px;
} }
} }
} }
...@@ -32,9 +32,7 @@ class FormWrap extends Component { ...@@ -32,9 +32,7 @@ class FormWrap extends Component {
handleSubmit = (e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
const { const { rowId, form, handleSubmit, data, rowData, detailType } = this.props;
rowId, form, handleSubmit, data, rowData, detailType,
} = this.props;
form.validateFieldsAndScroll((err, values) => { form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
const newValues: any[] = []; const newValues: any[] = [];
...@@ -183,9 +181,7 @@ class FormWrap extends Component { ...@@ -183,9 +181,7 @@ class FormWrap extends Component {
}; };
render() { render() {
const { const { loading, isShowDelBtn, data, btnWrapStyle, name, colsNum, delLabel, hideOperateBtn } = this.props;
loading, isShowDelBtn, data, btnWrapStyle, name, colsNum, delLabel, hideOperateBtn,
} = this.props;
return ( return (
<Provider value={{ locale: this.getContext() }}> <Provider value={{ locale: this.getContext() }}>
...@@ -216,15 +212,15 @@ class FormWrap extends Component { ...@@ -216,15 +212,15 @@ class FormWrap extends Component {
})} })}
</Form> </Form>
</div> </div>
{ <div className={styles.buttonWrap} style={btnWrapStyle}>
hideOperateBtn ? null : ( <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div className={styles.buttonWrap} style={btnWrapStyle}> {isShowDelBtn && (
<div style={{ display: 'flex', justifyContent: 'center' }}> <Button onClick={this.handleDelete} type="link" className={styles.delBtnCls}>
{isShowDelBtn ? ( {delLabel || '删除'}
<Button onClick={this.handleDelete} type="link" className={styles.delBtnCls}> </Button>
{delLabel || '删除'} )}
</Button> {!hideOperateBtn && (
) : null} <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button onClick={this.handleCancel} className={styles.btnCls}> <Button onClick={this.handleCancel} className={styles.btnCls}>
取消 取消
</Button> </Button>
...@@ -238,10 +234,9 @@ class FormWrap extends Component { ...@@ -238,10 +234,9 @@ class FormWrap extends Component {
确定 确定
</Button> </Button>
</div> </div>
</div> )}
) </div>
} </div>
</div> </div>
</Provider> </Provider>
); );
......
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