mirror of https://github.com/halo-dev/halo-admin
Fixed attachment drawer error.
parent
8e66102aa1
commit
c25508e2bb
|
@ -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()
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
>
|
||||
<a-input-search
|
||||
placeholder="搜索附件"
|
||||
v-model="queryParam.keyword"
|
||||
@search="loadAttachments(true)"
|
||||
enterButton
|
||||
/>
|
||||
</a-row>
|
||||
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue