赛事联调

dev_2022-06-14
yujialong 2 years ago
parent 6210b29513
commit 55a9ea2897
  1. 33
      src/api/index.js
  2. BIN
      src/assets/img/label.png
  3. 40
      src/pages/achievement/list/index.vue
  4. 584
      src/pages/match/add/index.vue
  5. 146
      src/pages/match/list/index.vue
  6. 77
      src/pages/match/manage/index.vue
  7. 608
      src/pages/match/manage/matchDetail.vue
  8. 4
      src/pages/match/manage/matchProgress.vue
  9. 52
      src/pages/match/manage/matchSignup.vue
  10. 123
      src/pages/match/manage/notice.vue
  11. 304
      src/pages/match/manage/noticeDetail.vue
  12. 18
      src/router/index.js
  13. 8
      src/setting.js
  14. 2
      src/store/modules/user.js

@ -1,7 +1,7 @@
import Setting from "@/setting";
const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL;
const host1 = "http://39.108.250.202:8080/"
const host1 = "http://121.37.12.51:8080/"
export default {
queryToken: `liuwanr/userInfo/queryToken`,
@ -42,7 +42,7 @@ export default {
saveOrg: `occupationlab/architecture/save`, // 新增组织架构
updateOrg: `occupationlab/architecture/update`, // 编辑组织架构
deleteOrg: `occupationlab/architecture/delete`, // 删除组织架构
studentTemplate: `http://39.108.250.202/template/学生导入模板.xlsx`, // 学生导入模板
studentTemplate: `http://121.37.12.51/template/学生导入模板.xlsx`, // 学生导入模板
// 测评管理
questionsList: `occupationlab/questions/list`, // 题库列表查询
@ -51,7 +51,7 @@ export default {
questionsDetail: `occupationlab/questions/detail`, // 查看当前题库信息
questionsDelete: `occupationlab/questions/delete`, // 根据主键删除
questionsIsDisable: `occupationlab/questions/isDisable`, // 是否禁用试题
questionsTemplate: `http://39.108.250.202/template/试题导入模板.xlsx`, //excel模板文件下载
questionsTemplate: `http://121.37.12.51/template/试题导入模板.xlsx`, //excel模板文件下载
questionsImport: `${host}occupationlab/questions/importQuestion`, // 批量导入题库
questionsExportFailure: `${host}occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出
questionsInfo: `occupationlab/questions/info`, // 测评规则信息的展示
@ -103,13 +103,18 @@ export default {
updateProjectJudgment: `occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
// 赛事管理
// 赛事
contestPageConditionQueryByOccupationlab: `occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlab`,
addContest: `occupationlab/enterprise/match/contest/addContest`,
deleteContest: `occupationlab/enterprise/match/contest/deleteContest`,
editContest: `occupationlab/enterprise/match/contest/editContest`,
publishContest: `occupationlab/enterprise/match/contest/publishContest`,
deleteContest: `occupationlab/enterprise/match/contest/deleteContest`,
getContest: `occupationlab/enterprise/match/contest/getContest`,
queryContestByCondition: `occupationlab/enterprise/match/contest/queryContestByCondition`,
deleteAnnex: `occupationlab/contest/annex/delete`,
saveAnnex: `occupationlab/contest/annex/save`,
getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`,
disabledEvents: `occupationlab/enterprise/match/contest/disabledEvents`,
// 竞赛进展
addContestProgress: `occupationlab/enterprise/match/contest-progress/addContestProgress`,
deleteContestProgress: `occupationlab/enterprise/match/contest-progress/deleteContestProgress`,
@ -118,10 +123,18 @@ export default {
// 报名人员
addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`,
disableContests: `occupationlab/enterprise/match/applicant/disableContests`,
excelExport: `occupationlab/enterprise/match/applicant/excelExport`,
excelExport: `${host}occupationlab/enterprise/match/applicant/excelExport`,
queryApplicantByCondition: `occupationlab/enterprise/match/applicant/queryApplicantByCondition`,
disableApplicant: `occupationlab/enterprise/match/applicant/disableApplicant`,
batchExport: `occupationlab/enterprise/match/applicant/batchExport`,
exportDataInBatches: `${host}occupationlab/enterprise/match/applicant/exportDataInBatches`,
// 赛事公告
addAnnouncement: `occupationlab/contest/announcement/addAnnouncement`,
amendmentAnnouncement: `occupationlab/contest/announcement/amendmentAnnouncement`,
deleteAnnouncement: `occupationlab/contest/announcement/deleteAnnouncement`,
queryAnnouncementByContestId: `occupationlab/contest/announcement/queryAnnouncementByContestId`,
queryAnnouncementDetails: `occupationlab/contest/announcement/queryAnnouncementDetails`,
deleteAnnouncementAnnex: `occupationlab/contestAnnouncementAnnex/delete`,
saveAnnouncementAnnex: `occupationlab/contestAnnouncementAnnex/save`,
// 栏目管理
addColumn: `occupationlab/enterprise/information/column/addColumn`,
@ -204,7 +217,7 @@ export default {
modifyStaff: `occupationlab/staff/modifyStaff`, //编辑员工
delStaff: `occupationlab/staff/delStaff`, //删除员工
staffList: `occupationlab/staff/staffList`, //员工列表
staffTemplate: `http://39.108.250.202/template/员工用户导入模板.xlsx`, //员工用户导入模板
staffTemplate: `http://121.37.12.51/template/员工用户导入模板.xlsx`, //员工用户导入模板
exportFailureStaff: `${host}occupationlab/staff/exportFailure`, //批量导入员工失败数据导出
importStaff: `${host}occupationlab/staff/importStaff`, //批量导入员工
// 角色管理

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

@ -30,7 +30,7 @@
</li>
<li v-show="projectPermissions === 1">
<label>班级</label>
<el-select v-model="classId" @change="initData">
<el-select v-model="classId" @change="classChange">
<el-option
v-for="item in classList"
:key="item.id"
@ -41,7 +41,7 @@
</li>
<li>
<label>课程</label>
<el-select v-model="curriculumId" @change="initData">
<el-select v-model="curriculumId" @change="curriculumChange">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in curriculumList"
@ -107,11 +107,11 @@ export default {
name: "achievement",
data() {
return {
classId: "",
classId: this.$route.query.class ? +this.$route.query.class : '',
classList: [],
curriculumId: "",
curriculumId: this.$route.query.curriculum ? +this.$route.query.curriculum : '',
curriculumList: [],
projectPermissions: 0,
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0,
keyword: "",
searchTimer: null,
startingtime: "",
@ -175,13 +175,6 @@ export default {
}
},
mounted() {
let per = this.$route.query.per
if(per == '1'){
per = 1
}else{
per = 0
}
this.projectPermissions = per
this.getschoolCourse();
this.getClassData();
},
@ -247,6 +240,7 @@ export default {
this.loadIns.close()
});
},
//
perChange(val) {
this.$router.push({
path: 'list',
@ -257,6 +251,28 @@ export default {
})
this.getData()
},
//
classChange(val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
class: val
}
})
this.getData()
},
//
curriculumChange(val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
curriculum: val
}
})
this.getData()
},
initData() {
this.$refs.table.clearSelection();
this.page = 1;

@ -2,7 +2,7 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="'创建赛事'"></el-page-header>
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
@ -21,7 +21,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>
@ -44,7 +44,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>
@ -54,9 +54,22 @@
</div>
</el-upload>
</el-form-item>
<el-form-item label="比赛范围">
<div>
<el-radio v-model="form.competitionScope" :label="0">本校内</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope" :label="2">指定区域院校</el-radio>
<el-button v-if="form.competitionScope === 2" type="primary" size="mini" @click="showRange">选择院校</el-button>
<span style="margin-left: 20px">{{ rangeName }}</span>
</div>
</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="主办方">
@ -98,240 +111,385 @@
:picker-options="pickerOptions"></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 label="附件">
<el-upload
:on-remove="handleAnnexRemove"
:on-error="uploadError"
:before-upload="beforeUpload"
:on-success="uploadAnnexSuccess"
:before-remove="beforeRemove"
:limit="5"
:on-exceed="handleExceedAnnex"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-throttle @click="save(0)">发布</el-button>
<el-button @click="save(0)">保存</el-button>
<el-button type="primary" @click="save(1)">发布</el-button>
<el-button type="danger" @click="preview">预览</el-button>
</el-form-item>
</el-form>
</el-card>
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" :close-on-click-modal="false">
<el-cascader
ref="range"
v-model="range"
:options="ranges"
:props="props"
clearable
filterable></el-cascader>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="rangeVisible = false"> </el-button>
<el-button size="small" type="primary" @click="rangeSubmit"> </el-button>
</span>
</el-dialog>
<el-dialog title="预览" :visible.sync="previewVisible" width="1080px" custom-class="preview-dia" :close-on-click-modal="false">
<div class="match">
<div class="info">
<h6 class="title">{{ form.name }}</h6>
<div class="meta">最近编辑时间{{ form.updateTime }}</div>
</div>
<div class="l-title" id="part1"><img src="@/assets/img/label.png" alt=""> 竞赛信息</div>
<div v-if="form.description" class="texts ql-editor" v-html="form.description"></div>
<template v-if="form.contestAnnexList">
<h6 class="p-title">附件下载</h6>
<ul class="files">
<li v-for="(item, i) in form.contestAnnexList" :key="i">
<el-link class="file-name" type="primary" @click="previewFile(item)">{{ item.fileName }}</el-link>
<el-link type="primary" :underline="false" @click="download(item)">下载</el-link>
</li>
</ul>
</template>
</div>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import quill from "@/components/quill";
import Setting from "@/setting";
export default {
name: "add",
data() {
const that = this
return {
headers: {
token: util.local.get(Setting.tokenKey)
},
id: "",
coverUrl: "",
carouselUrl: "",
publishStatus: 0,
userId: this.$store.state.userLoginId,
username: this.$store.state.name,
uploadList: [],
uploadDataList: [],
coverVisible: false,
coverImageUrl: "",
name: "",
sponsor: "",
fileName: '',
form: {
id: '',
platformSource: 1, // (0:1)
ztOpen: 0, // (0 1 0)
name: '',
sponsor: '',
undertaker: '',
competitionScope: 0, // (0: 1: 2:)
contestRangeList: [], //
contestAnnexList: [], //
coverUrl: '',
carouselUrl: '',
publishStatus: 0,
signUpStartTime: '',
signUpEndTime: '',
playStartTime: '',
playEndTime: '',
description: '',
},
signupTime: '',
playTime: '',
sponsorList: [""],
undertaker: "",
undertakerList: [""],
signUpStartTime: "",
signUpEndTime: "",
signupTime: "",
playTime: "",
playStartTime: "",
playEndTime: "",
description: "",
pickerOptions: {
disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000;
}
},
submiting: false
provinceList: this.$store.state.provinceList,
rangeVisible: false,
range: [],
ranges: [],
rangeName: '',
//
props: {
multiple: true,
checkStrictly: true,
lazy: true,
lazyLoad (node, resolve) {
const { level, value } = node
//
if (!level) {
that.$get(that.api.queryProvince).then(({ list }) => {
const data = []
list.map(e => {
data.push({
value: e.provinceId,
label: e.provinceName
})
})
resolve(data)
}).catch(res => {})
} else if (level === 1) {
//
that.$get(that.api.queryCity, {
provinceId: value
}).then(({ list }) => {
const data = []
list.map(e => {
data.push({
provinceId: value,
value: e.cityId,
label: e.cityName
})
})
resolve(data)
}).catch(res => {})
} else if (level === 2) {
//
that.$get(that.api.getSchoolsByProvince, {
provinceId: node.data.provinceId,
cityId: value,
schoolName: ''
}).then(({ list }) => {
const data = []
list.map(e => {
data.push({
value: e.schoolId,
label: e.schoolName,
leaf: true
})
})
resolve(data)
}).catch(res => {})
} else {
resolve([])
}
}
},
submiting: false,
updateTime: 0,
previewVisible: false
};
},
components: {
quill
},
watch: {
// ,
form: {
handler(){
this.updateTime++
},
deep:true
},
signupTime: function(val) {
if (val) {
this.signUpStartTime = val[0];
this.signUpEndTime = val[1];
} else {
this.signUpStartTime = "";
this.signUpEndTime = "";
}
const { form } = this
if (val) {
form.signUpStartTime = val[0];
form.signUpEndTime = val[1];
} else {
form.signUpStartTime = ''
form.signUpEndTime = ''
}
},
playTime: function(val) {
if (val) {
this.playStartTime = val[0];
this.playEndTime = val[1];
} else {
this.playStartTime = "";
this.playEndTime = "";
}
const { form } = this
if (val) {
form.playStartTime = val[0]
form.playEndTime = val[1]
} else {
form.playStartTime = ''
form.playEndTime = ''
}
}
},
mounted() {
this.id = this.$route.query.id;
this.isDetail = Boolean(this.$route.query.show);
this.id && this.getData();
},
methods: {
//
goBack() {
this.$router.back();
},
save(status) {
if (this.submiting) return false;
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 util.warningMsg("报名时间不能早于当前时间");
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
//
showRange() {
this.rangeVisible = true
},
//
rangeSubmit() {
// id
const data = []
this.range.map(e => {
data.push({
provinceId: e[0] || '',
cityId: e[1] || '',
schoolId: e[2] || '',
type: e.length > 2 ? 0 : 1
})
})
this.form.contestRangeList = data
let data = {
id: this.id,
coverUrl: this.coverUrl,
carouselUrl: this.carouselUrl,
description: this.description,
founderId: 1,
founderName: this.username,
name: this.name,
playEndTime: this.playEndTime,
playStartTime: this.playStartTime,
publishStatus: status,
signUpEndTime: this.signUpEndTime,
signUpStartTime: this.signUpStartTime,
sponsor: this.sponsor,
undertaker: this.undertaker
};
this.submiting = true;
// name
const checked = this.$refs.range.getCheckedNodes()
const name = []
checked.map(e => {
name.push(e.label)
})
this.rangeName = name.join('、')
if (this.id) {
this.$put(this.api.editContest, data).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addContest, data).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
}
},
getData() {
this.$get(this.api.getContest + this.id)
.then(res => {
if (res.status == 200) {
let info = res.contest;
this.coverUrl = info.coverUrl;
this.description = info.description;
this.name = info.name;
this.rangeVisible = false
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
handleExceedAnnex(files, fileList) {
util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`);
},
uploadSuccess(res) {
const { coverUrl } = this.form
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {})
this.form.coverUrl = res.data.filesResult.fileUrl
},
uploadLgSuccess(res) {
const { carouselUrl } = this.form
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => {}).catch(res => {})
this.form.carouselUrl = res.data.filesResult.fileUrl
},
//
uploadAnnexSuccess(res) {
const file = res.data.filesResult
this.form.contestAnnexList.push({
fileName: this.fileName,
filePath: file.fileUrl || file.fileId
})
},
//
beforeUpload(file) {
this.fileName = file.name
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.form.coverUrl = ''
}).catch(res => {})
},
handleLgRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => {
this.form.carouselUrl = ''
}).catch(res => {})
},
handleAnnexRemove(file, fileList) {
debugger
this.$del(`${this.api.fileDeletion}?keys=${this.coverUrl}`).then(res => {
this.carouselUrl = ''
}).catch(res => {})
},
//
preview() {
this.previewVisible = true
},
//
previewFile(item) {
const { filePath } = item
const suffix = filePath.substr(filePath.lastIndexOf('.') + 1)
window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
download(item) {
util.downloadFile(item.fileName, item.filePath)
},
//
save(status) {
if (this.submiting) return false;
const { form } = this
form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join();
if (form.competitionScope == 2 && !form.contestRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.name) return util.warningMsg("请填写竞赛名称");
if (status == 1) {
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().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 util.warningMsg("报名时间不能早于当前时间");
if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情");
this.signupTime = [info.signUpStartTime, info.signUpEndTime];
this.playTime = [info.playStartTime, info.playEndTime];
} else {
util.errorMsg("查询失败");
}
})
.catch(err => {
});
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
uploadSuccess(res, file, fileList) {
if (this.coverUrl) {
let fileName = this.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;
},
uploadLgSuccess(res, file, fileList) {
if (this.carouselUrl) {
let fileName = this.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;
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = "";
}).catch(res => {
});
},
handleLgRemove(file, fileList) {
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = "";
}).catch(res => {
});
},
uploadSure() {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
})
.then(() => {
this.$router.back();
})
.catch(() => {
});
},
addSponsor() {
this.sponsorList.push("");
},
delSponsor(index) {
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.undertakerList.push("");
},
delOrganizer(index) {
this.undertakerList.splice(index, 1);
this.submiting = true
form.publishStatus = status
if (this.form.id) {
this.$put(this.api.editContest, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addContest, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
}
},
back() {
const updateTime = this.updateTime
//
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
backPage(){
this.$router.back()
},
addSponsor() {
this.sponsorList.push("");
},
delSponsor(index) {
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.undertakerList.push("");
},
delOrganizer(index) {
this.undertakerList.splice(index, 1);
}
}
};
</script>
@ -468,4 +626,42 @@ $upload-lg-height: 150px;
font-weight: bold;
}
}
.match {
.l-title{
display: flex;
align-items: center;
margin-bottom: 12px;
font-size: 14px;
color: #333;
img{
margin-right: 5px;
}
}
.title{
width: 67%;
margin: 0 auto;
font-size: 28px;
text-align: center;
color: #0B1D30;
}
.info .meta{
padding: 16px 0;
font-size: 12px;
color: #999;
text-align: center;
}
.texts {
margin-bottom: 30px;
}
.files {
li {
display: flex;
align-items: center;
margin: 10px 0;
}
.file-name {
margin-right: 10px;
}
}
}
</style>

@ -24,38 +24,48 @@
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<label>状态</label>
<dl>
<dd>
<el-radio-group v-model="form.publishStatus" @change="changeType">
<el-radio v-for="(item,index) in statuses" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
</dd>
</dl>
</li>
</ul>
<div>
<el-button type="info" round @click="add">创建竞赛</el-button>
<el-button type="primary" round @click="add">创建竞赛</el-button>
</div>
</div>
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="竞赛名称" align="center"></el-table-column>
<el-table-column prop="applicantNum" label="报名人数" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.applicantNum ? scope.row.applicantNum : 0 }}
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column>
<el-table-column prop="applicantNum" label="报名人数" align="center" width="150"></el-table-column>
<el-table-column prop="status" label="状态" align="center" width="150">
<template slot-scope="scope">
{{ transferPublishStatus[scope.row.publishStatus] }}
</template>
<template slot-scope="scope">
{{ scope.row.publishStatus ? '已发布' : '未发布' }}
</template>
</el-table-column>
<el-table-column prop="time" label="竞赛时间" align="center" width="300">
<template slot-scope="scope">
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }}
</template>
</el-table-column>
<el-table-column prop="gmtCreate" label="创建时间" align="center" width="200"></el-table-column>
<el-table-column prop="founder" label="创建人" align="center" width="200">
<template slot-scope="scope">
{{scope.row.founder || '系统默认管理员'}}
</template>
<el-table-column prop="createTime" label="创建时间" align="center" width="200"></el-table-column>
<el-table-column prop="founderName" label="创建人" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.founderName || '学校超管' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
@ -66,20 +76,22 @@
</el-table-column>
<el-table-column label="发布状态" align="center" width="120">
<template slot-scope="scope">
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 -->
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 -->
<el-switch
v-if="auth('禁用')"
v-model="scope.row.publishStatus"
v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.publishStatus ? '关' : '开'"
:active-text="scope.row.isOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</div>
@ -92,27 +104,28 @@ export default {
name: "match",
data() {
return {
timer: null,
keyword: "",
statusList: [
{
value: "",
name: "不限"
},
{
value: 1,
name: "待发布"
},
{
value: 0,
name: "已发布"
}
],
matchData: [],
statuses: [
{
id: '',
name: '不限'
},
{
id: 0,
name: '待发布'
},
{
id: 1,
name: '已发布'
}
],
form: {
month: "",
publishStatus: "",
startTime: "",
endTime: ""
endTime: "",
},
multipleSelection: [],
dateList: [
@ -134,10 +147,10 @@ export default {
}
],
date: [],
pageNo: +this.$route.query.page || 1,
page: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
transferPublishStatus: ["已发布", "未发布"]
total: 0,
transferPublishStatus: [ "未发布", "已发布"]
};
},
watch: {
@ -167,29 +180,41 @@ export default {
}
},
mounted() {
this.getData();
this.getData()
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
getData() {
let data = {};
if (this.form.month) data.month = this.form.month;
if (this.keyword) data.name = this.keyword;
if (this.form.publishStatus !== "") data.publishStatus = this.form.publishStatus;
if (this.form.startTime) data.startTime = this.form.startTime;
if (this.form.endTime) data.endTime = this.form.endTime;
this.$get(`${this.api.queryContestByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => {
this.matchData = res.contestList;
this.totals = res.total;
this.$refs.table.clearSelection();
if (!this.matchData.length && this.totals) {
this.pageNo--;
this.getData();
}
}).catch(res => {
});
const { form } = this
// this.timer = setInterval(() => {
this.$post(this.api.contestPageConditionQueryByOccupationlab, {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: 0, // (0: 1: 2.)
endTime: form.endTime || null,
keyWord: this.keyword || null,
platformSource: 1, // (01)
startTime: form.startTime || null,
publishStatus: form.publishStatus
}).then(({ data }) => {
const { records } = data
records.map(e => {
if (e.ztOpen) e.isOpen = 1
})
this.matchData = records
this.total = data.total
this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
}).catch(res => {})
// }, 1000)
},
initData() {
this.pageNo = 1;
this.page = 1;
this.getData();
},
add() {
@ -242,7 +267,7 @@ export default {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.page = val;
this.$router.push(`list?page=${val}`)
this.getData();
},
@ -251,11 +276,16 @@ export default {
return date;
},
switchOff(val, row, index) {
this.$put(`${this.api.publishContest}/${row.id}/${val}`)
this.$post(this.api.disabledEvents, {
contestId: row.id,
isOpen: val,
type: 1 // (01)
})
.then(res => {
val == 1 ? util.warningMsg("该赛事信息已隐藏对学生端用户不可见") : util.successMsg("该赛事信息已对学生端用户公开");
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
})
.catch(err => {
row.isOpen = val ? 0 : 1
});
}
}

@ -3,17 +3,19 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="'赛事管理'"></el-page-header>
<el-page-header @back="back" :content="'赛事管理'"></el-page-header>
</div>
</el-card>
<div class="page" style="margin-bottom: 24px">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" @waitChange="tabChangeWait()" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<!-- 大赛详情 -->
<MatchDetail v-if="active == 'first'" />
<MatchDetail v-if="active == 'first'" ref="detail" />
<!-- 竞赛进展 -->
<MatchProgress v-else-if="active == 'second'" />
<!-- 公告通知 -->
<notice v-else-if="active == 'third'" />
<!-- 报名人员 -->
<MatchSignup v-else />
</div>
@ -24,55 +26,66 @@
<script>
import MatchDetail from "./matchDetail";
import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup";
import EventBus from "@/libs/bus.js";
export default {
name: "matchManage",
data() {
return {
active: "first",
active: this.$route.query.tab || "first",
tabs: {
first: "大赛详情",
second: "竞赛进展",
third: "报名人员"
third: "公告通知",
fourth: "报名人员"
}
};
},
components: {
MatchDetail,
MatchProgress,
notice,
MatchSignup
},
created() {
EventBus.$on("tabChangeWait", (waitIndex) => {
this.tabChange(waitIndex)
});
},
beforeDestroy() {
// EventBus
EventBus.$off()
},
methods: {
goBack() {
this.$router.back();
back() {
this.handleSave(0) && this.$router.back()
},
tabChange(index) {
this.$store.commit("match/setWaitIndex", index);
if(!(this.wait === 1 || this.wait === 0)) {
this.active = index;
}else {
EventBus.$emit(`tabClickWait${this.wait}`, );
this.$store.commit("match/setWait", 999);
// confirm
handleSave(i) {
//
if (this.active === 'first') {
const detail = this.$refs.detail
console.log(11, detail.updateTime, i)
if (detail.updateTime > 1) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
detail.save(1)
this.backOrTab(i)
}).catch(() => {
this.backOrTab(i)
})
} else {
this.backOrTab(i)
}
return false
} else {
return true
}
},
tabChangeWait(index) {
this.tabChange(index)
}
},
computed: {
wait() {
return this.$store.state.match.wait
backPage(){
this.$router.back()
},
tabSwitch(i) {
this.active = i
this.$router.push(`/match/manage?id=${this.$route.query.id}&tab=${i}`)
},
backOrTab(i) {
i ? this.tabSwitch(i) : this.backPage()
},
tabChange(i) {
this.handleSave(i) && this.tabSwitch(i)
}
}
};

@ -51,6 +51,19 @@
</div>
</el-upload>
</el-form-item>
<el-form-item label="比赛范围">
<div>
<el-radio v-model="form.competitionScope" :label="0">本校内</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope" :label="2">指定区域院校</el-radio>
<el-button v-if="form.competitionScope === 2" type="primary" size="mini" @click="showRange">选择院校</el-button>
<span style="margin-left: 20px">{{ rangeName }}</span>
</div>
</el-form-item>
<el-form-item label="竞赛名称">
<div class="d-inline-block">
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input>
@ -58,9 +71,9 @@
</el-form-item>
<el-form-item label="主办方">
<div class="inline-input">
<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>
<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>
<button v-if="index == 0" class="add-btn" @click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
@ -70,267 +83,442 @@
</el-form-item>
<el-form-item label="承办方(选填)">
<div class="inline-input">
<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>
<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>
<button v-if="index == 0" class="add-btn" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
<button v-if="!form.undertakerList.length" class="add-btn" @click="addOrganizer">
<button v-if="!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="form.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="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="form.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="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="form.description" :height="400" />
</el-form-item>
<el-form-item label="附件">
<el-upload
:on-remove="handleAnnexRemove"
:on-error="uploadError"
:before-upload="beforeUpload"
:on-success="uploadAnnexSuccess"
:before-remove="beforeRemove"
:limit="5"
:on-exceed="handleExceedAnnex"
:action="this.api.fileupload"
:headers="headers"
:file-list="fileList"
name="file"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-if="form.publishStatus == 1" v-throttle @click="save(0)">发布</el-button>
<el-button type="primary" @click="save(1)">发布</el-button>
<el-button @click="$router.back()">取消</el-button>
</el-form-item>
</el-form>
</div>
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" :close-on-click-modal="false">
<el-cascader
ref="range"
v-model="range"
:options="ranges"
:props="props"
clearable
filterable></el-cascader>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="rangeVisible = false"> </el-button>
<el-button size="small" type="primary" @click="rangeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import quill from "@/components/quill";
import util from "@/libs/util";
import quill from "@/components/quill";
import Setting from "@/setting";
import { mapActions } from "vuex";
import EventBus from "@/libs/bus.js";
export default {
name: "matchDetail",
name: "add",
data() {
const that = this
return {
headers: {
token: util.local.get(Setting.tokenKey)
},
id: this.$route.query.id,
form: {
coverUrl: '',
carouselUrl: '',
publishStatus: 0,
uploadList: [],
uploadDataList: [],
name: '',
sponsor: '',
sponsorList: [''],
undertaker: '',
undertakerList: [],
signUpStartTime: '',
signUpEndTime: '',
signupTime: '',
playTime: '',
playStartTime: '',
playEndTime: '',
description: ''
id: this.$route.query.id,
platformSource: 1, // (0:1)
ztOpen: 0, // (0 1 0)
name: '',
sponsor: '',
undertaker: '',
competitionScope: 0, // (0: 1: 2:)
contestRangeList: [], //
contestAnnexList: [], //
fileName: '',
coverUrl: '',
carouselUrl: '',
publishStatus: 0,
signUpStartTime: '',
signUpEndTime: '',
playStartTime: '',
playEndTime: '',
description: '',
},
signupTime: '',
playTime: '',
sponsorList: [""],
undertakerList: [""],
fileList: [],
pickerOptions: {
disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000;
}
},
provinceList: this.$store.state.provinceList,
rangeVisible: false,
range: [],
ranges: [],
rangeName: '',
//
props: {
multiple: true,
checkStrictly: true,
lazy: true,
lazyLoad (node, resolve) {
const { level, value } = node
//
console.log('lazy', node)
if (!level) {
that.$get(that.api.queryProvince).then(({ list }) => {
const data = []
list.map(e => {
data.push({
value: e.provinceId,
label: e.provinceName
})
})
resolve(data)
}).catch(res => {})
} else if (level === 1) {
//
that.$get(that.api.queryCity, {
provinceId: value
}).then(({ list }) => {
const data = []
list.map(e => {
data.push({
provinceId: value,
value: e.cityId,
label: e.cityName
})
})
resolve(data)
}).catch(res => {})
} else if (level === 2) {
//
that.$get(that.api.getSchoolsByProvince, {
provinceId: node.data.provinceId,
cityId: value,
schoolName: ''
}).then(({ list }) => {
const data = []
list.map(e => {
data.push({
value: e.schoolId,
label: e.schoolName,
leaf: true
})
})
resolve(data)
}).catch(res => {})
} else {
resolve([])
}
}
},
submiting: false,
updateTime: 0
};
},
components: {
quill
},
computed: {
wait() {
return this.$store.state.match.wait
}
},
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$store.commit('match/setWait', 0)
},
deep:true
handler(){
this.updateTime++
},
deep:true
},
'form.signupTime': function(val) {
if (val) {
this.signUpStartTime = val[0];
this.signUpEndTime = val[1];
} else {
this.signUpStartTime = "";
this.signUpEndTime = "";
}
signupTime: function(val) {
const { form } = this
if (val) {
form.signUpStartTime = val[0];
form.signUpEndTime = val[1];
} else {
form.signUpStartTime = ''
form.signUpEndTime = ''
}
},
'form.playTime': function(val) {
if (val) {
this.playStartTime = val[0];
this.playEndTime = val[1];
} else {
this.playStartTime = "";
this.playEndTime = "";
}
playTime: function(val) {
const { form } = this
if (val) {
form.playStartTime = val[0]
form.playEndTime = val[1]
} else {
form.playStartTime = ''
form.playEndTime = ''
}
}
},
mounted() {
this.getData();
this.commitId();
EventBus.$on("tabClickWait0", () => this.waitSave());
this.getData()
},
methods: {
...mapActions("match", [
"setMatchId"
]),
waitSave() {
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.save(1, false)
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex)
}).catch(() => {
this.$message({
type: 'success',
message: '已取消保存'
});
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex)
});
getData() {
this.$post(`${this.api.getContest}?contestId=${this.form.id}`).then(({ contest }) => {
this.signupTime = [contest.signUpStartTime, contest.signUpEndTime]
this.playTime = [contest.playStartTime, contest.playEndTime]
this.sponsorList = contest.sponsor.split(",")
this.undertakerList = contest.undertaker.split(",")
//
const fileList = contest.contestAnnexList
if (fileList) {
const files = []
fileList.map(e => {
files.push({
name: e.fileName,
url: e.filePath
})
})
this.fileList = files
} else {
contest.contestAnnexList = []
}
},
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 (!sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().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 (!form.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!form.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = {
id: this.id,
coverUrl: form.coverUrl,
carouselUrl: form.carouselUrl,
description: form.description,
founderId: 1,
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("修改成功")
back && this.$router.back()
}).catch(err => {
});
} else {
this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功")
back && this.$router.back()
}).catch(err => {
});
}
},
getData() {
this.$get(this.api.getContest + "/" + this.id).then(res => {
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);
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
uploadSuccess(res, file, fileList) {
if (this.coverUrl) {
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.form.coverUrl = res.data.filesResult.fileUrl;
},
uploadLgSuccess(res, file, fileList) {
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.form.carouselUrl = res.data.filesResult.fileUrl;
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = "";
}).catch(res => {
});
},
handleLgRemove(file, fileList) {
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.carouselUrl = "";
}).catch(res => {
});
},
uploadSure() {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
}).then(() => {
this.$router.push("/match");
}).catch(() => {
});
},
addSponsor() {
this.form.sponsorList.push("");
},
delSponsor(index) {
this.form.sponsorList.splice(index, 1);
},
addOrganizer() {
this.form.undertakerList.push("");
},
delOrganizer(index) {
this.form.undertakerList.splice(index, 1);
//
const ranges = contest.contestRangeList
if (ranges) {
const range = []
ranges.map(e => {
const item = [+e.provinceId]
e.cityId && item.push(+e.cityId)
e.schoolId && item.push(+e.schoolId)
range.push(item)
})
this.range = range
}
// name
const rangeName = contest.contestRangeRespList
if (rangeName) {
const range = []
rangeName.map(e => {
range.push(e.type ? (e.provinceName || e.cityName) : e.schoolName)
})
this.rangeName = range.join(',')
}
this.form = contest
// name
this.$nextTick(() => {
this.updateTime = 1
// const checked = this.$refs.range.getCheckedNodes()
// console.log(444, contest, checked)
// const name = []
// checked.map(e => {
// name.push(e.label)
// })
// this.rangeName = name.join('')
})
}).catch(err => {})
},
//
showRange() {
this.rangeVisible = true
console.log(33, this.form.contestRangeList)
},
//
rangeSubmit() {
// id
const data = []
this.range.map(e => {
data.push({
contestId: this.form.id || '',
provinceId: e[0] || '',
cityId: e[1] || '',
schoolId: e[2] || '',
type: e.length > 2 ? 0 : 1
})
})
this.form.contestRangeList = data
// name
const checked = this.$refs.range.getCheckedNodes()
const name = []
checked.map(e => {
name.push(e.label)
})
this.rangeName = name.join('、')
this.rangeVisible = false
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
handleExceedAnnex(files, fileList) {
util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`);
},
uploadSuccess(res) {
const { coverUrl } = this.form
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {})
this.form.coverUrl = res.data.filesResult.fileUrl
},
uploadLgSuccess(res) {
const { carouselUrl } = this.form
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => {}).catch(res => {})
this.form.carouselUrl = res.data.filesResult.fileUrl
},
//
uploadAnnexSuccess(res) {
const file = res.data.filesResult
const { id } = this.form
const data = {
contestId: id || '',
fileName: this.fileName,
filePath: file.fileUrl
}
this.form.contestAnnexList.push(data)
//
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {})
console.log(44, this.form)
},
//
beforeUpload(file) {
this.fileName = file.name
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.form.coverUrl = ''
}).catch(res => {})
},
handleLgRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => {
this.form.carouselUrl = ''
}).catch(res => {})
},
handleAnnexRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.contestAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {})
},
//
save(status) {
if (this.submiting) return false;
const { form } = this
form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join();
if (form.competitionScope == 2 && !form.contestRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.name) return util.warningMsg("请填写竞赛名称");
if (status == 1) {
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().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 util.warningMsg("报名时间不能早于当前时间");
if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情");
this.submiting = true
form.publishStatus = status
if (this.form.id) {
delete form.contestAnnexList
this.$post(this.api.editContest, form).then(res => {
this.updateTime = 1
this.submiting = false;
util.successMsg("修改成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addContest, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.$router.back();
})
.catch(err => {
this.submiting = false;
});
}
},
//
preview() {
},
back() {
const updateTime = this.updateTime
//
if (updateTime > 1) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(1)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
backPage(){
this.$router.back()
},
addSponsor() {
this.sponsorList.push("");
},
delSponsor(index) {
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.undertakerList.push("");
},
delOrganizer(index) {
this.undertakerList.splice(index, 1);
}
}
};
</script>

@ -81,7 +81,9 @@ export default {
row.operate = true
},
getData() {
this.$get(`${this.api.getContestProgress}/${this.id}`).then(res => {
this.$get(this.api.getContestProgress, {
contestId: this.id
}).then(res => {
this.listData = res.contestProgressList;
for(let index=0; index<this.listData.length; index++) {
//

@ -18,14 +18,14 @@
<el-table-column type="selection" :selectable="row => row.isDisable!=0" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="school" label="学校">
</el-table-column>
<el-table-column prop="username" label="学生姓名">
</el-table-column>
<el-table-column prop="account" label="号">
<el-table-column prop="account" label="号">
</el-table-column>
<el-table-column prop="phone" label="手机号">
</el-table-column>
@ -43,7 +43,7 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</div>
@ -52,6 +52,7 @@
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import axios from 'axios'
export default {
name: "matchSignup",
@ -62,7 +63,7 @@ export default {
keyword: "",
listData: [],
multipleSelection: [],
pageNo: 1,
page: 1,
pageSize: 10,
totals: 0
};
@ -80,13 +81,14 @@ export default {
},
methods: {
getData() {
let data = {
contestId: this.id
};
if (this.keyword) data.name = this.keyword;
this.$get(`${this.api.queryApplicantByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => {
this.listData = res.applicantList;
this.totals = res.total;
this.$post(this.api.queryApplicantByCondition, {
pageNum: this.page,
pageSize: this.pageSize,
contestId: this.id,
keyWord: this.keyword,
}).then(({ data }) => {
this.listData = data.records;
this.totals = data.total;
this.$refs.table.clearSelection();
}).catch(res => {
});
@ -95,11 +97,11 @@ export default {
this.multipleSelection = val;
},
onSearch() {
this.pageNo = 1;
this.page = 1;
this.getData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.page = val;
this.getData();
},
switchOff(val, row, index) {
@ -137,16 +139,20 @@ export default {
location.href = `${this.api.excelExport}?contestId=${this.id}`;
},
exportBatch() {
if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection;
let data = newArr.map(item => {
return item.id;
});
location.href = `${this.api.batchExport}?ids=${data.join(",")}`;
} else {
util.errorMsg("请先选择数据 !");
}
const data = this.multipleSelection
if (data.length) {
data.map((e, i) => e.id = i + 1)
axios.post(this.api.exportDataInBatches, data, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
}).catch(res => {})
} else {
util.errorMsg("请先选择数据 !");
}
}
}
};

@ -0,0 +1,123 @@
<template>
<!-- 报名人员 -->
<div class="page-content" style="padding: 24px">
<div class="tool" style="justify-content: flex-end">
<el-button type="primary" round @click="add">新增</el-button>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="announcementTitle" label="标题名称">
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
</el-table-column>
<el-table-column prop="updateTime" label="发布时间">
</el-table-column>
<el-table-column prop="phone" label="状态">
<template slot-scope="scope">
{{ scope.row.status ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch
v-model="scope.row.isOpen"
:active-text="scope.row.isOpen ? '关' : '开'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
export default {
name: "matchSignup",
data() {
return {
id: this.$route.query.id,
keyword: "",
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted() {
this.getData()
},
methods: {
getData() {
this.$post(`${this.api.queryAnnouncementByContestId}?pageNum=${this.pageNo}&pageSize=${this.pageSize}&contestId=${this.id}`).then(({ data }) => {
this.listData = data.records
this.totals = data.total
this.$refs.table.clearSelection()
}).catch(res => {})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
del(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.deleteAnnouncement}?id=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
switchOff(val, row, index) {
this.$put(`${this.api.disableApplicant}/${row.id}/${val}`)
.then(res => {
})
.catch(err => {
});
},
add() {
this.$router.push(`/match/noticeDetail?contestId=${this.id}`)
},
edit(row) {
this.$router.push(`/match/noticeDetail?id=${row.id}&contestId=${this.id}`)
}
}
};
</script>
<style scoped>
</style>

@ -0,0 +1,304 @@
<template>
<!-- 大赛详情 -->
<div>
<el-card shadow="hover" style="margin-bottom: 20px">
<div class="flex-between">
<el-page-header @back="back" :content="(form.id ? '编辑' : '创建') + '公告'"></el-page-header>
</div>
</el-card>
<div class="page">
<div class="page-content">
<el-form label-width="170px" label-suffix=":" size="small">
<el-form-item label="公告标题">
<div class="d-inline-block">
<el-input placeholder="请输入公告名称" v-model="form.announcementTitle" clearable></el-input>
</div>
</el-form-item>
<el-form-item label="正文">
<quill :border="true" v-model="form.announcementText" :height="400" />
</el-form-item>
<el-form-item label="附件">
<el-upload
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:before-remove="beforeRemove"
:limit="5"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
:file-list="fileList"
name="file"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button v-if="!form.id" @click="save(0)">草稿</el-button>
<el-button type="primary" @click="save(1)">发布</el-button>
<el-button @click="back">取消</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import quill from "@/components/quill";
import util from "@/libs/util";
import Setting from "@/setting";
export default {
name: "matchDetail",
data() {
return {
headers: {
token: util.local.get(Setting.tokenKey)
},
form: {
id: this.$route.query.id,
contestId: this.$route.query.contestId,
announcementText: '',
announcementTitle: '',
announcementAnnexList: []
},
updateTime: 0,
fileName: '',
fileList: [],
};
},
components: {
quill
},
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$store.commit('match/setWait', 0)
},
deep:true
},
},
mounted() {
this.form.id && this.getData()
},
methods: {
getData() {
this.$post(`${this.api.queryAnnouncementDetails}?id=${this.form.id}`).then(({ data }) => {
this.form = data
//
const fileList = data.announcementAnnexList
if (fileList) {
const files = []
fileList.map(e => {
files.push({
name: e.fileName,
url: e.filePath
})
})
this.fileList = files
} else {
data.announcementAnnexList = []
}
}).catch(err => {})
},
//
save(status) {
const form = this.form
if (!form.announcementTitle) return util.warningMsg('请填写公告标题')
if (!form.announcementText) return util.warningMsg('请填写正文')
form.status = status
if (form.id) {
delete form.announcementAnnexList
this.$post(this.api.amendmentAnnouncement, form).then(res => {
util.successMsg("修改成功")
this.$router.back()
}).catch(err => {})
} else {
this.$post(this.api.addAnnouncement, form).then(res => {
util.successMsg("创建成功")
this.$router.back()
}).catch(err => {})
}
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
//
uploadSuccess(res) {
const file = res.data.filesResult
const { id } = this.form
const data = {
announcementId: id || '',
fileName: this.fileName,
filePath: file.fileUrl || file.fileId
}
this.form.announcementAnnexList.push(data)
//
id && this.$post(this.api.saveAnnouncementAnnex, data).then(res => {}).catch(res => {})
console.log(44, this.form)
},
//
beforeUpload(file) {
this.fileName = file.name
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.deleteAnnouncementAnnex}?id=${id}`).then(res => {}).catch(res => {})
},
back() {
this.$router.back()
}
}
};
</script>
<style scoped lang="scss">
$upload-width: 220px;
$upload-height: 140px;
$upload-lg-height: 150px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #cb221c;
}
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
/deep/ .d-inline-block {
width: 216px;
.el-select, .el-input {
width: 100%;
}
}
.inline-input {
.input-wrap {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
display: inline-block;
width: 216px;
margin-right: 8px;
}
.remove {
width: 16px;
height: 16px;
background: url("../../../assets/img/close.png") 0 0/cover no-repeat;
cursor: pointer;
}
}
.add-btn {
margin-left: 32px;
}
}
.add-btn {
display: flex;
justify-content: center;
align-items: center;
width: 216px;
line-height: 32px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
background-color: transparent;
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
cursor: pointer;
i {
margin-right: 8px;
font-size: 14px;
font-weight: bold;
}
}
</style>

@ -234,6 +234,24 @@ function getPermission() {
meta: { title: "实验台" }
})
}
const assessment = permissionRouters.findIndex(e => e.name === 'assessment')
if (assessment !== -1) {
permissionRouters[assessment].children.push({
name: `assessment-add`,
path: `/assessment/add`,
component: () => import("@/pages/assessment/add"),
meta: { title: "创建考核" }
})
}
const notice = permissionRouters.findIndex(e => e.name === 'match')
if (notice !== -1) {
permissionRouters[notice].children.push({
name: `noticeDetail`,
path: `/match/noticeDetail`,
component: () => import("@/pages/match/manage/noticeDetail"),
meta: { title: "通知公告" }
})
}
// 把处理完成的路由,add到router里
// 记录一下路由的名称,用于nav
let nav = data.map(e => e.path);

@ -7,7 +7,7 @@ const isHh = url.includes("10.196.131.73"); //是否河海版本
const isCH = url.includes("124.71.12.62"); //是否巢湖版本
const isBeta = url.includes("120.78.198.231"); //是否职站测试
const isPro = url.includes("occupationlab.com"); //是否职站生产
const isTest = url.includes('39.108.250.202'); //是否中台测试服
const isTest = url.includes('121.37.12.51'); //是否中台测试服
let bankPath = `${location.origin}/banksystem` // 银行系统地址
let jumpPath = `${location.origin}/judgmentPoint`
@ -32,8 +32,8 @@ if (isHh) {
} else if (isDev) {
jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093`
host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
// host = "http://121.37.12.51:9000/"; // 中台测试服
host = "http://192.168.31.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓
}
@ -92,7 +92,7 @@ const Setting = {
dynamicRoute: true,
// 文件上传
upload: {
apiURL: "http://39.108.250.202:9000/",
apiURL: "http://121.37.12.51:9000/",
maxSize: 30
}
};

@ -99,7 +99,7 @@ export default {
if (state.fromClient) {
util.cookies.remove('serverLogin')
location.href = Setting.isDev
? `http://192.168.31.125:8082/#/`
? `http://${location.hostname}:8082/#/`
: Setting.isTest
? `${location.origin}/student/#/login`
: `${location.origin}/#/login`

Loading…
Cancel
Save