diff --git a/src/api/attachment.js b/src/api/attachment.js index 369a2964..0ff68107 100644 --- a/src/api/attachment.js +++ b/src/api/attachment.js @@ -35,6 +35,13 @@ attachmentApi.update = (attachmentId, attachment) => { }) } +attachmentApi.getMediaTypes = () => { + return service({ + url: `${baseUrl}/mediaTypes`, + method: 'get' + }) +} + attachmentApi.CancelToken = axios.CancelToken attachmentApi.isCancel = axios.isCancel diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index b01b8975..5f3216ed 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -22,8 +22,8 @@ - - image/png + + {{ item }} @@ -38,6 +38,7 @@
上传 + 回收站
@@ -104,6 +105,7 @@ export default { uploadVisible: false, selectAttachment: {}, attachments: [], + mediaTypes: [], editable: false, pagination: { page: 1, @@ -114,7 +116,8 @@ export default { page: 0, size: 18, sort: null, - keyword: null + keyword: null, + mediaType: null }, uploadHandler: attachmentApi.upload, drawerVisiable: false @@ -122,6 +125,7 @@ export default { }, created() { this.loadAttachments() + this.loadMediaTypes() }, methods: { loadAttachments(isSearch) { @@ -136,6 +140,11 @@ export default { this.pagination.total = response.data.data.total }) }, + loadMediaTypes() { + attachmentApi.getMediaTypes().then(response => { + this.mediaTypes = response.data.data + }) + }, showDetailDrawer(attachment) { this.selectAttachment = attachment this.drawerVisiable = true @@ -153,6 +162,7 @@ export default { }, handleUploadSuccess() { this.loadAttachments() + this.loadMediaTypes() }, handlePaginationChange(page, size) { this.$log.debug(`Current: ${page}, PageSize: ${size}`) @@ -162,6 +172,7 @@ export default { }, resetParam() { this.queryParam.keyword = null + this.queryParam.mediaType = null this.loadAttachments() }, handleDelete(attachment) {