Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
16e709a3
Commit
16e709a3
authored
Oct 22, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: 优化页面展示
parent
1cfebb1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
request.jsx
src/pages/testPages/request.jsx
+25
-7
No files found.
src/pages/testPages/request.jsx
View file @
16e709a3
import
React
,
{
useState
}
from
'react'
;
import
{
Form
,
Input
,
Button
,
Space
,
Select
}
from
'antd'
;
import
{
Form
,
Input
,
Button
,
Space
,
Select
,
Col
}
from
'antd'
;
import
{
MinusCircleOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
post
}
from
'services'
;
...
...
@@ -56,11 +56,22 @@ const RequestTest = () => {
</
Select
>
);
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
14
},
};
const
paramItemLayout
=
{
labebCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
24
},
};
return
(
<
Form
form=
{
form
}
name=
"dynamic_form_nest_item"
onFinish=
{
onFinish
}
{
...
formItemLayout
}
autoComplete=
"off"
>
<
Form
.
Item
...
...
@@ -83,12 +94,14 @@ const RequestTest = () => {
{
(
fields
,
{
add
,
remove
})
=>
(
<>
{
fields
.
map
(
field
=>
(
<
Col
span=
{
14
}
offset=
{
5
}
>
<
Space
key=
{
field
.
key
}
align=
"start"
>
<
Form
.
Item
{
...
field
}
label=
"key"
name=
{
[
field
.
name
,
'key'
]
}
fieldKey=
{
[
field
.
fieldKey
,
'key'
]
}
{
...
paramItemLayout
}
rules=
{
[{
required
:
true
,
message
:
'Missing key'
}]
}
>
<
Input
/>
...
...
@@ -96,17 +109,22 @@ const RequestTest = () => {
<
Form
.
Item
{
...
field
}
label=
"value"
{
...
paramItemLayout
}
fieldKey=
{
[
field
.
fieldKey
,
'value'
]
}
name=
{
[
field
.
name
,
'value'
]
}
>
<
Input
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
console
.
log
(
field
)
||
remove
(
field
.
name
)
}
/>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
field
.
name
)
}
/>
</
Space
>
</
Col
>
))
}
<
Form
.
Item
>
<
Form
.
Item
wrapperCol=
{
{
span
:
14
,
offset
:
5
,
}
}
>
<
Button
type=
"dashed"
onClick=
{
()
=>
{
...
...
@@ -121,8 +139,8 @@ const RequestTest = () => {
)
}
</
Form
.
List
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Form
.
Item
wrapperCol=
{
{
span
:
5
,
offset
:
10
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
block
>
Submit
</
Button
>
</
Form
.
Item
>
...
...
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