Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
fee7e28c
Commit
fee7e28c
authored
Feb 14, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索全部内容
parent
f9b24111
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
124 additions
and
14 deletions
+124
-14
components/pc/combinedCard.vue
+44
-0
components/pc/pageHeader.vue
+1
-1
pages/search.vue
+34
-8
pages/search/all.vue
+45
-0
pages/search/blog.vue
+0
-1
pages/search/project.vue
+0
-1
pages/search/question.vue
+0
-1
pages/search/topic.vue
+0
-1
pages/search/user.vue
+0
-1
No files found.
components/pc/combinedCard.vue
0 → 100644
View file @
fee7e28c
<
template
>
<div>
<project-card
:info=
"info"
v-if=
"info.itemType==='BLOG'||info.itemType==='PROJECT'"
></project-card>
<answer-card
:info=
"info"
v-if=
"info.itemType==='ANSWER'"
></answer-card>
<topic-card
:info=
"info"
v-if=
"info.itemType==='TOPIC'"
></topic-card>
<user-card
from=
"other"
:info=
"info"
v-if=
"info.itemType==='USER'"
></user-card>
</div>
</
template
>
<
script
>
import
ProjectCard
from
'./projectCard'
;
import
AnswerCard
from
'./answerCard'
;
import
TopicCard
from
'./topicCard'
;
import
UserCard
from
'./fanCard'
export
default
{
components
:{
ProjectCard
,
AnswerCard
,
TopicCard
,
UserCard
},
props
:{
info
:{
type
:
Object
,
default
:()
=>
({})
}
},
created
()
{
if
(
this
.
info
.
itemType
===
"BLOG"
||
this
.
info
.
itemType
===
"PROJECT"
){
}
if
(
this
.
info
.
itemType
===
"TOPIC"
){
}
if
(
this
.
info
.
itemType
===
"ANSWER"
){
}
if
(
this
.
info
.
itemType
===
"USESR"
){
}
}
}
</
script
>
components/pc/pageHeader.vue
View file @
fee7e28c
...
...
@@ -204,7 +204,7 @@
clickToSearch
(){
let
searchValue
=
this
.
searchValue
;
this
.
$router
.
push
(
'/search/
project
?keywords='
+
searchValue
)
this
.
$router
.
push
(
'/search/
all
?keywords='
+
searchValue
)
},
handleLogout
()
{
this
.
$alert
(
'确认注销登录?'
,
''
,
{
...
...
pages/search.vue
View file @
fee7e28c
...
...
@@ -20,7 +20,7 @@
<!--
<transition
name=
"fade-transform"
mode=
"out-in"
>
-->
<nuxt-child
:total=
"total"
:keywords=
"keywords"
:resultList=
"resultList"
></nuxt-child>
<!--
</transition>
-->
<pagination
style=
"margin:
0
auto;"
:pages=
"pages"
ref=
"pagination"
v-on:listenPageChange=
"changePage"
></pagination>
<pagination
style=
"margin:
30px
auto;"
:pages=
"pages"
ref=
"pagination"
v-on:listenPageChange=
"changePage"
></pagination>
</div>
<div
class=
"search-center__right"
>
...
...
@@ -77,6 +77,10 @@
return
{
list
:[
{
label
:
"全部"
,
address
:
"/search/all"
},
{
label
:
"项目"
,
address
:
"/search/project"
},
...
...
@@ -99,7 +103,8 @@
],
resultList
:[],
pages
:
1
,
keywords
:
''
keywords
:
''
,
total
:
0
}
},
created
()
{
...
...
@@ -109,6 +114,14 @@
watch
:{
$route
(){
this
.
resultList
=
[];
this
.
total
=
0
;
this
.
restartPagination
();
this
.
dataGetSearch
(
1
);
},
keywords
(
val
){
this
.
resultList
=
[];
this
.
total
=
0
;
this
.
restartPagination
();
this
.
dataGetSearch
(
1
);
}
...
...
@@ -129,12 +142,21 @@
let
keywords
=
keywords2
||
this
.
keywords
;
let
index
=
pathName
.
lastIndexOf
(
'-'
);
let
name
=
pathName
.
substring
(
index
+
1
);
let
params
=
{
page
:
currentPage
,
size
:
8
,
keywords
,
type
:
name
.
toUpperCase
()
};
let
params
;
if
(
name
.
toUpperCase
()
!==
'ALL'
){
params
=
{
page
:
currentPage
,
size
:
8
,
keywords
,
type
:
name
.
toUpperCase
()
};
}
else
{
params
=
{
page
:
currentPage
,
size
:
8
,
keywords
,
};
}
this
.
$axios
.
$get
(
config
.
api
.
get
.
Search
.
search
,{
params
:
params
...
...
@@ -198,6 +220,10 @@
@extend
%flex-row-spb;
align-items
:
start
;
}
.search-center__content
{
min-height
:
700
*$
length
;
}
.search-center__right
{
.search-container__rightone{
width
:
282
*$
length
;
...
...
pages/search/all.vue
0 → 100644
View file @
fee7e28c
<
template
>
<card-container
:title=
"`与 $
{keywords} 关键词相关的内容 共 ${total} 条`"
width="816px"
>
<combined-card
v-for=
"(val,index) in resultList"
:key=
"val.itemId"
:info=
"val"
></combined-card>
<empty-card
v-if=
"resultList.length===0"
height=
"556px"
></empty-card>
</card-container>
</
template
>
<
script
>
import
CardContainer
from
"../../components/pc/cardContainer"
;
import
EmptyCard
from
'../../components/pc/emptyCard'
;
import
CombinedCard
from
"../../components/pc/combinedCard"
;
export
default
{
name
:
"project"
,
components
:{
CardContainer
,
CombinedCard
,
EmptyCard
},
props
:{
resultList
:{
type
:
Array
,
default
:()
=>
([])
},
keywords
:{
type
:
String
,
default
:
''
},
total
:{
type
:
Number
,
default
:
0
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
pages/search/blog.vue
View file @
fee7e28c
...
...
@@ -2,7 +2,6 @@
<card-container
:title=
"`与 $
{keywords} 关键词相关的 博客 共 ${total} 条`"
width="816px"
style="min-height: 730px"
>
<project-card
v-for=
"(val,index) in resultList"
:key=
"val.itemId"
:info=
"val"
></project-card>
<empty-card
v-if=
"resultList.length===0"
height=
"556px"
></empty-card>
...
...
pages/search/project.vue
View file @
fee7e28c
...
...
@@ -2,7 +2,6 @@
<card-container
:title=
"`与 $
{keywords} 关键词相关的 项目 共 ${total} 条`"
width="816px"
style="min-height: 730px"
>
<project-card
v-for=
"(val,index) in resultList"
:key=
"val.itemId"
:info=
"val"
></project-card>
<empty-card
v-if=
"resultList.length===0"
height=
"556px"
></empty-card>
...
...
pages/search/question.vue
View file @
fee7e28c
...
...
@@ -2,7 +2,6 @@
<card-container
:title=
"`与 $
{keywords} 关键词相关的 问题 共 ${total} 条`"
width="816px"
style="min-height: 730px"
>
<answer-card
card-type=
"2"
v-for=
"(val,index) in resultList"
:info=
"val"
:key=
"val.questionId"
></answer-card>
<empty-card
v-if=
"resultList.length===0"
height=
"556px"
></empty-card>
...
...
pages/search/topic.vue
View file @
fee7e28c
...
...
@@ -2,7 +2,6 @@
<card-container
:title=
"`与 $
{keywords} 关键词相关的 话题 共 ${total} 条`"
width="816px"
style="min-height: 730px"
>
<topic-card
v-for=
"(val,index) in resultList"
:key=
"val.itemId"
:info=
"val"
></topic-card>
...
...
pages/search/user.vue
View file @
fee7e28c
...
...
@@ -2,7 +2,6 @@
<card-container
:title=
"`与 $
{keywords} 关键词相关的 用户 共 ${total} 条`"
width="816px"
style="min-height: 730px"
>
<fan-card
from=
"other"
v-for=
"(val,index) in resultList"
:key=
"val.itemId"
:info=
"val"
></fan-card>
<empty-card
v-if=
"resultList.length===0"
height=
"556px"
></empty-card>
...
...
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