From 67a25d77cec4129319cc252d8e7db3c6a555fa04 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 28 Jun 2022 11:18:20 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 1 + src/pages/match/add/index.vue | 10 ++++- src/pages/match/list/index.vue | 56 ++++++++++++++------------ src/pages/match/manage/index.vue | 3 +- src/pages/match/manage/matchDetail.vue | 13 ++++-- src/pages/match/manage/notice.vue | 2 +- src/pages/student/list/index.vue | 1 + src/setting.js | 4 +- 8 files changed, 56 insertions(+), 34 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index bbe239f..5cfb059 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -131,6 +131,7 @@ export default { addAnnouncement: `occupationlab/contest/announcement/addAnnouncement`, amendmentAnnouncement: `occupationlab/contest/announcement/amendmentAnnouncement`, deleteAnnouncement: `occupationlab/contest/announcement/deleteAnnouncement`, + disableAnnouncement: `occupationlab/contest/announcement/disableAnnouncement`, queryAnnouncementByContestId: `occupationlab/contest/announcement/queryAnnouncementByContestId`, queryAnnouncementDetails: `occupationlab/contest/announcement/queryAnnouncementDetails`, deleteAnnouncementAnnex: `occupationlab/contestAnnouncementAnnex/delete`, diff --git a/src/pages/match/add/index.vue b/src/pages/match/add/index.vue index 1c1e355..4b958ad 100644 --- a/src/pages/match/add/index.vue +++ b/src/pages/match/add/index.vue @@ -119,7 +119,6 @@ :on-error="uploadError" :before-upload="beforeUpload" :on-success="uploadAnnexSuccess" - :before-remove="beforeRemove" :limit="5" :on-exceed="handleExceedAnnex" :action="this.api.fileupload" @@ -375,7 +374,14 @@ export default { }, // 附件上传前 beforeUpload(file) { - this.fileName = file.name + const isLt2M = file.size / 1024 / 1024 < 10 + if (!isLt2M) util.warningMsg('请上传小于10MB的附件!') + if (isLt2M) { + this.fileName = file.name + return true + } else { + return false + } }, uploadError(err, file, fileList) { this.$message({ diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index e1ca01c..3d53d91 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -99,6 +99,7 @@