|
|
@ -1,62 +1,121 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="m-b-20 head-card"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20 head-card"> |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
<el-page-header v-if="grades.length" @back="$router.back()" :content="grades[index].stageName + '/排名'"></el-page-header> |
|
|
|
<el-page-header v-if="grades.length" |
|
|
|
|
|
|
|
@back="$router.back()" |
|
|
|
|
|
|
|
:content="grades[index].stageName + '/排名'"></el-page-header> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20"> |
|
|
|
<div class="tabs"> |
|
|
|
<div class="tabs"> |
|
|
|
<template v-for="(item, i) in grades"> |
|
|
|
<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> |
|
|
|
<a v-if="i === index || !item.stageId" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
class="item" |
|
|
|
|
|
|
|
:class="{active: item.stageId == active}" |
|
|
|
|
|
|
|
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex-between" style="margin: 20px 0"> |
|
|
|
<div class="flex-between" |
|
|
|
|
|
|
|
style="margin: 20px 0"> |
|
|
|
<div style="display: inline-flex;align-items: center"> |
|
|
|
<div style="display: inline-flex;align-items: center"> |
|
|
|
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio> |
|
|
|
<el-radio v-model="type" |
|
|
|
<el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio> |
|
|
|
:label="0" |
|
|
|
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button> |
|
|
|
@change="typeChange">默认系统排序</el-radio> |
|
|
|
|
|
|
|
<el-radio v-model="type" |
|
|
|
|
|
|
|
:label="1" |
|
|
|
|
|
|
|
@change="typeChange">手动上传</el-radio> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
:disabled="type === 0" |
|
|
|
|
|
|
|
class="ml20" |
|
|
|
|
|
|
|
@click="batchImport">上传文件</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<!-- <el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button> --> |
|
|
|
<el-button v-if="!published" |
|
|
|
<el-button v-if="!published" type="primary" @click="cancelPublish(1)">发布排名</el-button> |
|
|
|
type="primary" |
|
|
|
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button> |
|
|
|
@click="cancelPublish(1)">发布排名</el-button> |
|
|
|
|
|
|
|
<div v-else> |
|
|
|
|
|
|
|
<span style="margin-right: 10px">{{ publishTime }}发布排名</span> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="cancelPublish(0)">取消发布</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center"> |
|
|
|
</div> |
|
|
|
<el-table-column type="index" width="60" label="排名" align="center"> |
|
|
|
<el-table :data="list" |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="60" |
|
|
|
|
|
|
|
label="排名" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<template v-if="competitionType == 1"> |
|
|
|
<template v-if="competitionType == 1"> |
|
|
|
<el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column> |
|
|
|
<el-table-column prop="teamName" |
|
|
|
<el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column> |
|
|
|
label="团队名称" |
|
|
|
|
|
|
|
min-width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="leaderName" |
|
|
|
|
|
|
|
label="队长" |
|
|
|
|
|
|
|
min-width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> |
|
|
|
<el-table-column v-else |
|
|
|
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column> |
|
|
|
prop="userName" |
|
|
|
<el-table-column prop="timeSum" label="用时" width="90" align="center"> |
|
|
|
label="学生姓名" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="schoolName" |
|
|
|
|
|
|
|
label="学校" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="timeSum" |
|
|
|
|
|
|
|
label="用时" |
|
|
|
|
|
|
|
width="90" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }} |
|
|
|
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column> |
|
|
|
<el-table-column prop="score" |
|
|
|
<el-table-column label="得分详情" align="center" width="160"> |
|
|
|
label="分数" |
|
|
|
|
|
|
|
width="90" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="得分详情" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text" @click="show(scope.row, scope.$index)">查看</el-button> |
|
|
|
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="show(scope.row, scope.$index)">查看</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:current-page="page"> |
|
|
|
</el-pagination> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="团队得分详情" |
|
|
|
<h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称:{{ curRow.teamName }} 阶段名称:{{ stageName }}</h6> |
|
|
|
:visible.sync="teamVisible" |
|
|
|
|
|
|
|
width="900px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<h6 v-if="active" |
|
|
|
|
|
|
|
style="margin-bottom: 10px;font-size: 16px;">团队名称:{{ curRow.teamName }} 阶段名称:{{ stageName }}</h6> |
|
|
|
<table class="table tc"> |
|
|
|
<table class="table tc"> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<template v-if="!active"> |
|
|
|
<template v-if="!active"> |
|
|
@ -71,10 +130,12 @@ |
|
|
|
<th width="100">得分详情</th> |
|
|
|
<th width="100">得分详情</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<template v-if="teams.length"> |
|
|
|
<template v-if="teams.length"> |
|
|
|
<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 class="scores" :rowspan="item.rowspan"> |
|
|
|
<td class="scores" |
|
|
|
|
|
|
|
:rowspan="item.rowspan"> |
|
|
|
<p class="score">{{ item.teamScore }}</p> |
|
|
|
<p class="score">{{ item.teamScore }}</p> |
|
|
|
<p>{{ item.teamCalculationMethodName }}</p> |
|
|
|
<p>{{ item.teamCalculationMethodName }}</p> |
|
|
|
<p>权重:</p> |
|
|
|
<p>权重:</p> |
|
|
@ -88,10 +149,13 @@ |
|
|
|
<td>{{ item.timeSum }}min</td> |
|
|
|
<td>{{ item.timeSum }}min</td> |
|
|
|
<td>{{ item.score }}</td> |
|
|
|
<td>{{ item.score }}</td> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button> |
|
|
|
<el-button v-if="item.reportId" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="toReport(item)">查看</el-button> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<td v-else colspan="6"></td> |
|
|
|
<td v-else |
|
|
|
|
|
|
|
colspan="6"></td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<tr v-else> |
|
|
|
<tr v-else> |
|
|
@ -103,18 +167,24 @@ |
|
|
|
<td colspan="6">总排名:第{{ curRow.index }}名</td> |
|
|
|
<td colspan="6">总排名:第{{ curRow.index }}名</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" type="primary" @click="teamVisible = false">确定</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="teamVisible = false">确定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
|
|
|
width="24%" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
|
<el-upload ref="upload" |
|
|
|
ref="upload" |
|
|
|
|
|
|
|
name="file" |
|
|
|
name="file" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
@ -132,27 +202,54 @@ |
|
|
|
isOverallRanking: active ? 0 : 1, |
|
|
|
isOverallRanking: active ? 0 : 1, |
|
|
|
schoolId: '' |
|
|
|
schoolId: '' |
|
|
|
}" |
|
|
|
}" |
|
|
|
:auto-upload="false" |
|
|
|
:auto-upload="false"> |
|
|
|
> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
<el-link v-if="uploadFaild" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" @click="importVisible = false">取 消</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="importVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="请选择发布排名时间" |
|
|
|
|
|
|
|
:visible.sync="publishVisible" |
|
|
|
|
|
|
|
width="260px" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
custom-class="publish-dia"> |
|
|
|
|
|
|
|
<el-date-picker popper-class="no-atTheMoment" |
|
|
|
|
|
|
|
v-model="publishTime" |
|
|
|
|
|
|
|
placeholder="请选择结束时间" |
|
|
|
|
|
|
|
type="datetime" |
|
|
|
|
|
|
|
:picker-options="pickerOptions"> |
|
|
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="publishVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="publishTimeSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Setting from "@/setting"; |
|
|
|
import Setting from '@/setting' |
|
|
|
import util from "@/libs/util"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
import echarts from "echarts"; |
|
|
|
import echarts from "echarts"; |
|
|
|
import axios from 'axios'; |
|
|
|
import axios from 'axios'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: +this.$route.query.id, |
|
|
|
id: +this.$route.query.id, |
|
|
|
stageId: +this.$route.query.stageId, |
|
|
|
stageId: +this.$route.query.stageId, |
|
|
@ -197,15 +294,32 @@ export default { |
|
|
|
totalScore: 0, |
|
|
|
totalScore: 0, |
|
|
|
published: false, |
|
|
|
published: false, |
|
|
|
uploadData: [], |
|
|
|
uploadData: [], |
|
|
|
sourceType: '' |
|
|
|
sourceType: '', |
|
|
|
|
|
|
|
publishVisible: false, |
|
|
|
|
|
|
|
publishTime: '', |
|
|
|
|
|
|
|
timeId: '', |
|
|
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
|
|
// 控制过往日期不可选 |
|
|
|
|
|
|
|
disabledDate (time) { |
|
|
|
|
|
|
|
return time.getTime() < Date.now() - 8.64e7; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 控制过往时间不可选 |
|
|
|
|
|
|
|
selectableRange: (() => { |
|
|
|
|
|
|
|
let data = new Date(); |
|
|
|
|
|
|
|
let hour = data.getHours(); |
|
|
|
|
|
|
|
let minute = data.getMinutes(); |
|
|
|
|
|
|
|
let second = data.getSeconds(); |
|
|
|
|
|
|
|
return [`${hour}:${minute}:${second} - 23:59:59`] |
|
|
|
|
|
|
|
})(), |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.getStage() |
|
|
|
this.getStage() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 获排名 |
|
|
|
// 获排名 |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
// 查询是否已经发布排名 |
|
|
|
// 查询是否已经发布排名 |
|
|
|
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&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) |
|
|
|
// const ids = this.grades.map(e => e.stageId) |
|
|
@ -239,10 +353,10 @@ export default { |
|
|
|
this.sourceType = source |
|
|
|
this.sourceType = source |
|
|
|
this.type = source == 1 ? 1 : 0 |
|
|
|
this.type = source == 1 ? 1 : 0 |
|
|
|
this.getRank() |
|
|
|
this.getRank() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询排名 |
|
|
|
// 查询排名 |
|
|
|
getRank() { |
|
|
|
getRank () { |
|
|
|
// 手动上传的排名接口 |
|
|
|
// 手动上传的排名接口 |
|
|
|
if (this.type) { |
|
|
|
if (this.type) { |
|
|
|
this.$post(this.api.manuallyUploadedRankings, { |
|
|
|
this.$post(this.api.manuallyUploadedRankings, { |
|
|
@ -257,7 +371,8 @@ export default { |
|
|
|
this.sourceType = message.total ? message.records[0].isRelease : 0 |
|
|
|
this.sourceType = message.total ? message.records[0].isRelease : 0 |
|
|
|
this.list = message.records |
|
|
|
this.list = message.records |
|
|
|
this.total = message.total |
|
|
|
this.total = message.total |
|
|
|
}).catch(res => {}) |
|
|
|
this.getPublishTime() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
} else { // 默认排名接口 |
|
|
|
} else { // 默认排名接口 |
|
|
|
if (!this.active) { |
|
|
|
if (!this.active) { |
|
|
|
// 总分排名 |
|
|
|
// 总分排名 |
|
|
@ -273,18 +388,20 @@ export default { |
|
|
|
this.published = publishStatus |
|
|
|
this.published = publishStatus |
|
|
|
this.list = page |
|
|
|
this.list = page |
|
|
|
this.total = total |
|
|
|
this.total = total |
|
|
|
}).catch(res => {}) |
|
|
|
this.getPublishTime() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
} else { // 阶段排名 |
|
|
|
} else { // 阶段排名 |
|
|
|
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => { |
|
|
|
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => { |
|
|
|
this.published = publishStatus |
|
|
|
this.published = publishStatus |
|
|
|
this.list = page |
|
|
|
this.list = page |
|
|
|
this.total = total |
|
|
|
this.total = total |
|
|
|
}).catch(res => {}) |
|
|
|
this.getPublishTime() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取阶段 |
|
|
|
// 获取阶段 |
|
|
|
getStage() { |
|
|
|
getStage () { |
|
|
|
this.$post(this.api.detailsOfCompetitionStage, { |
|
|
|
this.$post(this.api.detailsOfCompetitionStage, { |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 100, |
|
|
|
pageSize: 100, |
|
|
@ -298,11 +415,11 @@ export default { |
|
|
|
stageName: '总分' |
|
|
|
stageName: '总分' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 排序类型切换回调 |
|
|
|
// 排序类型切换回调 |
|
|
|
typeChange(val) { |
|
|
|
typeChange (val) { |
|
|
|
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {}).catch(res => {}) |
|
|
|
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).catch(res => { }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { |
|
|
|
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { |
|
|
@ -311,18 +428,18 @@ export default { |
|
|
|
// this.published = whetherToPublish |
|
|
|
// this.published = whetherToPublish |
|
|
|
// }).catch(res => {}) |
|
|
|
// }).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
initData () { |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// tab回调 |
|
|
|
// tab回调 |
|
|
|
tabChange(i) { |
|
|
|
tabChange (i) { |
|
|
|
this.type = 0 |
|
|
|
this.type = 0 |
|
|
|
this.active = i |
|
|
|
this.active = i |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查看详情 |
|
|
|
// 查看详情 |
|
|
|
show(row, i) { |
|
|
|
show (row, i) { |
|
|
|
this.teams = [] |
|
|
|
this.teams = [] |
|
|
|
// 个人:跳转实验报告,团队:弹框显示成员列表 |
|
|
|
// 个人:跳转实验报告,团队:弹框显示成员列表 |
|
|
|
if (this.competitionType == 1) { |
|
|
|
if (this.competitionType == 1) { |
|
|
@ -341,7 +458,7 @@ export default { |
|
|
|
data.stageId = this.active |
|
|
|
data.stageId = this.active |
|
|
|
this.$post(this.api.stageTeamScoreDetails, data).then(({ page }) => { |
|
|
|
this.$post(this.api.stageTeamScoreDetails, data).then(({ page }) => { |
|
|
|
this.teams = page.records |
|
|
|
this.teams = page.records |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
ids.pop() |
|
|
|
ids.pop() |
|
|
@ -369,7 +486,7 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.teams = result |
|
|
|
this.teams = result |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
// } else { // 没发布 |
|
|
|
// } else { // 没发布 |
|
|
|
// this.$post(this.api.totalRankingScoreDetails, data).then(({ page }) => { |
|
|
|
// this.$post(this.api.totalRankingScoreDetails, data).then(({ page }) => { |
|
|
|
// const list = page.records |
|
|
|
// const list = page.records |
|
|
@ -401,22 +518,22 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 跳转实验报告 |
|
|
|
// 跳转实验报告 |
|
|
|
toReport(row) { |
|
|
|
toReport (row) { |
|
|
|
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
|
|
|
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { // 切换分页 |
|
|
|
handleCurrentChange (val) { // 切换分页 |
|
|
|
this.page = val; |
|
|
|
this.page = val; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发布排名 |
|
|
|
// 发布排名 |
|
|
|
publishSubmit() { |
|
|
|
publishSubmit () { |
|
|
|
const { startTime, endTime } = this.grades[this.index] |
|
|
|
const { startTime, endTime } = this.grades[this.index] |
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
if (this.type) { // 手动发布 |
|
|
|
if (this.type) { // 手动发布 |
|
|
|
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { |
|
|
|
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
util.successMsg('发布成功!') |
|
|
|
util.successMsg('发布成功!') |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data |
|
|
|
let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data |
|
|
|
if (!this.type) { // 默认排序 |
|
|
|
if (!this.type) { // 默认排序 |
|
|
@ -446,12 +563,12 @@ export default { |
|
|
|
this.uploadData = [] |
|
|
|
this.uploadData = [] |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
util.successMsg('发布成功!') |
|
|
|
util.successMsg('发布成功!') |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
// }).catch(res => {}) |
|
|
|
// }).catch(res => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发布排名确认 |
|
|
|
// 发布排名确认 |
|
|
|
publish() { |
|
|
|
publish () { |
|
|
|
// 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 |
|
|
|
// 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 |
|
|
|
// if (this.published && this.sourceType != this.type) { |
|
|
|
// if (this.published && this.sourceType != this.type) { |
|
|
|
// this.$confirm(this.sourceType == 1 && !this.type ? |
|
|
|
// this.$confirm(this.sourceType == 1 && !this.type ? |
|
|
@ -471,13 +588,40 @@ export default { |
|
|
|
type: 'success' |
|
|
|
type: 'success' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.publishSubmit() |
|
|
|
this.publishSubmit() |
|
|
|
}).catch(() => {}) : |
|
|
|
}).catch(() => { }) : |
|
|
|
this.publishSubmit() |
|
|
|
this.publishSubmit() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
// this.publishSubmit() |
|
|
|
// this.publishSubmit() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取定时发布排名 |
|
|
|
|
|
|
|
async getPublishTime () { |
|
|
|
|
|
|
|
const res = await this.$post(this.api.getCompetitionStageRankingTime, { |
|
|
|
|
|
|
|
competitionId: this.id, |
|
|
|
|
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
|
|
|
publicationType: this.type, |
|
|
|
|
|
|
|
stageId: this.active || this.stageId, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (res.releaseTime) { |
|
|
|
|
|
|
|
this.published = true |
|
|
|
|
|
|
|
this.timeId = res.releaseTime.id |
|
|
|
|
|
|
|
this.publishTime = res.releaseTime.releaseTime |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 定时发布排名 |
|
|
|
|
|
|
|
async publishTimeSubmit () { |
|
|
|
|
|
|
|
this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
|
|
|
|
competitionId: this.id, |
|
|
|
|
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
|
|
|
publicationType: this.type, |
|
|
|
|
|
|
|
stageId: this.active || this.stageId, |
|
|
|
|
|
|
|
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
util.successMsg('发布成功') |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
this.publishVisible = false |
|
|
|
|
|
|
|
}, |
|
|
|
// 取消发布排名 |
|
|
|
// 取消发布排名 |
|
|
|
cancelPublish(publish) { |
|
|
|
async cancelPublish (publish) { |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
const stageIds = ids.splice(0, ids.length - 1) |
|
|
|
const stageIds = ids.splice(0, ids.length - 1) |
|
|
|
const query = [] |
|
|
|
const query = [] |
|
|
@ -487,50 +631,49 @@ export default { |
|
|
|
// 如果是发布排名,则先删除已发布的排名,再调发布排名的接口 |
|
|
|
// 如果是发布排名,则先删除已发布的排名,再调发布排名的接口 |
|
|
|
// 如果是取消发布,则直接调取消发布的接口 |
|
|
|
// 如果是取消发布,则直接调取消发布的接口 |
|
|
|
if (publish) { |
|
|
|
if (publish) { |
|
|
|
// this.type ? |
|
|
|
this.publishTime = new Date() |
|
|
|
this.publish() |
|
|
|
this.publishVisible = true |
|
|
|
// this.$post(this.api.deleteLastPublication, { |
|
|
|
|
|
|
|
// competitionId: this.id, |
|
|
|
|
|
|
|
// isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
|
|
|
// stageIds: this.active ? [this.active] : stageIds |
|
|
|
|
|
|
|
// }).then(res => { |
|
|
|
|
|
|
|
// this.publish() |
|
|
|
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => { |
|
|
|
try { |
|
|
|
|
|
|
|
// 取消定时发布的接口跟取消普通发布的接口不一样 |
|
|
|
|
|
|
|
if (this.timeId) { |
|
|
|
|
|
|
|
await this.$post(`${this.api.cancelCompetitionStageRankingTime}?releaseId=${this.timeId}`) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`) |
|
|
|
|
|
|
|
} |
|
|
|
this.sourceType = '' |
|
|
|
this.sourceType = '' |
|
|
|
this.type = 0 |
|
|
|
this.type = 0 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
util.successMsg('取消发布成功!') |
|
|
|
util.successMsg('取消发布成功!') |
|
|
|
}).catch(res => {}) |
|
|
|
} catch (error) { } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量导入 |
|
|
|
// 批量导入 |
|
|
|
batchImport() { |
|
|
|
batchImport () { |
|
|
|
this.importVisible = true |
|
|
|
this.importVisible = true |
|
|
|
this.uploadList = [] |
|
|
|
this.uploadList = [] |
|
|
|
this.uploadFaild = false |
|
|
|
this.uploadFaild = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 模板下载 |
|
|
|
// 模板下载 |
|
|
|
download() { |
|
|
|
download () { |
|
|
|
location.href = this.api[this.competitionType == 1 ? 'rankImportTeam' : 'rankImportPerson'] |
|
|
|
location.href = this.api[this.competitionType == 1 ? 'rankImportTeam' : 'rankImportPerson'] |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上传文件 |
|
|
|
// 上传文件 |
|
|
|
handleExceed(files, fileList) { |
|
|
|
handleExceed (files, fileList) { |
|
|
|
util.warningMsg( |
|
|
|
util.warningMsg( |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
) |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 下载失败文件 |
|
|
|
// 下载失败文件 |
|
|
|
showFaild() { |
|
|
|
showFaild () { |
|
|
|
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, { |
|
|
|
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, { |
|
|
|
headers: this.headers, |
|
|
|
headers: this.headers, |
|
|
|
responseType: 'blob' |
|
|
|
responseType: 'blob' |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data])) |
|
|
|
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data])) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
this.uploadFaild = false |
|
|
|
this.uploadFaild = false |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
const { exportCode } = res.data |
|
|
|
const { exportCode } = res.data |
|
|
@ -547,25 +690,25 @@ export default { |
|
|
|
util.errorMsg(res.message || "上传失败,请检查数据") |
|
|
|
util.errorMsg(res.message || "上传失败,请检查数据") |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError (err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
message: "上传出错,请重试!", |
|
|
|
message: "上传出错,请重试!", |
|
|
|
type: "error", |
|
|
|
type: "error", |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove(file, fileList) { |
|
|
|
handleRemove (file, fileList) { |
|
|
|
this.uploadList = fileList |
|
|
|
this.uploadList = fileList |
|
|
|
this.uploadFaild = false |
|
|
|
this.uploadFaild = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSure() { |
|
|
|
uploadSure () { |
|
|
|
this.list.length ? |
|
|
|
this.list.length ? |
|
|
|
this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => { |
|
|
|
this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => { |
|
|
|
this.$refs.upload.submit() |
|
|
|
this.$refs.upload.submit() |
|
|
|
}).catch(res => {}) : |
|
|
|
}).catch(res => { }) : |
|
|
|
this.$refs.upload.submit() |
|
|
|
this.$refs.upload.submit() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -576,7 +719,8 @@ export default { |
|
|
|
.table { |
|
|
|
.table { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
border-collapse: collapse; |
|
|
|
border-collapse: collapse; |
|
|
|
th, td { |
|
|
|
th, |
|
|
|
|
|
|
|
td { |
|
|
|
padding: 12px; |
|
|
|
padding: 12px; |
|
|
|
border: 1px solid #ebeef5; |
|
|
|
border: 1px solid #ebeef5; |
|
|
|
} |
|
|
|
} |
|
|
@ -593,7 +737,7 @@ export default { |
|
|
|
.score { |
|
|
|
.score { |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 600; |
|
|
|
font-weight: 600; |
|
|
|
color: #9076FF; |
|
|
|
color: #9076ff; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |