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
a5b4c85b
Commit
a5b4c85b
authored
Oct 27, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change advanced form layout
parent
f81fc7da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
53 deletions
+125
-53
src/routes/List/TableList.js
src/routes/List/TableList.js
+115
-46
src/routes/List/TableList.less
src/routes/List/TableList.less
+10
-7
No files found.
src/routes/List/TableList.js
View file @
a5b4c85b
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
connect
}
from
'
dva
'
;
import
{
Card
,
Form
,
Input
,
Select
,
Icon
,
Button
,
Dropdown
,
Menu
,
InputNumber
,
DatePicker
,
Modal
,
message
}
from
'
antd
'
;
import
{
Row
,
Col
,
Card
,
Form
,
Input
,
Select
,
Icon
,
Button
,
Dropdown
,
Menu
,
InputNumber
,
DatePicker
,
Modal
,
message
}
from
'
antd
'
;
import
StandardTable
from
'
../../components/StandardTable
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
...
...
@@ -152,8 +152,120 @@ export default class TableList extends PureComponent {
});
}
renderSimpleForm
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
<
Form
onSubmit
=
{
this
.
handleSearch
}
layout
=
"
inline
"
>
<
Row
gutter
=
{
48
}
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
规则编号
"
>
{
getFieldDecorator
(
'
no
'
)(
<
Input
placeholder
=
"
请输入
"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
'
100%
'
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
span
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
a
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
toggleForm
}
>
展开
<
Icon
type
=
"
down
"
/>
<
/a
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
}
renderAdvancedForm
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
<
Form
onSubmit
=
{
this
.
handleSearch
}
layout
=
"
inline
"
>
<
Row
gutter
=
{
48
}
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
规则编号
"
>
{
getFieldDecorator
(
'
no
'
)(
<
Input
placeholder
=
"
请输入
"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
'
100%
'
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
调用次数
"
>
{
getFieldDecorator
(
'
number
'
)(
<
InputNumber
style
=
{{
width
:
'
100%
'
}}
/
>
)}
<
/FormItem
>
<
/Col
>
<
/Row
>
<
Row
gutter
=
{
48
}
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
更新日期
"
>
{
getFieldDecorator
(
'
date
'
)(
<
DatePicker
style
=
{{
width
:
'
100%
'
}}
placeholder
=
"
请输入更新日期
"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status3
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
'
100%
'
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status4
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
'
100%
'
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
/Col
>
<
/Row
>
<
div
>
<
span
style
=
{{
float
:
'
right
'
}}
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
a
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
toggleForm
}
>
收起
<
Icon
type
=
"
up
"
/>
<
/a
>
<
/span
>
<
/div
>
<
/Form
>
);
}
renderForm
()
{
return
this
.
state
.
expandForm
?
this
.
renderAdvancedForm
()
:
this
.
renderSimpleForm
();
}
render
()
{
const
{
rule
:
{
loading
:
ruleLoading
,
data
}
,
form
:
{
getFieldDecorator
}
}
=
this
.
props
;
const
{
rule
:
{
loading
:
ruleLoading
,
data
}
}
=
this
.
props
;
const
{
selectedRows
,
modalVisible
,
addInputValue
}
=
this
.
state
;
const
menu
=
(
...
...
@@ -168,50 +280,7 @@ export default class TableList extends PureComponent {
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
<
Form
onSubmit
=
{
this
.
handleSearch
}
layout
=
"
inline
"
>
<
div
style
=
{{
marginBottom
:
16
}}
>
<
FormItem
label
=
"
规则编号
"
>
{
getFieldDecorator
(
'
no
'
)(
<
Input
placeholder
=
"
请输入
"
style
=
{{
width
:
272
}}
/
>
)}
<
/FormItem
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
272
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
)}
<
/FormItem
>
<
span
className
=
{
styles
.
formButton
}
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
a
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
toggleForm
}
>
{
this
.
state
.
expandForm
?
'
收起
'
:
'
展开
'
}
<
Icon
type
=
{
this
.
state
.
expandForm
?
'
up
'
:
'
down
'
}
/
>
<
/a
>
<
/span
>
<
/div
>
{
this
.
state
.
expandForm
&&
(
<
div
style
=
{{
marginBottom
:
16
}}
>
<
FormItem
label
=
"
更新时间
"
>
{
getFieldDecorator
(
'
updatedAt
'
)(
<
DatePicker
style
=
{{
width
:
272
}}
/
>
)}
<
/FormItem
>
<
FormItem
label
=
"
调用次数
"
>
{
getFieldDecorator
(
'
callNo
'
)(
<
InputNumber
prefix
=
{
<
Icon
type
=
"
right
"
/>
}
placeholder
=
"
请输入
"
style
=
{{
width
:
272
}}
/
>
)}
<
/FormItem
>
<
/div
>
)
}
<
/Form
>
{
this
.
renderForm
()}
<
/div
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
Button
icon
=
"
plus
"
type
=
"
primary
"
onClick
=
{()
=>
this
.
handleModalVisible
(
true
)}
>
新建
<
/Button
>
...
...
src/routes/List/TableList.less
View file @
a5b4c85b
...
...
@@ -10,13 +10,16 @@
}
}
.tableListForm :global(.ant-form-item) {
margin-right: 48px;
margin-bottom: 8px;
}
.formButton {
white-space: nowrap;
.tableListForm {
:global {
.ant-form-item {
margin-bottom: 24px;
display: flex;
}
.ant-form-item-control-wrapper {
flex: 1;
}
}
}
@media screen and (max-width: @screen-lg) {
...
...
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