|
|
@ -52,6 +52,9 @@ |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="比赛范围"> |
|
|
|
<el-form-item label="比赛范围"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-radio v-model="form.competitionScope" :label="0" disabled>本校内</el-radio> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio> |
|
|
|
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -109,7 +112,6 @@ |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:before-upload="beforeUpload" |
|
|
|
:before-upload="beforeUpload" |
|
|
|
:on-success="uploadAnnexSuccess" |
|
|
|
:on-success="uploadAnnexSuccess" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
|
|
|
:limit="5" |
|
|
|
:limit="5" |
|
|
|
:on-exceed="handleExceedAnnex" |
|
|
|
:on-exceed="handleExceedAnnex" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:action="this.api.fileupload" |
|
|
@ -201,7 +203,7 @@ export default { |
|
|
|
lazyLoad (node, resolve) { |
|
|
|
lazyLoad (node, resolve) { |
|
|
|
const { level, value } = node |
|
|
|
const { level, value } = node |
|
|
|
// 省份 |
|
|
|
// 省份 |
|
|
|
console.log('lazy', node) |
|
|
|
console.log('lazy', node, that.range) |
|
|
|
if (!level) { |
|
|
|
if (!level) { |
|
|
|
that.$get(that.api.queryProvince).then(({ list }) => { |
|
|
|
that.$get(that.api.queryProvince).then(({ list }) => { |
|
|
|
const data = [] |
|
|
|
const data = [] |
|
|
@ -292,6 +294,7 @@ export default { |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData() { |
|
|
|
this.$post(`${this.api.getContest}?contestId=${this.form.id}`).then(({ contest }) => { |
|
|
|
this.$post(`${this.api.getContest}?contestId=${this.form.id}`).then(({ contest }) => { |
|
|
|
|
|
|
|
this.$parent.name = contest.name |
|
|
|
this.signupTime = [contest.signUpStartTime, contest.signUpEndTime] |
|
|
|
this.signupTime = [contest.signUpStartTime, contest.signUpEndTime] |
|
|
|
this.playTime = [contest.playStartTime, contest.playEndTime] |
|
|
|
this.playTime = [contest.playStartTime, contest.playEndTime] |
|
|
|
this.sponsorList = contest.sponsor.split(",") |
|
|
|
this.sponsorList = contest.sponsor.split(",") |
|
|
@ -322,6 +325,7 @@ export default { |
|
|
|
range.push(item) |
|
|
|
range.push(item) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.range = range |
|
|
|
this.range = range |
|
|
|
|
|
|
|
console.log("🚀 ~ file: matchDetail.vue ~ line 327 ~ this.$post ~ this.range", this.range) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选择范围name |
|
|
|
// 选择范围name |
|
|
@ -329,7 +333,7 @@ export default { |
|
|
|
if (rangeName) { |
|
|
|
if (rangeName) { |
|
|
|
const range = [] |
|
|
|
const range = [] |
|
|
|
rangeName.map(e => { |
|
|
|
rangeName.map(e => { |
|
|
|
range.push(e.type ? (e.provinceName || e.cityName) : e.schoolName) |
|
|
|
range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.rangeName = range.join(',') |
|
|
|
this.rangeName = range.join(',') |
|
|
|
} |
|
|
|
} |
|
|
@ -356,6 +360,7 @@ export default { |
|
|
|
rangeSubmit() { |
|
|
|
rangeSubmit() { |
|
|
|
// 处理提交需要的id |
|
|
|
// 处理提交需要的id |
|
|
|
const data = [] |
|
|
|
const data = [] |
|
|
|
|
|
|
|
console.log(55, this.range) |
|
|
|
this.range.map(e => { |
|
|
|
this.range.map(e => { |
|
|
|
data.push({ |
|
|
|
data.push({ |
|
|
|
contestId: this.form.id || '', |
|
|
|
contestId: this.form.id || '', |
|
|
@ -405,11 +410,17 @@ export default { |
|
|
|
this.form.contestAnnexList.push(data) |
|
|
|
this.form.contestAnnexList.push(data) |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {}) |
|
|
|
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {}) |
|
|
|
console.log(44, this.form) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件上传前 |
|
|
|
// 附件上传前 |
|
|
|
beforeUpload(file) { |
|
|
|
beforeUpload(file) { |
|
|
|
this.fileName = file.name |
|
|
|
const isLt2M = file.size / 1024 / 1024 < 10 |
|
|
|
|
|
|
|
if (!isLt2M) util.warningMsg('请上传小于10MB的附件!') |
|
|
|
|
|
|
|
if (isLt2M) { |
|
|
|
|
|
|
|
this.fileName = file.name |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
@ -432,6 +443,7 @@ export default { |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleAnnexRemove(file, fileList) { |
|
|
|
handleAnnexRemove(file, fileList) { |
|
|
|
|
|
|
|
console.log("🚀 ~ file: matchDetail.vue ~ line 435 ~ handleAnnexRemove ~ file, fileList", file, fileList) |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {}) |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {}) |
|
|
|
const id = this.form.contestAnnexList.find(e => e.fileName === file.name).id |
|
|
|
const id = this.form.contestAnnexList.find(e => e.fileName === file.name).id |
|
|
|
this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {}) |
|
|
|
this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {}) |
|
|
|