刪除功能

// 刪除功能
 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();

            });
        }
    })
}

htmlhtml

<Button type="primary" htmlType="submit"
 onClick={() =>  this.handleDel()}style={{marginRight:"20px"}}> 刪除   </Button>
相關文章
相關標籤/搜索