yujialong 1 year ago
parent 6ddd42d38e
commit 2cb471ec92
  1. 39
      src/pages/match/add/index.vue
  2. 4
      src/pages/match/add/step1.vue
  3. 10
      src/pages/match/add/step2.vue
  4. 19
      src/pages/match/add/step3.vue
  5. 39
      src/pages/match/manage/index.vue
  6. 12
      src/pages/match/manage/matchRank.vue
  7. 2
      src/pages/match/preview/index.vue

@ -93,12 +93,12 @@
<el-button v-if="step === 2 || step === 3" <el-button v-if="step === 2 || step === 3"
type="primary" type="primary"
@click="prev">上一步</el-button> @click="prev">上一步</el-button>
<el-button v-if="releaseType == 0" <el-button v-if="releaseType == 0 || (releaseType && step === 3)"
type="primary" type="primary"
@click="save(1)">发布</el-button> @click="save(1)">发布</el-button>
<el-button v-else <el-button v-else
type="primary" type="primary"
@click="save(id ? 1 : 0, 2)">保存并下一步</el-button> @click="save(0, 2)">保存并下一步</el-button>
</div> </div>
<el-button type="danger" <el-button type="danger"
@click="preview" @click="preview"
@ -155,20 +155,22 @@ export default {
step4 step4
}, },
// , // ,
beforeRouteLeave (to, from, next) { // beforeRouteLeave (to, from, next) {
const { updateTime } = this.$refs['step' + this.step] // const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { // // debugger
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { // console.log('out', updateTime, this.step)
type: 'warning' // if (this.step < 4 && this.$refs['step' + this.step] && updateTime) {
}).then(() => { // this.$confirm(``, '', {
this.save(this.step, to.path, next) // type: 'warning'
}).catch(() => { // }).then(() => {
next() // this.save(this.step, to.path, next)
}) // }).catch(() => {
} else { // next()
next() // })
} // } else {
}, // next()
// }
// },
mounted () { mounted () {
this.getPer() this.getPer()
}, },
@ -198,9 +200,6 @@ export default {
}, },
// //
save (status, next = 0, cb) { save (status, next = 0, cb) {
console.log('status=>', status)
console.log('cb=>', cb)
console.log('this.step=>', this.step)
this.$refs['step' + this.step].save(status, next, this.releaseType, cb) this.$refs['step' + this.step].save(status, next, this.releaseType, cb)
}, },
// //
@ -234,7 +233,6 @@ export default {
} else if (next === 1) { } else if (next === 1) {
this.step-- this.step--
} else { } else {
console.log(99999999)
if (typeof setupId === 'function') { if (typeof setupId === 'function') {
setupId() setupId()
} else if (typeof type === 'function') { } else if (typeof type === 'function') {
@ -275,7 +273,6 @@ export default {
back () { back () {
// //
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:278 ~ back ~ updateTime:", updateTime)
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { if (this.step < 4 && this.$refs['step' + this.step] && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning' type: 'warning'

@ -710,11 +710,13 @@ export default {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1 if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1
} }
this.$parent.showLoad() this.$parent.showLoad()
form.publishStatus = status delete form.publishStatus
if (status === 1) form.publishStatus = 1
form.ztOpen = status ? 0 : 1 // form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id form.id = this.$route.query.id
this.updateTime = 0
if (form.id) { if (form.id) {
this.$post(this.api.editCompetition, form).then(res => { this.$post(this.api.editCompetition, form).then(res => {
this.updateTime = 0 this.updateTime = 0

@ -153,7 +153,7 @@
style="width: 120px"></el-input> style="width: 120px"></el-input>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
</div> </div>
<div v-if="item.resultAnnouncementTime != 0" <div v-if="item.resultAnnouncementTime !== '' && item.resultAnnouncementTime !== null && item.resultAnnouncementTime !== undefined"
class="line"> class="line">
是否公布成绩详情 是否公布成绩详情
<el-radio v-model="item.resultsDetails" <el-radio v-model="item.resultsDetails"
@ -357,10 +357,10 @@ export default {
const stages = this.form.competitionStageList const stages = this.form.competitionStageList
const { ruleId } = this.form const { ruleId } = this.form
if (stages.length < val) { if (stages.length < val) {
const list = [] const len = stages.length
for (let i = 1; i <= val - stages.length; i++) { for (let i = 1; i <= val - len; i++) {
const form = JSON.parse(JSON.stringify(this.ruleForm)) const form = JSON.parse(JSON.stringify(this.ruleForm))
form.number = stages.length + i form.number = len + i
if (ruleId) form.ruleId = ruleId if (ruleId) form.ruleId = ruleId
this.form.competitionStageList.push(form) this.form.competitionStageList.push(form)
} }
@ -458,6 +458,8 @@ export default {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 if (!e.teamNumLimitOpt) e.teamNumLimit = 0
} }
this.$parent.showLoad() this.$parent.showLoad()
this.updateTime = 0
this.pass = 1
if (form.ruleId) { if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()

@ -69,7 +69,7 @@
: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>
<span style="margin: 0 10px 0 30px;">说明</span> <span style="margin: 0 10px 0 30px;">说明</span>
<el-input maxlength="1000" <el-input maxlength="1000"
@ -151,7 +151,7 @@ export default {
updateTime: 0, updateTime: 0,
step1: this.$parent.$refs.step1.form, step1: this.$parent.$refs.step1.form,
cache: this.$store.state.match.cache, cache: this.$store.state.match.cache,
nums: ['一', '二', '三'], nums: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'],
methods: [ methods: [
{ {
id: 0, id: 0,
@ -343,11 +343,11 @@ export default {
this.$emit('next', next) this.$emit('next', next)
return return
} }
//
if (status) {
let invalid = 0 let invalid = 0
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
for (const e of form) { for (const e of form) {
//
if (status) {
if (!e.time.length) { if (!e.time.length) {
invalid = 1 invalid = 1
util.errorMsg('请选择比赛时间') util.errorMsg('请选择比赛时间')
@ -381,11 +381,6 @@ export default {
util.errorMsg('请输入评分规则') util.errorMsg('请输入评分规则')
break break
} }
// if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
// invalid = 1
// util.errorMsg('')
// break
// }
} else { } else {
if (e.onlineButton && !e.onlineAddress) { if (e.onlineButton && !e.onlineAddress) {
invalid = 1 invalid = 1
@ -404,8 +399,10 @@ export default {
} }
} }
} }
if (invalid) return e.startTime = e.time[0]
e.endTime = e.time[1]
} }
if (invalid) return
// //
for (const e of form) { for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0 e.offlineButton = e.offlineButton ? 1 : 0
@ -419,6 +416,8 @@ export default {
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form competitionContents: form
}).then(res => { }).then(res => {
this.updateTime = 0
this.pass = 1
this.$parent.hideLoad() this.$parent.hideLoad()
// //
status && this.publish(status) status && this.publish(status)

@ -81,25 +81,25 @@ export default {
mounted () { mounted () {
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs()
}, },
beforeRouteLeave (to, from, next) { // beforeRouteLeave (to, from, next) {
const { detail } = this.$refs // const { detail } = this.$refs
if (detail) { // if (detail) {
const step = detail.$refs['step' + detail.step] // const step = detail.$refs['step' + detail.step]
if (detail.step < 4 && step && step.updateTime && !step.pass && !this.pass) { // if (detail.step < 4 && step && step.updateTime && !step.pass && !this.pass) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', { // this.$confirm(``, '.......', {
type: 'warning' // type: 'warning'
}).then(() => { // }).then(() => {
detail.save(1, to.path, next) // detail.save(1, to.path, next)
}).catch(() => { // }).catch(() => {
next() // next()
}) // })
} else { // } else {
next() // next()
} // }
} else { // } else {
next() // next()
} // }
}, // },
methods: { methods: {
initTabs () { initTabs () {
const { btns } = this const { btns } = this
@ -154,7 +154,6 @@ export default {
}, },
// //
backPage () { backPage () {
console.log(444, this.$store.state)
this.pass = 1 this.pass = 1
this.$router.push(`/match?page=${this.$store.state.match.page}`) this.$router.push(`/match?page=${this.$store.state.match.page}`)
}, },

@ -148,8 +148,10 @@
:rowspan="item.rowspan"> :rowspan="item.rowspan">
<p class="score">{{ item.teamScore }}</p> <p class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p> <p>{{ item.teamCalculationMethodName }}</p>
<template v-if="isPointWeight">
<p>权重</p> <p>权重</p>
<p>{{ item.pointWeight }}%</p> <p>{{ item.pointWeight }}%</p>
</template>
</td> </td>
</template> </template>
<template v-if="item.accountId"> <template v-if="item.accountId">
@ -324,7 +326,8 @@ export default {
}, },
uploaded: 0, uploaded: 0,
multipleSelection: [], multipleSelection: [],
loading: false loading: false,
isPointWeight: false
}; };
}, },
mounted () { mounted () {
@ -443,11 +446,12 @@ export default {
data.stageIds = ids.splice(0, this.index + 1) data.stageIds = ids.splice(0, this.index + 1)
// //
// if (this.published) { // if (this.published) {
this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => { this.$post(this.api.totalRankingScoreDetails, data).then(res => {
if (data.length) { this.isPointWeight = res.isPointWeight
if (res.data.length) {
const result = [] const result = []
// //
data.map(e => { res.data.map(e => {
const team = e.stageTeamInformation const team = e.stageTeamInformation
if (team.length) { if (team.length) {
const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod) const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod)

@ -78,7 +78,7 @@
<p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p> <p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p> <p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template> </template>
<p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p> <!-- <p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p> -->
<div v-if="form.rule === 1" <div v-if="form.rule === 1"
class="flex"> class="flex">
<p>晋级规则</p> <p>晋级规则</p>

Loading…
Cancel
Save