|
|
@ -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" |
|
|
@ -70,14 +69,17 @@ |
|
|
|
:file-list="item.competitionStageContentSetting.fileList" |
|
|
|
:file-list="item.competitionStageContentSetting.fileList" |
|
|
|
name="file"> |
|
|
|
name="file"> |
|
|
|
<el-button size="small" |
|
|
|
<el-button size="small" |
|
|
|
type="primary">上传试卷</el-button> |
|
|
|
type="primary">上传文件</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="display: flex;align-items: flex-start;margin-top: 10px"> |
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
<el-input maxlength="1000" |
|
|
|
<el-input maxlength="1000" |
|
|
|
placeholder="请输入内容" |
|
|
|
placeholder="请输入内容" |
|
|
|
|
|
|
|
type="textarea" |
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" |
|
|
|
<el-form-item class="req" |
|
|
@ -233,11 +235,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 |
|
|
@ -312,17 +320,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 |
|
|
|
}] |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发布赛事 |
|
|
|
// 发布赛事 |
|
|
|
publish () { |
|
|
|
publish () { |
|
|
@ -375,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 |
|
|
@ -404,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'], { |
|
|
|