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
Show 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
React
,
{
PureComponent
}
from
'
react
'
;
import
{
connect
}
from
'
dva
'
;
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
StandardTable
from
'
../../components/StandardTable
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
...
@@ -152,66 +152,135 @@ export default class TableList extends PureComponent {
...
@@ -152,66 +152,135 @@ export default class TableList extends PureComponent {
});
});
}
}
render
()
{
renderSimpleForm
()
{
const
{
rule
:
{
loading
:
ruleLoading
,
data
},
form
:
{
getFieldDecorator
}
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
selectedRows
,
modalVisible
,
addInputValue
}
=
this
.
state
;
const
menu
=
(
<
Menu
onClick
=
{
this
.
handleMenuClick
}
selectedKeys
=
{[]}
>
<
Menu
.
Item
key
=
"
remove
"
>
删除
<
/Menu.Item
>
<
Menu
.
Item
key
=
"
approval
"
>
批量审批
<
/Menu.Item
>
<
/Menu
>
);
return
(
return
(
<
PageHeaderLayout
title
=
"
查询表格
"
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
<
Form
onSubmit
=
{
this
.
handleSearch
}
layout
=
"
inline
"
>
<
Form
onSubmit
=
{
this
.
handleSearch
}
layout
=
"
inline
"
>
<
div
style
=
{{
marginBottom
:
16
}}
>
<
Row
gutter
=
{
48
}
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
规则编号
"
>
<
FormItem
label
=
"
规则编号
"
>
{
getFieldDecorator
(
'
no
'
)(
{
getFieldDecorator
(
'
no
'
)(
<
Input
placeholder
=
"
请输入
"
style
=
{{
width
:
272
}}
/
>
<
Input
placeholder
=
"
请输入
"
/>
)}
)}
<
/FormItem
>
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
使用状态
"
>
<
FormItem
label
=
"
使用状态
"
>
{
getFieldDecorator
(
'
status
'
)(
{
getFieldDecorator
(
'
status
'
)(
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
272
}}
>
<
Select
placeholder
=
"
请选择
"
style
=
{{
width
:
'
100%
'
}}
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
0
"
>
关闭
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
Option
value
=
"
1
"
>
运行中
<
/Option
>
<
/Select
>
<
/Select
>
)}
)}
<
/FormItem
>
<
/FormItem
>
<
span
className
=
{
styles
.
formButton
}
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
span
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
>
查询
<
/Button
>
<
Button
type
=
"
primary
"
htmlType
=
"
submit
"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
a
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
toggleForm
}
>
<
a
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
toggleForm
}
>
{
this
.
state
.
expandForm
?
'
收起
'
:
'
展开
'
}
<
Icon
type
=
{
this
.
state
.
expandForm
?
'
up
'
:
'
down
'
}
/
>
展开
<
Icon
type
=
"
down
"
/>
<
/a
>
<
/a
>
<
/span
>
<
/span
>
<
/div
>
<
/Col
>
{
<
/Row
>
this
.
state
.
expandForm
&&
(
<
/Form
>
<
div
style
=
{{
marginBottom
:
16
}}
>
);
<
FormItem
label
=
"
更新时间
"
>
}
{
getFieldDecorator
(
'
updatedAt
'
)(
<
DatePicker
style
=
{{
width
:
272
}}
/
>
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
>
<
/FormItem
>
<
/Col
>
<
Col
span
=
{
8
}
>
<
FormItem
label
=
"
调用次数
"
>
<
FormItem
label
=
"
调用次数
"
>
{
getFieldDecorator
(
'
callNo
'
)(
{
getFieldDecorator
(
'
number
'
)(
<
InputNumber
<
InputNumber
style
=
{{
width
:
'
100%
'
}}
/
>
prefix
=
{
<
Icon
type
=
"
right
"
/>
}
)}
placeholder
=
"
请输入
"
<
/FormItem
>
style
=
{{
width
:
272
}}
<
/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
>
<
/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
>
<
/div
>
)
}
<
/Form
>
<
/Form
>
);
}
renderForm
()
{
return
this
.
state
.
expandForm
?
this
.
renderAdvancedForm
()
:
this
.
renderSimpleForm
();
}
render
()
{
const
{
rule
:
{
loading
:
ruleLoading
,
data
}
}
=
this
.
props
;
const
{
selectedRows
,
modalVisible
,
addInputValue
}
=
this
.
state
;
const
menu
=
(
<
Menu
onClick
=
{
this
.
handleMenuClick
}
selectedKeys
=
{[]}
>
<
Menu
.
Item
key
=
"
remove
"
>
删除
<
/Menu.Item
>
<
Menu
.
Item
key
=
"
approval
"
>
批量审批
<
/Menu.Item
>
<
/Menu
>
);
return
(
<
PageHeaderLayout
title
=
"
查询表格
"
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
{
this
.
renderForm
()}
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
Button
icon
=
"
plus
"
type
=
"
primary
"
onClick
=
{()
=>
this
.
handleModalVisible
(
true
)}
>
新建
<
/Button
>
<
Button
icon
=
"
plus
"
type
=
"
primary
"
onClick
=
{()
=>
this
.
handleModalVisible
(
true
)}
>
新建
<
/Button
>
...
...
src/routes/List/TableList.less
View file @
a5b4c85b
...
@@ -10,13 +10,16 @@
...
@@ -10,13 +10,16 @@
}
}
}
}
.tableListForm :global(.ant-form-item) {
.tableListForm {
margin-right: 48px;
:global {
margin-bottom: 8px;
.ant-form-item {
}
margin-bottom: 24px;
display: flex;
.formButton {
}
white-space: nowrap;
.ant-form-item-control-wrapper {
flex: 1;
}
}
}
}
@media screen and (max-width: @screen-lg) {
@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