fix: all pagination error.

pull/59/head
ruibaby 2019-11-24 21:02:55 +08:00
parent 7cdb85964a
commit 264180600f
11 changed files with 110 additions and 101 deletions

View File

@ -23,4 +23,4 @@ export default {
} }
} }
} }
</script> </script>

View File

@ -32,7 +32,7 @@
<a-form-item label="存储位置"> <a-form-item label="存储位置">
<a-select <a-select
v-model="queryParam.attachmentType" v-model="queryParam.attachmentType"
@change="handleQuery" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="item in Object.keys(attachmentType)" v-for="item in Object.keys(attachmentType)"
@ -49,7 +49,7 @@
<a-form-item label="文件类型"> <a-form-item label="文件类型">
<a-select <a-select
v-model="queryParam.mediaType" v-model="queryParam.mediaType"
@change="handleQuery" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="(item,index) in mediaTypes" v-for="(item,index) in mediaTypes"
@ -66,11 +66,11 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="handleQuery" @click="handleQuery()"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@click="handleResetParam" @click="handleResetParam()"
>重置</a-button> >重置</a-button>
</span> </span>
</a-col> </a-col>
@ -124,6 +124,7 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
:pageSizeOptions="['18', '36', '54','72','90','108']" :pageSizeOptions="['18', '36', '54','72','90','108']"
@ -246,17 +247,15 @@ export default {
this.queryParam.keyword = null this.queryParam.keyword = null
this.queryParam.mediaType = null this.queryParam.mediaType = null
this.queryParam.attachmentType = null this.queryParam.attachmentType = null
this.loadAttachments() this.handlePaginationChange(1, this.pagination.size)
this.loadMediaTypes() this.loadMediaTypes()
}, },
handleQuery() { handleQuery() {
this.queryParam.page = 0 this.handlePaginationChange(1, this.pagination.size)
this.pagination.page = 1
this.loadAttachments()
}, },
onUploadClose() { onUploadClose() {
this.$refs.upload.handleClearFileList() this.$refs.upload.handleClearFileList()
this.loadAttachments() this.handlePaginationChange(1, this.pagination.size)
this.loadMediaTypes() this.loadMediaTypes()
}, },
handleJudgeMediaType(attachment) { handleJudgeMediaType(attachment) {

View File

@ -15,7 +15,7 @@
<a-input-search <a-input-search
placeholder="搜索附件" placeholder="搜索附件"
v-model="queryParam.keyword" v-model="queryParam.keyword"
@search="loadAttachments(true)" @search="handleQuery()"
enterButton enterButton
/> />
</a-row> </a-row>
@ -50,8 +50,9 @@
<a-divider /> <a-divider />
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
:defaultPageSize="pagination.size" :current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
@change="handlePaginationChange" @change="handlePaginationChange"
></a-pagination> ></a-pagination>
</div> </div>
@ -122,7 +123,7 @@ export default {
}, },
queryParam: { queryParam: {
page: 0, page: 0,
size: 18, size: 12,
sort: null, sort: null,
keyword: null keyword: null
}, },
@ -162,18 +163,18 @@ export default {
this.$log.debug('Show detail of', attachment) this.$log.debug('Show detail of', attachment)
this.detailVisible = true this.detailVisible = true
}, },
loadAttachments(isSearch) { loadAttachments() {
this.queryParam.page = this.pagination.page - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.size this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
if (isSearch) {
this.queryParam.page = 0
}
attachmentApi.query(this.queryParam).then(response => { attachmentApi.query(this.queryParam).then(response => {
this.attachments = response.data.data.content this.attachments = response.data.data.content
this.pagination.total = response.data.data.total this.pagination.total = response.data.data.total
}) })
}, },
handleQuery() {
this.handlePaginationChange(1, this.pagination.size)
},
handlePaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.pagination.page = page this.pagination.page = page
this.pagination.size = pageSize this.pagination.size = pageSize
@ -182,7 +183,7 @@ export default {
onUploadClose() { onUploadClose() {
this.$refs.upload.handleClearFileList() this.$refs.upload.handleClearFileList()
this.loadSkeleton() this.loadSkeleton()
this.loadAttachments() this.handlePaginationChange(1, this.pagination.size)
}, },
handleDelete() { handleDelete() {
this.loadAttachments() this.loadAttachments()

View File

@ -14,6 +14,8 @@
> >
<a-input-search <a-input-search
placeholder="搜索附件" placeholder="搜索附件"
v-model="queryParam.keyword"
@search="handleQuery()"
enterButton enterButton
/> />
</a-row> </a-row>
@ -48,8 +50,9 @@
<a-divider /> <a-divider />
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
:defaultPageSize="pagination.size" :current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
@change="handlePaginationChange" @change="handlePaginationChange"
></a-pagination> ></a-pagination>
</div> </div>
@ -125,6 +128,12 @@ export default {
size: 12, size: 12,
sort: '' sort: ''
}, },
queryParam: {
page: 0,
size: 12,
sort: null,
keyword: null
},
attachments: [], attachments: [],
uploadHandler: attachmentApi.upload uploadHandler: attachmentApi.upload
} }
@ -148,13 +157,17 @@ export default {
this.uploadVisible = true this.uploadVisible = true
}, },
loadAttachments() { loadAttachments() {
const pagination = Object.assign({}, this.pagination) this.queryParam.page = this.pagination.page - 1
pagination.page-- this.queryParam.size = this.pagination.size
attachmentApi.query(pagination).then(response => { this.queryParam.sort = this.pagination.sort
attachmentApi.query(this.queryParam).then(response => {
this.attachments = response.data.data.content this.attachments = response.data.data.content
this.pagination.total = response.data.data.total this.pagination.total = response.data.data.total
}) })
}, },
handleQuery() {
this.handlePaginationChange(1, this.pagination.size)
},
handleSelectAttachment(item) { handleSelectAttachment(item) {
this.$emit('listenToSelect', item) this.$emit('listenToSelect', item)
}, },
@ -166,14 +179,10 @@ export default {
this.pagination.size = pageSize this.pagination.size = pageSize
this.loadAttachments() this.loadAttachments()
}, },
handleAttachmentUploadSuccess() {
this.$message.success('上传成功!')
this.loadAttachments()
},
onUploadClose() { onUploadClose() {
this.$refs.upload.handleClearFileList() this.$refs.upload.handleClearFileList()
this.loadSkeleton() this.loadSkeleton()
this.loadAttachments() this.handlePaginationChange(1, this.pagination.size)
}, },
handleJudgeMediaType(attachment) { handleJudgeMediaType(attachment) {
var mediaType = attachment.mediaType var mediaType = attachment.mediaType

View File

@ -23,7 +23,7 @@
<a-select <a-select
v-model="queryParam.status" v-model="queryParam.status"
placeholder="请选择评论状态" placeholder="请选择评论状态"
@change="handleQuery" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="status in Object.keys(commentStatus)" v-for="status in Object.keys(commentStatus)"
@ -41,11 +41,11 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="handleQuery" @click="handleQuery()"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@click="handleResetParam" @click="handleResetParam()"
>重置</a-button> >重置</a-button>
</span> </span>
</a-col> </a-col>
@ -377,7 +377,9 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']" :pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger showSizeChanger
@showSizeChange="handlePaginationChange" @showSizeChange="handlePaginationChange"
@ -522,8 +524,8 @@ export default {
columns: this.type === 'posts' ? postColumns : sheetColumns, columns: this.type === 'posts' ? postColumns : sheetColumns,
replyCommentVisible: false, replyCommentVisible: false,
pagination: { pagination: {
current: 1, page: 1,
pageSize: 10, size: 10,
sort: null sort: null
}, },
queryParam: { queryParam: {
@ -559,8 +561,8 @@ export default {
methods: { methods: {
loadComments() { loadComments() {
this.loading = true this.loading = true
this.queryParam.page = this.pagination.current - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.pageSize this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
commentApi.queryComment(this.type, this.queryParam).then(response => { commentApi.queryComment(this.type, this.queryParam).then(response => {
this.comments = response.data.data.content this.comments = response.data.data.content
@ -569,9 +571,7 @@ export default {
}) })
}, },
handleQuery() { handleQuery() {
this.queryParam.page = 0 this.handlePaginationChange(1, this.pagination.size)
this.pagination.current = 1
this.loadComments()
}, },
handleEditStatusClick(commentId, status) { handleEditStatusClick(commentId, status) {
commentApi.updateStatus(this.type, commentId, status).then(response => { commentApi.updateStatus(this.type, commentId, status).then(response => {
@ -617,14 +617,14 @@ export default {
}, },
handlePaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.current = page this.pagination.page = page
this.pagination.pageSize = pageSize this.pagination.size = pageSize
this.loadComments() this.loadComments()
}, },
handleResetParam() { handleResetParam() {
this.queryParam.keyword = null this.queryParam.keyword = null
this.queryParam.status = null this.queryParam.status = null
this.loadComments() this.handlePaginationChange(1, this.pagination.size)
}, },
handlePublishMore() { handlePublishMore() {
if (this.selectedRowKeys.length <= 0) { if (this.selectedRowKeys.length <= 0) {

View File

@ -36,8 +36,9 @@
<a-divider /> <a-divider />
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
:defaultPageSize="pagination.size" :current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
@change="handlePaginationChange" @change="handlePaginationChange"
></a-pagination> ></a-pagination>
</div> </div>

View File

@ -300,12 +300,13 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="logPagination.page"
:total="logPagination.total" :total="logPagination.total"
:defaultPageSize="50" :defaultPageSize="logPagination.size"
:pageSizeOptions="['50', '100','150','200']" :pageSizeOptions="['50', '100','150','200']"
showSizeChanger showSizeChanger
@showSizeChange="onPaginationChange" @showSizeChange="handlePaginationChange"
@change="onPaginationChange" @change="handlePaginationChange"
/> />
</div> </div>
</a-col> </a-col>
@ -365,17 +366,14 @@ export default {
}, },
logs: [], logs: [],
logPagination: { logPagination: {
current: 1, page: 1,
pageSize: 50, size: 50,
sort: null sort: null
}, },
logQueryParam: { logQueryParam: {
page: 0, page: 0,
size: 50, size: 50,
sort: null, sort: null
keyword: null,
categoryId: null,
status: null
}, },
interval: null interval: null
} }
@ -475,8 +473,8 @@ export default {
setTimeout(() => { setTimeout(() => {
this.logsLoading = false this.logsLoading = false
}, 500) }, 500)
this.logQueryParam.page = this.logPagination.current - 1 this.logQueryParam.page = this.logPagination.page - 1
this.logQueryParam.size = this.logPagination.pageSize this.logQueryParam.size = this.logPagination.size
this.logQueryParam.sort = this.logPagination.sort this.logQueryParam.sort = this.logPagination.sort
logApi.pageBy(this.logQueryParam).then(response => { logApi.pageBy(this.logQueryParam).then(response => {
this.logs = response.data.data.content this.logs = response.data.data.content
@ -495,10 +493,10 @@ export default {
window.open(response.data, '_blank') window.open(response.data, '_blank')
}) })
}, },
onPaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.logPagination.current = page this.logPagination.page = page
this.logPagination.pageSize = pageSize this.logPagination.size = pageSize
this.loadLogs() this.loadLogs()
} }
} }

View File

@ -23,7 +23,7 @@
<a-select <a-select
v-model="queryParam.status" v-model="queryParam.status"
placeholder="请选择文章状态" placeholder="请选择文章状态"
@change="handleQuery" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="status in Object.keys(postStatus)" v-for="status in Object.keys(postStatus)"
@ -41,7 +41,7 @@
<a-select <a-select
v-model="queryParam.categoryId" v-model="queryParam.categoryId"
placeholder="请选择分类" placeholder="请选择分类"
@change="handleQuery" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="category in categories" v-for="category in categories"
@ -58,11 +58,11 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="handleQuery" @click="handleQuery()"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@click="handleResetParam" @click="handleResetParam()"
>重置</a-button> >重置</a-button>
</span> </span>
</a-col> </a-col>
@ -478,7 +478,9 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']" :pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger showSizeChanger
@showSizeChange="handlePaginationChange" @showSizeChange="handlePaginationChange"
@ -586,8 +588,8 @@ export default {
return { return {
postStatus: postApi.postStatus, postStatus: postApi.postStatus,
pagination: { pagination: {
current: 1, page: 1,
pageSize: 10, size: 10,
sort: null sort: null
}, },
queryParam: { queryParam: {
@ -601,7 +603,6 @@ export default {
// //
columns, columns,
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [],
categories: [], categories: [],
posts: [], posts: [],
postsLoading: false, postsLoading: false,
@ -609,8 +610,7 @@ export default {
postCommentVisible: false, postCommentVisible: false,
selectedPost: {}, selectedPost: {},
selectedTagIds: [], selectedTagIds: [],
selectedCategoryIds: [], selectedCategoryIds: []
postComments: []
} }
}, },
computed: { computed: {
@ -641,8 +641,8 @@ export default {
loadPosts() { loadPosts() {
this.postsLoading = true this.postsLoading = true
// Set from pagination // Set from pagination
this.queryParam.page = this.pagination.current - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.pageSize this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
postApi.query(this.queryParam).then(response => { postApi.query(this.queryParam).then(response => {
this.posts = response.data.data.content this.posts = response.data.data.content
@ -672,20 +672,18 @@ export default {
}, },
handlePaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.current = page this.pagination.page = page
this.pagination.pageSize = pageSize this.pagination.size = pageSize
this.loadPosts() this.loadPosts()
}, },
handleResetParam() { handleResetParam() {
this.queryParam.keyword = null this.queryParam.keyword = null
this.queryParam.categoryId = null this.queryParam.categoryId = null
this.queryParam.status = null this.queryParam.status = null
this.loadPosts() this.handlePaginationChange(1, this.pagination.size)
}, },
handleQuery() { handleQuery() {
this.queryParam.page = 0 this.handlePaginationChange(1, this.pagination.size)
this.pagination.current = 1
this.loadPosts()
}, },
handleEditStatusClick(postId, status) { handleEditStatusClick(postId, status) {
postApi.updateStatus(postId, status).then(response => { postApi.updateStatus(postId, status).then(response => {

View File

@ -465,7 +465,9 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']" :pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger showSizeChanger
@showSizeChange="handlePaginationChange" @showSizeChange="handlePaginationChange"
@ -568,8 +570,8 @@ export default {
data() { data() {
return { return {
pagination: { pagination: {
current: 1, page: 1,
pageSize: 10, size: 10,
sort: null sort: null
}, },
queryParam: { queryParam: {
@ -589,8 +591,7 @@ export default {
sheetCommentVisible: false, sheetCommentVisible: false,
internalSheets: [], internalSheets: [],
sheets: [], sheets: [],
menu: {}, menu: {}
sheetComments: []
} }
}, },
computed: { computed: {
@ -620,8 +621,8 @@ export default {
methods: { methods: {
loadSheets() { loadSheets() {
this.sheetsLoading = true this.sheetsLoading = true
this.queryParam.page = this.pagination.current - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.pageSize this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
sheetApi.list(this.queryParam).then(response => { sheetApi.list(this.queryParam).then(response => {
this.sheets = response.data.data.content this.sheets = response.data.data.content
@ -676,8 +677,8 @@ export default {
}, },
handlePaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.current = page this.pagination.page = page
this.pagination.pageSize = pageSize this.pagination.size = pageSize
this.loadSheets() this.loadSheets()
}, },
onSheetSettingsClose() { onSheetSettingsClose() {

View File

@ -25,7 +25,7 @@
<a-select <a-select
placeholder="请选择状态" placeholder="请选择状态"
v-model="queryParam.type" v-model="queryParam.type"
@change="loadJournals(true)" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="type in Object.keys(journalType)" v-for="type in Object.keys(journalType)"
@ -42,11 +42,11 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="loadJournals(true)" @click="handleQuery()"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@click="resetParam" @click="resetParam()"
>重置</a-button> >重置</a-button>
</span> </span>
</a-col> </a-col>
@ -133,12 +133,13 @@
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
class="pagination" class="pagination"
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']" :pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger showSizeChanger
@showSizeChange="onPaginationChange" @showSizeChange="handlePaginationChange"
@change="onPaginationChange" @change="handlePaginationChange"
/> />
</div> </div>
</a-list> </a-list>
@ -262,20 +263,20 @@ export default {
...mapGetters(['user']) ...mapGetters(['user'])
}, },
methods: { methods: {
loadJournals(isSearch) { loadJournals() {
this.listLoading = true
this.queryParam.page = this.pagination.page - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.size this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
if (isSearch) {
this.queryParam.page = 0
}
this.listLoading = true
journalApi.query(this.queryParam).then(response => { journalApi.query(this.queryParam).then(response => {
this.journals = response.data.data.content this.journals = response.data.data.content
this.pagination.total = response.data.data.total this.pagination.total = response.data.data.total
this.listLoading = false this.listLoading = false
}) })
}, },
handleQuery() {
this.handlePaginationChange(1, this.pagination.size)
},
handleNew() { handleNew() {
this.title = '新建' this.title = '新建'
this.visible = true this.visible = true
@ -344,7 +345,7 @@ export default {
} }
this.visible = false this.visible = false
}, },
onPaginationChange(page, pageSize) { handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`) this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.page = page this.pagination.page = page
this.pagination.size = pageSize this.pagination.size = pageSize
@ -357,7 +358,7 @@ export default {
resetParam() { resetParam() {
this.queryParam.keyword = null this.queryParam.keyword = null
this.queryParam.type = null this.queryParam.type = null
this.loadJournals() this.handlePaginationChange(1, this.pagination.size)
} }
} }
} }

View File

@ -31,7 +31,7 @@
<a-form-item label="分组"> <a-form-item label="分组">
<a-select <a-select
v-model="queryParam.team" v-model="queryParam.team"
@change="loadPhotos(true)" @change="handleQuery()"
> >
<a-select-option <a-select-option
v-for="(item,index) in teams" v-for="(item,index) in teams"
@ -48,11 +48,11 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="loadPhotos(true)" @click="handleQuery()"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@click="resetParam" @click="resetParam()"
>重置</a-button> >重置</a-button>
</span> </span>
</a-col> </a-col>
@ -101,6 +101,7 @@
</a-row> </a-row>
<div class="page-wrapper"> <div class="page-wrapper">
<a-pagination <a-pagination
:current="pagination.page"
:total="pagination.total" :total="pagination.total"
:defaultPageSize="pagination.size" :defaultPageSize="pagination.size"
:pageSizeOptions="['18', '36', '54','72','90','108']" :pageSizeOptions="['18', '36', '54','72','90','108']"
@ -324,20 +325,20 @@ export default {
this.loadTeams() this.loadTeams()
}, },
methods: { methods: {
loadPhotos(isSearch) { loadPhotos() {
this.listLoading = true
this.queryParam.page = this.pagination.page - 1 this.queryParam.page = this.pagination.page - 1
this.queryParam.size = this.pagination.size this.queryParam.size = this.pagination.size
this.queryParam.sort = this.pagination.sort this.queryParam.sort = this.pagination.sort
if (isSearch) {
this.queryParam.page = 0
}
this.listLoading = true
photoApi.query(this.queryParam).then(response => { photoApi.query(this.queryParam).then(response => {
this.photos = response.data.data.content this.photos = response.data.data.content
this.pagination.total = response.data.data.total this.pagination.total = response.data.data.total
this.listLoading = false this.listLoading = false
}) })
}, },
handleQuery() {
this.handlePaginationChange(1, this.pagination.size)
},
loadTeams() { loadTeams() {
photoApi.listTeams().then(response => { photoApi.listTeams().then(response => {
this.teams = response.data.data this.teams = response.data.data
@ -396,7 +397,7 @@ export default {
resetParam() { resetParam() {
this.queryParam.keyword = null this.queryParam.keyword = null
this.queryParam.team = null this.queryParam.team = null
this.loadPhotos() this.handlePaginationChange(1, this.pagination.size)
this.loadTeams() this.loadTeams()
}, },
onDrawerClose() { onDrawerClose() {