|
|
@ -1,111 +1,259 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="m-b-20 head-card"> |
|
|
|
<el-card shadow="hover" |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
class="m-b-20 head-card"> |
|
|
|
<el-page-header @back="$router.back()" content="成绩管理"></el-page-header> |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
</div> |
|
|
|
<el-page-header @back="$router.back()" |
|
|
|
|
|
|
|
content="成绩管理"></el-page-header> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card v-if="method != 2" shadow="hover" class="m-b-20"> |
|
|
|
<el-card v-if="method != 2" |
|
|
|
<div class="stat"> |
|
|
|
shadow="hover" |
|
|
|
<div class="nums"> |
|
|
|
class="m-b-20"> |
|
|
|
<div class="item"> |
|
|
|
<div class="stat"> |
|
|
|
<p class="name">实验总人数</p> |
|
|
|
<div class="nums"> |
|
|
|
<p class="val">{{ totalNumber }}</p> |
|
|
|
<div class="item"> |
|
|
|
</div> |
|
|
|
<p class="name">实验总人数</p> |
|
|
|
<div class="item"> |
|
|
|
<p class="val">{{ totalNumber }}</p> |
|
|
|
<p class="name">实验平均分</p> |
|
|
|
</div> |
|
|
|
<p class="val">{{ avgScore }}</p> |
|
|
|
<div class="item"> |
|
|
|
</div> |
|
|
|
<p class="name">实验平均分</p> |
|
|
|
</div> |
|
|
|
<p class="val">{{ avgScore }}</p> |
|
|
|
<div class="chart" id="chart"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<div class="chart" |
|
|
|
|
|
|
|
id="chart"></div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
class="m-b-20"> |
|
|
|
<div> |
|
|
|
<div v-if="showFile" |
|
|
|
<el-input |
|
|
|
class="tabs m-b-20"> |
|
|
|
size="small" |
|
|
|
<a class="item" |
|
|
|
placeholder="请输入学校/学生姓名" |
|
|
|
v-for="(item, i) in tabs" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
:key="i" |
|
|
|
v-model="keyword" clearable |
|
|
|
:class="{active: i === active}" |
|
|
|
style="width: 300px" |
|
|
|
@click="tabChange(i)">{{ item }}</a> |
|
|
|
></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="delAllData">批量删除</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="exportData">导出</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId"> |
|
|
|
|
|
|
|
<el-table-column type="selection" width="55" 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="schoolName" label="学校" min-width="150" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" min-width="100" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="timeSum" label="耗时" width="90" align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.timeSum }}min |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="160"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.reportId" type="text" @click="show(scope.row)">查看成绩报告</el-button> |
|
|
|
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
|
|
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<div> |
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
<el-input size="small" |
|
|
|
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
placeholder="请输入学校/学生姓名" |
|
|
|
</div> |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
<el-upload |
|
|
|
v-model="keyword" |
|
|
|
ref="importStaff" |
|
|
|
clearable |
|
|
|
name="file" |
|
|
|
style="width: 300px"></el-input> |
|
|
|
accept=".xls,.xlsx" |
|
|
|
</div> |
|
|
|
:on-remove="handleRemove" |
|
|
|
<div v-if="!active"> |
|
|
|
:on-error="uploadError" |
|
|
|
<el-button v-if="method == 2" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
type="primary" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
@click="batchImport">上传成绩</el-button> |
|
|
|
:limit="1" |
|
|
|
<el-button type="primary" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
@click="delAllData">批量删除</el-button> |
|
|
|
:action="this.api.batchImportGrades" |
|
|
|
<el-button type="primary" |
|
|
|
:file-list="uploadList" |
|
|
|
@click="exportData">导出</el-button> |
|
|
|
:headers="headers" |
|
|
|
</div> |
|
|
|
:data="{ |
|
|
|
<div v-else> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="exportData1">批量导出</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<template v-if="!active"> |
|
|
|
|
|
|
|
<el-table :data="list" |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
:key="1" |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
|
|
row-key="reportId"> |
|
|
|
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
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="schoolName" |
|
|
|
|
|
|
|
label="学校" |
|
|
|
|
|
|
|
min-width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="competitionType" |
|
|
|
|
|
|
|
prop="teamName" |
|
|
|
|
|
|
|
label="团队名称" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="userName" |
|
|
|
|
|
|
|
label="学生姓名" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
|
|
|
label="学号" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="score" |
|
|
|
|
|
|
|
label="分数" |
|
|
|
|
|
|
|
width="90" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="timeSum" |
|
|
|
|
|
|
|
label="耗时" |
|
|
|
|
|
|
|
width="90" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.timeSum }}min |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="submitTime" |
|
|
|
|
|
|
|
label="提交时间" |
|
|
|
|
|
|
|
min-width="150" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="160"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.reportId" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="show(scope.row)">查看成绩报告</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:current-page="page"> |
|
|
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
|
|
|
<el-table :data="list1" |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
:key="2" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange1" |
|
|
|
|
|
|
|
row-key="reportId"> |
|
|
|
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="60" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.$index + (page1 - 1) * pageSize + 1 }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="schoolName" |
|
|
|
|
|
|
|
label="学校" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="competitionType" |
|
|
|
|
|
|
|
prop="teamName" |
|
|
|
|
|
|
|
label="团队名称" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="userName" |
|
|
|
|
|
|
|
label="学生姓名" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
|
|
|
label="学号" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="fileName" |
|
|
|
|
|
|
|
label="文件名" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="fileSize" |
|
|
|
|
|
|
|
label="文件大小" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="fileFormat" |
|
|
|
|
|
|
|
label="文件类型" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="fileFormat" |
|
|
|
|
|
|
|
label="文件格式" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
|
|
|
label="提交时间" |
|
|
|
|
|
|
|
width="150" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="160"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-if="!isCompress(scope.row.fileFormat)" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="preview(scope.row)">预览文件</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="exportFile(scope.row)">导出文件</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total1" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange1" |
|
|
|
|
|
|
|
:current-page="page1"> |
|
|
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
|
|
|
width="24%" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-upload ref="importStaff" |
|
|
|
|
|
|
|
name="file" |
|
|
|
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
|
|
|
:on-error="uploadError" |
|
|
|
|
|
|
|
:on-success="uploadSuccess" |
|
|
|
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
|
|
|
:limit="1" |
|
|
|
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
|
|
|
:action="this.api.batchImportGrades" |
|
|
|
|
|
|
|
:file-list="uploadList" |
|
|
|
|
|
|
|
:headers="headers" |
|
|
|
|
|
|
|
:data="{ |
|
|
|
competitionId: this.id, |
|
|
|
competitionId: this.id, |
|
|
|
stageId: this.stageId, |
|
|
|
stageId: this.stageId, |
|
|
|
systemId: 0 |
|
|
|
systemId: 0 |
|
|
|
}" |
|
|
|
}"> |
|
|
|
> |
|
|
|
<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" |
|
|
|
</div> |
|
|
|
type="primary" |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
<el-button size="small" @click="importVisible = false">取 消</el-button> |
|
|
|
</div> |
|
|
|
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
<span slot="footer" |
|
|
|
</span> |
|
|
|
class="dialog-footer"> |
|
|
|
</el-dialog> |
|
|
|
<el-button size="small" |
|
|
|
</div> |
|
|
|
@click="importVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -114,221 +262,287 @@ import util from "@/libs/util"; |
|
|
|
import * as echarts from "echarts"; |
|
|
|
import * as 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, |
|
|
|
method: +this.$route.query.method, |
|
|
|
method: +this.$route.query.method, |
|
|
|
competitionType: +this.$route.query.competitionType, |
|
|
|
competitionType: +this.$route.query.competitionType, |
|
|
|
keyword: "", |
|
|
|
showFile: this.$route.query.showFile === 'true', |
|
|
|
searchTimer: null, |
|
|
|
isCompress: util.isCompress, |
|
|
|
list: [], |
|
|
|
keyword: "", |
|
|
|
multipleSelection: [], |
|
|
|
searchTimer: null, |
|
|
|
page: 1, |
|
|
|
list: [], |
|
|
|
pageSize: 10, |
|
|
|
multipleSelection: [], |
|
|
|
total: 0, |
|
|
|
page: 1, |
|
|
|
totalNumber: 0, // 总人数 |
|
|
|
pageSize: 10, |
|
|
|
avgScore: 0, // 平均分 |
|
|
|
total: 0, |
|
|
|
importVisible: false, |
|
|
|
|
|
|
|
uploadList: [], |
|
|
|
list1: [], |
|
|
|
uploadFaild: false, |
|
|
|
multipleSelection1: [], |
|
|
|
exportCode: '', |
|
|
|
page1: 1, |
|
|
|
headers: { |
|
|
|
total1: 0, |
|
|
|
token: sessionStorage.getItem("token") |
|
|
|
|
|
|
|
}, |
|
|
|
totalNumber: 0, // 总人数 |
|
|
|
statData: {} |
|
|
|
avgScore: 0, // 平均分 |
|
|
|
}; |
|
|
|
importVisible: false, |
|
|
|
|
|
|
|
uploadList: [], |
|
|
|
|
|
|
|
uploadFaild: false, |
|
|
|
|
|
|
|
exportCode: '', |
|
|
|
|
|
|
|
headers: { |
|
|
|
|
|
|
|
token: sessionStorage.getItem("token") |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
statData: {}, |
|
|
|
|
|
|
|
tabs: ['成绩列表', '文件列表'], |
|
|
|
|
|
|
|
active: 0 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
keyword: function (val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mounted () { |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
getData () { |
|
|
|
|
|
|
|
// 文件列表 |
|
|
|
|
|
|
|
if (this.active) { |
|
|
|
|
|
|
|
this.$post(this.api.cCompetitionStageFileList, { |
|
|
|
|
|
|
|
pageNum: this.page1, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
competitionId: this.id, |
|
|
|
|
|
|
|
stageId: this.stageId, |
|
|
|
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
|
|
this.list1 = data.records |
|
|
|
|
|
|
|
this.total1 = data.total |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
} else { // 成绩列表 |
|
|
|
|
|
|
|
this.$post(this.api.stageGradeManagementList, { |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
competitionId: this.id, |
|
|
|
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
|
|
|
stageId: this.stageId, |
|
|
|
|
|
|
|
isNakadai: 1 |
|
|
|
|
|
|
|
}).then(({ data, page }) => { |
|
|
|
|
|
|
|
this.total = page.total |
|
|
|
|
|
|
|
this.list = page.records |
|
|
|
|
|
|
|
this.statData = data |
|
|
|
|
|
|
|
this.avgScore = (+data.avgScore).toFixed(2) |
|
|
|
|
|
|
|
this.totalNumber = data.totalNumber |
|
|
|
|
|
|
|
this.getChart() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
initData () { |
|
|
|
keyword: function(val) { |
|
|
|
this.page = 1 |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
this.getData() |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 查看成绩报告 |
|
|
|
this.getData() |
|
|
|
show (row) { |
|
|
|
|
|
|
|
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
getData() { |
|
|
|
exportData () { |
|
|
|
this.$post(this.api.stageGradeManagementList, { |
|
|
|
// 有勾选,就带上勾选的id |
|
|
|
pageNum: this.page, |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
pageSize: this.pageSize, |
|
|
|
const ids = this.multipleSelection.map(e => e.reportId) |
|
|
|
competitionId: this.id, |
|
|
|
url += `&ids=${ids.toString()}` |
|
|
|
keyWord: this.keyword, |
|
|
|
} |
|
|
|
stageId: this.stageId, |
|
|
|
axios.post(this.api.exportExperimentalResultsInBatch, this.list, { |
|
|
|
isNakadai: 1 |
|
|
|
headers: this.headers, |
|
|
|
}).then(({ data, page }) => { |
|
|
|
responseType: 'blob' |
|
|
|
this.total = page.total |
|
|
|
}).then((res) => { |
|
|
|
this.list = page.records |
|
|
|
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
this.statData = data |
|
|
|
}).catch(res => { }) |
|
|
|
this.avgScore = (+data.avgScore).toFixed(2) |
|
|
|
}, |
|
|
|
this.totalNumber = data.totalNumber |
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
this.getChart() |
|
|
|
exportData1 () { |
|
|
|
}).catch(res => {}) |
|
|
|
// 有勾选,就带上勾选的id |
|
|
|
}, |
|
|
|
let ids |
|
|
|
initData() { |
|
|
|
if (this.multipleSelection1.length) { |
|
|
|
this.page = 1 |
|
|
|
ids = this.multipleSelection1.map(e => e.id) |
|
|
|
this.getData() |
|
|
|
} |
|
|
|
}, |
|
|
|
const data = { |
|
|
|
// 查看成绩报告 |
|
|
|
pageNum: 1, |
|
|
|
show(row) { |
|
|
|
pageSize: 1000, |
|
|
|
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
|
|
|
competitionId: this.id, |
|
|
|
}, |
|
|
|
stageId: this.stageId, |
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
} |
|
|
|
exportData() { |
|
|
|
if (ids) data.ids = ids |
|
|
|
// 有勾选,就带上勾选的id |
|
|
|
axios.post(this.api.derive, data, { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
headers: this.headers, |
|
|
|
const ids = this.multipleSelection.map(e => e.reportId) |
|
|
|
responseType: 'blob' |
|
|
|
url += `&ids=${ids.toString()}` |
|
|
|
}).then((res) => { |
|
|
|
} |
|
|
|
console.log("🚀 ~ file: matchArchList.vue:378 ~ exportData1 ~ res:", res) |
|
|
|
axios.post(this.api.exportExperimentalResultsInBatch, this.list, { |
|
|
|
util.downloadFileDirect(`批量导出.zip`, new Blob([res.data])) |
|
|
|
headers: this.headers, |
|
|
|
}).catch(res => { }) |
|
|
|
responseType: 'blob' |
|
|
|
}, |
|
|
|
}).then((res) => { |
|
|
|
handleDelete (row) { // 删除 |
|
|
|
util.downloadFileDirect(`赛事成绩.xls`,new Blob([res.data])) |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
}).catch(res => {}) |
|
|
|
type: "warning" |
|
|
|
}, |
|
|
|
}).then(() => { |
|
|
|
handleDelete(row) { // 删除 |
|
|
|
this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
ids: [this.method == 2 ? row.scoreId : row.reportId], |
|
|
|
type: "warning" |
|
|
|
competitionId: this.id, |
|
|
|
}).then(() => { |
|
|
|
stageId: row.stageId |
|
|
|
this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
}).then(res => { |
|
|
|
ids: [this.method == 2 ? row.scoreId : row.reportId], |
|
|
|
util.successMsg("删除成功"); |
|
|
|
competitionId: this.id, |
|
|
|
this.getData(); |
|
|
|
stageId: row.stageId |
|
|
|
}).catch(res => { |
|
|
|
}).then(res => { |
|
|
|
}); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
}).catch(() => { |
|
|
|
this.getData(); |
|
|
|
}); |
|
|
|
}).catch(res => { |
|
|
|
}, |
|
|
|
}); |
|
|
|
delAllData () { // 批量删除 |
|
|
|
}).catch(() => { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
}); |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
}, |
|
|
|
type: "warning" |
|
|
|
delAllData() { // 批量删除 |
|
|
|
}).then(() => { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
return this.method == 2 ? item.scoreId : item.reportId |
|
|
|
type: "warning" |
|
|
|
}); |
|
|
|
}).then(() => { |
|
|
|
this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
ids, |
|
|
|
return this.method == 2 ? item.scoreId : item.reportId |
|
|
|
competitionId: this.id, |
|
|
|
}); |
|
|
|
stageId: this.stageId |
|
|
|
this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
}).then(res => { |
|
|
|
ids, |
|
|
|
this.multipleSelection = []; |
|
|
|
competitionId: this.id, |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
stageId: this.stageId |
|
|
|
util.successMsg("删除成功"); |
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectionChange(val) { // 多选 |
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange(val) { // 切换分页 |
|
|
|
|
|
|
|
this.page = val; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectionChange (val) { // 多选 |
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange (val) { // 切换分页 |
|
|
|
|
|
|
|
this.page = val; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleSelectionChange1 (val) { // 多选 |
|
|
|
|
|
|
|
this.multipleSelection1 = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange1 (val) { // 切换分页 |
|
|
|
|
|
|
|
this.page1 = val; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getChart () { // 初始化折线图 |
|
|
|
|
|
|
|
const data = [] |
|
|
|
|
|
|
|
const { statData } = this |
|
|
|
|
|
|
|
for (let i = 1; i <= 10; i++) { |
|
|
|
|
|
|
|
data.push(statData['num' + i]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let myChart = echarts.init(document.getElementById("chart")); |
|
|
|
|
|
|
|
myChart.setOption({ |
|
|
|
|
|
|
|
title: { text: "实验分数分布图" }, |
|
|
|
|
|
|
|
tooltip: {}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
name: "分数", |
|
|
|
|
|
|
|
type: "category", |
|
|
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
|
|
interval: 10, |
|
|
|
|
|
|
|
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"] |
|
|
|
}, |
|
|
|
}, |
|
|
|
getChart() { // 初始化折线图 |
|
|
|
yAxis: { |
|
|
|
const data = [] |
|
|
|
name: "人数", |
|
|
|
const { statData } = this |
|
|
|
type: "value", |
|
|
|
for (let i = 1; i <= 10; i++) { |
|
|
|
interval: 1 |
|
|
|
data.push(statData['num' + i]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let myChart = echarts.init(document.getElementById("chart")); |
|
|
|
|
|
|
|
myChart.setOption({ |
|
|
|
|
|
|
|
title: { text: "实验分数分布图" }, |
|
|
|
|
|
|
|
tooltip: {}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
name: "分数", |
|
|
|
|
|
|
|
type: "category", |
|
|
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
|
|
interval: 10, |
|
|
|
|
|
|
|
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
name: "人数", |
|
|
|
|
|
|
|
type: "value", |
|
|
|
|
|
|
|
interval: 1 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [{ |
|
|
|
|
|
|
|
data, |
|
|
|
|
|
|
|
type: "line", |
|
|
|
|
|
|
|
areaStyle: {}, |
|
|
|
|
|
|
|
color: ["#8191fd"] |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
|
|
|
|
batchImport() { |
|
|
|
|
|
|
|
this.importVisible = true |
|
|
|
|
|
|
|
this.uploadList = [] |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 模板下载 |
|
|
|
|
|
|
|
download() { |
|
|
|
|
|
|
|
location.href = this.api.gradeImport |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 上传文件 |
|
|
|
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
|
|
|
util.warningMsg( |
|
|
|
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 下载失败文件 |
|
|
|
|
|
|
|
showFaild() { |
|
|
|
|
|
|
|
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, { |
|
|
|
|
|
|
|
headers: this.headers, |
|
|
|
|
|
|
|
responseType: 'blob' |
|
|
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
|
|
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data])) |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
if (res.status === 200) { |
|
|
|
|
|
|
|
if (res.data.exportCode) { |
|
|
|
|
|
|
|
this.exportCode = res.data.exportCode |
|
|
|
|
|
|
|
this.uploadFaild = true |
|
|
|
|
|
|
|
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadError(err, file, fileList) { |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
|
|
|
type: "error", |
|
|
|
|
|
|
|
center: true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
|
|
|
this.uploadList = fileList |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSure() { |
|
|
|
series: [{ |
|
|
|
this.importVisible = false |
|
|
|
data, |
|
|
|
this.getData() |
|
|
|
type: "line", |
|
|
|
|
|
|
|
areaStyle: {}, |
|
|
|
|
|
|
|
color: ["#8191fd"] |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
|
|
|
|
batchImport () { |
|
|
|
|
|
|
|
this.importVisible = true |
|
|
|
|
|
|
|
this.uploadList = [] |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 模板下载 |
|
|
|
|
|
|
|
download () { |
|
|
|
|
|
|
|
location.href = this.api.gradeImport |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 上传文件 |
|
|
|
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
|
|
|
util.warningMsg( |
|
|
|
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 下载失败文件 |
|
|
|
|
|
|
|
showFaild () { |
|
|
|
|
|
|
|
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, { |
|
|
|
|
|
|
|
headers: this.headers, |
|
|
|
|
|
|
|
responseType: 'blob' |
|
|
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
|
|
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data])) |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
if (res.status === 200) { |
|
|
|
|
|
|
|
if (res.data.exportCode) { |
|
|
|
|
|
|
|
this.exportCode = res.data.exportCode |
|
|
|
|
|
|
|
this.uploadFaild = true |
|
|
|
|
|
|
|
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
|
|
|
type: "error", |
|
|
|
|
|
|
|
center: true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleRemove (file, fileList) { |
|
|
|
|
|
|
|
this.uploadList = fileList |
|
|
|
|
|
|
|
this.uploadFaild = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadSure () { |
|
|
|
|
|
|
|
this.importVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// tab回调 |
|
|
|
|
|
|
|
tabChange (i) { |
|
|
|
|
|
|
|
this.active = i |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 预览附件 |
|
|
|
|
|
|
|
preview (item) { |
|
|
|
|
|
|
|
window.open((util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导出文件 |
|
|
|
|
|
|
|
exportFile (item) { |
|
|
|
|
|
|
|
util.downloadFile(item.userName + '-' + item.fileName, item.filePath) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
|
|
|
|
/deep/ .head-card { |
|
|
|
/deep/ .head-card { |
|
|
|
.el-card__body { |
|
|
|
.el-card__body { |
|
|
|
padding-bottom: 0px; |
|
|
|
padding-bottom: 0px; |
|
|
|