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
c5d6923d
Commit
c5d6923d
authored
Aug 29, 2017
by
ddcat1115
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/ant-design/test2
parents
f2497cb0
d9283419
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
src/routes/Forms/AdvancedForm.js
src/routes/Forms/AdvancedForm.js
+12
-13
src/routes/Forms/TableForm.js
src/routes/Forms/TableForm.js
+3
-1
src/routes/Forms/style.less
src/routes/Forms/style.less
+5
-2
No files found.
src/routes/Forms/AdvancedForm.js
View file @
c5d6923d
...
@@ -101,7 +101,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -101,7 +101,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
Card
title
=
"
仓库管理
"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
<
Card
title
=
"
仓库管理
"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
<
Form
layout
=
"
vertical
"
hideRequiredMark
>
<
Form
layout
=
"
vertical
"
hideRequiredMark
>
<
Row
gutter
=
{
16
}
>
<
Row
gutter
=
{
16
}
>
<
Col
md
=
{
6
}
sm
=
{
24
}
>
<
Col
lg
=
{
6
}
md
=
{
12
}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
name
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
name
}
>
{
getFieldDecorator
(
'
name
'
,
{
{
getFieldDecorator
(
'
name
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请输入仓库名称
'
}],
rules
:
[{
required
:
true
,
message
:
'
请输入仓库名称
'
}],
...
@@ -110,7 +110,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -110,7 +110,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
md
=
{{
span
:
8
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
url
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
url
}
>
{
getFieldDecorator
(
'
url
'
,
{
{
getFieldDecorator
(
'
url
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
...
@@ -124,7 +124,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -124,7 +124,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
md
=
{{
span
:
10
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
lg
=
{{
span
:
10
}}
md
=
{{
span
:
24
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
owner
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
owner
}
>
{
getFieldDecorator
(
'
owner
'
,
{
{
getFieldDecorator
(
'
owner
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择管理员
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择管理员
'
}],
...
@@ -138,7 +138,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -138,7 +138,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
gutter
=
{
16
}
>
<
Row
gutter
=
{
16
}
>
<
Col
md
=
{
6
}
sm
=
{
24
}
>
<
Col
lg
=
{
6
}
md
=
{
12
}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
approver
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
approver
}
>
{
getFieldDecorator
(
'
approver
'
,
{
{
getFieldDecorator
(
'
approver
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择审批员
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择审批员
'
}],
...
@@ -150,7 +150,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -150,7 +150,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
md
=
{{
span
:
8
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
dateRange
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
dateRange
}
>
{
getFieldDecorator
(
'
dateRange
'
,
{
{
getFieldDecorator
(
'
dateRange
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择生效日期
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择生效日期
'
}],
...
@@ -159,7 +159,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -159,7 +159,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
md
=
{{
span
:
10
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
lg
=
{{
span
:
10
}}
md
=
{{
span
:
24
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
type
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
type
}
>
{
getFieldDecorator
(
'
type
'
,
{
{
getFieldDecorator
(
'
type
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择仓库类型
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择仓库类型
'
}],
...
@@ -177,7 +177,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -177,7 +177,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
Card
title
=
"
任务管理
"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
<
Card
title
=
"
任务管理
"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
<
Form
layout
=
"
vertical
"
hideRequiredMark
>
<
Form
layout
=
"
vertical
"
hideRequiredMark
>
<
Row
gutter
=
{
16
}
>
<
Row
gutter
=
{
16
}
>
<
Col
md
=
{
6
}
sm
=
{
24
}
>
<
Col
lg
=
{
6
}
md
=
{
12
}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
name2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
name2
}
>
{
getFieldDecorator
(
'
name2
'
,
{
{
getFieldDecorator
(
'
name2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请输入
'
}],
rules
:
[{
required
:
true
,
message
:
'
请输入
'
}],
...
@@ -186,7 +186,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -186,7 +186,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
md
=
{{
span
:
8
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
url2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
url2
}
>
{
getFieldDecorator
(
'
url2
'
,
{
{
getFieldDecorator
(
'
url2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择
'
}],
...
@@ -195,7 +195,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -195,7 +195,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
md
=
{{
span
:
10
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
lg
=
{{
span
:
10
}}
md
=
{{
span
:
24
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
owner2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
owner2
}
>
{
getFieldDecorator
(
'
owner2
'
,
{
{
getFieldDecorator
(
'
owner2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择管理员
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择管理员
'
}],
...
@@ -209,7 +209,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -209,7 +209,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
gutter
=
{
16
}
>
<
Row
gutter
=
{
16
}
>
<
Col
md
=
{
6
}
sm
=
{
24
}
>
<
Col
lg
=
{
6
}
md
=
{
12
}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
approver2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
approver2
}
>
{
getFieldDecorator
(
'
approver2
'
,
{
{
getFieldDecorator
(
'
approver2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择审批员
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择审批员
'
}],
...
@@ -221,7 +221,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -221,7 +221,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
md
=
{{
span
:
8
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
6
,
offset
:
2
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
12
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
dateRange2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
dateRange2
}
>
{
getFieldDecorator
(
'
dateRange2
'
,
{
{
getFieldDecorator
(
'
dateRange2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请输入
'
}],
rules
:
[{
required
:
true
,
message
:
'
请输入
'
}],
...
@@ -230,7 +230,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -230,7 +230,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
)}
)}
<
/Form.Item
>
<
/Form.Item
>
<
/Col
>
<
/Col
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
md
=
{{
span
:
10
}}
sm
=
{
24
}
>
<
Col
xl
=
{{
span
:
8
,
offset
:
2
}}
lg
=
{{
span
:
10
}}
md
=
{{
span
:
24
}}
sm
=
{
24
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
type2
}
>
<
Form
.
Item
label
=
{
fieldLabels
.
type2
}
>
{
getFieldDecorator
(
'
type2
'
,
{
{
getFieldDecorator
(
'
type2
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请选择仓库类型
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择仓库类型
'
}],
...
@@ -252,7 +252,6 @@ function AdvancedForm({ form, dispatch, submitting }) {
...
@@ -252,7 +252,6 @@ function AdvancedForm({ form, dispatch, submitting }) {
<
/Card
>
<
/Card
>
<
FooterToolbar
>
<
FooterToolbar
>
{
getErrorInfo
()}
{
getErrorInfo
()}
<
Button
size
=
"
large
"
>
取消
<
/Button
>
<
Button
type
=
"
primary
"
size
=
"
large
"
onClick
=
{
validate
}
loading
=
{
submitting
}
>
<
Button
type
=
"
primary
"
size
=
"
large
"
onClick
=
{
validate
}
loading
=
{
submitting
}
>
提交
提交
<
/Button
>
<
/Button
>
...
...
src/routes/Forms/TableForm.js
View file @
c5d6923d
...
@@ -59,6 +59,7 @@ export default class TableForm extends PureComponent {
...
@@ -59,6 +59,7 @@ export default class TableForm extends PureComponent {
name
:
''
,
name
:
''
,
department
:
''
,
department
:
''
,
editable
:
true
,
editable
:
true
,
isNew
:
true
,
});
});
this
.
index
+=
1
;
this
.
index
+=
1
;
this
.
setState
({
data
:
newData
});
this
.
setState
({
data
:
newData
});
...
@@ -73,6 +74,7 @@ export default class TableForm extends PureComponent {
...
@@ -73,6 +74,7 @@ export default class TableForm extends PureComponent {
}
}
saveRow
(
e
,
key
)
{
saveRow
(
e
,
key
)
{
const
target
=
this
.
getRowByKey
(
key
);
const
target
=
this
.
getRowByKey
(
key
);
delete
target
.
isNew
;
if
(
!
target
.
workId
||
!
target
.
name
||
!
target
.
department
)
{
if
(
!
target
.
workId
||
!
target
.
name
||
!
target
.
department
)
{
message
.
error
(
'
请填写完整成员信息。
'
);
message
.
error
(
'
请填写完整成员信息。
'
);
return
;
return
;
...
@@ -148,7 +150,7 @@ export default class TableForm extends PureComponent {
...
@@ -148,7 +150,7 @@ export default class TableForm extends PureComponent {
key
:
'
action
'
,
key
:
'
action
'
,
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
if
(
record
.
editable
)
{
if
(
record
.
editable
)
{
if
(
record
.
key
.
indexOf
(
'
NEW_TEMP_ID_
'
)
>=
0
)
{
if
(
record
.
isNew
)
{
return
(
return
(
<
span
>
<
span
>
<
a
onClick
=
{
e
=>
this
.
saveRow
(
e
,
record
.
key
)}
>
保存
<
/a
>
<
a
onClick
=
{
e
=>
this
.
saveRow
(
e
,
record
.
key
)}
>
保存
<
/a
>
...
...
src/routes/Forms/style.less
View file @
c5d6923d
...
@@ -69,10 +69,13 @@
...
@@ -69,10 +69,13 @@
}
}
// 避免表格编辑模式切换时抖动
// 避免表格编辑模式切换时抖动
:global(.ant-table) td {
transition: none !important;
}
.editable {
.editable {
td {
td {
transition: none !important;
padding-top: 13px !important;
padding-top: 12.5px !important;
padding-bottom: 12.5px !important;
padding-bottom: 12.5px !important;
}
}
}
}
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