Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
8442c477
Commit
8442c477
authored
May 13, 2020
by
徐一鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务评价信息翻页组件
parent
6f2c9d80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
150 additions
and
21 deletions
+150
-21
src/components/comments-list.vue
src/components/comments-list.vue
+1
-0
src/components/comments-pagination.vue
src/components/comments-pagination.vue
+120
-0
src/components/service-tab-comments.vue
src/components/service-tab-comments.vue
+29
-21
No files found.
src/components/comments-list.vue
View file @
8442c477
...
...
@@ -55,6 +55,7 @@ export default {
flex-shrink
:
0
;
padding-top
:
5px
;
margin-right
:
27px
;
margin-left
:
10px
;
}
.comment-right
{
font-size
:
16px
;
...
...
src/components/comments-pagination.vue
0 → 100644
View file @
8442c477
<
template
>
<div
class=
"comments_pagination"
>
<div
class=
"total_info"
>
<span>
{{
`共${total
}
个条目`
}}
<
/span
>
<
/div
>
<
div
class
=
"
page_size_action
"
>
<
span
>
每页行数:
<
/span
>
<
el
-
select
:
value
=
"
pageSize
"
@
change
=
"
sizeChange
"
>
<
el
-
option
v
-
for
=
"
item in pageSizes
"
:
label
=
"
item
"
:
value
=
"
item
"
:
key
=
"
item
"
><
/el-option
>
<
/el-select
>
<
/div
>
<
div
class
=
"
page_action
"
>
<
a
:
class
=
"
{ disabled: preDisabled
}
"
@
click
.
prevent
=
"
prePage
"
>
<
i
class
=
"
el-icon-arrow-left
"
><
/i
>
<
/a
>
<
span
>
{{
`第${currentPage
}
页 / 共${totalPages
}
页`
}}
<
/span
>
<
a
:
class
=
"
{ disabled: nextDisabled
}
"
@
click
.
prevent
=
"
nextPage
"
>
<
i
class
=
"
el-icon-arrow-right
"
><
/i
>
<
/a
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
export
default
{
props
:
{
total
:
{
type
:
Number
,
required
:
true
,
}
,
pageSizes
:
{
type
:
Array
,
required
:
true
,
}
,
pageSize
:
{
type
:
Number
,
required
:
true
,
}
,
currentPage
:
{
type
:
Number
,
required
:
true
,
}
,
}
,
data
:
()
=>
({
}
),
computed
:
{
totalPages
()
{
return
Math
.
ceil
(
this
.
total
/
this
.
pageSize
);
}
,
preDisabled
()
{
return
this
.
currentPage
===
1
;
}
,
nextDisabled
()
{
return
this
.
currentPage
===
this
.
totalPages
;
}
,
}
,
methods
:
{
sizeChange
(
value
)
{
this
.
$emit
(
"
size-change
"
,
value
);
}
,
prePage
()
{
if
(
this
.
preDisabled
)
{
return
;
}
this
.
$emit
(
"
current-change
"
,
this
.
currentPage
-
1
);
}
,
nextPage
()
{
if
(
this
.
nextDisabled
)
{
return
;
}
this
.
$emit
(
"
current-change
"
,
this
.
currentPage
+
1
);
}
,
}
,
}
;
<
/script
>
<
style
scoped
>
.
comments_pagination
{
display
:
flex
;
justify
-
content
:
flex
-
start
;
align
-
items
:
center
;
font
-
size
:
14
px
;
line
-
height
:
25
px
;
color
:
#
333
;
}
.
total_info
{
flex
-
grow
:
1
;
}
.
page_size_action
{
margin
-
left
:
50
px
;
}
.
page_size_action
>
.
el
-
select
{
width
:
70
px
;
}
.
page_action
{
user
-
select
:
none
;
margin
-
left
:
50
px
;
}
.
page_action
>
a
{
cursor
:
pointer
;
}
.
page_action
>
a
>
i
{
font
-
weight
:
bold
;
}
.
page_action
>
a
.
disabled
{
opacity
:
0.5
;
cursor
:
not
-
allowed
;
}
<
/style
>
<
style
>
.
page_size_action
>
.
el
-
select
.
el
-
input__inner
,
.
page_size_action
>
.
el
-
select
.
el
-
input
.
is
-
focus
.
el
-
input__inner
{
border
:
1
px
solid
#
fff
;
}
<
/style
>
src/components/service-tab-comments.vue
View file @
8442c477
...
...
@@ -2,30 +2,27 @@
<div
class=
"service_tab-comments"
>
<comments-score
:data=
"data.baseInfo"
></comments-score>
<comments-list
:data=
"data.ffpjxxList"
></comments-list>
<div
class=
"comments_pages"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:total=
"data.baseInfo.total"
:page-sizes=
"[10, 50, 100]"
:current-page=
"1"
:page-size=
"10"
layout=
"total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</div>
<comments-pagination
:total=
"data.baseInfo.total"
:page-sizes=
"pageSizes"
:page-size=
"pageSize"
:current-page=
"currentPage"
@
size-change=
"changePageSize"
@
current-change=
"changeCurrentPage"
></comments-pagination>
</div>
</
template
>
<
script
>
import
commentsScore
from
"
@/components/comments-score
"
;
import
commentsList
from
"
@/components/comments-list
"
;
import
commentsPagination
from
"
@/components/comments-pagination
"
;
export
default
{
components
:
{
commentsScore
,
commentsList
,
commentsPagination
,
},
props
:
{
data
:
{
...
...
@@ -33,13 +30,18 @@ export default {
required
:
true
,
},
},
data
:
()
=>
({}),
data
:
()
=>
({
pageSizes
:
[
10
,
50
,
100
],
pageSize
:
10
,
currentPage
:
1
,
}),
methods
:
{
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
);
changePageSize
(
value
)
{
this
.
pageSize
=
value
;
this
.
currentPage
=
1
;
},
handleCurrentChange
(
val
)
{
console
.
log
(
`当前页:
${
val
}
`
)
;
changeCurrentPage
(
value
)
{
this
.
currentPage
=
value
;
},
},
created
()
{},
...
...
@@ -47,8 +49,14 @@ export default {
</
script
>
<
style
scoped
>
.comments_pages
{
text-align
:
center
;
margin-top
:
20px
;
.service_tab-comments
{
padding
:
35px
20px
20px
;
}
.service_tab-comments
>
.comments_score
,
.service_tab-comments
>
.comments_list
{
padding
:
0
30px
;
}
.service_tab-comments
>
.comments_pagination
{
margin-top
:
60px
;
}
</
style
>
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