赛事登修复

dev_2022-05-11
Jo 3 years ago
parent 7b33819db6
commit 402040fc54
  1. 16513
      package-lock.json
  2. 3
      src/layouts/header/index.vue
  3. 9
      src/pages/achievement/teach/index.vue
  4. 2
      src/pages/assessment/list/index.vue
  5. 3
      src/pages/match/manage/index.vue
  6. 273
      src/pages/match/manage/matchDetail.vue
  7. 54
      src/pages/match/manage/matchProgress.vue
  8. 3
      src/pages/match/manage/matchSignup.vue
  9. 2
      src/pages/project/list/index.vue
  10. 4
      src/setting.js

16513
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -142,6 +142,9 @@ export default {
display: inline-flex;
align-items: center;
cursor: pointer;
span {
font-size: 12px;
}
}
.el-button--text {

@ -250,6 +250,10 @@ export default {
data[9]++;
}
})
// const datas = []
// for (let i = 0; i <= 100; i++) {
// datas.push(list.filter(e => e.score === i).length)
// }
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
@ -258,11 +262,14 @@ export default {
name: "分数",
type: "category",
boundaryGap: false,
interval: 10,
// splitNumber: 10,
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
},
yAxis: {
name: "人数",
type: "value"
type: "value",
interval: 1
},
series: [{
data,

@ -96,7 +96,7 @@
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="170">
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<template v-if="scope.row.status == 0 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-if="scope.row.type == 1" type="text" @click="start(scope.row)">启动</el-button>

@ -59,7 +59,7 @@ export default {
},
tabChange(index) {
this.$store.commit("match/setWaitIndex", index);
if(!(this.wait !== 999)) {
if(!(this.wait === 1 || this.wait === 0)) {
this.active = index;
}else {
EventBus.$emit(`tabClickWait${this.wait}`, );
@ -68,7 +68,6 @@ export default {
},
tabChangeWait(index) {
this.tabChange(index)
// tabChange(sessionStorage.setItem('tabIndex', fromIndex))
}
},
computed: {

@ -1,6 +1,6 @@
<template>
<!-- 大赛详情 -->
<div style="padding: 24px" @click="test">
<div style="padding: 24px">
<div class="page-content">
<el-form label-width="170px" label-suffix=":" size="small">
<el-form-item label="竞赛封面(选填)">
@ -17,7 +17,7 @@
:headers="headers"
name="file"
>
<img v-if="coverUrl" :src="coverUrl" class="avatar">
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
@ -41,7 +41,7 @@
:headers="headers"
name="file"
>
<img v-if="carouselUrl" :src="carouselUrl" class="avatar-lg">
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
@ -53,14 +53,14 @@
</el-form-item>
<el-form-item label="竞赛名称">
<div class="d-inline-block">
<el-input placeholder="请输入竞赛名称" v-model="name" clearable></el-input>
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input>
</div>
</el-form-item>
<el-form-item label="主办方">
<div class="inline-input">
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<div class="input-wrap" v-for="(item,index) in form.sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="form.sponsorList[index]"></el-input>
<i v-if="form.sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
@ -70,32 +70,32 @@
</el-form-item>
<el-form-item label="承办方(选填)">
<div class="inline-input">
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<div class="input-wrap" v-for="(item,index) in form.undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="form.undertakerList[index]"></el-input>
<i v-if="form.undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
<button v-if="!undertakerList.length" class="add-btn" @click="addOrganizer">
<button v-if="!form.undertakerList.length" class="add-btn" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</el-form-item>
<el-form-item label="报名时间">
<el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker v-model="form.signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="竞赛时间">
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker v-model="form.playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="竞赛详情">
<quill :border="true" v-model="description" :height="400" />
<quill :border="true" v-model="form.description" :height="400" />
</el-form-item>
<el-form-item>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-if="publishStatus == 1" v-throttle @click="save(0)">发布</el-button>
<el-button type="primary" v-if="form.publishStatus == 1" v-throttle @click="save(0)">发布</el-button>
</el-form-item>
</el-form>
</div>
@ -117,33 +117,46 @@ export default {
token: util.local.get(Setting.tokenKey)
},
id: this.$route.query.id,
coverUrl: "",
carouselUrl: "",
publishStatus: 0,
uploadList: [],
uploadDataList: [],
name: "",
sponsor: "",
sponsorList: [""],
undertaker: "",
undertakerList: [],
signUpStartTime: "",
signUpEndTime: "",
signupTime: "",
playTime: "",
playStartTime: "",
playEndTime: "",
description: "",
touchTime:0,
form: {
coverUrl: '',
carouselUrl: '',
publishStatus: 0,
uploadList: [],
uploadDataList: [],
name: '',
sponsor: '',
sponsorList: [''],
undertaker: '',
undertakerList: [],
signUpStartTime: '',
signUpEndTime: '',
signupTime: '',
playTime: '',
playStartTime: '',
playEndTime: '',
description: ''
},
updateTime: 0
};
},
created() {
},
components: {
quill
},
computed: {
wait() {
return this.$store.state.match.wait
}
},
watch: {
signupTime: function(val) {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$store.commit('match/setWait', 0)
},
deep:true
},
'form.signupTime': function(val) {
if (val) {
this.signUpStartTime = val[0];
this.signUpEndTime = val[1];
@ -152,7 +165,7 @@ export default {
this.signUpEndTime = "";
}
},
playTime: function(val) {
'form.playTime': function(val) {
if (val) {
this.playStartTime = val[0];
this.playEndTime = val[1];
@ -168,10 +181,6 @@ export default {
EventBus.$on("tabClickWait0", () => this.waitSave());
},
methods: {
test() {
this.$store.commit("match/setWait", 0);
// console.log(this.$store.state.match.waitIndex)
},
...mapActions("match", [
"setMatchId"
]),
@ -192,107 +201,87 @@ export default {
});
},
save(status, judge=true) {
this.touchTime = 0
this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg("请填写竞赛名称");
save(status, back = 1) {
const form = this.form
const sponsor = form.sponsorList.filter(d => d).join();
if (!form.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方");
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间");
if (!sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().getTime();
let signUpStartTime = new Date(this.signUpStartTime).getTime();
let signUpEndTime = new Date(this.signUpEndTime).getTime();
let playStartTime = new Date(this.playStartTime).getTime();
let signUpStartTime = new Date(form.signUpStartTime).getTime();
let signUpEndTime = new Date(form.signUpEndTime).getTime();
let playStartTime = new Date(form.playStartTime).getTime();
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('')
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (!form.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
if (!form.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = {
id: this.id,
coverUrl: this.coverUrl,
carouselUrl: this.carouselUrl,
description: this.description,
coverUrl: form.coverUrl,
carouselUrl: form.carouselUrl,
description: form.description,
founderId: 1,
name: this.name,
playEndTime: this.playEndTime,
playStartTime: this.playStartTime,
publishStatus: status ? this.publishStatus : 0,
signUpEndTime: this.signUpEndTime,
signUpStartTime: this.signUpStartTime,
sponsor: this.sponsor,
undertaker: this.undertaker
name: form.name,
playEndTime: form.playEndTime,
playStartTime: form.playStartTime,
publishStatus: status ? form.publishStatus : 0,
signUpEndTime: form.signUpEndTime,
signUpStartTime: form.signUpStartTime,
sponsor,
undertaker: form.undertakerList.filter(d => d).join()
};
this.$store.commit("match/setWait", 999);
if (this.id) {
this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功");
if(judge) {
this.$router.back();
}
util.successMsg("修改成功")
back && this.$router.back()
}).catch(err => {
});
} else {
this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功");
if(judge) {
this.$router.back();
}
util.successMsg("创建成功")
back && this.$router.back()
}).catch(err => {
});
}
},
getData() {
this.$get(this.api.getContest + "/" + this.id).then(res => {
let data = res.contest;
this.coverUrl = data.coverUrl;
this.carouselUrl = data.carouselUrl;
this.description = data.description;
this.name = data.name;
this.playEndTime = data.playEndTime;
this.playStartTime = data.playStartTime;
this.publishStatus = data.publishStatus;
this.signUpEndTime = data.signUpEndTime;
this.signUpStartTime = data.signUpStartTime;
this.sponsor = data.sponsor;
this.undertaker = data.undertaker;
this.signupTime = [data.signUpStartTime, data.signUpEndTime];
this.playTime = [data.playStartTime, data.playEndTime];
this.sponsorList = data.sponsor.split(",");
this.undertakerList = data.undertaker.split(",");
}).catch(err => {
});
const data = res.contest
data.signupTime = [data.signUpStartTime, data.signUpEndTime]
data.playTime = [data.playStartTime, data.playEndTime]
data.sponsorList = data.sponsor.split(",")
data.undertakerList = data.undertaker.split(",")
this.form = data
}).catch(err => {})
},
commitId() {
this.setMatchId(this.id);
// this.$store.commit("setMatchId", { matchId: this.id });
},
handleExceed(files, fileList) {
this.touchTime = this.touchTime+1
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
uploadSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
}
this.coverUrl = res.data.filesResult.fileUrl;
this.form.coverUrl = res.data.filesResult.fileUrl;
},
uploadLgSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.carouselUrl) {
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
if (this.form.carouselUrl) {
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
}
this.carouselUrl = res.data.filesResult.fileUrl;
this.form.carouselUrl = res.data.filesResult.fileUrl;
},
uploadError(err, file, fileList) {
this.touchTime = this.touchTime+1
this.$message({
message: "上传出错,请重试!",
type: "error",
@ -300,27 +289,23 @@ export default {
});
},
beforeRemove(file, fileList) {
this.touchTime = this.touchTime+1
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = "";
this.form.coverUrl = "";
}).catch(res => {
});
},
handleLgRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = "";
this.form.carouselUrl = "";
}).catch(res => {
});
},
uploadSure() {
this.touchTime = this.touchTime+1
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
@ -335,80 +320,18 @@ export default {
});
},
addSponsor() {
this.touchTime = this.touchTime+1
this.sponsorList.push("");
this.form.sponsorList.push("");
},
delSponsor(index) {
this.touchTime = this.touchTime+1
this.sponsorList.splice(index, 1);
this.form.sponsorList.splice(index, 1);
},
addOrganizer() {
this.touchTime = this.touchTime+1
this.undertakerList.push("");
this.form.undertakerList.push("");
},
delOrganizer(index) {
this.touchTime = this.touchTime+1
this.undertakerList.splice(index, 1);
}
},
beforeDestroy() {
if (this.touchTime>0){
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方");
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().getTime();
let signUpStartTime = new Date(this.signUpStartTime).getTime();
let signUpEndTime = new Date(this.signUpEndTime).getTime();
let playStartTime = new Date(this.playStartTime).getTime();
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('')
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = {
id: this.id,
coverUrl: this.coverUrl,
carouselUrl: this.carouselUrl,
description: this.description,
founderId: 1,
name: this.name,
playEndTime: this.playEndTime,
playStartTime: this.playStartTime,
publishStatus: status ? this.publishStatus : 0,
signUpEndTime: this.signUpEndTime,
signUpStartTime: this.signUpStartTime,
sponsor: this.sponsor,
undertaker: this.undertaker
};
if (this.id) {
this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功");
this.$router.back();
}).catch(err => {
});
} else {
this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功");
this.$router.back();
}).catch(err => {
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
});
this.form.undertakerList.splice(index, 1);
}
},
}
};
</script>

@ -73,7 +73,6 @@ export default {
},
mounted() {
this.getData();
console.log(this.listData)
EventBus.$on("tabClickWait1", () => this.waitSave());
},
methods: {
@ -133,8 +132,6 @@ export default {
if(row.id === "") {
this.listData.splice(index, 1)
util.successMsg("删除成功");
console.log(this.listData)
console.log(this.hasEdit)
}else {
this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
@ -225,56 +222,7 @@ export default {
hasEdit() {
return this.listData.some(item => item.operate)
}
},
beforeDestroy() {
console.log('beforeDestroy')
// EventBus.$off();
// this.waitSave()
// if(this.hasEdit) {
// console.log('what')
// }
// if (this.touchTime>0){
// if (this.hasEdit){
// this.$confirm('?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// let num = 0;
// for(var i=0;i<this.listData.length;i++){
// let data = this.listData[i];
// if (data.title) {
// if (this.listData[i].id) {
// this.$put(this.api.editContestProgress, data).then(res => {
// }).catch(res => {
// });
// }else{
// num = num+1
// }
// }else{
// num = num+1
// }
// }
// if (num >0){
// this.$message({
// type: 'error',
// message: ''
// });
// }else{
// this.$message({
// type: 'success',
// message: '!'
// });
// }
// }).catch(() => {
// this.$message({
// type: 'info',
// message: ''
// });
// });
// }
},
}
};
</script>

@ -120,7 +120,6 @@ export default {
type: "warning"
})
.then(() => {
console.log(11, delList.join());
this.$put(`${this.api.disableContests}?ids=${delList.join(",")}`).then(res => {
this.multipleSelection = [];
util.successMsg("禁用成功");
@ -143,8 +142,6 @@ export default {
let data = newArr.map(item => {
return item.id;
});
// return console.log(11,data)
location.href = `${this.api.batchExport}?ids=${data.join(",")}`;
} else {
util.errorMsg("请先选择数据 !");

@ -84,7 +84,7 @@
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作" width="300">
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row,'0',queryData.founder)">查看</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row,'1',queryData.founder)">编辑</el-button>

@ -40,8 +40,8 @@ if (isHh) {
jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093`
// host = "http://www.occupationlab.com:9000/";//线上
// host = "http://39.108.250.202:9000/"; // 中台测试服
host = "http://192.168.31.151:9000/"; // 榕
host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统";
} else {

Loading…
Cancel
Save