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

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. 71
      src/views/match/manage/matchRank.vue
  7. 2
      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`, manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`, queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`, releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `${host1}competition/competition/rank/totalRankingScoreDetails`,
gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`, gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`, rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`, rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`,

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

@ -211,12 +211,13 @@ export default {
save() { save() {
const { form } = this const { form } = this
if (!form.time.length) return util.warningMsg('请选择比赛时间') 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.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目') if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId) const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId)
form.systemId = systemId if (systemId) form.systemId = systemId
form.projectName = projectName if (projectName) form.projectName = projectName
form.startTime = form.time[0] form.startTime = form.time[0]
form.endTime = form.time[1] form.endTime = form.time[1]
this.$emit('hideSet', this.form) this.$emit('hideSet', this.form)

@ -138,7 +138,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item class="req" label="竞赛详情"> <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>
<el-form-item label="附件"> <el-form-item label="附件">
<el-upload <el-upload
@ -325,12 +325,19 @@ export default {
}, },
submiting: false, submiting: false,
updateTime: 0, updateTime: 0,
quillShow: true
}; };
}, },
components: { components: {
quill quill
}, },
watch: { watch: {
editing: function(val) {
this.quillShow = false
this.$nextTick(() => {
this.quillShow = true
})
},
// , // ,
form: { form: {
handler(){ handler(){

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

@ -73,7 +73,12 @@
<tr v-for="(item, i) in teams" :key="i"> <tr v-for="(item, i) in teams" :key="i">
<template v-if="!active && item.rowspan"> <template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td> <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> </template>
<td>{{ i + 1 }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td> <td>{{ item.userName }}</td>
@ -90,7 +95,7 @@
</tr> </tr>
<tr v-if="!active && teams.length"> <tr v-if="!active && teams.length">
<td>综合得分</td> <td>综合得分</td>
<td>{{ totalScore }}</td> <td>{{ curRow.score }}</td>
<td colspan="6">总排名{{ curRow.index }}</td> <td colspan="6">总排名{{ curRow.index }}</td>
</tr> </tr>
</table> </table>
@ -149,6 +154,20 @@ export default {
method: this.$route.query.method, method: this.$route.query.method,
competitionType: +this.$route.query.competitionType, competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule, rule: +this.$route.query.rule,
teamCalculationMethods: [
{
id: 0,
name: '最高分'
},
{
id: 1,
name: '平均分'
},
{
id: 2,
name: '求和'
}
],
headers: { headers: {
token: sessionStorage.getItem("token") token: sessionStorage.getItem("token")
}, },
@ -279,8 +298,13 @@ export default {
}).catch(res => {}) }).catch(res => {})
} else { } else {
const ids = this.grades.map(e => e.stageId) const ids = this.grades.map(e => e.stageId)
data.stageIds = ids.splice(0, ids.length - 1) ids.pop()
this.$post(this.api.detailsOfTotalTeamScores, data).then(({ data, resultCalculationMethod }) => { 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 = [] const result = []
let totalScore = 0 let totalScore = 0
// //
@ -300,10 +324,14 @@ export default {
score = scores.reduce((prev, next) => prev + next) score = scores.reduce((prev, next) => prev + next)
} }
team[0].teamScore = score 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[0].rowspan = team.length
team.map(n => { team.map(n => {
n = Object.assign(n, e) n = Object.assign(n, e)
}) })
console.log("🚀 ~ file: matchRank.vue:334 ~ this.$post ~ resultCalculationMethod", resultCalculationMethod, score)
// 0 */100 // 0 */100
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100 if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100
result.push(...team) result.push(...team)
@ -311,6 +339,7 @@ export default {
}) })
// //
const teamScores = data.map(e => e.teamScore) const teamScores = data.map(e => e.teamScore)
console.log("🚀 ~ file: matchRank.vue:339 ~ this.$post ~ teamScores", teamScores, totalScore)
if (resultCalculationMethod === 1) { // if (resultCalculationMethod === 1) { //
totalScore = teamScores.reduce((prev, next) => prev + next) totalScore = teamScores.reduce((prev, next) => prev + next)
} else if (resultCalculationMethod === 2) { // } else if (resultCalculationMethod === 2) { //
@ -318,7 +347,33 @@ export default {
} }
this.totalScore = totalScore this.totalScore = totalScore
this.teams = result 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 { } else {
this.toReport(row) this.toReport(row)
@ -477,5 +532,13 @@ export default {
text-align: center; text-align: center;
background-color: #f8faff; background-color: #f8faff;
} }
.scores {
line-height: 1.6;
}
.score {
font-size: 16px;
font-weight: 600;
color: #9076FF;
}
} }
</style> </style>

@ -36,6 +36,7 @@
</div> </div>
</template> </template>
<template v-if="form.releaseType">
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div> <div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6> <h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule"> <div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
@ -65,6 +66,7 @@
</div> </div>
</div> </div>
</div> </div>
</template>
<!-- 进展 --> <!-- 进展 -->
<div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div> <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" <el-input :disabled="isDetail" v-model.trim="projectManage.projectName"
placeholder="20个字符以内" @blur="projectNameExistis"></el-input> placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item> </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-form-item label="项目权限">
<el-select :disabled="isDetail" v-model="projectManage.permissions" <el-select :disabled="isDetail" v-model="projectManage.permissions"
placeholder="请选择" @change="permissionChange"> placeholder="请选择" @change="permissionChange">
@ -236,6 +239,7 @@ export default {
projectManage: { projectManage: {
founder: 0, // (0 1) founder: 0, // (0 1)
projectName: "", // projectName: "", //
remark: '',
permissions: 0, // (0 1 2) permissions: 0, // (0 1 2)
systemId: this.$route.query.systemId, // id systemId: this.$route.query.systemId, // id
hintOpen: 1, // (0 1 1) hintOpen: 1, // (0 1 1)

Loading…
Cancel
Save