|
|
@ -60,8 +60,7 @@ |
|
|
|
:label="1">是</el-radio> |
|
|
|
:label="1">是</el-radio> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles"> |
|
|
|
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles"> |
|
|
|
<el-upload accept=".jpg,.png,.jpeg,.gif" |
|
|
|
<el-upload :on-remove="(file, fileList) => handleRemove(file, fileList, item)" |
|
|
|
:on-remove="(file, fileList) => handleRemove(file, fileList, item)" |
|
|
|
|
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="res => uploadSuccess(res, item)" |
|
|
|
:on-success="res => uploadSuccess(res, item)" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:before-remove="beforeRemove" |
|
|
@ -235,11 +234,17 @@ export default { |
|
|
|
fileList: [] |
|
|
|
fileList: [] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 文件路径名称处理 |
|
|
|
if (form.competitionStageContentSetting.fileUrl) { |
|
|
|
if (form.competitionStageContentSetting.fileUrl) { |
|
|
|
form.competitionStageContentSetting.fileList = [{ |
|
|
|
const urls = form.competitionStageContentSetting.fileUrl.split('|') |
|
|
|
name: form.competitionStageContentSetting.fileName, |
|
|
|
const names = form.competitionStageContentSetting.fileName.split('|') |
|
|
|
url: form.competitionStageContentSetting.fileUrl, |
|
|
|
form.competitionStageContentSetting.fileList = [] |
|
|
|
}] |
|
|
|
urls.map((n, i) => { |
|
|
|
|
|
|
|
form.competitionStageContentSetting.fileList.push({ |
|
|
|
|
|
|
|
name: names[i], |
|
|
|
|
|
|
|
url: n |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
form.competitionStageContentSetting.competitionId = this.id |
|
|
|
form.competitionStageContentSetting.competitionId = this.id |
|
|
|
form.competitionStageContentSetting.stageId = e.stageId |
|
|
|
form.competitionStageContentSetting.stageId = e.stageId |
|
|
@ -314,17 +319,15 @@ export default { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove (file, fileList, item) { |
|
|
|
handleRemove (file, fileList, item) { |
|
|
|
item.fileName = '' |
|
|
|
const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url) |
|
|
|
item.fileUrl = '' |
|
|
|
item.competitionStageContentSetting.fileList.splice(i, 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess (res, item) { |
|
|
|
uploadSuccess (res, item) { |
|
|
|
const { originalFileName, fileUrl } = res.filesResult |
|
|
|
const { originalFileName, fileUrl } = res.filesResult |
|
|
|
item.competitionStageContentSetting.fileUrl = fileUrl |
|
|
|
item.competitionStageContentSetting.fileList.push({ |
|
|
|
item.competitionStageContentSetting.fileName = originalFileName |
|
|
|
|
|
|
|
item.competitionStageContentSetting.fileList = [{ |
|
|
|
|
|
|
|
name: originalFileName, |
|
|
|
name: originalFileName, |
|
|
|
url: fileUrl |
|
|
|
url: fileUrl |
|
|
|
}] |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 发布赛事 |
|
|
|
// 发布赛事 |
|
|
@ -378,11 +381,11 @@ export default { |
|
|
|
util.errorMsg('请输入评分规则') |
|
|
|
util.errorMsg('请输入评分规则') |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) { |
|
|
|
// if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) { |
|
|
|
invalid = 1 |
|
|
|
// invalid = 1 |
|
|
|
util.errorMsg('请输入说明') |
|
|
|
// util.errorMsg('请输入说明') |
|
|
|
break |
|
|
|
// break |
|
|
|
} |
|
|
|
// } |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (e.onlineButton && !e.onlineAddress) { |
|
|
|
if (e.onlineButton && !e.onlineAddress) { |
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
@ -407,6 +410,10 @@ export default { |
|
|
|
for (const e of form) { |
|
|
|
for (const e of form) { |
|
|
|
e.offlineButton = e.offlineButton ? 1 : 0 |
|
|
|
e.offlineButton = e.offlineButton ? 1 : 0 |
|
|
|
e.onlineButton = e.onlineButton ? 1 : 0 |
|
|
|
e.onlineButton = e.onlineButton ? 1 : 0 |
|
|
|
|
|
|
|
if (e.competitionStageContentSetting && e.competitionStageContentSetting.fileList && e.competitionStageContentSetting.fileList.length) { |
|
|
|
|
|
|
|
e.competitionStageContentSetting.fileName = e.competitionStageContentSetting.fileList.map(n => n.name).join('|') |
|
|
|
|
|
|
|
e.competitionStageContentSetting.fileUrl = e.competitionStageContentSetting.fileList.map(n => n.url).join('|') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$parent.showLoad() |
|
|
|
this.$parent.showLoad() |
|
|
|
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { |
|
|
|
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { |
|
|
|