From 82cbb0d5890d09fdbb5cde8588ae14d6dbafe773 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sat, 11 May 2019 00:16:02 +0800 Subject: [PATCH] Refactor codes. --- src/views/attachment/AttachmentList.vue | 10 ++-------- src/views/dashboard/Dashboard.vue | 5 +---- src/views/system/OptionForm.vue | 10 ++-------- src/views/user/Profile.vue | 5 +---- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index b362ce4fa..9d1a979cf 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -77,7 +77,7 @@ 上传 @@ -147,7 +147,7 @@ v-if="selectAttachment" :attachment="selectAttachment" :addToPhoto="true" - @delete="handleDelete" + @delete="()=>this.loadAttachments()" /> @@ -223,9 +223,6 @@ export default { this.selectAttachment = attachment this.drawerVisiable = true }, - handleShowUploadModal() { - this.uploadVisible = true - }, handleUploadSuccess() { this.loadAttachments() this.loadMediaTypes() @@ -245,9 +242,6 @@ export default { handleQuery() { this.queryParam.page = 0 this.loadAttachments() - }, - handleDelete(attachment) { - this.loadAttachments() } } } diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index 26b100b25..4f951932c 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -255,7 +255,7 @@ closable :visible="logDrawerVisiable" destroyOnClose - @close="onLogDrawerClose" + @close="()=>this.logDrawerVisiable = false" > @@ -43,7 +43,7 @@ @@ -638,16 +638,10 @@ export default { break } }, - handleShowLogoAttachDrawer() { - this.logoDrawerVisible = true - }, handleSelectLogo(data) { this.options.blog_logo = data.path this.logoDrawerVisible = false }, - handleShowFaviconAttachDrawer() { - this.faviconDrawerVisible = true - }, handleTestMailClick() { mailApi.testMail(this.mailParam).then(response => { this.$message.info(response.data.message) diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue index 72acf11ce..99b3e2d8f 100644 --- a/src/views/user/Profile.vue +++ b/src/views/user/Profile.vue @@ -19,7 +19,7 @@
@@ -182,9 +182,6 @@ export default { }, methods: { ...mapMutations({ setUser: 'SET_USER' }), - handleShowAttachDrawer() { - this.attachmentDrawerVisible = true - }, loadUser() { userApi.getProfile().then(response => { this.user = response.data.data