From 51f575f2fda969db1e233667c6017cfdd9aa5ef4 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Mon, 22 Apr 2019 13:01:30 +0800 Subject: [PATCH] Show type property for attachment detail. --- src/api/attachment.js | 22 +++++++++++++++ src/views/attachment/AttachmentList.vue | 27 ++++++++++++++----- .../components/AttachmentDetailDrawer.vue | 5 ++++ .../components/AttachmentDrawer.vue | 11 +++++++- 4 files changed, 57 insertions(+), 8 deletions(-) diff --git a/src/api/attachment.js b/src/api/attachment.js index c2ee0298..f2c54325 100644 --- a/src/api/attachment.js +++ b/src/api/attachment.js @@ -56,4 +56,26 @@ attachmentApi.upload = (formData, uploadProgress, cancelToken) => { }) } +attachmentApi.type = { + LOCAL: { + type: 'local', + text: '本地' + }, + SMMS: { + type: 'smms', + text: 'SM.MS' + }, + UPYUN: { + type: 'upyun', + text: '又拍云' + }, + QNYUN: { + type: 'qnyun', + text: '七牛云' + }, + ALIYUN: { + type: 'aliyun', + text: '阿里云' + } +} export default attachmentApi diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 41314a2b..b70e2617 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -14,18 +14,22 @@ - 本地 - SM.MS - 又拍云 - 七牛云 - 阿里云 + {{ attachmentType[item].text }} - {{ item }} + {{ item }} @@ -46,7 +50,7 @@ @@ -103,6 +107,7 @@ export default { mixins: [mixin, mixinDevice], data() { return { + attachmentType: attachmentApi.type, uploadVisible: false, selectAttachment: {}, attachments: [], @@ -125,6 +130,14 @@ export default { drawerVisiable: false } }, + computed: { + formattedDatas() { + return this.attachments.map(attachment => { + attachment.typeProperty = this.attachmentType[attachment.type] + return attachment + }) + } + }, created() { this.loadAttachments() this.loadMediaTypes() diff --git a/src/views/attachment/components/AttachmentDetailDrawer.vue b/src/views/attachment/components/AttachmentDetailDrawer.vue index 4c21a1e3..05fb9eea 100644 --- a/src/views/attachment/components/AttachmentDetailDrawer.vue +++ b/src/views/attachment/components/AttachmentDetailDrawer.vue @@ -36,6 +36,11 @@ 附件类型: + + + 存储位置: + +