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 @@