Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
前端-黄佳鑫
jinfa-platform
Commits
7469d7b1
Commit
7469d7b1
authored
Jun 15, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调价删除按钮相关
parent
3979a4b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
index.less
...ages/member/components/QualitiesUploadFormItem/index.less
+6
-0
index.tsx
...pages/member/components/QualitiesUploadFormItem/index.tsx
+41
-11
No files found.
src/pages/member/components/QualitiesUploadFormItem/index.less
View file @
7469d7b1
...
@@ -14,4 +14,9 @@
...
@@ -14,4 +14,9 @@
&:hover {
&:hover {
background-color: @descriptions-bg;
background-color: @descriptions-bg;
}
}
}
.del-btn {
position: relative;
top: -10px;
}
}
\ No newline at end of file
src/pages/member/components/QualitiesUploadFormItem/index.tsx
View file @
7469d7b1
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-01 16:13:35
* @Date: 2021-06-01 16:13:35
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-
07 16:18:24
* @LastEditTime: 2021-06-
15 11:53:20
* @Description: 资质证明上传组件
* @Description: 资质证明上传组件
*/
*/
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Row
,
Col
,
Button
}
from
'antd'
;
import
{
Row
,
Col
,
Button
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
CloseCircleOutlined
}
from
'@ant-design/icons'
;
import
{
ArrayList
}
from
'@formily/react-shared-components'
;
import
{
ArrayList
}
from
'@formily/react-shared-components'
;
import
{
Schema
,
SchemaField
}
from
'@formily/antd'
;
import
{
Schema
,
SchemaField
}
from
'@formily/antd'
;
import
{
toArr
,
FormPath
}
from
'@formily/shared'
;
import
{
toArr
,
FormPath
}
from
'@formily/shared'
;
...
@@ -16,6 +16,12 @@ import {
...
@@ -16,6 +16,12 @@ import {
}
from
'@/constants'
;
}
from
'@/constants'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
expireDayTitle
=
(
<
span
style=
{
{
marginTop
:
40
}
}
>
到期日
</
span
>
);
const
schema
=
new
Schema
({
const
schema
=
new
Schema
({
type
:
'object'
,
type
:
'object'
,
properties
:
{
properties
:
{
...
@@ -39,6 +45,12 @@ const schema = new Schema({
...
@@ -39,6 +45,12 @@ const schema = new Schema({
},
},
accept
:
'.doc, .docx, .xls, .xlsx, .pot, .pps, .vsd, .wps, .dps, .pdf, .txt, .png, .jpg, .rar, .zip'
,
accept
:
'.doc, .docx, .xls, .xlsx, .pot, .pps, .vsd, .wps, .dps, .pdf, .txt, .png, .jpg, .rar, .zip'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请上传资质证明'
,
},
],
},
},
MEGA_LAYOUT2
:
{
MEGA_LAYOUT2
:
{
type
:
'object'
,
type
:
'object'
,
...
@@ -46,8 +58,13 @@ const schema = new Schema({
...
@@ -46,8 +58,13 @@ const schema = new Schema({
properties
:
{
properties
:
{
expireDay
:
{
expireDay
:
{
type
:
'string'
,
type
:
'string'
,
title
:
'到期日'
,
title
:
expireDayTitle
,
'x-component'
:
'DatePicker'
,
'x-component'
:
'DatePicker'
,
'x-component-props'
:
{
style
:
{
marginTop
:
20
,
},
},
},
},
permanent
:
{
permanent
:
{
type
:
'string'
,
type
:
'string'
,
...
@@ -75,7 +92,8 @@ const QualitiesUploadFormItem = (props) => {
...
@@ -75,7 +92,8 @@ const QualitiesUploadFormItem = (props) => {
}
=
props
;
}
=
props
;
const
{
colSpan
}
=
(
props
.
props
[
'x-component-props'
]
||
{});
const
{
colSpan
}
=
(
props
.
props
[
'x-component-props'
]
||
{});
const
onAdd
=
()
=>
mutators
.
push
(
schema
.
getEmptyValue
())
const
onAdd
=
()
=>
mutators
.
push
(
schema
.
getEmptyValue
());
const
onRemove
=
index
=>
mutators
.
remove
(
index
);
const
span
=
colSpan
?
{
const
span
=
colSpan
?
{
span
:
colSpan
,
span
:
colSpan
,
...
@@ -89,16 +107,28 @@ const QualitiesUploadFormItem = (props) => {
...
@@ -89,16 +107,28 @@ const QualitiesUploadFormItem = (props) => {
<
ArrayList
value=
{
value
}
>
<
ArrayList
value=
{
value
}
>
<
Row
<
Row
gutter=
{
{
sm
:
44
,
md
:
88
,
lg
:
88
}
}
gutter=
{
{
sm
:
44
,
md
:
88
,
lg
:
88
}
}
style=
{
{
width
:
'100%'
,
}
}
>
>
{
toArr
(
value
).
map
((
item
,
index
)
=>
(
{
toArr
(
value
).
map
((
item
,
index
)
=>
(
<
Col
key=
{
index
}
{
...
span
}
>
<
Col
key=
{
index
}
{
...
span
}
>
<
SchemaField
<
Row
path=
{
FormPath
.
parse
(
path
).
concat
(
index
)
}
gutter=
{
50
}
schema=
{
schema
}
align=
"middle"
/>
>
<
Col
flex=
{
1
}
>
<
SchemaField
path=
{
FormPath
.
parse
(
path
).
concat
(
index
)
}
schema=
{
schema
}
/>
</
Col
>
<
Col
>
<
Button
onClick=
{
()
=>
onRemove
(
index
)
}
type=
"link"
icon=
{
<
CloseCircleOutlined
style=
{
{
fontSize
:
20
}
}
/>
}
className=
{
styles
[
'del-btn'
]
}
/>
</
Col
>
</
Row
>
</
Col
>
</
Col
>
))
}
))
}
{
editable
&&
(
{
editable
&&
(
...
...
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