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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
26 deletions
+44
-26
request.jsx
src/pages/testPages/request.jsx
+44
-26
No files found.
src/pages/testPages/request.jsx
View file @
16e709a3
import
React
,
{
useState
}
from
'react'
;
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
{
MinusCircleOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
post
}
from
'services'
;
import
{
get
,
post
}
from
'services'
;
...
@@ -56,11 +56,22 @@ const RequestTest = () => {
...
@@ -56,11 +56,22 @@ const RequestTest = () => {
</
Select
>
</
Select
>
);
);
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
14
},
};
const
paramItemLayout
=
{
labebCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
24
},
};
return
(
return
(
<
Form
<
Form
form=
{
form
}
form=
{
form
}
name=
"dynamic_form_nest_item"
name=
"dynamic_form_nest_item"
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
{
...
formItemLayout
}
autoComplete=
"off"
autoComplete=
"off"
>
>
<
Form
.
Item
<
Form
.
Item
...
@@ -83,30 +94,37 @@ const RequestTest = () => {
...
@@ -83,30 +94,37 @@ const RequestTest = () => {
{
(
fields
,
{
add
,
remove
})
=>
(
{
(
fields
,
{
add
,
remove
})
=>
(
<>
<>
{
fields
.
map
(
field
=>
(
{
fields
.
map
(
field
=>
(
<
Space
key=
{
field
.
key
}
align=
"start"
>
<
Col
span=
{
14
}
offset=
{
5
}
>
<
Form
.
Item
<
Space
key=
{
field
.
key
}
align=
"start"
>
{
...
field
}
<
Form
.
Item
label=
"key"
{
...
field
}
name=
{
[
field
.
name
,
'key'
]
}
label=
"key"
fieldKey=
{
[
field
.
fieldKey
,
'key'
]
}
name=
{
[
field
.
name
,
'key'
]
}
rules=
{
[{
required
:
true
,
message
:
'Missing key'
}]
}
fieldKey=
{
[
field
.
fieldKey
,
'key'
]
}
>
{
...
paramItemLayout
}
<
Input
/>
rules=
{
[{
required
:
true
,
message
:
'Missing key'
}]
}
</
Form
.
Item
>
>
<
Form
.
Item
<
Input
/>
{
...
field
}
</
Form
.
Item
>
label=
"value"
<
Form
.
Item
fieldKey=
{
[
field
.
fieldKey
,
'value'
]
}
{
...
field
}
name=
{
[
field
.
name
,
'value'
]
}
label=
"value"
>
{
...
paramItemLayout
}
<
Input
/>
fieldKey=
{
[
field
.
fieldKey
,
'value'
]
}
</
Form
.
Item
>
name=
{
[
field
.
name
,
'value'
]
}
<
MinusCircleOutlined
>
onClick=
{
()
=>
console
.
log
(
field
)
||
remove
(
field
.
name
)
}
<
Input
/>
/>
</
Form
.
Item
>
</
Space
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
field
.
name
)
}
/>
</
Space
>
</
Col
>
))
}
))
}
<
Form
.
Item
>
<
Form
.
Item
wrapperCol=
{
{
span
:
14
,
offset
:
5
,
}
}
>
<
Button
<
Button
type=
"dashed"
type=
"dashed"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -121,8 +139,8 @@ const RequestTest = () => {
...
@@ -121,8 +139,8 @@ const RequestTest = () => {
)
}
)
}
</
Form
.
List
>
</
Form
.
List
>
<
Form
.
Item
>
<
Form
.
Item
wrapperCol=
{
{
span
:
5
,
offset
:
10
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
block
>
Submit
Submit
</
Button
>
</
Button
>
</
Form
.
Item
>
</
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