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

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

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

@ -80,14 +80,17 @@
<p>{{ item.pointWeight }}%</p> <p>{{ item.pointWeight }}%</p>
</td> </td>
</template> </template>
<td>{{ i + 1 }}</td> <template v-if="item.accountId">
<td>{{ item.userName }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.schoolName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.timeSum }}min</td> <td>{{ item.schoolName }}</td>
<td>{{ item.score }}</td> <td>{{ item.timeSum }}min</td>
<td> <td>{{ item.score }}</td>
<el-button type="text" @click="toReport(item)">查看</el-button> <td>
</td> <el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button>
</td>
</template>
<td v-else colspan="6"></td>
</tr> </tr>
</template> </template>
<tr v-else> <tr v-else>
@ -201,9 +204,11 @@ export default {
// //
getData() { 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)) // >(:(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.sourceType = source
this.type = source == 1 ? 1 : 0 this.type = source == 1 ? 1 : 0
}).catch(res => {}) }).catch(res => {})
@ -278,6 +283,7 @@ export default {
}, },
// //
show(row, i) { show(row, i) {
this.teams = []
// //
if (this.competitionType == 1) { if (this.competitionType == 1) {
row.index = i + 1 row.index = i + 1
@ -303,49 +309,24 @@ export default {
// //
// if (this.published) { // if (this.published) {
this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => { this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => {
if (data.length && data[0].stageTeamInformation.length) { if (data.length) {
const resultCalculationMethod = data[0].stageTeamInformation[0].resultCalculationMethod
const result = [] const result = []
let totalScore = 0
// //
data.map(e => { data.map(e => {
const team = e.stageTeamInformation const team = e.stageTeamInformation
if (team.length) { 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) const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod)
if (teamCItem) team[0].teamCalculationMethodName = teamCItem.name 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
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100
result.push(...team) 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 this.teams = result
} }
}).catch(res => {}) }).catch(res => {})
@ -399,14 +380,16 @@ export default {
list.map(e => { list.map(e => {
e.competitionId = id e.competitionId = id
e.isOverallRanking = isOverall e.isOverallRanking = isOverall
if (isOverall) delete e.stageId // if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull if (isPerson) e.teamId = null // teamIdnull
}) })
data = list 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.$post(this.api.publishRanking, data).then(res => {
this.uploadData = [] this.uploadData = []
this.getData() this.getData()

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

Loading…
Cancel
Save