Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
GCL_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
안형욱
2021-06-13 20:54:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0bbd42f87621ee3fa200027116530d7d6d1d604d
0bbd42f8
1 parent
df714abf
style: 고급 검색 ui 개선
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
27 deletions
frontend/src/components/SearchOptionModal.js
frontend/src/components/common/Button.js
frontend/src/components/common/Input.js
frontend/src/components/document/Thumbnail.js
frontend/src/lib/api/elasticsearch.js
frontend/src/components/SearchOptionModal.js
View file @
0bbd42f
...
...
@@ -8,7 +8,7 @@ const Background = styled.div``;
const
ModalWrapper
=
styled
.
div
`
width: 400px;
height:
300
px;
height:
194
px;
`
;
const
ModalContent
=
styled
.
div
`
...
...
@@ -23,13 +23,13 @@ const ModalContent = styled.div`
const
SearchWrap
=
styled
.
div
`
position: absolute;
top: 80%;
lef
t: 20%;
righ
t: 20%;
`
;
const
CloseWrap
=
styled
.
div
`
position: absolute;
top: 80%;
righ
t: 20%;
lef
t: 20%;
`
;
const
StandardWrap
=
styled
.
div
`
...
...
@@ -51,7 +51,6 @@ const TextWrap = styled.div`
width: 360px;
top:
${
props
=>
props
.
top
}
;
right:
${
props
=>
props
.
right
}
;
border-bottom: 2px solid #dee2e6;
padding-left: 20px;
padding-bottom:
${
props
=>
props
.
bottom
}
;
`
;
...
...
@@ -59,8 +58,7 @@ const TextWrap = styled.div`
const
Modal
=
({
showModal
,
setShowModal
})
=>
{
const
[
query
,
setQuery
]
=
useState
(
''
);
const
[
keywordQuery
,
setKeywordQuery
]
=
useState
(
''
);
const
[
writerQuery
,
setWriterQuery
]
=
useState
(
''
);
const
[
dateQuery
,
setDateQuery
]
=
useState
(
''
);
const
[
writer
,
setWriter
]
=
useState
(
''
);
const
history
=
useHistory
();
const
modalRef
=
useRef
();
const
closeModal
=
e
=>
{
...
...
@@ -76,7 +74,7 @@ const Modal = ({ showModal, setShowModal }) => {
<
Card
shadow
=
"lg"
>
<
ModalWrapper
>
<
ModalContent
>
<
TextWrap
top
=
"
6
%"
right
=
"10%"
bottom
=
"4%"
height
=
"40px"
>
<
TextWrap
top
=
"
8
%"
right
=
"10%"
bottom
=
"4%"
height
=
"40px"
>
기본검색
<
/TextWrap
>
<
StandardWrap
>
...
...
@@ -103,7 +101,7 @@ const Modal = ({ showModal, setShowModal }) => {
}}
/
>
<
/StandardWrap
>
<
TextWrap
top
=
"
2
4%"
right
=
"10%"
bottom
=
"31%"
>
<
TextWrap
top
=
"
3
4%"
right
=
"10%"
bottom
=
"31%"
>
고급검색
<
/TextWrap
>
<
AdvancedWrap
>
...
...
@@ -124,28 +122,29 @@ const Modal = ({ showModal, setShowModal }) => {
}}
placeholder
=
"작성자"
type
=
"text"
value
=
{
decodeURIComponent
(
writerQuery
)}
onChange
=
{
e
=>
setWriterQuery
(
e
.
target
.
value
)}
/
>
<
TextInput
inputStyle
=
{{
marginBottom
:
18
,
fontSize
:
15
,
}}
placeholder
=
"생성 날짜"
type
=
"text"
value
=
{
decodeURIComponent
(
dateQuery
)}
onChange
=
{
e
=>
setDateQuery
(
e
.
target
.
value
)}
value
=
{
decodeURIComponent
(
writer
)}
onChange
=
{
e
=>
setWriter
(
e
.
target
.
value
)}
/
>
<
/AdvancedWrap
>
<
/ModalContent
>
<
CloseWrap
onClick
=
{()
=>
setShowModal
(
prev
=>
!
prev
)}
>
<
Button
width
=
"100px"
color
=
"
blue
"
>
<
Button
width
=
"100px"
color
=
"
gray
"
>
닫기
<
/Button
>
<
/CloseWrap
>
<
SearchWrap
>
<
Button
width
=
"100px"
color
=
"gray"
>
<
SearchWrap
onClick
=
{()
=>
{
const
searchQuery
=
{};
if
(
query
!==
''
)
searchQuery
.
query
=
query
;
if
(
keywordQuery
!==
''
)
searchQuery
.
keyword
=
keywordQuery
;
if
(
writer
!==
''
)
searchQuery
.
writer
=
writer
;
const
params
=
new
URLSearchParams
(
searchQuery
);
history
.
push
(
`search?
${
decodeURIComponent
(
params
.
toString
())}
`
);
}}
>
<
Button
width
=
"100px"
color
=
"blue"
>
검색
<
/Button
>
<
/SearchWrap
>
...
...
frontend/src/components/common/Button.js
View file @
0bbd42f
...
...
@@ -18,10 +18,16 @@ const Buttons = ({
width
,
fontsize
,
icon
=
''
,
onClick
,
})
=>
{
return
(
<
ButtonBlock
float
=
{
float
}
width
=
{
width
}
fontsize
=
{
fontsize
}
>
<
Button
size
=
{
size
}
color
=
{
color
||
'blue'
}
rightIcon
=
{
icon
}
>
<
Button
onClick
=
{
onClick
}
size
=
{
size
}
color
=
{
color
||
'blue'
}
rightIcon
=
{
icon
}
>
{
children
}
<
/Button>
<
/ButtonBlock>
...
...
frontend/src/components/common/Input.js
View file @
0bbd42f
...
...
@@ -43,8 +43,10 @@ const MyInput = ({
})
=>
{
const
[
query
,
setQuery
]
=
useState
(
''
);
const
history
=
useHistory
();
const
search
=
useLocation
();
const
name
=
decodeURIComponent
(
search
.
search
.
substring
(
7
));
const
{
search
}
=
useLocation
();
const
name
=
decodeURIComponent
(
new
URLSearchParams
(
search
).
get
(
'query'
)
||
''
);
const
dispatch
=
useDispatch
();
useEffect
(()
=>
{
...
...
frontend/src/components/document/Thumbnail.js
View file @
0bbd42f
...
...
@@ -15,7 +15,6 @@ const ImageWrapper = styled.div`
`
;
const
Thumbnails
=
({
srcs
})
=>
{
const
[
lists
,
setLists
]
=
useState
([]);
console
.
log
(
srcs
);
const
placeholder
=
()
=>
{
if
(
srcs
.
length
<
4
)
{
const
list
=
[];
...
...
frontend/src/lib/api/elasticsearch.js
View file @
0bbd42f
...
...
@@ -19,4 +19,12 @@ export const esApi = {
return
res
.
data
;
},
// searchByFilter: async (filters, searchWord = '') => {
// // const res = await esInstance.post(
// // `/api/as/v1/engines/${process.env.REACT_APP_ENGINE_NAME}/search`,
// // {
// // query: searchWord,
// // }
// // );
// },
};
...
...
Please
register
or
login
to post a comment