dev_2022-05-11
e 3 years ago
parent 29ba5f7232
commit c5c8ba96dc
  1. 6
      src/pages/achievement/vir/index.vue
  2. 100
      src/pages/match/manage/matchDetail.vue
  3. 16
      src/pages/match/manage/matchProgress.vue
  4. 9
      src/pages/project/list/index.vue

@ -101,7 +101,7 @@ export default {
}, },
getData() { getData() {
this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => { this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => {
this.multipleSelection = res.page.records; // this.multipleSelection = res.page.records;
this.listData = res.page.records; this.listData = res.page.records;
this.total = res.page.total; this.total = res.page.total;
let avgScore = +res.avgScore let avgScore = +res.avgScore
@ -124,9 +124,9 @@ export default {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.reportId; return item.reportId;
}); });
location.href = `${this.api.exportPracticeInfo}?ids=${ids.toString()}`; location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`;
} else { } else {
location.href = `${this.api.exportPracticeInfo}?ids=`; location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}`;
} }
}, },
handleDelete(row) { handleDelete(row) {

@ -132,7 +132,8 @@ export default {
playTime: "", playTime: "",
playStartTime: "", playStartTime: "",
playEndTime: "", playEndTime: "",
description: "" description: "",
touchTime:0,
}; };
}, },
components: { components: {
@ -140,6 +141,7 @@ export default {
}, },
watch: { watch: {
signupTime: function(val) { signupTime: function(val) {
this.touchTime = this.touchTime+1
if (val) { if (val) {
this.signUpStartTime = val[0]; this.signUpStartTime = val[0];
this.signUpEndTime = val[1]; this.signUpEndTime = val[1];
@ -149,6 +151,7 @@ export default {
} }
}, },
playTime: function(val) { playTime: function(val) {
this.touchTime = this.touchTime+1
if (val) { if (val) {
this.playStartTime = val[0]; this.playStartTime = val[0];
this.playEndTime = val[1]; this.playEndTime = val[1];
@ -167,9 +170,9 @@ export default {
"setMatchId" "setMatchId"
]), ]),
save(status) { save(status) {
this.touchTime = 0
this.sponsor = this.sponsorList.filter(d => d).join(); this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join(); this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg("请填写竞赛名称"); if (!this.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) { if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方"); if (!this.sponsor) return util.warningMsg("请填写主办方");
@ -183,7 +186,6 @@ export default {
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情"); if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = { let data = {
id: this.id, id: this.id,
coverUrl: this.coverUrl, coverUrl: this.coverUrl,
@ -203,21 +205,18 @@ export default {
this.$put(this.api.editContest, data).then(res => { this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功");
this.$router.back(); this.$router.back();
}) }).catch(err => {
.catch(err => {
}); });
} else { } else {
this.$post(this.api.addContest, data).then(res => { this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功"); util.successMsg("创建成功");
this.$router.back(); this.$router.back();
}) }).catch(err => {
.catch(err => {
}); });
} }
}, },
getData() { getData() {
this.$get(this.api.getContest + "/" + this.id) this.$get(this.api.getContest + "/" + this.id).then(res => {
.then(res => {
let data = res.contest; let data = res.contest;
this.coverUrl = data.coverUrl; this.coverUrl = data.coverUrl;
this.carouselUrl = data.carouselUrl; this.carouselUrl = data.carouselUrl;
@ -230,24 +229,24 @@ export default {
this.signUpStartTime = data.signUpStartTime; this.signUpStartTime = data.signUpStartTime;
this.sponsor = data.sponsor; this.sponsor = data.sponsor;
this.undertaker = data.undertaker; this.undertaker = data.undertaker;
this.signupTime = [data.signUpStartTime, data.signUpEndTime]; this.signupTime = [data.signUpStartTime, data.signUpEndTime];
this.playTime = [data.playStartTime, data.playEndTime]; this.playTime = [data.playStartTime, data.playEndTime];
this.sponsorList = data.sponsor.split(","); this.sponsorList = data.sponsor.split(",");
this.undertakerList = data.undertaker.split(","); this.undertakerList = data.undertaker.split(",");
}) }).catch(err => {
.catch(err => {
}); });
}, },
commitId() { commitId() {
this.touchTime = this.touchTime+1
this.setMatchId(this.id); this.setMatchId(this.id);
// this.$store.commit("setMatchId", { matchId: this.id }); // this.$store.commit("setMatchId", { matchId: this.id });
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.touchTime = this.touchTime+1
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.coverUrl) { if (this.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -257,6 +256,7 @@ export default {
this.coverUrl = res.data.filesResult.fileUrl; this.coverUrl = res.data.filesResult.fileUrl;
}, },
uploadLgSuccess(res, file, fileList) { uploadLgSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.carouselUrl) { if (this.carouselUrl) {
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -266,6 +266,7 @@ export default {
this.carouselUrl = res.data.filesResult.fileUrl; this.carouselUrl = res.data.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.touchTime = this.touchTime+1
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
@ -273,9 +274,11 @@ export default {
}); });
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
this.touchTime = this.touchTime+1
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ""; this.coverUrl = "";
@ -283,6 +286,7 @@ export default {
}); });
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = ""; this.carouselUrl = "";
@ -290,6 +294,7 @@ export default {
}); });
}, },
uploadSure() { uploadSure() {
this.touchTime = this.touchTime+1
this.BatchUpload = false; this.BatchUpload = false;
this.pageNo = 1; this.pageNo = 1;
this.keyword = ""; this.keyword = "";
@ -298,27 +303,86 @@ export default {
goback() { goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => {
this.$router.push("/match"); this.$router.push("/match");
}) }).catch(() => {
.catch(() => {
}); });
}, },
addSponsor() { addSponsor() {
this.touchTime = this.touchTime+1
this.sponsorList.push(""); this.sponsorList.push("");
}, },
delSponsor(index) { delSponsor(index) {
this.touchTime = this.touchTime+1
this.sponsorList.splice(index, 1); this.sponsorList.splice(index, 1);
}, },
addOrganizer() { addOrganizer() {
this.touchTime = this.touchTime+1
this.undertakerList.push(""); this.undertakerList.push("");
}, },
delOrganizer(index) { delOrganizer(index) {
this.touchTime = this.touchTime+1
this.undertakerList.splice(index, 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: '已取消保存'
});
});
}
},
}; };
</script> </script>

@ -63,7 +63,8 @@ export default {
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
totals: 0 totals: 0,
touchTime:0,
}; };
}, },
mounted() { mounted() {
@ -81,12 +82,14 @@ export default {
if (data.title.length) { if (data.title.length) {
if (row.id) { if (row.id) {
this.$put(this.api.editContestProgress, data).then(res => { this.$put(this.api.editContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("修改成功"); util.successMsg("修改成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(this.api.addContestProgress, data).then(res => { this.$post(this.api.addContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("创建成功"); util.successMsg("创建成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -110,18 +113,18 @@ export default {
handleDelete(row) { handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => { this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
}) }).catch(() => {
.catch(() => {
}); });
}, },
addData() { addData() {
this.touchTime = this.touchTime+1
if (this.listData.length) { if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) { if (this.listData[this.listData.length - 1].id) {
this.listData.push({ this.listData.push({
@ -147,6 +150,7 @@ export default {
}, },
}, },
beforeDestroy() { beforeDestroy() {
if (this.touchTime>0){
this.$confirm('暂未保存,是否保存本次编辑?', '提示', { this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -179,13 +183,13 @@ export default {
message: '保存成功!' message: '保存成功!'
}); });
} }
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消保存' message: '已取消保存'
}); });
}); });
}
}, },
}; };
</script> </script>

@ -86,8 +86,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="auth('编辑')" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-if="scope.row.founder != 0" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="auth('删除')" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button> <el-button v-if="scope.row.founder != 0" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button> <el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch <el-switch
v-if="auth('禁用')" v-if="auth('禁用')"
@ -232,10 +232,15 @@ export default {
]), ]),
getSystemData() { getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => { this.$get(this.api.getSystemIdBySchool).then(res => {
if (res.status == 200){
this.systemList = res.data; this.systemList = res.data;
// systemIdsystemIdsystemId // systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id; this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData(); this.getData();
}else{
}
}); });
}, },
getData() { getData() {

Loading…
Cancel
Save