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
90736543
Commit
90736543
authored
Sep 02, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
be8f5f8e
0ca7ff75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
14 deletions
+65
-14
index.less
src/components/UploadImage/index.less
+35
-1
index.tsx
src/components/UploadImage/index.tsx
+18
-9
index.tsx
src/pages/classAndProperty/class/index.tsx
+2
-2
basicInfoForm.tsx
...ages/commodity/products/addProductsItem/basicInfoForm.tsx
+10
-2
No files found.
src/components/UploadImage/index.less
View file @
90736543
...
...
@@ -4,6 +4,7 @@
.size_require {
color: #97A0AF;
margin-left: 24px;
}
.upload_btn {
...
...
@@ -11,7 +12,6 @@
width: 104px;
height: 104px;
display: flex;
margin-right: 24px;
align-items: center;
justify-content: center;
color: #6B778C;
...
...
@@ -42,4 +42,37 @@
margin-top: 12px;
}
}
// 删除效果
.delete_wrap {
display: none;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
position: absolute;
left: 0;
top: 0;
border-radius: 2px;
.delete_btn {
color: #fff;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
}
}
.upload_wrap{
position: relative;
width: 104px;
height: 104px;
&:hover {
.delete_wrap {
display: block;
}
}
}
}
\ No newline at end of file
src/components/UploadImage/index.tsx
View file @
90736543
import
React
,
{
useState
,
Fragment
,
forwardRef
}
from
'react'
import
{
Upload
,
message
}
from
'antd'
import
{
LoadingOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
import
{
Upload
,
message
,
Button
}
from
'antd'
import
{
LoadingOutlined
,
PlusOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
import
{
UploadFile
,
UploadChangeParam
}
from
'antd/lib/upload/interface'
import
cx
from
'classnames'
import
styles
from
'./index.less'
...
...
@@ -58,6 +58,10 @@ const UploadImage: React.FC<UploadImagePorpsType> = forwardRef((props, ref) => {
beforeUpload
};
const
clearImage
=
()
=>
{
onChange
(
''
)
}
const
uploadButton
=
(
<
Fragment
>
{
loading
?
<
LoadingOutlined
/>
:
<
PlusOutlined
/>
}
...
...
@@ -67,13 +71,18 @@ const UploadImage: React.FC<UploadImagePorpsType> = forwardRef((props, ref) => {
return
(
<
div
className=
{
styles
.
upload_image_wrap
}
>
<
Upload
{
...
uploadProps
}
>
{
<
div
className=
{
cx
(
styles
.
upload_btn
,
!
imgUrl
?
styles
.
isAdd
:
""
,
large
?
styles
.
large
:
''
)
}
>
{
imgUrl
?
<
img
src=
{
imgUrl
}
/>
:
uploadButton
}
</
div
>
}
</
Upload
>
<
div
className=
{
styles
.
upload_wrap
}
>
<
Upload
{
...
uploadProps
}
>
{
<
div
className=
{
cx
(
styles
.
upload_btn
,
!
imgUrl
?
styles
.
isAdd
:
""
,
large
?
styles
.
large
:
''
)
}
>
{
imgUrl
?
<
img
src=
{
imgUrl
}
/>
:
uploadButton
}
</
div
>
}
</
Upload
>
{
imgUrl
&&
<
div
className=
{
styles
.
delete_wrap
}
><
Button
onClick=
{
clearImage
}
className=
{
styles
.
delete_btn
}
type=
"text"
icon=
{
<
DeleteOutlined
/>
}
/></
div
>
}
</
div
>
{
showDesc
&&
<
div
className=
{
styles
.
size_require
}
>
...
...
src/pages/classAndProperty/class/index.tsx
View file @
90736543
...
...
@@ -96,6 +96,7 @@ const ClassProperty: React.FC<{}> = () => {
setNodeRecord
(
undefined
)
// 保存后要将是否填写过表单设为false
setIsEditForm
(
false
)
flag
=
false
})
}
...
...
@@ -175,12 +176,11 @@ const ClassProperty: React.FC<{}> = () => {
setIsEditForm
(
true
)
})
$
(
'onFieldValueChange'
,
'name, type, imageUrl, category'
).
subscribe
(
state
=>
{
console
.
log
(
flag
,
'flag'
)
if
(
flag
){
setIsEditForm
(
true
)
flag
=
false
}
else
flag
=
true
})
}
}
schema=
{
classSchema
}
...
...
src/pages/commodity/products/addProductsItem/basicInfoForm.tsx
View file @
90736543
...
...
@@ -72,8 +72,16 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
useEffect
(()
=>
{
// 获取品类树
PublicApi
.
getProductCustomerGetCustomerCategoryTree
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setCustomerCategoryTree
(
res
.
data
)
if
(
res
.
code
===
1000
){
// 过滤children空数组
let
{
data
}
=
res
data
.
map
(
item
=>
{
if
(
!
item
.
children
.
length
)
delete
item
.
children
})
console
.
log
(
data
)
setCustomerCategoryTree
(
data
)
}
})
//获取省市区
PublicApi
.
getManageAreaAll
().
then
(
res
=>
{
...
...
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