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

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

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

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

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

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

@ -78,7 +78,7 @@
<p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</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"
class="flex">
<p>晋级规则</p>

Loading…
Cancel
Save