temp
This commit is contained in:
@@ -9,10 +9,15 @@ type AddUserState = {
|
||||
isShow: boolean;
|
||||
};
|
||||
|
||||
class AddUser extends React.Component<{}, AddUserState> {
|
||||
type AddUserProps = {
|
||||
onSuccess: () => void;
|
||||
showAddUser?: () => void;
|
||||
};
|
||||
|
||||
class AddUser extends React.Component<AddUserProps, AddUserState> {
|
||||
private formRef = React.createRef<FormInstance>();
|
||||
|
||||
constructor(props: {}) {
|
||||
constructor(props: AddUserProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
isShow: false,
|
||||
@@ -20,13 +25,19 @@ class AddUser extends React.Component<{}, AddUserState> {
|
||||
}
|
||||
|
||||
handleOk = () => {
|
||||
console.log(this.formRef.current?.submit());
|
||||
this.formRef.current?.submit();
|
||||
this.props.onSuccess();
|
||||
};
|
||||
|
||||
switchShow = () => {
|
||||
this.setState((state) => ({
|
||||
isShow: !state.isShow,
|
||||
}));
|
||||
this.setState(
|
||||
(state) => ({
|
||||
isShow: !state.isShow,
|
||||
}),
|
||||
() => {
|
||||
this.props.showAddUser && this.props.showAddUser();
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
handleFinish = (values: any) => {
|
||||
|
||||
Reference in New Issue
Block a user