dev_202303
yujialong 2 years ago
parent db97703c92
commit 048d68dfd6
  1. 2
      src/main.js
  2. 4
      src/setting.js
  3. 48
      src/utils/api.js
  4. 65
      src/views/match/manage/matchRank.vue
  5. 35
      src/views/match/manage/matchSignup.vue

@ -16,7 +16,6 @@ import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStat
import preventReClick from './utils/preventReClick' //防多次点击,重复提交
import plugins from '@/directive';
Vue.prototype.api = api;
Vue.prototype.$get = get;
Vue.prototype.$post = post;
@ -44,7 +43,6 @@ Vue.config.productionTip = false;
Vue.use(ElementUI, { size: 'small' });
Vue.use(plugins);
new Vue({
router,
store,

@ -11,8 +11,8 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.51:9000/'// 榕
host = 'http://192.168.31.116:9000/'// 赓
// host = 'http://192.168.31.51:9000/'// 榕
// host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}

@ -1,7 +1,7 @@
import Setting from "@/setting";
const host = Setting.apiBaseURL
const host1 = 'http://192.168.31.51:9000/'
const host1 = 'http://121.37.12.51/'
const uploadURL = Setting.uploadURL
export default {
@ -305,7 +305,7 @@ export default {
getCompetition: `competition/competition/management/getCompetition`,
getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`,
publishCompetition: `competition/competition/management/publishCompetition`,
detailsOfCompetitionStage: `${host1}competition/competition/management/detailsOfCompetitionStage`,
detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`,
// 赛事内容
@ -336,7 +336,7 @@ export default {
cancelRegistration: `competition/competition/registration/cancelRegistration`,
disableContests: `competition/competition/registration/disableContests`,
disableRegistration: `competition/competition/registration/disableRegistration`,
excelExport: `competition/competition/registration/excelExport`,
excelExport: `${host}competition/competition/registration/excelExport`,
exportDataInBatches: `competition/competition/registration/exportDataInBatches`,
queryRegistrationByCondition: `competition/competition/registration/queryRegistrationByCondition`,
searchTeam: `competition/competition/team/searchTeam`,
@ -362,27 +362,27 @@ export default {
queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`,
saveAnnouncementAnnex: `competition/competition/announcementAnnex/save`,
// 赛事成绩
batchDeleteContestGrade: `${host1}competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host1}competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `${host1}competition/competition/performance/exportFailure`,
rankExportFailure: `${host1}competition/competition/rank/exportFailure`,
stageGradeManagementList: `${host1}competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `${host1}competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `${host1}competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `${host1}competition/competition/rank/batchImportRanking`,
publishRanking: `${host1}competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `${host1}competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `${host1}competition/competition/rank/multipleStageTeamScoreDetails`,
detailsOfTotalTeamScores: `${host1}competition/competition/rank/detailsOfTotalTeamScores`,
cancelRanking: `${host1}competition/competition/rank/cancelRanking`,
reportDetail: `${host1}occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `${host1}competition/competition/rank/deleteLastPublication`,
whetherToPublish: `${host1}competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `${host1}competition/competition/rank/totalRankingScoreDetails`,
batchDeleteContestGrade: `competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host}competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host}competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `${host}competition/competition/performance/exportFailure`,
rankExportFailure: `${host}competition/competition/rank/exportFailure`,
stageGradeManagementList: `competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `${host}competition/competition/rank/batchImportRanking`,
publishRanking: `competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `competition/competition/rank/multipleStageTeamScoreDetails`,
detailsOfTotalTeamScores: `competition/competition/rank/detailsOfTotalTeamScores`,
cancelRanking: `competition/competition/rank/cancelRanking`,
reportDetail: `occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `competition/competition/rank/deleteLastPublication`,
whetherToPublish: `competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `competition/competition/rank/queryPublicationSource`,
releaseVerification: `competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `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`,

@ -80,14 +80,17 @@
<p>{{ item.pointWeight }}%</p>
</td>
</template>
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.schoolName }}</td>
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
<el-button type="text" @click="toReport(item)">查看</el-button>
</td>
<template v-if="item.accountId">
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.schoolName }}</td>
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
<el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button>
</td>
</template>
<td v-else colspan="6"></td>
</tr>
</template>
<tr v-else>
@ -201,9 +204,11 @@ export default {
//
getData() {
//
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
const ids = this.grades.map(e => e.stageId)
ids.pop()
// >(:(1,0))
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
}).catch(res => {})
@ -278,6 +283,7 @@ export default {
},
//
show(row, i) {
this.teams = []
//
if (this.competitionType == 1) {
row.index = i + 1
@ -303,49 +309,24 @@ export default {
//
// 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
if (data.length) {
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)
} else {
e.rowspan = 1
result.push(e)
}
})
//
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
}
}).catch(res => {})
@ -399,14 +380,16 @@ export default {
list.map(e => {
e.competitionId = id
e.isOverallRanking = isOverall
if (isOverall) delete e.stageId
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
data = list
}
}
const ids = this.grades.map(e => e.stageId)
ids.pop()
//
this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(this.api.publishRanking, data).then(res => {
this.uploadData = []
this.getData()

@ -7,7 +7,7 @@
<label>搜索</label>
<el-input placeholder="请输入姓名/手机号/团队名称/学号" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 250px"></el-input>
</li>
<li>
<li v-if="info.releaseType">
<label>参赛人员状态</label>
<el-select v-model="isDisable" @change="initData">
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option>
@ -29,7 +29,7 @@
</el-table-column>
<el-table-column prop="school" label="学校" sortable="custom">
</el-table-column>
<el-table-column prop="teamName" label="团队名称" sortable="custom">
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称" sortable="custom">
</el-table-column>
<el-table-column prop="username" label="学生姓名">
</el-table-column>
@ -40,15 +40,17 @@
<el-table-column label="操作" align="center" width="320">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '关' : '开'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
<template v-if="info.releaseType">
<el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '关' : '开'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</template>
</el-table-column>
</el-table>
@ -122,6 +124,9 @@ export default {
return {
token: sessionStorage.getItem('token'),
id: +this.$route.query.id,
info: {
completeCompetitionSetup: {}
},
isDisable: '',
statusList: [
{
@ -176,7 +181,6 @@ export default {
},
submiting: false,
teamVisible: false,
teams: [],
teamNameRepeat: false,
@ -202,6 +206,7 @@ export default {
},
mounted() {
this.initData()
this.getInfo()
this.getClient()
this.getTeam()
},
@ -222,6 +227,12 @@ export default {
}).catch(res => {
});
},
//
getInfo() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
}).catch(err => {})
},
initData() {
this.page = 1
this.getData()

Loading…
Cancel
Save