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
ef0eaf39
Commit
ef0eaf39
authored
Dec 04, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 图库搜索
parent
73291171
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
index.less
src/components/Upload/index.less
+8
-2
index.tsx
src/components/Upload/index.tsx
+16
-4
No files found.
src/components/Upload/index.less
View file @
ef0eaf39
...
...
@@ -27,7 +27,12 @@
cursor: pointer;
border-bottom: 1px solid #2f54eb;
}
.search{
width: 50%;
}
.hide{
display: none !important;
}
.svgBg{
background: #aaa;
background-image: linear-gradient(white 0px, transparent 0), linear-gradient(hsla(0,0%,100%,.3) 1px, transparent 0), linear-gradient(90deg, hsla(0,0%,100%,.3) 1px, transparent 0);
...
...
@@ -66,6 +71,7 @@
&:hover>span{
color: #2f54eb;
}
img {
margin: auto;
width: 100%;
...
...
@@ -76,7 +82,7 @@
background-color: rgba(238,238,238,1);
}
&:hover,
&.seleted {
&
>
.seleted {
.iconBtn {
visibility: visible;
}
...
...
src/components/Upload/index.tsx
View file @
ef0eaf39
import
React
from
'react'
;
import
{
Upload
,
Modal
,
message
,
Tabs
,
Result
}
from
'antd'
;
import
{
Upload
,
Modal
,
message
,
Tabs
,
Result
,
Input
}
from
'antd'
;
import
{
PlusOutlined
,
CheckCircleFilled
}
from
'@ant-design/icons'
;
import
ImgCrop
from
'antd-img-crop'
;
import
classnames
from
'classnames'
;
...
...
@@ -46,6 +46,7 @@ interface PicturesWallType {
type
?:
'CityTemp'
|
'icon'
|
'androidMenu'
|
'menuNew'
,
value
?:
string
|
string
[],
uploadContext
:
any
,
search
:
string
,
}
class
PicturesWall
extends
React
.
Component
<
PicturesWallType
>
{
...
...
@@ -57,6 +58,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
imgBed
:
this
.
props
.
uploadContext
?.
imgBed
||
[],
curSelectedImg
:
''
,
prevProps
:{},
search
:
''
,
fileList
:
this
.
props
.
value
?
Array
.
isArray
(
this
.
props
.
value
)
?
this
.
props
.
value
.
map
((
v
)
=>
({
url
:
v
,
uid
:
uuid
(
8
,
16
),
...
...
@@ -331,25 +333,35 @@ class PicturesWall extends React.Component<PicturesWallType> {
{
imgBed
.
map
((
item
,
i
)
=>
{
return
(
<
TabPane
tab=
{
tabNames
[
item
.
moduleName
]
}
key=
{
item
.
moduleName
}
>
<
Input
placeholder=
"搜索图库"
className=
{
styles
.
search
}
size=
"middle"
value=
{
this
.
state
.
search
}
onChange=
{
e
=>
this
.
setState
({
search
:
e
.
target
.
value
})
}
allowClear
/>
<
div
className=
{
styles
.
imgBox
}
>
{
item
.
child
?.
map
(
m
=>
m
.
fileUrls
).
flat
(
Infinity
).
map
((
item
:
string
,
i
:
number
)
=>
{
const
fileName
=
this
.
getFileName
(
item
)
return
(
<
div
className=
{
styles
.
imgItem
}
className=
{
classnames
({
[
styles
.
imgItem
]:
true
,
[
styles
.
hide
]:
!
fileName
.
includes
(
this
.
state
.
search
)
})
}
key=
{
i
}
onClick=
{
()
=>
this
.
handleImgSelected
(
item
)
}
>
<
div
className=
{
classnames
(
curSelectedImg
===
item
?
styles
.
seleted
:
''
,
)
}
>
<
img
className=
{
classnames
({[
styles
.
svgGray
]:
/
\
.
svg$
/
.
test
(
item
)})
}
src=
{
this
.
getImageUrl
(
item
)
}
title=
{
item
}
alt=
"熊猫运维中台系统"
/>
<
span
className=
{
styles
.
iconBtn
}
>
<
CheckCircleFilled
/>
</
span
>
</
div
>
<
span
>
{
this
.
getFileName
(
item
)
}
</
span
>
<
span
>
{
fileName
}
</
span
>
</
div
>
);
})
}
...
...
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