mirror of https://github.com/halo-dev/halo-admin
Fixed post search error.
parent
6951d6d416
commit
c86b450d9b
|
@ -53,7 +53,7 @@
|
||||||
<span class="table-page-search-submitButtons">
|
<span class="table-page-search-submitButtons">
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="loadPosts"
|
@click="loadPosts(true)"
|
||||||
>查询</a-button>
|
>查询</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
style="margin-left: 8px;"
|
style="margin-left: 8px;"
|
||||||
|
@ -275,12 +275,15 @@ export default {
|
||||||
this.loadPosts()
|
this.loadPosts()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPosts() {
|
loadPosts(isSearch) {
|
||||||
this.postsLoading = true
|
this.postsLoading = true
|
||||||
// Set from pagination
|
// Set from pagination
|
||||||
this.queryParam.page = this.pagination.current - 1
|
this.queryParam.page = this.pagination.current - 1
|
||||||
this.queryParam.size = this.pagination.pageSize
|
this.queryParam.size = this.pagination.pageSize
|
||||||
this.queryParam.sort = this.pagination.sort
|
this.queryParam.sort = this.pagination.sort
|
||||||
|
if (isSearch) {
|
||||||
|
this.queryParam.page = 0
|
||||||
|
}
|
||||||
postApi.query(this.queryParam).then(response => {
|
postApi.query(this.queryParam).then(response => {
|
||||||
this.posts = response.data.data.content
|
this.posts = response.data.data.content
|
||||||
this.pagination.total = response.data.data.total
|
this.pagination.total = response.data.data.total
|
||||||
|
|
Loading…
Reference in New Issue