Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chatGLM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘坚-丰林-DEV
chatGLM
Commits
4d71e5cc
Commit
4d71e5cc
authored
Apr 17, 2023
by
littleforest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: changed init state issues
parent
232e6205
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
22 deletions
+16
-22
index.tsx
src/pages/UserManage/index.tsx
+16
-22
No files found.
src/pages/UserManage/index.tsx
View file @
4d71e5cc
...
...
@@ -10,19 +10,7 @@ import { PlusOutlined } from '@ant-design/icons';
import
type
{
ActionType
}
from
'@ant-design/pro-components'
;
import
{
PageContainer
}
from
'@ant-design/pro-components'
;
import
{
ProTable
}
from
'@ant-design/pro-components'
;
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
Modal
,
Radio
,
Row
,
Select
,
Switch
,
message
,
}
from
'antd'
;
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
Modal
,
Radio
,
Row
,
Switch
,
message
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
useRef
,
useState
}
from
'react'
;
...
...
@@ -30,6 +18,8 @@ import styles from './index.less';
import
{
Exclamtion
}
from
'@/components/Icons/Icons'
;
const
{
Item
}
=
Form
;
const
{
Password
}
=
Input
;
const
layout
=
{
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
18
},
...
...
@@ -59,11 +49,7 @@ const UserManage = () => {
const
[
ressetLoading
,
setResetLoading
]
=
useState
(
false
);
const
[
accountModalName
,
setAccountModalName
]
=
useState
(
'新建账号'
);
const
[
accountForm
]
=
Form
.
useForm
();
const
isActiveSelectOption
=
[
{
label
:
'启用'
,
value
:
true
},
{
label
:
'禁用'
,
value
:
false
},
];
const
[
resetPasswordForm
]
=
Form
.
useForm
();
const
showModal
=
()
=>
{
getRole
().
then
((
res
)
=>
{
...
...
@@ -131,7 +117,7 @@ const UserManage = () => {
title
:
'操作'
,
valueType
:
'option'
,
key
:
'option'
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
render
:
(
_text
,
record
,
_
,
_
action
)
=>
[
<
a
key=
"editable"
onClick=
{
()
=>
{
...
...
@@ -194,6 +180,7 @@ const UserManage = () => {
.
then
((
res
)
=>
{
setLoading
(
false
);
setIsModalAccountOpen
(
false
);
accountForm
.
resetFields
();
actionRef
.
current
?.
reload
();
})
.
catch
((
error
)
=>
{
...
...
@@ -212,6 +199,7 @@ const UserManage = () => {
setLoading
(
false
);
setIsModalAccountOpen
(
false
);
message
.
success
(
'编辑成功'
);
accountForm
.
resetFields
();
actionRef
.
current
?.
reload
();
})
.
catch
((
error
)
=>
{
...
...
@@ -277,6 +265,7 @@ const UserManage = () => {
setResetLoading
(
false
);
setIsModalResetPassword
(
false
);
actionRef
.
current
?.
reload
();
resetPasswordForm
.
resetFields
();
message
.
success
(
'重置成功'
);
})
.
catch
((
err
)
=>
{
...
...
@@ -312,7 +301,12 @@ const UserManage = () => {
}
}
footer=
{
null
}
>
<
Form
{
...
resetLayout
}
onFinish=
{
handleClickOpenModalReset
}
name=
"resetPassword"
>
<
Form
form=
{
resetPasswordForm
}
{
...
resetLayout
}
onFinish=
{
handleClickOpenModalReset
}
name=
"resetPassword"
>
<
Item
name=
{
'newPassword'
}
label=
{
'新密码'
}
...
...
@@ -387,7 +381,7 @@ const UserManage = () => {
{
validator
:
validatePassword
},
]
}
>
<
Input
/>
<
Password
/>
</
Item
>
</>
)
}
...
...
@@ -448,7 +442,7 @@ const UserManage = () => {
}
}
rowKey=
"id"
pagination=
{
{
pageSize
:
5
,
pageSize
:
9
,
onChange
:
(
page
)
=>
{},
}
}
options=
{
false
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment