From 37f848ae589ee6d8cef65cf93c3d6703d5a2371c Mon Sep 17 00:00:00 2001 From: unknown <2569982966@qq.com> Date: Thu, 30 Jun 2022 18:21:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=A4=E5=9C=A8=E7=BA=BF=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=9C=AA=E5=AE=9E=E7=8E=B0=20=E5=85=B6?= =?UTF-8?q?=E4=BD=99=E4=BD=9C=E5=93=81=E6=8F=90=E4=BA=A4=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Submit/Submit.vue | 119 ++++++++++++++++++++++++++++++------ src/utils/http/interface.js | 15 ++++- 2 files changed, 114 insertions(+), 20 deletions(-) diff --git a/src/pages/Submit/Submit.vue b/src/pages/Submit/Submit.vue index 53cd9f8..0912af1 100644 --- a/src/pages/Submit/Submit.vue +++ b/src/pages/Submit/Submit.vue @@ -21,7 +21,7 @@
您的提交已经被打回 可再次提交
" + this.loading = false + }else if (res.data.status == 0){ + // 已提交,不可再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,如有问题请联系管理员
" + + //设置上传状态 + this.uploadStatus = true + this.loading = false + } + }else if (this.submitPerDay == -1){ + //无限次 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,再次提交作品将会覆盖
" + this.loading = false + }else { + //可提交指定次数 + if (res.data.status < this.submitPerDay){ + //已提交次数 小于当日可提交次数 可以再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + var num = this.submitPerDay - res.data.status + this.uploadMessage="您已经提交作品,本日还有"+ num + "次提交机会
" + this.loading = false + }else{ + //不可再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,本日提交机会已用尽" + + //设置上传状态 + this.uploadStatus = true + this.loading = false + } + } + // res.data.status == 0 - //设置上传状态 - this.uploadStatus = true - this.loading = false } else if (res.status == 10) { // 没有提交信息 this.loading = false diff --git a/src/utils/http/interface.js b/src/utils/http/interface.js index dca3713..fe22851 100644 --- a/src/utils/http/interface.js +++ b/src/utils/http/interface.js @@ -271,6 +271,18 @@ export const getSubmitInfo = (data) => { }) }; + +export const insertSubmitInfo = (data) => { + return axios({ + headers:{ + "Authorization": localStorage.getItem("systemToken") + }, + url: '/submit/insertSubmitInfo', + method: 'post', + data + }) +}; + // 默认全部倒出 // 根据需要进行 export default { @@ -298,5 +310,6 @@ export default { updateApplyInfo, getDivisionAndKind, getSubmitCust, - getSubmitInfo + getSubmitInfo, + insertSubmitInfo } \ No newline at end of file