Merge pull request !33 from Sky_ID/lwh
This commit is contained in:
Sky_ID 2022-06-30 10:22:21 +00:00 committed by Gitee
commit 9c637af435
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 114 additions and 20 deletions

View File

@ -21,7 +21,7 @@
<div v-loading="loading" element-loading-background="rgb(255, 255, 255)">
<div v-if="uploadStatus">
<div v-if="uploadIF">
<svg t="1656492230012" class="icon" viewBox="0 0 2874 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2968" width="150" height="150">
@ -35,7 +35,7 @@
d="M1423.09935933 752.52420883l-0.60714098-0.91071264c-0.45535687-0.60714211-39.16065678-59.04455566-115.96411448-111.1069787-47.66064413-32.33030941-195.80328163-123.55338923-197.3211375-124.46410182l-0.60714213-0.45535686 62.0802651-98.35699769 0.60714212 0.45535685c1.51785472 1.06249899 145.41049969 110.95519346 183.66044275 144.49978598 13.66069362 11.99105365 34.75887673 32.48209465 62.99097882 61.16955248l212.49968584-307.82097291c39.16065678-56.6159872 189.883648-249.68713102 191.40150272-251.66034265l0.60714213-0.75892734 0.60714212 0.75892734 112.47304816 139.03550921-0.60714212 0.45535572c-2.12499682 1.82142635-210.22290375 190.03543325-264.10675199 243.61571216-43.41065045 43.25886521-149.05335125 172.42831645-208.24969328 245.74070784l-39.46422728 59.80348303z m-312.37453825-237.54429212c10.77676942 6.67856099 150.57120597 92.89271979 196.71399537 124.1605313 71.64275143 48.57135673 110.34805134 102.7587766 115.66054287 110.49983661l38.40172944-57.98205667c59.19634091-73.31239139 164.83904171-202.63362901 208.40147737-245.89249423 52.66956515-52.21420829 251.81212786-232.53537109 263.65139629-243.16035527l-111.1069787-137.21408285c-10.3214137 13.35712313-152.99977443 195.95506802-190.79436061 250.74963002l-213.56218482 309.33882765-0.60714211-0.60714098c-28.38388621-28.99102834-49.78564096-49.63385571-63.4463346-61.7766946-36.88387357-32.33030941-172.2765312-135.69622813-182.90151539-143.892645l-60.41062511 95.77664402z"
p-id="2971" fill="#36ab60"></path>
</svg>
<div class="el-upload__text" style="margin-top: -20px">您已上传</div>
<div class="el-upload__text" style="margin-top: -20px" v-html="uploadMessage"></div>
</div>
<div v-else>
<i class="el-icon-upload"></i>
@ -69,7 +69,7 @@ export default {
return {
fileList: [],
uploadActionUrl:"/api/comp/uploadImg",
uploadMessage:"",
uploadData: {
fileName : this.$route.params.compId + '-submit-',
@ -82,8 +82,19 @@ export default {
onlineScript: false,
onlineInter: '',
uploadStatus: false,
uploadIF: false, //
loading: true,
file: ''
file: '',
submitPerDay:"", //
submitInfo:{
submitNum : null,
compId : '',
teamId: '',
file: '',
score: null,
status: 0 //
}
};
},
@ -120,13 +131,20 @@ export default {
importSuccess(res) {
if(res.status == 0){
this.submitInfo.file=res.url
//TODO:
this.submitInfo.compId = this.$route.params.compId
this.$api.insertSubmitInfo(this.submitInfo).then((res) =>{
if (res.status == 0) {
this.$message({
showClose: true,
message: '上传报名表成功',
type: 'success'
});
this.file=res.url
//TODO:
}
})
}else{
this.$message({
showClose: true,
@ -233,7 +251,10 @@ export default {
if (res.status == 0) {
//
this.onlineScript = res.data.onlineScript
this.onlineInter = res.date.onlineInter
this.onlineInter = res.data.onlineInter
//
this.submitPerDay = res.data.submitPerDay
} else {
Message.error("获取比赛信息失败")
}
@ -246,23 +267,83 @@ export default {
this.$api.getApplyForPerson(applyInfo).then((res) => {
if (res.status == 0 && res.data.applyInfo.status == 2) {
//
this.submitInfo.teamId = res.data.applyInfo.teamId
var teamId = res.data.applyInfo.teamId
var submitInfo = {
compId: this.$route.params.compId,
teamId
}
this.$api.getSubmitInfo(submitInfo).then((res) => {
if (res.status == 0) {
//
//
/**
* 先判断提交次数设置
*/
this.uploadIF = true
this.submitInfo.status = res.data.status
if (this.submitPerDay == 0) {
//
if (res.data.status == -1) {
//
this.fileList.push({
name: res.data.file.split("/")[3],
url: res.data.file
}
)
this.uploadMessage="<p>您的提交已经被打回 可再次提交</p>"
this.loading = false
}else if (res.data.status == 0){
//
this.fileList.push({
name: res.data.file.split("/")[3],
url: res.data.file
}
)
this.uploadMessage="<p style='color: red'>您已经提交作品,如有问题请联系管理员</p>"
//
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="<p style='color: green'>您已经提交作品,再次提交作品将会覆盖</p>"
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="<p style='color: green'>您已经提交作品,本日还有"+ num + "次提交机会</p>"
this.loading = false
}else{
//
this.fileList.push({
name: res.data.file.split("/")[3],
url: res.data.file
}
)
this.uploadMessage="<p style='color: red'>您已经提交作品,本日提交机会已用尽"
//
this.uploadStatus = true
this.loading = false
}
}
// res.data.status == 0
} else if (res.status == 10) {
//
this.loading = false

View File

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