Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5efdabf1
authored
May 31, 2024
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 删除用户改为注销
parent
5c050283
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
web/src/components/UsersTable.js
+17
-17
No files found.
web/src/components/UsersTable.js
View file @
5efdabf1
...
@@ -208,23 +208,23 @@ const UsersTable = () => {
...
@@ -208,23 +208,23 @@ const UsersTable = () => {
>
>
编辑
编辑
<
/Button
>
<
/Button
>
<
Popconfirm
title
=
'确定是否要注销此用户?'
content
=
'相当于删除用户,此修改将不可逆'
okType
=
{
'danger'
}
position
=
{
'left'
}
onConfirm
=
{()
=>
{
manageUser
(
record
.
username
,
'delete'
,
record
).
then
(()
=>
{
removeRecord
(
record
.
id
);
});
}}
>
<
Button
theme
=
'light'
type
=
'danger'
style
=
{{
marginRight
:
1
}}
>
注销
<
/Button
>
<
/Popconfirm
>
<
/
>
<
/
>
)}
)}
<
Popconfirm
title
=
'确定是否要删除此用户?'
content
=
'硬删除,此修改将不可逆'
okType
=
{
'danger'
}
position
=
{
'left'
}
onConfirm
=
{()
=>
{
manageUser
(
record
.
username
,
'delete'
,
record
).
then
(()
=>
{
removeRecord
(
record
.
id
);
});
}}
>
<
Button
theme
=
'light'
type
=
'danger'
style
=
{{
marginRight
:
1
}}
>
删除
<
/Button
>
<
/Popconfirm
>
<
/div
>
<
/div
>
),
),
},
},
...
@@ -253,13 +253,13 @@ const UsersTable = () => {
...
@@ -253,13 +253,13 @@ const UsersTable = () => {
};
};
const
removeRecord
=
(
key
)
=>
{
const
removeRecord
=
(
key
)
=>
{
console
.
log
(
key
);
let
newDataSource
=
[...
users
];
let
newDataSource
=
[...
users
];
if
(
key
!=
null
)
{
if
(
key
!=
null
)
{
let
idx
=
newDataSource
.
findIndex
((
data
)
=>
data
.
id
===
key
);
let
idx
=
newDataSource
.
findIndex
((
data
)
=>
data
.
id
===
key
);
if
(
idx
>
-
1
)
{
if
(
idx
>
-
1
)
{
newDataSource
.
splice
(
idx
,
1
);
// update deletedAt
newDataSource
[
idx
].
DeletedAt
=
new
Date
();
setUsers
(
newDataSource
);
setUsers
(
newDataSource
);
}
}
}
}
...
...
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