项目管理添加备注字段,赛事修复

dev_202303
yujialong 2 years ago
parent a825f18d15
commit db97703c92
  1. 1
      src/utils/api.js
  2. 3
      src/views/course/AddCurriculum.vue
  3. 7
      src/views/match/add/set.vue
  4. 9
      src/views/match/add/step1.vue
  5. 5
      src/views/match/add/step3.vue
  6. 143
      src/views/match/manage/matchRank.vue
  7. 4
      src/views/match/preview/index.vue
  8. 4
      src/views/serve/projectAdd.vue

@ -382,6 +382,7 @@ export default {
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `${host1}competition/competition/rank/totalRankingScoreDetails`,
gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`,

@ -354,7 +354,7 @@
<ul class="systems">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" @change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName">
<el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
<el-checkbox v-model="item.check" :label="item.remark ? item.remark + '(' + item.projectName + ')' : item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
</li>
</ul>
</div>
@ -377,6 +377,7 @@
{{ scope.row.type ? '流程类' : '编程类' }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="55">
<template slot-scope="scope">

@ -211,12 +211,13 @@ export default {
save() {
const { form } = this
if (!form.time.length) return util.warningMsg('请选择比赛时间')
if (this.timeInvalid) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
const { playStartTime, playEndTime } = this.step1
if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId)
form.systemId = systemId
form.projectName = projectName
if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName
form.startTime = form.time[0]
form.endTime = form.time[1]
this.$emit('hideSet', this.form)

@ -138,7 +138,7 @@
</div>
</el-form-item>
<el-form-item class="req" label="竞赛详情">
<quill :border="true" v-model="form.description" :height="400" />
<quill v-if="quillShow" :border="true" v-model="form.description" :height="400" :readonly="!editing && form.id !== ''" />
</el-form-item>
<el-form-item label="附件">
<el-upload
@ -325,12 +325,19 @@ export default {
},
submiting: false,
updateTime: 0,
quillShow: true
};
},
components: {
quill
},
watch: {
editing: function(val) {
this.quillShow = false
this.$nextTick(() => {
this.quillShow = true
})
},
// ,
form: {
handler(){

@ -247,6 +247,11 @@ export default {
util.errorMsg('请输入线下地点')
break
}
if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
}
}
if (invalid) return

@ -73,7 +73,12 @@
<tr v-for="(item, i) in teams" :key="i">
<template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td>
<td :rowspan="item.rowspan">{{ item.teamScore }}</td>
<td class="scores" :rowspan="item.rowspan">
<p class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p>
<p>权重</p>
<p>{{ item.pointWeight }}%</p>
</td>
</template>
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
@ -90,7 +95,7 @@
</tr>
<tr v-if="!active && teams.length">
<td>综合得分</td>
<td>{{ totalScore }}</td>
<td>{{ curRow.score }}</td>
<td colspan="6">总排名{{ curRow.index }}</td>
</tr>
</table>
@ -149,6 +154,20 @@ export default {
method: this.$route.query.method,
competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule,
teamCalculationMethods: [
{
id: 0,
name: '最高分'
},
{
id: 1,
name: '平均分'
},
{
id: 2,
name: '求和'
}
],
headers: {
token: sessionStorage.getItem("token")
},
@ -279,46 +298,82 @@ export default {
}).catch(res => {})
} else {
const ids = this.grades.map(e => e.stageId)
data.stageIds = ids.splice(0, ids.length - 1)
this.$post(this.api.detailsOfTotalTeamScores, data).then(({ data, resultCalculationMethod }) => {
const result = []
let totalScore = 0
//
data.map(e => {
const team = e.stageTeamInformation
if (team.length) {
//
const method = e.teamCalculationMethod
const scores = team.map(n => +n.score)
let score
//
if (method == 0) { //
score = Math.max(scores)
} else if (method == 1) { //
score = scores.reduce((prev, next) => prev + next) / scores.length
} else { //
score = scores.reduce((prev, next) => prev + next)
}
team[0].teamScore = score
team[0].rowspan = team.length
team.map(n => {
n = Object.assign(n, e)
ids.pop()
data.stageIds = ids.splice(0, this.index + 1)
//
// if (this.published) {
this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => {
if (data.length && data[0].stageTeamInformation.length) {
const resultCalculationMethod = data[0].stageTeamInformation[0].resultCalculationMethod
const result = []
let totalScore = 0
//
data.map(e => {
const team = e.stageTeamInformation
if (team.length) {
//
const method = e.teamCalculationMethod
const scores = team.map(n => +n.score)
let score
//
if (method == 0) { //
score = Math.max(scores)
} else if (method == 1) { //
score = scores.reduce((prev, next) => prev + next) / scores.length
} else { //
score = scores.reduce((prev, next) => prev + next)
}
team[0].teamScore = score
const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod)
if (teamCItem) team[0].teamCalculationMethodName = teamCItem.name
team[0].rowspan = team.length
team.map(n => {
n = Object.assign(n, e)
})
console.log("🚀 ~ file: matchRank.vue:334 ~ this.$post ~ resultCalculationMethod", resultCalculationMethod, score)
// 0 */100
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100
result.push(...team)
}
})
// 0 */100
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100
result.push(...team)
//
const teamScores = data.map(e => e.teamScore)
console.log("🚀 ~ file: matchRank.vue:339 ~ this.$post ~ teamScores", teamScores, totalScore)
if (resultCalculationMethod === 1) { //
totalScore = teamScores.reduce((prev, next) => prev + next)
} else if (resultCalculationMethod === 2) { //
totalScore = teamScores.reduce((prev, next) => prev + next) / teamScores.length
}
this.totalScore = totalScore
this.teams = result
}
})
//
const teamScores = data.map(e => e.teamScore)
if (resultCalculationMethod === 1) { //
totalScore = teamScores.reduce((prev, next) => prev + next)
} else if (resultCalculationMethod === 2) { //
totalScore = teamScores.reduce((prev, next) => prev + next) / teamScores.length
}
this.totalScore = totalScore
this.teams = result
}).catch(res => {})
}).catch(res => {})
// } else { //
// this.$post(this.api.totalRankingScoreDetails, data).then(({ page }) => {
// const list = page.records
// page.records.map((e, i) => {
// if (!list.find(n => n.stageId == e.stageId && n.rowspan)) {
// e.rowspan = list.filter(n => n.stageId == e.stageId).length
// this.$post(this.api.stageTeamScoreDetails, {
// pageNum: 1,
// pageSize: 100,
// competitionId: this.id,
// teamId: row.teamId,
// stageId: e.stageId
// }).then(({ page }) => {
// }).catch(res => {})
// }
// })
// let totalScore = 0
// this.totalScore = totalScore
// this.teams = list
// console.log("🚀 ~ file: matchRank.vue:346 ~ this.$post ~ list", list)
// }).catch(res => {})
// }
}
} else {
this.toReport(row)
@ -477,5 +532,13 @@ export default {
text-align: center;
background-color: #f8faff;
}
.scores {
line-height: 1.6;
}
.score {
font-size: 16px;
font-weight: 600;
color: #9076FF;
}
}
</style>

@ -36,7 +36,8 @@
</div>
</template>
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<template v-if="form.releaseType">
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
<p style="font-size: 16px;color: #333;">{{ rule.stageName }}</p>
@ -65,6 +66,7 @@
</div>
</div>
</div>
</template>
<!-- 进展 -->
<div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div>

@ -27,6 +27,9 @@
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName"
placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model.trim="projectManage.remark" placeholder="20个字符以内"></el-input>
</el-form-item>
<el-form-item label="项目权限">
<el-select :disabled="isDetail" v-model="projectManage.permissions"
placeholder="请选择" @change="permissionChange">
@ -236,6 +239,7 @@ export default {
projectManage: {
founder: 0, // (0 1)
projectName: "", //
remark: '',
permissions: 0, // (0 1 2)
systemId: this.$route.query.systemId, // id
hintOpen: 1, // (0 1 1)

Loading…
Cancel
Save