This commit is contained in:
2024-01-15 19:29:02 +08:00
parent e5b2a51cec
commit 0281ce9dd6
5 changed files with 127 additions and 49 deletions

View File

@@ -26,7 +26,10 @@ class AddUser extends React.Component<AddUserProps, AddUserState> {
handleOk = () => {
this.formRef.current?.submit();
this.props.onSuccess();
};
handleCancel = () => {
this.switchShow();
};
switchShow = () => {
@@ -39,13 +42,20 @@ class AddUser extends React.Component<AddUserProps, AddUserState> {
trailwayAddUser(values).then((resp: any) => {
if (resp.code == 200) {
this.switchShow();
this.props.onSuccess();
}
});
};
render() {
return (
<Modal title="增加用户" visible={this.state.isShow} onOk={this.handleOk}>
<Modal
title="增加用户"
visible={this.state.isShow}
onOk={this.handleOk}
onCancel={this.handleCancel}
closable={false}
>
<Form ref={this.formRef} onFinish={this.handleFinish}>
<FormItem name="username">
<Input placeholder="账户" />