Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
81cceb58
Commit
81cceb58
authored
Nov 01, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Editable Table, close #68
parent
e9bfdedf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/routes/Forms/TableForm.js
src/routes/Forms/TableForm.js
+7
-4
No files found.
src/routes/Forms/TableForm.js
View file @
81cceb58
...
...
@@ -89,11 +89,12 @@ export default class TableForm extends PureComponent {
return
;
}
const
target
=
this
.
getRowByKey
(
key
);
delete
target
.
isNew
;
if
(
!
target
.
workId
||
!
target
.
name
||
!
target
.
department
)
{
message
.
error
(
'
请填写完整成员信息。
'
);
e
.
target
.
focus
();
return
;
}
delete
target
.
isNew
;
this
.
toggleEditable
(
e
,
key
);
this
.
props
.
onChange
(
this
.
state
.
data
);
},
10
);
...
...
@@ -176,15 +177,17 @@ export default class TableForm extends PureComponent {
if
(
record
.
isNew
)
{
return
(
<
span
>
<
a
onClick
=
{
e
=>
this
.
saveRow
(
e
,
record
.
key
)}
>
保存
<
/a
>
<
a
>
保存
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
a
onClick
=
{
e
=>
this
.
remove
(
e
,
record
.
key
)}
>
删除
<
/a
>
<
Popconfirm
title
=
"
是否要删除此行?
"
onConfirm
=
{()
=>
this
.
remove
(
record
.
key
)}
>
<
a
>
删除
<
/a
>
<
/Popconfirm
>
<
/span
>
);
}
return
(
<
span
>
<
a
onClick
=
{
e
=>
this
.
saveRow
(
e
,
record
.
key
)}
>
保存
<
/a
>
<
a
>
保存
<
/a
>
<
Divider
type
=
"
vertical
"
/>
<
a
onClick
=
{
e
=>
this
.
cancel
(
e
,
record
.
key
)}
>
取消
<
/a
>
<
/span
>
...
...
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