首页 > 技术文章 > 删除功能

zmz-com 2019-11-01 16:18 原文

// 删除功能
 handleDel = () => {
    const { dispatch} = this.props;
    const {selectedRowKeys} = this.state;
    const _this = this;
    confirm ({
        title: '提示',
        content: '您确认要删除吗?',
        okText: '确认',
        okType: 'danger',
        cancelText: '取消',
        onOk () {
            dispatch({
                type:'smsModel/getupdateBatchDel',
                payload:{
                    body:{
                        idList:
                            selectedRowKeys,
                    }
                }
            }).then (()=> {
                _this.refreshList();

            });
        }
    })
}

html

<Button type="primary" htmlType="submit"
 onClick={() =>  this.handleDel()}style={{marginRight:"20px"}}> 删除   </Button>

  

推荐阅读