赛事联调

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. 492
      src/pages/match/add/index.vue
  5. 124
      src/pages/match/list/index.vue
  6. 73
      src/pages/match/manage/index.vue
  7. 506
      src/pages/match/manage/matchDetail.vue
  8. 4
      src/pages/match/manage/matchProgress.vue
  9. 46
      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"; import Setting from "@/setting";
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL; const uploadURL = Setting.upload.apiURL;
const host1 = "http://39.108.250.202:8080/" const host1 = "http://121.37.12.51:8080/"
export default { export default {
queryToken: `liuwanr/userInfo/queryToken`, queryToken: `liuwanr/userInfo/queryToken`,
@ -42,7 +42,7 @@ export default {
saveOrg: `occupationlab/architecture/save`, // 新增组织架构 saveOrg: `occupationlab/architecture/save`, // 新增组织架构
updateOrg: `occupationlab/architecture/update`, // 编辑组织架构 updateOrg: `occupationlab/architecture/update`, // 编辑组织架构
deleteOrg: `occupationlab/architecture/delete`, // 删除组织架构 deleteOrg: `occupationlab/architecture/delete`, // 删除组织架构
studentTemplate: `http://39.108.250.202/template/学生导入模板.xlsx`, // 学生导入模板 studentTemplate: `http://121.37.12.51/template/学生导入模板.xlsx`, // 学生导入模板
// 测评管理 // 测评管理
questionsList: `occupationlab/questions/list`, // 题库列表查询 questionsList: `occupationlab/questions/list`, // 题库列表查询
@ -51,7 +51,7 @@ export default {
questionsDetail: `occupationlab/questions/detail`, // 查看当前题库信息 questionsDetail: `occupationlab/questions/detail`, // 查看当前题库信息
questionsDelete: `occupationlab/questions/delete`, // 根据主键删除 questionsDelete: `occupationlab/questions/delete`, // 根据主键删除
questionsIsDisable: `occupationlab/questions/isDisable`, // 是否禁用试题 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`, // 批量导入题库 questionsImport: `${host}occupationlab/questions/importQuestion`, // 批量导入题库
questionsExportFailure: `${host}occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出 questionsExportFailure: `${host}occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出
questionsInfo: `occupationlab/questions/info`, // 测评规则信息的展示 questionsInfo: `occupationlab/questions/info`, // 测评规则信息的展示
@ -103,13 +103,18 @@ export default {
updateProjectJudgment: `occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新 updateProjectJudgment: `occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除 deleteProjectJudgment: `occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
// 赛事管理
// 赛事
contestPageConditionQueryByOccupationlab: `occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlab`,
addContest: `occupationlab/enterprise/match/contest/addContest`, addContest: `occupationlab/enterprise/match/contest/addContest`,
deleteContest: `occupationlab/enterprise/match/contest/deleteContest`,
editContest: `occupationlab/enterprise/match/contest/editContest`, editContest: `occupationlab/enterprise/match/contest/editContest`,
publishContest: `occupationlab/enterprise/match/contest/publishContest`, deleteContest: `occupationlab/enterprise/match/contest/deleteContest`,
getContest: `occupationlab/enterprise/match/contest/getContest`, 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`, addContestProgress: `occupationlab/enterprise/match/contest-progress/addContestProgress`,
deleteContestProgress: `occupationlab/enterprise/match/contest-progress/deleteContestProgress`, deleteContestProgress: `occupationlab/enterprise/match/contest-progress/deleteContestProgress`,
@ -118,10 +123,18 @@ export default {
// 报名人员 // 报名人员
addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`, addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`,
disableContests: `occupationlab/enterprise/match/applicant/disableContests`, 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`, queryApplicantByCondition: `occupationlab/enterprise/match/applicant/queryApplicantByCondition`,
disableApplicant: `occupationlab/enterprise/match/applicant/disableApplicant`, 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`, addColumn: `occupationlab/enterprise/information/column/addColumn`,
@ -204,7 +217,7 @@ export default {
modifyStaff: `occupationlab/staff/modifyStaff`, //编辑员工 modifyStaff: `occupationlab/staff/modifyStaff`, //编辑员工
delStaff: `occupationlab/staff/delStaff`, //删除员工 delStaff: `occupationlab/staff/delStaff`, //删除员工
staffList: `occupationlab/staff/staffList`, //员工列表 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`, //批量导入员工失败数据导出 exportFailureStaff: `${host}occupationlab/staff/exportFailure`, //批量导入员工失败数据导出
importStaff: `${host}occupationlab/staff/importStaff`, //批量导入员工 importStaff: `${host}occupationlab/staff/importStaff`, //批量导入员工
// 角色管理 // 角色管理

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

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

@ -2,7 +2,7 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" :content="'创建赛事'"></el-page-header> <el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
@ -21,7 +21,7 @@
:headers="headers" :headers="headers"
name="file" 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> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
@ -44,7 +44,7 @@
:headers="headers" :headers="headers"
name="file" 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> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
@ -54,9 +54,22 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </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="竞赛名称"> <el-form-item label="竞赛名称">
<div class="d-inline-block"> <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> </div>
</el-form-item> </el-form-item>
<el-form-item label="主办方"> <el-form-item label="主办方">
@ -98,227 +111,372 @@
:picker-options="pickerOptions"></el-date-picker> :picker-options="pickerOptions"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="竞赛详情"> <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-form-item> <el-form-item>
<el-button v-throttle @click="save(1)">保存</el-button> <el-button @click="save(0)">保存</el-button>
<el-button type="primary" v-throttle @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-item>
</el-form> </el-form>
</el-card> </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> </div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Setting from "@/setting";
export default { export default {
name: "add", name: "add",
data() { data() {
const that = this
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
id: "", fileName: '',
coverUrl: "", form: {
carouselUrl: "", id: '',
platformSource: 1, // (0:1)
ztOpen: 0, // (0 1 0)
name: '',
sponsor: '',
undertaker: '',
competitionScope: 0, // (0: 1: 2:)
contestRangeList: [], //
contestAnnexList: [], //
coverUrl: '',
carouselUrl: '',
publishStatus: 0, publishStatus: 0,
userId: this.$store.state.userLoginId, signUpStartTime: '',
username: this.$store.state.name, signUpEndTime: '',
uploadList: [], playStartTime: '',
uploadDataList: [], playEndTime: '',
coverVisible: false, description: '',
coverImageUrl: "", },
name: "", signupTime: '',
sponsor: "", playTime: '',
sponsorList: [""], sponsorList: [""],
undertaker: "",
undertakerList: [""], undertakerList: [""],
signUpStartTime: "",
signUpEndTime: "",
signupTime: "",
playTime: "",
playStartTime: "",
playEndTime: "",
description: "",
pickerOptions: { pickerOptions: {
disabledDate: time => { disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000; 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: { components: {
quill quill
}, },
watch: { watch: {
// ,
form: {
handler(){
this.updateTime++
},
deep:true
},
signupTime: function(val) { signupTime: function(val) {
const { form } = this
if (val) { if (val) {
this.signUpStartTime = val[0]; form.signUpStartTime = val[0];
this.signUpEndTime = val[1]; form.signUpEndTime = val[1];
} else { } else {
this.signUpStartTime = ""; form.signUpStartTime = ''
this.signUpEndTime = ""; form.signUpEndTime = ''
} }
}, },
playTime: function(val) { playTime: function(val) {
const { form } = this
if (val) { if (val) {
this.playStartTime = val[0]; form.playStartTime = val[0]
this.playEndTime = val[1]; form.playEndTime = val[1]
} else { } else {
this.playStartTime = ""; form.playStartTime = ''
this.playEndTime = ""; form.playEndTime = ''
} }
} }
}, },
mounted() { mounted() {
this.id = this.$route.query.id;
this.isDetail = Boolean(this.$route.query.show);
this.id && this.getData();
}, },
methods: { methods: {
// //
goBack() { showRange() {
this.$router.back(); this.rangeVisible = true
}, },
save(status) { //
if (this.submiting) return false; rangeSubmit() {
this.sponsor = this.sponsorList.filter(d => d).join(); // id
this.undertaker = this.undertakerList.filter(d => d).join(); const data = []
if (!this.name) return util.warningMsg("请填写竞赛名称"); this.range.map(e => {
if (status == 0) { data.push({
if (!this.sponsor) return util.warningMsg("请填写主办方"); provinceId: e[0] || '',
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间"); cityId: e[1] || '',
} schoolId: e[2] || '',
let now = new Date().getTime(); type: e.length > 2 ? 0 : 1
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("请填写竞赛详情");
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;
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.form.contestRangeList = data
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.signupTime = [info.signUpStartTime, info.signUpEndTime]; // name
this.playTime = [info.playStartTime, info.playEndTime]; const checked = this.$refs.range.getCheckedNodes()
} else { const name = []
util.errorMsg("查询失败"); checked.map(e => {
} name.push(e.label)
}) })
.catch(err => { this.rangeName = name.join('、')
}); this.rangeVisible = false
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { handleExceedAnnex(files, fileList) {
if (this.coverUrl) { util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`);
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) { uploadSuccess(res) {
if (this.carouselUrl) { const { coverUrl } = this.form
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {})
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.coverUrl = res.data.filesResult.fileUrl
}).catch(res => { },
}); uploadLgSuccess(res) {
} const { carouselUrl } = this.form
this.carouselUrl = res.data.filesResult.fileUrl; 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) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); })
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.coverUrl = ''
this.coverUrl = ""; }).catch(res => {})
}).catch(res => {
});
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => {
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.carouselUrl = ''
this.carouselUrl = ""; }).catch(res => {})
}).catch(res => { },
}); handleAnnexRemove(file, fileList) {
debugger
this.$del(`${this.api.fileDeletion}?keys=${this.coverUrl}`).then(res => {
this.carouselUrl = ''
}).catch(res => {})
}, },
uploadSure() { //
this.BatchUpload = false; preview() {
this.pageNo = 1; this.previewVisible = true
this.keyword = "";
this.getData();
}, },
goback() { //
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { previewFile(item) {
type: "warning" 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.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();
}) })
.then(() => { .catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addContest, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.$router.back(); this.$router.back();
}) })
.catch(() => { .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() { addSponsor() {
this.sponsorList.push(""); this.sponsorList.push("");
@ -468,4 +626,42 @@ $upload-lg-height: 150px;
font-weight: bold; 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> </style>

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

@ -3,17 +3,19 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" :content="'赛事管理'"></el-page-header> <el-page-header @back="back" :content="'赛事管理'"></el-page-header>
</div> </div>
</el-card> </el-card>
<div class="page" style="margin-bottom: 24px"> <div class="page" style="margin-bottom: 24px">
<div class="tabs"> <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> </div>
<!-- 大赛详情 --> <!-- 大赛详情 -->
<MatchDetail v-if="active == 'first'" /> <MatchDetail v-if="active == 'first'" ref="detail" />
<!-- 竞赛进展 --> <!-- 竞赛进展 -->
<MatchProgress v-else-if="active == 'second'" /> <MatchProgress v-else-if="active == 'second'" />
<!-- 公告通知 -->
<notice v-else-if="active == 'third'" />
<!-- 报名人员 --> <!-- 报名人员 -->
<MatchSignup v-else /> <MatchSignup v-else />
</div> </div>
@ -24,55 +26,66 @@
<script> <script>
import MatchDetail from "./matchDetail"; import MatchDetail from "./matchDetail";
import MatchProgress from "./matchProgress"; import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup"; import MatchSignup from "./matchSignup";
import EventBus from "@/libs/bus.js";
export default { export default {
name: "matchManage", name: "matchManage",
data() { data() {
return { return {
active: "first", active: this.$route.query.tab || "first",
tabs: { tabs: {
first: "大赛详情", first: "大赛详情",
second: "竞赛进展", second: "竞赛进展",
third: "报名人员" third: "公告通知",
fourth: "报名人员"
} }
}; };
}, },
components: { components: {
MatchDetail, MatchDetail,
MatchProgress, MatchProgress,
notice,
MatchSignup MatchSignup
}, },
created() {
EventBus.$on("tabChangeWait", (waitIndex) => {
this.tabChange(waitIndex)
});
},
beforeDestroy() {
// EventBus
EventBus.$off()
},
methods: { methods: {
goBack() { back() {
this.$router.back(); this.handleSave(0) && this.$router.back()
}, },
tabChange(index) { // confirm
this.$store.commit("match/setWaitIndex", index); handleSave(i) {
if(!(this.wait === 1 || this.wait === 0)) { //
this.active = index; 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 { } else {
EventBus.$emit(`tabClickWait${this.wait}`, ); this.backOrTab(i)
this.$store.commit("match/setWait", 999);
} }
}, return false
tabChangeWait(index) { } else {
this.tabChange(index) return true
} }
}, },
computed: { backPage(){
wait() { this.$router.back()
return this.$store.state.match.wait },
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> </div>
</el-upload> </el-upload>
</el-form-item> </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="竞赛名称"> <el-form-item label="竞赛名称">
<div class="d-inline-block"> <div class="d-inline-block">
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> <el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input>
@ -58,9 +71,9 @@
</el-form-item> </el-form-item>
<el-form-item label="主办方"> <el-form-item label="主办方">
<div class="inline-input"> <div class="inline-input">
<div class="input-wrap" v-for="(item,index) in form.sponsorList" :key="index"> <div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="form.sponsorList[index]"></el-input> <el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="form.sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i> <i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addSponsor"> <button v-if="index == 0" class="add-btn" @click="addSponsor">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
@ -70,266 +83,441 @@
</el-form-item> </el-form-item>
<el-form-item label="承办方(选填)"> <el-form-item label="承办方(选填)">
<div class="inline-input"> <div class="inline-input">
<div class="input-wrap" v-for="(item,index) in form.undertakerList" :key="index"> <div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="form.undertakerList[index]"></el-input> <el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="form.undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i> <i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addOrganizer"> <button v-if="index == 0" class="add-btn" @click="addOrganizer">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
</div> </div>
</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> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
</el-form-item> </el-form-item>
<el-form-item label="报名时间"> <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>
<el-form-item label="竞赛时间"> <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>
<el-form-item label="竞赛详情"> <el-form-item label="竞赛详情">
<quill :border="true" v-model="form.description" :height="400" /> <quill :border="true" v-model="form.description" :height="400" />
</el-form-item> </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-form-item>
<el-button v-throttle @click="save(1)">保存</el-button> <el-button type="primary" @click="save(1)">发布</el-button>
<el-button type="primary" v-if="form.publishStatus == 1" v-throttle @click="save(0)">发布</el-button> <el-button @click="$router.back()">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </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> </div>
</template> </template>
<script> <script>
import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
import quill from "@/components/quill";
import Setting from "@/setting"; import Setting from "@/setting";
import { mapActions } from "vuex";
import EventBus from "@/libs/bus.js";
export default { export default {
name: "matchDetail", name: "add",
data() { data() {
const that = this
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
id: this.$route.query.id,
form: { form: {
coverUrl: '', id: this.$route.query.id,
carouselUrl: '', platformSource: 1, // (0:1)
publishStatus: 0, ztOpen: 0, // (0 1 0)
uploadList: [],
uploadDataList: [],
name: '', name: '',
sponsor: '', sponsor: '',
sponsorList: [''],
undertaker: '', undertaker: '',
undertakerList: [], competitionScope: 0, // (0: 1: 2:)
contestRangeList: [], //
contestAnnexList: [], //
fileName: '',
coverUrl: '',
carouselUrl: '',
publishStatus: 0,
signUpStartTime: '', signUpStartTime: '',
signUpEndTime: '', signUpEndTime: '',
signupTime: '',
playTime: '',
playStartTime: '', playStartTime: '',
playEndTime: '', playEndTime: '',
description: '' 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 updateTime: 0
}; };
}, },
components: { components: {
quill quill
}, },
computed: {
wait() {
return this.$store.state.match.wait
}
},
watch: { watch: {
// , // ,
form: { form: {
handler(){ handler(){
this.updateTime++ this.updateTime++
if(this.updateTime > 1) this.$store.commit('match/setWait', 0)
}, },
deep:true deep:true
}, },
'form.signupTime': function(val) { signupTime: function(val) {
const { form } = this
if (val) { if (val) {
this.signUpStartTime = val[0]; form.signUpStartTime = val[0];
this.signUpEndTime = val[1]; form.signUpEndTime = val[1];
} else { } else {
this.signUpStartTime = ""; form.signUpStartTime = ''
this.signUpEndTime = ""; form.signUpEndTime = ''
} }
}, },
'form.playTime': function(val) { playTime: function(val) {
const { form } = this
if (val) { if (val) {
this.playStartTime = val[0]; form.playStartTime = val[0]
this.playEndTime = val[1]; form.playEndTime = val[1]
} else { } else {
this.playStartTime = ""; form.playStartTime = ''
this.playEndTime = ""; form.playEndTime = ''
} }
} }
}, },
mounted() { mounted() {
this.getData(); this.getData()
this.commitId();
EventBus.$on("tabClickWait0", () => this.waitSave());
}, },
methods: { methods: {
...mapActions("match", [ getData() {
"setMatchId" this.$post(`${this.api.getContest}?contestId=${this.form.id}`).then(({ contest }) => {
]), this.signupTime = [contest.signUpStartTime, contest.signUpEndTime]
waitSave() { this.playTime = [contest.playStartTime, contest.playEndTime]
this.$confirm('暂未保存,是否保存本次编辑?', '提示', { this.sponsorList = contest.sponsor.split(",")
confirmButtonText: '确定', this.undertakerList = contest.undertaker.split(",")
cancelButtonText: '取消', //
type: 'warning' const fileList = contest.contestAnnexList
}).then(() => { if (fileList) {
this.save(1, false) const files = []
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex) fileList.map(e => {
}).catch(() => { files.push({
this.$message({ name: e.fileName,
type: 'success', url: e.filePath
message: '已取消保存' })
}); })
EventBus.$emit('tabChangeWait', this.$store.state.match.waitIndex) this.fileList = files
});
},
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 { } else {
this.$post(this.api.addContest, data).then(res => { contest.contestAnnexList = []
util.successMsg("创建成功")
back && this.$router.back()
}).catch(err => {
});
} }
},
getData() { //
this.$get(this.api.getContest + "/" + this.id).then(res => { const ranges = contest.contestRangeList
const data = res.contest if (ranges) {
data.signupTime = [data.signUpStartTime, data.signUpEndTime] const range = []
data.playTime = [data.playStartTime, data.playEndTime] ranges.map(e => {
data.sponsorList = data.sponsor.split(",") const item = [+e.provinceId]
data.undertakerList = data.undertaker.split(",") e.cityId && item.push(+e.cityId)
this.form = data 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 => {}) }).catch(err => {})
}, },
commitId() { //
this.setMatchId(this.id); 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) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { handleExceedAnnex(files, fileList) {
if (this.coverUrl) { util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`);
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) { uploadSuccess(res) {
if (this.form.carouselUrl) { const { coverUrl } = this.form
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {})
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.coverUrl = res.data.filesResult.fileUrl
}).catch(res => { },
}); uploadLgSuccess(res) {
} const { carouselUrl } = this.form
this.form.carouselUrl = res.data.filesResult.fileUrl; 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) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); })
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.coverUrl = ''
this.form.coverUrl = ""; }).catch(res => {})
}).catch(res => {
});
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => {
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.form.carouselUrl = ''
this.form.carouselUrl = ""; }).catch(res => {})
}).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;
}); });
}
}, },
uploadSure() { //
this.BatchUpload = false; preview() {
this.pageNo = 1;
this.keyword = "";
this.getData();
}, },
goback() { back() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { const updateTime = this.updateTime
type: "warning" //
if (updateTime > 1) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => { }).then(() => {
this.$router.push("/match"); this.save(1)
}).catch(() => { }).catch(() => {
}); this.backPage()
})
} else {
this.backPage()
}
},
backPage(){
this.$router.back()
}, },
addSponsor() { addSponsor() {
this.form.sponsorList.push(""); this.sponsorList.push("");
}, },
delSponsor(index) { delSponsor(index) {
this.form.sponsorList.splice(index, 1); this.sponsorList.splice(index, 1);
}, },
addOrganizer() { addOrganizer() {
this.form.undertakerList.push(""); this.undertakerList.push("");
}, },
delOrganizer(index) { delOrganizer(index) {
this.form.undertakerList.splice(index, 1); this.undertakerList.splice(index, 1);
} }
} }
}; };

@ -81,7 +81,9 @@ export default {
row.operate = true row.operate = true
}, },
getData() { getData() {
this.$get(`${this.api.getContestProgress}/${this.id}`).then(res => { this.$get(this.api.getContestProgress, {
contestId: this.id
}).then(res => {
this.listData = res.contestProgressList; this.listData = res.contestProgressList;
for(let index=0; index<this.listData.length; index++) { 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="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"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="school" label="学校"> <el-table-column prop="school" label="学校">
</el-table-column> </el-table-column>
<el-table-column prop="username" label="学生姓名"> <el-table-column prop="username" label="学生姓名">
</el-table-column> </el-table-column>
<el-table-column prop="account" label="号"> <el-table-column prop="account" label="号">
</el-table-column> </el-table-column>
<el-table-column prop="phone" label="手机号"> <el-table-column prop="phone" label="手机号">
</el-table-column> </el-table-column>
@ -43,7 +43,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <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> </el-pagination>
</div> </div>
</div> </div>
@ -52,6 +52,7 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting"; import Setting from "@/setting";
import axios from 'axios'
export default { export default {
name: "matchSignup", name: "matchSignup",
@ -62,7 +63,7 @@ export default {
keyword: "", keyword: "",
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0 totals: 0
}; };
@ -80,13 +81,14 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
let data = { this.$post(this.api.queryApplicantByCondition, {
contestId: this.id pageNum: this.page,
}; pageSize: this.pageSize,
if (this.keyword) data.name = this.keyword; contestId: this.id,
this.$get(`${this.api.queryApplicantByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => { keyWord: this.keyword,
this.listData = res.applicantList; }).then(({ data }) => {
this.totals = res.total; this.listData = data.records;
this.totals = data.total;
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
}).catch(res => { }).catch(res => {
}); });
@ -95,11 +97,11 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
onSearch() { onSearch() {
this.pageNo = 1; this.page = 1;
this.getData(); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
switchOff(val, row, index) { switchOff(val, row, index) {
@ -137,16 +139,20 @@ export default {
location.href = `${this.api.excelExport}?contestId=${this.id}`; location.href = `${this.api.excelExport}?contestId=${this.id}`;
}, },
exportBatch() { exportBatch() {
if (this.multipleSelection.length != "") { const data = this.multipleSelection
let newArr = this.multipleSelection; if (data.length) {
let data = newArr.map(item => { data.map((e, i) => e.id = i + 1)
return item.id; axios.post(this.api.exportDataInBatches, data, {
}); headers: {
location.href = `${this.api.batchExport}?ids=${data.join(",")}`; token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
}).catch(res => {})
} else { } else {
util.errorMsg("请先选择数据 !"); 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: "实验台" } 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里 // 把处理完成的路由,add到router里
// 记录一下路由的名称,用于nav // 记录一下路由的名称,用于nav
let nav = data.map(e => e.path); 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 isCH = url.includes("124.71.12.62"); //是否巢湖版本
const isBeta = url.includes("120.78.198.231"); //是否职站测试 const isBeta = url.includes("120.78.198.231"); //是否职站测试
const isPro = url.includes("occupationlab.com"); //是否职站生产 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 bankPath = `${location.origin}/banksystem` // 银行系统地址
let jumpPath = `${location.origin}/judgmentPoint` let jumpPath = `${location.origin}/judgmentPoint`
@ -32,8 +32,8 @@ if (isHh) {
} else if (isDev) { } else if (isDev) {
jumpPath = "http://192.168.31.125:8087/"; jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093` bankPath = `http://192.168.31.125:8093`
host = "http://39.108.250.202:9000/"; // 中台测试服 // host = "http://121.37.12.51:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕 host = "http://192.168.31.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓 // host = 'http://192.168.31.137:9000/'; // 赓
} }
@ -92,7 +92,7 @@ const Setting = {
dynamicRoute: true, dynamicRoute: true,
// 文件上传 // 文件上传
upload: { upload: {
apiURL: "http://39.108.250.202:9000/", apiURL: "http://121.37.12.51:9000/",
maxSize: 30 maxSize: 30
} }
}; };

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

Loading…
Cancel
Save