From c25508e2bb1be9f133a405504e407ecb762a6630 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Wed, 24 Apr 2019 23:06:35 +0800 Subject: [PATCH] Fixed attachment drawer error. --- src/views/attachment/AttachmentList.vue | 8 -------- .../components/AttachmentDrawer.vue | 20 +++++++++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 590888bbe..0d6d5bcd2 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -224,14 +224,6 @@ export default { showUploadModal() { this.uploadVisible = true }, - handleChange(info) { - const status = info.file.status - if (status === 'done') { - this.$message.success(`${info.file.name} 文件上传成功`) - } else if (status === 'error') { - this.$message.error(`${info.file.name} 文件上传失败`) - } - }, handleUploadSuccess() { this.loadAttachments() this.loadMediaTypes() diff --git a/src/views/attachment/components/AttachmentDrawer.vue b/src/views/attachment/components/AttachmentDrawer.vue index f98e212ff..9950465bf 100644 --- a/src/views/attachment/components/AttachmentDrawer.vue +++ b/src/views/attachment/components/AttachmentDrawer.vue @@ -14,6 +14,8 @@ > @@ -122,6 +124,12 @@ export default { size: 10, sort: '' }, + queryParam: { + page: 0, + size: 18, + sort: null, + keyword: null + }, attachments: [], selectedAttachment: {}, attachmentUploadHandler: attachmentApi.upload @@ -161,10 +169,14 @@ export default { this.$log.debug('Show detail of', attachment) this.detailVisiable = true }, - loadAttachments() { - const pagination = Object.assign({}, this.pagination) - pagination.page-- - attachmentApi.query(pagination).then(response => { + loadAttachments(isSearch) { + this.queryParam.page = this.pagination.page - 1 + this.queryParam.size = this.pagination.size + this.queryParam.sort = this.pagination.sort + if (isSearch) { + this.queryParam.page = 0 + } + attachmentApi.query(this.queryParam).then(response => { this.attachments = response.data.data.content this.pagination.total = response.data.data.total })