forked from osredm_test/osredm-comp-custom
除在线脚本功能未实现 其余作品提交功能实现
This commit is contained in:
parent
4573a89bdd
commit
37f848ae58
|
@ -21,7 +21,7 @@
|
||||||
<div v-loading="loading" element-loading-background="rgb(255, 255, 255)">
|
<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"
|
<svg t="1656492230012" class="icon" viewBox="0 0 2874 1024" version="1.1"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
p-id="2968" width="150" height="150">
|
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"
|
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>
|
p-id="2971" fill="#36ab60"></path>
|
||||||
</svg>
|
</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>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
|
@ -69,7 +69,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
fileList: [],
|
fileList: [],
|
||||||
uploadActionUrl:"/api/comp/uploadImg",
|
uploadActionUrl:"/api/comp/uploadImg",
|
||||||
|
uploadMessage:"",
|
||||||
|
|
||||||
uploadData: {
|
uploadData: {
|
||||||
fileName : this.$route.params.compId + '-submit-',
|
fileName : this.$route.params.compId + '-submit-',
|
||||||
|
@ -82,8 +82,19 @@ export default {
|
||||||
onlineScript: false,
|
onlineScript: false,
|
||||||
onlineInter: '',
|
onlineInter: '',
|
||||||
uploadStatus: false,
|
uploadStatus: false,
|
||||||
|
uploadIF: false, //是否上传过
|
||||||
loading: true,
|
loading: true,
|
||||||
file: ''
|
file: '',
|
||||||
|
submitPerDay:"", // 提交次数
|
||||||
|
|
||||||
|
submitInfo:{
|
||||||
|
submitNum : null,
|
||||||
|
compId : '',
|
||||||
|
teamId: '',
|
||||||
|
file: '',
|
||||||
|
score: null,
|
||||||
|
status: 0 //已提交次数
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -120,13 +131,20 @@ export default {
|
||||||
importSuccess(res) {
|
importSuccess(res) {
|
||||||
|
|
||||||
if(res.status == 0){
|
if(res.status == 0){
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
this.submitInfo.file=res.url
|
||||||
message: '上传报名表成功',
|
|
||||||
type: 'success'
|
|
||||||
});
|
|
||||||
this.file=res.url
|
|
||||||
//TODO:更新提案提交信息到数据库
|
//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'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
this.$message({
|
this.$message({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
@ -233,7 +251,10 @@ export default {
|
||||||
if (res.status == 0) {
|
if (res.status == 0) {
|
||||||
//查询成功
|
//查询成功
|
||||||
this.onlineScript = res.data.onlineScript
|
this.onlineScript = res.data.onlineScript
|
||||||
this.onlineInter = res.date.onlineInter
|
this.onlineInter = res.data.onlineInter
|
||||||
|
|
||||||
|
//提交次数
|
||||||
|
this.submitPerDay = res.data.submitPerDay
|
||||||
} else {
|
} else {
|
||||||
Message.error("获取比赛信息失败")
|
Message.error("获取比赛信息失败")
|
||||||
}
|
}
|
||||||
|
@ -246,23 +267,83 @@ export default {
|
||||||
this.$api.getApplyForPerson(applyInfo).then((res) => {
|
this.$api.getApplyForPerson(applyInfo).then((res) => {
|
||||||
if (res.status == 0 && res.data.applyInfo.status == 2) {
|
if (res.status == 0 && res.data.applyInfo.status == 2) {
|
||||||
//有报名信息 查询提交记录
|
//有报名信息 查询提交记录
|
||||||
|
this.submitInfo.teamId = res.data.applyInfo.teamId
|
||||||
var teamId = res.data.applyInfo.teamId
|
var teamId = res.data.applyInfo.teamId
|
||||||
var submitInfo = {
|
var submitInfo = {
|
||||||
compId: this.$route.params.compId,
|
compId: this.$route.params.compId,
|
||||||
teamId
|
teamId
|
||||||
}
|
}
|
||||||
this.$api.getSubmitInfo(submitInfo).then((res) => {
|
this.$api.getSubmitInfo(submitInfo).then((res) => {
|
||||||
|
|
||||||
if (res.status == 0) {
|
if (res.status == 0) {
|
||||||
// 有提交信息
|
// 有提交信息
|
||||||
this.fileList.push({
|
// 需要判断是否可以再次提交 以及其他提示信息
|
||||||
name: res.data.file.split("/")[3],
|
/**
|
||||||
url: res.data.file
|
* 先判断提交次数设置
|
||||||
}
|
*/
|
||||||
)
|
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
|
||||||
|
|
||||||
//设置上传状态
|
|
||||||
this.uploadStatus = true
|
|
||||||
this.loading = false
|
|
||||||
} else if (res.status == 10) {
|
} else if (res.status == 10) {
|
||||||
// 没有提交信息
|
// 没有提交信息
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
|
@ -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 {
|
export default {
|
||||||
|
@ -298,5 +310,6 @@ export default {
|
||||||
updateApplyInfo,
|
updateApplyInfo,
|
||||||
getDivisionAndKind,
|
getDivisionAndKind,
|
||||||
getSubmitCust,
|
getSubmitCust,
|
||||||
getSubmitInfo
|
getSubmitInfo,
|
||||||
|
insertSubmitInfo
|
||||||
}
|
}
|
Loading…
Reference in New Issue