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

@ -101,7 +101,7 @@ export default {
},
getData() {
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.total = res.page.total;
let avgScore = +res.avgScore
@ -124,9 +124,9 @@ export default {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
location.href = `${this.api.exportPracticeInfo}?ids=${ids.toString()}`;
location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`;
} else {
location.href = `${this.api.exportPracticeInfo}?ids=`;
location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}`;
}
},
handleDelete(row) {

@ -132,7 +132,8 @@ export default {
playTime: "",
playStartTime: "",
playEndTime: "",
description: ""
description: "",
touchTime:0,
};
},
components: {
@ -140,6 +141,7 @@ export default {
},
watch: {
signupTime: function(val) {
this.touchTime = this.touchTime+1
if (val) {
this.signUpStartTime = val[0];
this.signUpEndTime = val[1];
@ -149,6 +151,7 @@ export default {
}
},
playTime: function(val) {
this.touchTime = this.touchTime+1
if (val) {
this.playStartTime = val[0];
this.playEndTime = val[1];
@ -167,9 +170,9 @@ export default {
"setMatchId"
]),
save(status) {
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("请填写竞赛名称");
if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方");
@ -183,7 +186,6 @@ export default {
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,
@ -203,51 +205,48 @@ export default {
this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功");
this.$router.back();
})
.catch(err => {
});
}).catch(err => {
});
} else {
this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功");
this.$router.back();
})
.catch(err => {
});
}).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 => {
});
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 => {
});
},
commitId() {
this.touchTime = this.touchTime+1
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/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -257,6 +256,7 @@ export default {
this.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/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -266,6 +266,7 @@ export default {
this.carouselUrl = res.data.filesResult.fileUrl;
},
uploadError(err, file, fileList) {
this.touchTime = this.touchTime+1
this.$message({
message: "上传出错,请重试!",
type: "error",
@ -273,9 +274,11 @@ 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/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = "";
@ -283,6 +286,7 @@ export default {
});
},
handleLgRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = "";
@ -290,6 +294,7 @@ export default {
});
},
uploadSure() {
this.touchTime = this.touchTime+1
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
@ -298,27 +303,86 @@ export default {
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
})
.then(() => {
this.$router.push("/match");
})
.catch(() => {
});
}).then(() => {
this.$router.push("/match");
}).catch(() => {
});
},
addSponsor() {
this.touchTime = this.touchTime+1
this.sponsorList.push("");
},
delSponsor(index) {
this.touchTime = this.touchTime+1
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.touchTime = this.touchTime+1
this.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: '已取消保存'
});
});
}
},
};
</script>

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

@ -86,8 +86,8 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button v-if="auth('编辑')" 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="edit(scope.row)">编辑</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-switch
v-if="auth('禁用')"
@ -232,10 +232,15 @@ export default {
]),
getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => {
this.systemList = res.data;
// systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData();
if (res.status == 200){
this.systemList = res.data;
// systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData();
}else{
}
});
},
getData() {

Loading…
Cancel
Save