dev_202303
yujialong 2 years ago
parent 479bd27cd5
commit 254b2983c2
  1. 4
      src/setting.js
  2. 1
      src/utils/api.js
  3. 13
      src/views/match/add/set.vue
  4. 16
      src/views/match/add/step1.vue
  5. 19
      src/views/match/add/step2.vue
  6. 43
      src/views/match/add/step3.vue
  7. 11
      src/views/match/list/index.vue
  8. 5
      src/views/match/manage/matchArch.vue
  9. 217
      src/views/match/manage/matchInfo.vue
  10. 18
      src/views/match/manage/matchRank.vue
  11. 12
      src/views/match/manage/matchSignup.vue
  12. 2
      src/views/serve/projectAdd.vue

@ -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/'
}

@ -306,6 +306,7 @@ export default {
getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`,
publishCompetition: `competition/competition/management/publishCompetition`,
detailsOfCompetitionStage: `${host1}competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`,
// 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`,

@ -1,13 +1,5 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" content="设置大赛内容"></el-page-header>
<div>
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div>
<p class="m-b-20">比赛名称</p>
@ -102,6 +94,11 @@
></el-pagination>
</div>
</el-card>
<div style="text-align: center">
<el-button @click="back">返回</el-button>
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>

@ -113,19 +113,19 @@
</el-form-item>
<el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限">
<div class="input-center">
<el-input placeholder="请输入人数" v-model="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
<el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
</div>
</el-form-item>
<template v-if="form.completeCompetitionSetup.competitionType">
<el-form-item class="req" label="报名团队数上限">
<div class="input-center">
<el-input placeholder="请输入团队数" v-model="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
<el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
</div>
</el-form-item>
<el-form-item class="req" label="团队人数">
<div class="input-center" style="width: 250px;">
<el-input v-model="form.completeCompetitionSetup.minTeamSize" type="number"></el-input>
<el-input style="margin-left: 5px;" v-model="form.completeCompetitionSetup.maxTeamSize" type="number"></el-input> /
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize" type="number"></el-input>
<el-input style="margin-left: 5px;" v-model.number="form.completeCompetitionSetup.maxTeamSize" type="number"></el-input> /
</div>
</el-form-item>
</template>
@ -595,12 +595,18 @@ export default {
// if (signUpStartTime && now > signUpStartTime) return util.warningMsg("");
if (!form.playStartTime) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
//
if (competitionType) {
if (quantityLimit === '') return util.warningMsg('请填写报名团队数上限')
if (quantityLimit < 0) return util.warningMsg('报名团队数上限不得小于0')
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限')
if (minTeamSize < 2) return util.warningMsg('团队人数下限不得小于2')
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限')
if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限')
} else { //
if (quantityLimit === '') return util.warningMsg('请填写报名人数上限')
if (quantityLimit < 0) return util.warningMsg('报名人数上限不得小于0')
}
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return util.warningMsg("请填写竞赛详情");

@ -92,7 +92,7 @@
<span class="req">*</span>
成绩公布时间
阶段比赛结束后
<el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
<el-input v-model="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩
</div>
<div class="line">
@ -124,7 +124,7 @@
</el-form-item>
<el-form-item prop="resultAnnouncementTime" label="成绩公布时间">
阶段比赛结束后
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
<el-input v-model="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩
</el-form-item>
<el-form-item prop="resultsDetails" label="是否公布成绩详情">
@ -309,17 +309,30 @@ export default {
invalid = 1
util.errorMsg('请输入团队参数人数限制')
break
} else if (e.teamNumLimit < 0) {
invalid = 1
util.errorMsg('团队参数人数不得小于0')
break
} else if (e.teamNumLimit > maxTeamSize) {
invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限')
break
}
}
if (!e.resultsDetails && e.resultAnnouncementTime === '') {
if (!e.resultsDetails) {
e.resultAnnouncementTime = +e.resultAnnouncementTime
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) {
invalid = 1
util.errorMsg('成绩公布时间不得小于0')
break
}
}
}
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')

@ -32,24 +32,24 @@
</div>
</el-form-item>
<template v-if="item.method === 2">
<el-form-item label="比赛地点">
<el-form-item class="req" label="比赛地点">
<el-input v-model="item.offlineAddress" style="width: 80%"></el-input>
</el-form-item>
<el-form-item label="比赛内容">
<el-form-item class="req" label="比赛内容">
<el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input>
</el-form-item>
<el-form-item label="评分规则">
<el-form-item class="req" label="评分规则">
<el-input v-model="item.scoreRule" type="textarea" style="width: 80%"></el-input>
</el-form-item>
</template>
<template v-else>
<el-form-item class="req" prop="cid" label="课程系统">
{{ item.sysName }}
{{ item.cname }}
</el-form-item>
<el-form-item class="req" prop="assessmentId" label="已选择考核">
{{ item.projectName }}
</el-form-item>
<el-form-item prop="resultAnnouncementTime" label="比赛地点">
<el-form-item class="req" prop="resultAnnouncementTime" label="比赛地点">
<div class="line">
<el-checkbox v-model="item.onlineButton">线上</el-checkbox>
<el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton" style="width: 400px;margin-left: 10px"></el-input>
@ -127,7 +127,6 @@ export default {
},
},
mounted() {
console.log(33, this.step1)
this.handleForm()
},
methods: {
@ -145,6 +144,7 @@ export default {
form.stageName = e.stageName
this.form.push(form)
})
console.log(44, this.form)
}).catch(res => {})
},
//
@ -161,7 +161,6 @@ export default {
},
//
timeChange(val) {
console.log("🚀 ~ file: set.vue:180 ~ timeChange ~ val", val)
if (val.length) {
const startTime = new Date(val[0])
const endTime = new Date(val[1])
@ -193,6 +192,7 @@ export default {
save(status, next = 0) {
const { form } = this
let invalid = 0
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
for (const e of form) {
if (!e.time.length) {
invalid = 1
@ -206,10 +206,37 @@ export default {
util.errorMsg('请选择课程')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
}
}
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
}
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (invalid) return
this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {

@ -78,7 +78,7 @@
<el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column>
<el-table-column label="操作" align="center" width="260">
<template slot-scope="scope">
<el-button v-if="scope.row.playingStages.length" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
<el-button v-if="scope.row.playingStages && scope.row.playingStages.length" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
<el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-switch
@ -204,6 +204,7 @@ export default {
curRow: {
playingStages: []
},
timer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
@ -259,9 +260,15 @@ export default {
startTime: form.startTime || null,
}).then(({ data }) => {
const list = data.records
//
this.timer = setInterval(() => {
const now = new Date()
list.map(e => {
if (!e.playingStages) {
this.$set(e, 'playingStages', [])
} else {
e.playingStages = []
}
//
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
//
@ -275,8 +282,8 @@ export default {
}
}
})
}, 1000)
this.matchData = list
console.log("🚀 ~ file: index.vue:286 ~ getList ~ list", list)
this.total = data.total
this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) {

@ -2,7 +2,7 @@
<!-- 报名人员 -->
<div class="page-content" style="padding: 24px">
<el-collapse v-model="curStep">
<el-collapse-item v-for="(item, i) in list" :key="i" :title="item.stageName" :name="i">
<el-collapse-item v-for="(item, i) in list" :key="i" :title="item.stageName" :name="item.stageId">
<div class="line">
<span>比赛方式{{ item.methodName }}</span>
<span>比赛形式{{ item.competitionType ? '团队赛' : '个人赛' }}</span>
@ -28,7 +28,7 @@ export default {
return {
id: +this.$route.query.id,
list: [],
curStep: 0
curStep: []
};
},
mounted() {
@ -46,6 +46,7 @@ export default {
e.methodName = Const.methods.find(n => n.id === e.method).name
e.ruleName = Const.rules.find(n => n.id === e.rule).name
})
this.curStep = list.map(e => e.stageId)
this.list = list
}).catch(res => {});
},

@ -10,71 +10,226 @@
<table class="table">
<tr>
<th width="150">姓名</th>
<td></td>
<td>{{ info.person.userName }}</td>
</tr>
<tr>
<th>学号</th>
<td></td>
<td>{{ info.person.workNumber }}</td>
</tr>
<tr>
<th>学校</th>
<td></td>
<td>{{ info.person.schoolName }}</td>
</tr>
<template v-if="form.completeCompetitionSetup.competitionType">
<tr>
<th>指导老师</th>
<td></td>
<th width="150">团队名称</th>
<td>
<span>{{ info.team.teamName }}</span>
</td>
</tr>
<template>
<tr>
<th>队长</th>
<td>{{ info.caption.userName }}{{ info.caption.schoolName && ',' + info.caption.schoolName }}{{ info.caption.workNumber && ',' + info.caption.workNumber }}</td>
</tr>
<tr>
<th>团队成员</th>
<td>
<el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName }}</el-tag>
</td>
</tr>
<tr>
<th>团队邀请码</th>
<td>
<span>{{ info.team.invitationCode }}</span>
</td>
</tr>
</template>
</template>
<tr>
<th width="130">指导老师</th>
<td>
<table class="table tc">
<tr>
<th width="60">姓名</th>
<th width="100">职务</th>
<th width="100">手机号</th>
</tr>
<template v-if="info.teamInstructors.length">
<tr v-for="(item, i) in info.teamInstructors" :key="i">
<td width="60">{{ item.name }}</td>
<td width="100">{{ item.position }}</td>
<td width="100">{{ item.phone }}</td>
</tr>
</template>
<tr v-else>
<td colspan="3">暂无数据</td>
</tr>
</table>
</td>
</tr>
<tr>
<th>竞赛阶段</th>
<td>
<table class="table">
<table class="table tc">
<tr>
<th width="80">序号</th>
<th>赛项阶段名称</th>
<template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th>
<th>允许参赛人员</th>
<th v-if="info.team.captain === 0 && form.rule === 0">总分</th>
</template>
<th>竞赛成绩</th>
</tr>
<template v-if="info.stages.length">
<tr v-for="(item, i) in info.stages" :key="i">
<td>{{ i + 1 }}</td>
<td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.teamNumLimit || '不限制' }}</td>
<td>{{ item.teamParticipantIds || '无' }}</td>
<td v-if="info.team.captain === 0 && form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
</template>
<td>
<span v-if="item.score" class="m-r-10">分数{{item.score}}</span>
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button>
</td>
</tr>
</template>
<tr v-else>
<td colspan="6">暂无数据</td>
</tr>
</table>
<el-alert
v-if="form.completeCompetitionSetup.competitionType && info.team.captain === 0"
style="margin-top: 10px;"
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'"
type="warning"
show-icon>
</el-alert>
</td>
</tr>
</table>
</el-card>
<el-dialog title="团队得分详情" :visible.sync="memberVisible" width="900px" :close-on-click-modal="false">
<h6 v-if="members.length" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ members[0].teamName }} 阶段名称{{ curRow.stageName }}</h6>
<table class="table tc">
<tr>
<th width="60">序号</th>
<th width="100">姓名</th>
<th width="100">学校</th>
<th width="100">用时</th>
<th width="100">分数</th>
<th width="100">得分详情</th>
</tr>
<template v-if="members.length">
<tr v-for="(item, i) in members" :key="i">
<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>
</tr>
</template>
<tr v-else>
<td colspan="6">暂无数据</td>
</tr>
</table>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="memberVisible = false">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
export default {
data() {
return {
id: this.$route.query.id,
stageId: this.$route.query.stageId,
method: this.$route.query.method,
competitionType: this.$route.query.competitionType,
rule: this.$route.query.rule,
info: {},
id: +this.$route.query.id,
accountId: +this.$route.query.accountId,
form: {
competitionStage: [],
completeCompetitionSetup: {},
competitionRegistration: {}
},
info: {
isCaption: 0,
person: {},
caption: {},
team: {
captain: 1,
invitationCode: ''
},
stages: [],
teamDetail: [],
teamInstructors: []
},
memberVisible: false,
members: [],
curRow: {},
};
},
mounted() {
// this.getData()
this.getData()
},
methods: {
getData() {
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.stageId}`).then(({ data }) => {
this.list = data
}).catch(res => {})
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition
this.getInfo()
}).catch(err => {})
},
//
getInfo() {
this.$post(`${this.api.entryInformation}?competitionId=${this.id}&accountId=${this.accountId}`).then(res => {
const info = res.entryInformation
if (info.personalDetail) {
info.team = {}
info.teamDetail = []
} else {
info.isCaption = info.team.caption
}
const caption = info.teamDetail.find(e => !e.caption)
info.caption = caption ? caption : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.info = info
}).catch(err => {});
},
//
//
show(row) {
//
if (this.competitionType == 1) {
this.teamVisible = true
//
if (this.form.completeCompetitionSetup.competitionType && this.info.team.captain === 0) { //
this.curRow = row
this.memberVisible = true
const teamId = this.form.competitionRegistration.teamId
if (teamId) {
this.$post(this.api.stageGradeManagementList, {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
stageId: row.stageId,
isNakadai: 0
}).then(({ page }) => {
this.members = page.records.filter(e => e.teamId === teamId)
}).catch(res => {})
} else {
this.members = []
}
} else if (row.reportId) { // reportId
this.toReport(row)
}
// this.$router.push(`show?reportId=${row.reportId}`)
},
//
toReport(row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
}
};
@ -88,8 +243,20 @@ export default {
padding: 12px;
border: 1px solid #ebeef5;
}
&.tc {
text-align: center;
}
th {
background-color: #f6f4ff;
text-align: center;
background-color: #f8faff;
}
.line {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
margin-right: 15px;
}
}
}
</style>

@ -2,14 +2,16 @@
<div>
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="$router.back()" content="阶段/排名"></el-page-header>
<el-page-header v-if="grades.length" @back="$router.back()" :content="grades[index].stageName + '/排名'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="tabs">
<a v-for="(item, i) in grades" :key="i" class="item" :class="{active: item.stageId == active}" @click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
<template v-for="(item, i) in grades">
<a v-if="i === index || !item.stageId" :key="i" class="item" :class="{active: item.stageId == active}" @click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
</template>
</div>
<div class="flex-between" style="margin: 20px 0">
<div style="display: inline-flex;align-items: center">
@ -140,8 +142,8 @@ export default {
stageId: +this.$route.query.stageId,
index: +this.$route.query.index,
method: this.$route.query.method,
competitionType: this.$route.query.competitionType,
rule: this.$route.query.rule,
competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule,
headers: {
token: sessionStorage.getItem("token")
},
@ -172,6 +174,7 @@ export default {
//
getData() {
if (!this.active) {
//
const ids = this.grades.map(e => e.stageId)
this.$post(this.api.overallStandingsInThePointsRace, {
pageNum: this.page,
@ -182,7 +185,7 @@ export default {
this.list = page
this.total = total
}).catch(res => {})
} else {
} else { //
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(({ page, total }) => {
this.list = page
this.total = total
@ -198,7 +201,8 @@ export default {
}).then(({ page }) => {
this.grades = page.records.slice(0, this.index + 1)
this.active = this.grades[this.index].stageId
if (this.rule == 0) this.grades.push({
//
this.rule == 0 && this.grades.push({
stageId: 0,
stageName: '总分'
})
@ -380,7 +384,7 @@ export default {
},
//
showFaild() {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}`, {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {

@ -20,16 +20,16 @@
</div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="school" label="学校">
<el-table-column prop="school" label="学校" sortable="custom">
</el-table-column>
<el-table-column prop="school" label="团队名称">
<el-table-column prop="teamName" label="团队名称" sortable="custom">
</el-table-column>
<el-table-column prop="username" label="学生姓名">
</el-table-column>
@ -218,6 +218,10 @@ export default {
.catch(err => {
});
},
//
sortChange(column, prop, order) {
console.log(column, prop, order)
},
//
add() {
this.addVisible = true
@ -295,7 +299,7 @@ export default {
},
//
info(row) {
this.$router.push(`/matchInfo?id=${this.id}`)
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
},
exportAll() {
const data = this.multipleSelection

@ -238,7 +238,7 @@ export default {
projectName: "", //
permissions: 0, // (0 1 2)
systemId: this.$route.query.systemId, // id
hintOpen: 0, // (0 1 0)
hintOpen: 1, // (0 1 1)
experimentHint: "", //
experimentTarget: "", //
experimentDescription: "", //

Loading…
Cancel
Save