赛事相关同步中台

master
yujialong 2 months ago
parent b6568bd97c
commit 9681c32dac
  1. 2
      src/api/index.js
  2. 1
      src/assets/img/right.svg
  3. 1
      src/assets/img/shrink.svg
  4. 1
      src/assets/img/tag-active.svg
  5. 1
      src/assets/img/tag.svg
  6. 1
      src/assets/img/wrong.svg
  7. 50
      src/const/ques.js
  8. 37
      src/libs/util.js
  9. 51
      src/pages/match/manage/matchArch.vue
  10. 428
      src/pages/match/manage/matchArchList.vue
  11. 4
      src/pages/match/manage/matchInfo.vue
  12. 6
      src/pages/match/manage/matchRank.vue
  13. 597
      src/pages/match/manage/otherArchList.vue
  14. 1001
      src/pages/match/manage/theoryReport.vue
  15. 19
      src/pages/match/manage/trialReport.vue
  16. 101
      src/pages/student/list/index.vue
  17. 3
      src/plugins/requests/index.js
  18. 16
      src/router/modules/match.js

@ -182,6 +182,8 @@ export default {
checkTeamStatus: `competition/teamAbnormalInformation/checkTeamStatus`,
queryAbnormalTeam: `competition/teamAbnormalInformation/queryAbnormalTeam`,
viewEventAllocationInformation: `competition/competitionAutomaticAllocationRecord/viewEventAllocationInformation`,
getDetailedExamScores: `exam/exam/paper/getDetailedExamScores`,
exportExamPaperReport: `exam/exam/paper/exportExamPaperReport`,
// 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`,

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723792589398" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5839" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874 150C674.09-50 349.91-50 150 150s-200 524.09 0 724 524.09 200 724 0 200-524.09 0-724zM760.57 440.57l-256 256a80 80 0 0 1-113.14 0l-128-128a80 80 0 0 1 113.14-113.14L448 526.86l199.43-199.43a80 80 0 0 1 113.14 113.14z" fill="#2abd8c" p-id="5840"></path></svg>

After

Width:  |  Height:  |  Size: 593 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723535697263" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5903" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M877.5 565.9l-367.6-340-367.6 340c-22.5 14.5-52.5 14.5-67.5 0-15-21.7-15-50.7 0-65.1L495 117.5c0-7.2 7.5-7.2 15-7.2s7.5 0 15 7.2l420.2 383.3c22.5 21.7 15 50.6 0 65.1-22.7 14.5-52.7 14.5-67.7 0zM494.8 450.1c0-7.2 7.5-7.2 15-7.2s15 0 15 7.2L945 833.4c22.5 21.7 15 50.6 0 65.1-22.5 14.4-52.5 14.4-67.5 0L509.8 558.6 142.2 905.8c-22.5 14.5-52.5 14.5-67.5 0-15-21.7-15-50.7 0-65.1l420.1-390.6z m0 0" fill="#666666" p-id="5904"></path></svg>

After

Width:  |  Height:  |  Size: 766 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723619200843" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7128" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M695.7 118.6H326.9c-58.2 0-105.4 47.2-105.4 105.4v579.6c0 58.2 47.2 105.4 105.4 105.4l184.4-184.4L695.7 909c58.2 0 105.4-47.2 105.4-105.4V224c0-58.2-47.1-105.4-105.4-105.4z" fill="#d81e06" p-id="7129"></path></svg>

After

Width:  |  Height:  |  Size: 545 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723619200843" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7128" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M695.7 118.6H326.9c-58.2 0-105.4 47.2-105.4 105.4v579.6c0 58.2 47.2 105.4 105.4 105.4l184.4-184.4L695.7 909c58.2 0 105.4-47.2 105.4-105.4V224c0-58.2-47.1-105.4-105.4-105.4z" fill="#bfbfbf" p-id="7129"></path></svg>

After

Width:  |  Height:  |  Size: 545 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723792667165" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7415" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M480 64C217.6 64 0 281.6 0 544s217.6 480 480 480 480-217.6 480-480S742.4 64 480 64z m204.8 614.4c19.2 19.2 19.2 44.8 0 64-19.2 19.2-44.8 19.2-64 0L486.4 608 345.6 748.8c-19.2 19.2-51.2 19.2-70.4 0-19.2-19.2-19.2-51.2 0-70.4L416 537.6 281.6 403.2c-19.2-19.2-19.2-44.8 0-64 19.2-19.2 44.8-19.2 64 0L480 473.6l140.8-140.8c19.2-19.2 51.2-19.2 70.4 0 19.2 19.2 19.2 51.2 0 70.4L550.4 544l134.4 134.4z" fill="#e75050" p-id="7416"></path></svg>

After

Width:  |  Height:  |  Size: 768 B

@ -0,0 +1,50 @@
export default {
difficults: [
{
id: 'basic',
name: '基础',
coefficient: 0.2, // 难度系数,试卷里计算试卷难度专用
theme: 'success',
},
{
id: 'easy',
name: '普通',
coefficient: 0.4,
theme: '',
},
{
id: 'medium',
name: '较难',
coefficient: 0.6,
theme: 'warning',
},
{
id: 'hard',
name: '难',
coefficient: 0.8,
theme: 'danger',
},
],
questionTypes: [
{
id: 'single_choice',
name: '单选题'
},
{
id: 'multiple_choice',
name: '多选题'
},
{
id: 'judgement',
name: '判断题'
},
{
id: 'fill_blank',
name: '填空题'
},
{
id: 'essay',
name: '问答题'
},
],
}

@ -220,6 +220,43 @@ const util = {
resolve(new Date(data.currentTime))
})
},
// 阿拉伯数字转化为中文数字
arabicToChinese (num) {
const arr1 = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const arr2 = ['', '十', '百', '千', '万', '亿', '点', ''];
const a = `${num}`.replace(/(^0*)/g, '').split('.');
let k = 0;
let re = '';
for (let i = a[0].length - 1; i >= 0; i--) {
switch (k) {
case 0:
re = arr2[7] + re;
break;
case 4:
if (!new RegExp(`0{4}//d{${a[0].length - i - 1}}$`).test(a[0])) re = arr2[4] + re;
break;
case 8:
re = arr2[5] + re;
arr2[7] = arr2[5];
k = 0;
break;
default:
}
if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = arr1[0] + re;
if (a[0].charAt(i) != 0) re = arr1[a[0].charAt(i)] + arr2[k % 4] + re;
k++;
}
return num > 9 && num < 20 ? re.slice(1) : re;
},
// 阿拉伯数字转化为英文字母
numToLetter (num) {
let result = ''
if (num > 26) {
result += numberToLetter((num / 26) >> 0 - 1)
}
result += String.fromCharCode(65 + (num % 26))
return result
},
};
export default util;

@ -1,53 +1,29 @@
<template>
<!-- 报名人员 -->
<div class="page-content"
style="padding: 24px">
<el-table ref="table"
:data="list"
class="table"
stripe
header-align="center"
row-key="stageId">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<div class="page-content" style="padding: 24px">
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="stageId">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="stageName"
label="阶段名称"
align="center"></el-table-column>
<el-table-column prop="methodName"
label="比赛方式"
align="center"></el-table-column>
<el-table-column prop="founderName"
label="比赛形式"
align="center">
<el-table-column prop="stageName" label="阶段名称" align="center"></el-table-column>
<el-table-column prop="methodName" label="比赛方式" align="center"></el-table-column>
<el-table-column prop="founderName" label="比赛形式" align="center">
<template slot-scope="scope">
{{ scope.row.competitionType ? '团队赛' : '个人赛' }}
</template>
</el-table-column>
<el-table-column prop="ruleName"
label="赛制"
align="center"></el-table-column>
<el-table-column prop="status"
label="状态"
align="center"></el-table-column>
<el-table-column label="竞赛起止时间"
width="290"
align="center">
<el-table-column prop="ruleName" label="赛制" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center"></el-table-column>
<el-table-column label="竞赛起止时间" width="290" align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="260">
<el-table-column label="操作" align="center" width="260">
<template slot-scope="scope">
<el-button type="primary"
@click="toRank(scope.row, scope.$index)">排名</el-button>
<el-button type="primary" @click="toRank(scope.row, scope.$index)">排名</el-button>
<el-button @click="toArch(scope.row, scope.$index)">成绩管理</el-button>
</template>
</el-table-column>
@ -56,7 +32,6 @@
</template>
<script>
import util from "@/libs/util";
import Const from '@/const/match'
export default {
name: "matchArch",
@ -125,7 +100,7 @@ export default {
this.$store.commit('match/setReferrer', this.$route.fullPath)
const cur = this.form.competitionStage[i]
const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles)
this.$router.push(`archList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`)
this.$router.push(`${cur.method === 2 ? 'otherArchList' : 'matchArchList'}?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`)
}
}
};
@ -136,10 +111,12 @@ export default {
font-size: 16px;
color: #333;
}
.line {
display: flex;
justify-content: space-around;
align-items: center;
span {
margin-right: 30px;
}

@ -1,290 +1,129 @@
<template>
<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">
<el-page-header @back="back"
content="成绩管理"></el-page-header>
<el-page-header @back="back" content="成绩管理"></el-page-header>
</div>
</el-card>
<div v-loading="loading">
<el-card v-if="method != 2"
shadow="hover"
class="m-b-20">
<el-card v-if="method != 2" shadow="hover" class="m-b-20">
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">已参加/应参加人数</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }}</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }}
</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
<p class="name">平均分</p>
<p class="val">{{ (+statData.avgScore).toFixed(2) }}</p>
</div>
<div class="item">
<p class="name">最高分</p>
<p class="val">{{ statData.maxScore }}
</p>
</div>
<div class="item">
<p class="name">最低分</p>
<p class="val">{{ statData.minScore }}</p>
</div>
<div class="chart"
id="chart"></div>
</div>
<div class="chart" id="chart"></div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div v-if="showFile"
class="tabs m-b-20">
<a class="item"
v-for="(item, i) in tabs"
:key="i"
:class="{active: i === active}"
@click="tabChange(i)">{{ item }}</a>
<el-card shadow="hover" class="m-b-20">
<div class="tabs m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: item.id === active }"
@click="tabChange(item.id)">{{ item.name }}</a>
</div>
<div class="flex-between m-b-20">
<div>
<el-input size="small"
placeholder="请输入学校/学生姓名"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable
style="width: 300px"></el-input>
</div>
<div v-if="!active">
<el-button v-if="method == 2"
type="primary"
@click="batchImport">上传成绩</el-button>
<el-button type="primary"
:disabled="!!multipleSelection.find(e => method != 2 && !e.reportId)"
@click="delAllData">批量删除</el-button>
<el-button type="primary"
:loading="exporting"
@click="exportData">{{ exporting ? '正在导出' : '批量导出' }}</el-button>
</div>
<div v-else>
<el-button type="primary"
:loading="exporting1"
@click="exportData1">{{ exporting1 ? '正在导出' : '批量导出' }}</el-button>
<el-button type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' : '批量导出'
}}</el-button>
</div>
</div>
<template v-if="!active">
<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">
<el-table :data="list" class="table" :key="1" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<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="100"
align="center"></el-table-column>
<el-table-column prop="realSchool"
label="学生所在院校"
min-width="100"
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"
<el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" 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="workNumber"
label="学号"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="score"
label="分数"
width="90"
align="center">
<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">
<template slot-scope="scope">
{{ scope.row.submitTime ? scope.row.score : '--' }}
</template>
</el-table-column>
<el-table-column prop="timeSum"
label="耗时"
width="90"
align="center">
<el-table-column prop="timeSum" label="耗时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }}
</template>
</el-table-column>
<el-table-column prop="submitTime"
label="提交时间"
min-width="150"
align="center">
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.submitTime || '--' }}
</template>
</el-table-column>
<el-table-column label="状态"
width="100"
align="center">
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="method != 2 && scope.row.reportId"
type="text"
<el-button v-if="method != 2 && scope.row.reportId" type="text"
@click="show(scope.row)">查看成绩报告</el-button>
<el-button v-if="scope.row.reportId"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-if="scope.row.reportId" 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 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 prop="realSchool"
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="fileType"
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="200">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)"
type="text"
@click="preview(scope.row)">预览文件</el-button>
<el-button type="primary"
size="mini"
:loading="scope.row.loading"
@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>
</div>
<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"
@close="cancelUpload">
<div style="text-align: center">
<template v-if="!uploadFaild">
<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>
<el-upload ref="upload"
name="file"
class="import-file"
accept=".xls,.xlsx"
:before-upload="beforeUpload"
: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"
:disabled="uploading"
:data="{
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload"
: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" :disabled="uploading" :data="{
competitionId: this.id,
stageId: this.stageId,
systemId: 0
}">
<el-button type="primary"
:loading="uploading"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i
class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</template>
<template v-else>
<p style="margin-bottom: 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div>
<span v-if="uploading"
slot="footer"
class="dialog-footer">
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
@ -292,11 +131,10 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import * as echarts from "echarts";
import axios from 'axios';
import Zip from '@/libs/zip'
import Setting from '@/setting'
import Util from '@/libs/util'
import * as echarts from "echarts"
import axios from 'axios'
export default {
data () {
return {
@ -304,8 +142,7 @@ export default {
stageId: +this.$route.query.stageId,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
showFile: this.$route.query.showFile === 'true',
isCompress: util.isCompress,
isCompress: Util.isCompress,
keyword: this.$route.query.keyword || '',
searchTimer: null,
list: [],
@ -326,11 +163,24 @@ export default {
uploading: false,
faildData: null,
headers: {
token: util.local.get(Setting.tokenKey)
token: Util.local.get(Setting.tokenKey)
},
statData: {
avgScore: 0,
maxScore: 0,
minScore: 0,
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0,
tabs: [
{
id: 1,
name: '已提交'
},
{
id: 0,
name: '未提交'
}
],
active: 1,
loading: false,
exporting: false,
exporting1: false,
@ -341,7 +191,7 @@ export default {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'archList',
path: '/matchArchList',
query: {
...this.$route.query,
keyword: val
@ -357,51 +207,20 @@ export default {
methods: {
async getData () {
this.loading = true
//
if (this.active) {
const { data } = await this.$post(this.api.cCompetitionStageFileList, {
pageNum: this.page1,
pageSize: this.pageSize,
competitionId: this.id,
stageId: this.stageId,
keyWord: this.keyword,
})
data.records.forEach(e => {
e.loading = false
e.fileType = '其他'
if (util.isVideo(e.fileFormat)) {
e.fileType = '视频'
} else if (util.isAudio(e.fileFormat)) {
e.fileType = '音频'
} else if (util.isImg(e.fileFormat)) {
e.fileType = '图片'
} else if (util.isDoc(e.fileFormat)) {
e.fileType = '文档'
} else if (util.isCompress(e.fileFormat)) {
e.fileType = '压缩包'
} else if (e.fileType === 'pdf') {
e.fileType = 'pdf'
}
})
this.list1 = data.records
this.total1 = data.total
this.loading = false
} else { //
const { data, page } = await this.$post(this.api.stageGradeManagementList, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
stageId: this.stageId,
isNakadai: 1
isNakadai: 1,
participatingState: this.active,
})
this.loading = false
this.total = page.total
this.list = page.records
this.statData = data
this.avgScore = (+data.avgScore).toFixed(2)
this.method != 2 && this.getChart()
}
this.getChart()
},
initData () {
this.page = 1
@ -409,7 +228,7 @@ export default {
},
//
show (row) {
this.$router.push(`/match/report?reportId=${row.reportId}`)
this.$router.push(`${this.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`)
},
// ()
async exportData () {
@ -421,49 +240,41 @@ export default {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
} else {
} else if (this.list.length) {
const res = await axios.post(this.api.allExperimentalResultsAreDerived, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
isNakadai: 1,
stageId: this.stageId,
participatingState: this.active,
}, {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
}
}
},
// ()
exportData1 () {
this.exporting1 = true
let list = this.list1
if (this.multipleSelection1.length) {
list = this.multipleSelection1
}
Zip('批量导出', list, () => {
this.exporting1 = false
async handleDelete (row) { //
await this.$confirm(`< p > 确认要删除【${row.userName}】的成绩记录吗?</p > <p style="color: #f56c6c;">删除后成绩数据不可恢复,自动变为未提交</p>`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
})
},
handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteContestGrade, {
await this.$post(this.api.batchDeleteContestGrade, {
ids: [this.method == 2 ? row.scoreId : row.reportId],
competitionId: this.id,
stageId: this.stageId
}).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => { });
})
Util.successMsg("删除成功")
this.getData()
},
delAllData () { //
const list = this.multipleSelection
@ -485,7 +296,7 @@ export default {
await this.$post(this.api.batchDeleteContestGrade, data)
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
Util.successMsg("删除成功");
this.getData();
}).catch(() => { });
},
@ -494,7 +305,7 @@ export default {
},
handleCurrentChange (val) { //
this.$router.push({
path: 'archList',
path: '/matchArchList',
query: {
...this.$route.query,
page: val
@ -507,16 +318,8 @@ export default {
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])
}
const { fractionalSegmentCounts: data } = this.statData
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
@ -526,7 +329,7 @@ export default {
type: "category",
boundaryGap: false,
interval: 10,
data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"]
data: data.map(e => e.range)
},
yAxis: {
name: "人数",
@ -534,7 +337,7 @@ export default {
minInterval: 10
},
series: [{
data,
data: data.map(e => e.count),
type: "line",
areaStyle: {},
color: ["#8191fd"]
@ -553,12 +356,12 @@ export default {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data]))
Util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data]))
}).catch(res => { })
},
//
handleExceed (files, fileList) {
util.warningMsg(
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
@ -568,7 +371,7 @@ export default {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
Util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess (res) {
@ -581,14 +384,15 @@ export default {
this.faildData = data
this.uploadFaild = true
} else {
util.successMsg(data.tip, 3000)
Util.successMsg(data.tip, 3000)
this.importVisible = false
}
} else {
util.errorMsg(res.message || '上传失败,请检查数据')
Util.errorMsg(res.message || '上传失败,请检查数据')
}
},
uploadError (err, file, fileList) {
this.uploading = false
this.$message({
message: "上传出错,请重试!",
type: "error",
@ -612,15 +416,16 @@ export default {
this.initData()
this.importVisible = false
},
// tab
tabChange (i) {
this.multipleSelection = []
this.$refs.table.clearSelection()
this.active = i
this.getData()
this.initData()
},
//
preview (item) {
window.open((util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
window.open((Util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
exportFile (item) {
@ -670,7 +475,9 @@ export default {
.nums {
display: flex;
flex-wrap: wrap;
align-items: center;
width: 640px;
margin-right: 20px;
.item:nth-child(1) {
@ -681,6 +488,14 @@ export default {
background-image: url('../../../assets/img/avg.png');
}
.item:nth-child(3) {
background-image: url('../../../assets/img/ach1.png');
}
.item:nth-child(4) {
background-image: url('../../../assets/img/ach2.png');
}
.item {
width: 300px;
min-height: 145px;
@ -705,10 +520,11 @@ export default {
}
.chart {
flex: 1;
width: calc(100% - 660px);
height: 300px;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,

@ -570,9 +570,9 @@ export default {
},
//
show (row) {
this.curRow = row
//
if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row
this.memberVisible = true
if (this.info.teamId) {
this.getMembers()
@ -589,7 +589,7 @@ export default {
},
//
toReport (row) {
this.$router.push(`/match/report?reportId=${row.reportId}`)
this.$router.push(`${this.curRow.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`)
},
}
};

@ -101,7 +101,7 @@
<template v-if="item.accountId">
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.schoolName }}</td>
<td>{{ item.realSchool }}</td>
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
@ -180,7 +180,7 @@ export default {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
index: +this.$route.query.index,
method: this.$route.query.method,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule,
searchTimer: null,
@ -449,7 +449,7 @@ export default {
},
//
toReport (row) {
this.$router.push(`/match/report?reportId=${row.reportId}`)
this.$router.push(`/match/${this.method !== 1 ? 'trialReport' : 'theoryReport'}?reportId=${row.reportId}`)
},
handleSelectionChange (val) { //
this.multipleSelection = val;

@ -0,0 +1,597 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="back" content="成绩管理"></el-page-header>
</div>
</el-card>
<div v-loading="loading">
<el-card v-if="method != 2" shadow="hover" class="m-b-20">
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">已参加/应参加人数</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }}
</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
</div>
</div>
<div class="chart" id="chart"></div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div v-if="showFile" class="tabs m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i === active }" @click="tabChange(i)">{{
item }}</a>
</div>
<div class="flex-between m-b-20">
<div>
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable
style="width: 300px"></el-input>
</div>
<div v-if="!active">
<el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button>
<el-button type="primary" :disabled="!!multipleSelection.find(e => method != 2 && !e.reportId)"
@click="delAllData">批量删除</el-button>
<el-button type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' : '批量导出'
}}</el-button>
</div>
<div v-else>
<el-button type="primary" :loading="exporting1" @click="exportData1">{{ exporting1 ? '正在导出' : '批量导出'
}}</el-button>
</div>
</div>
<template v-if="!active">
<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="100" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" 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">
<template slot-scope="scope">
{{ scope.row.submitTime ? scope.row.score : '--' }}
</template>
</el-table-column>
<el-table-column prop="timeSum" label="耗时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }}
</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.submitTime || '--' }}
</template>
</el-table-column>
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="method != 2 && scope.row.reportId" type="text"
@click="show(scope.row)">查看成绩报告</el-button>
<el-button v-if="scope.row.reportId" 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 prop="realSchool" 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="fileType" 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="200">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)" type="text"
@click="preview(scope.row)">预览文件</el-button>
<el-button type="primary" size="mini" :loading="scope.row.loading"
@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>
</div>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"
@close="cancelUpload">
<div style="text-align: center">
<template v-if="!uploadFaild">
<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="upload" name="file" class="import-file" accept=".xls,.xlsx" :before-upload="beforeUpload"
: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" :disabled="uploading" :data="{
competitionId: this.id,
stageId: this.stageId,
systemId: 0
}">
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i
class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</template>
<template v-else>
<p style="margin-bottom: 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div>
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import * as echarts from "echarts";
import axios from 'axios';
import Zip from '@/libs/zip'
export default {
data () {
return {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
showFile: this.$route.query.showFile === 'true',
isCompress: util.isCompress,
keyword: this.$route.query.keyword || '',
searchTimer: null,
list: [],
multipleSelection: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
list1: [],
multipleSelection1: [],
page1: 1,
total1: 0,
avgScore: 0, //
importVisible: false,
uploadList: [],
uploadFaild: false,
uploading: false,
faildData: null,
headers: {
token: util.local.get(Setting.tokenKey)
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0,
loading: false,
exporting: false,
exporting1: false,
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'otherArchList',
query: {
...this.$route.query,
keyword: val
}
})
this.initData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
async getData () {
this.loading = true
//
if (this.active) {
const { data } = await this.$post(this.api.cCompetitionStageFileList, {
pageNum: this.page1,
pageSize: this.pageSize,
competitionId: this.id,
stageId: this.stageId,
keyWord: this.keyword,
})
data.records.forEach(e => {
e.loading = false
e.fileType = '其他'
if (util.isVideo(e.fileFormat)) {
e.fileType = '视频'
} else if (util.isAudio(e.fileFormat)) {
e.fileType = '音频'
} else if (util.isImg(e.fileFormat)) {
e.fileType = '图片'
} else if (util.isDoc(e.fileFormat)) {
e.fileType = '文档'
} else if (util.isCompress(e.fileFormat)) {
e.fileType = '压缩包'
} else if (e.fileType === 'pdf') {
e.fileType = 'pdf'
}
})
this.list1 = data.records
this.total1 = data.total
this.loading = false
} else { //
const { data, page } = await this.$post(this.api.stageGradeManagementList, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
stageId: this.stageId,
isNakadai: 1
})
this.loading = false
this.total = page.total
this.list = page.records
this.statData = data
this.avgScore = (+data.avgScore).toFixed(2)
this.method != 2 && this.getChart()
}
},
initData () {
this.page = 1
this.getData()
},
//
show (row) {
this.$router.push(`/match/trialReport?reportId=${row.reportId}`)
},
// ()
async exportData () {
if (this.list.length) {
this.exporting = true
//
if (this.multipleSelection.length) {
const res = await axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
} else {
const res = await axios.post(this.api.allExperimentalResultsAreDerived, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
isNakadai: 1,
stageId: this.stageId,
}, {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
}
}
},
// ()
exportData1 () {
this.exporting1 = true
let list = this.list1
if (this.multipleSelection1.length) {
list = this.multipleSelection1
}
Zip('批量导出', list, () => {
this.exporting1 = false
})
},
handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteContestGrade, {
ids: [this.method == 2 ? row.scoreId : row.reportId],
competitionId: this.id,
stageId: this.stageId
}).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => { });
},
delAllData () { //
const list = this.multipleSelection
this.$confirm(list.length ? '该项目下的所有成绩报告将会删除,是否继续?' : '是否确定删除列表所有成绩数据?', "提示", {
type: "warning"
}).then(async () => {
let ids = []
if (list.length) {
ids = list.map(item => {
return this.method == 2 ? item.scoreId : item.reportId
});
ids = ids.filter(e => e)
}
const data = {
competitionId: this.id,
stageId: this.stageId
}
if (list.length) data.ids = ids
await this.$post(this.api.batchDeleteContestGrade, data)
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(() => { });
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.$router.push({
path: 'otherArchList',
query: {
...this.$route.query,
page: 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", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"]
},
yAxis: {
name: "人数",
type: "value",
minInterval: 10
},
series: [{
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]
}]
});
},
//
batchImport () {
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
//
download () {
axios.get(`${this.api.gradeDownloadExcel}?competitionId=${this.id}&stageId=${this.stageId}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data]))
}).catch(res => { })
},
//
handleExceed (files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild () {
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.faildData.exportCode}&competitionType=${this.faildData.competitionType}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess (res) {
this.uploading = false
this.uploadFaild = false
if (res.status === 200) {
this.initData()
const { data } = res
if (data.exportCode) {
this.faildData = data
this.uploadFaild = true
} else {
util.successMsg(data.tip, 3000)
this.importVisible = false
}
} else {
util.errorMsg(res.message || '上传失败,请检查数据')
}
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeUpload (file) {
this.uploading = true
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleRemove (file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
cancelUpload () {
this.uploading = false
if (this.$refs.upload) this.$refs.upload.abort()
this.keyword = ''
this.initData()
this.importVisible = false
},
// 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) {
item.loading = true
const url = item.filePath
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = "blob"
x.onload = function (e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement("a")
a.href = url
a.download = item.userName + '-' + item.fileName
a.click()
item.loading = false
}
x.send()
},
back () {
this.$router.push(this.$store.state.match.referrer)
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .head-card {
.el-card__body {
padding-bottom: 0px;
.el-tabs__header {
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__item {
font-size: 18px;
}
}
}
}
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
margin-right: 20px;
.item:nth-child(1) {
background-image: url('../../../assets/img/total.png');
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item {
width: 300px;
min-height: 145px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background-size: 100% 100%;
background-repeat: no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
}
.chart {
flex: 1;
height: 300px;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -81,7 +81,7 @@
</template>
</el-table-column>
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column>
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150">
<el-table-column v-if="isLc" prop="judgmentName" label="考核点" align="center" width="150">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span>
@ -157,7 +157,7 @@ export default {
editing: false,
loadIns: null,
loading: false,
project: false,
isLc: false,
userScores: []
};
},
@ -169,8 +169,6 @@ export default {
this.loading = true
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => {
this.form = report
this.expData = userScores
this.project = this.expData.find(e => e.lcRuleRecords) // lcRuleRecords
let form = this.form;
this.infoData = {
workNumber: form.workNumber,
@ -183,17 +181,18 @@ export default {
className: form.className,
userName: form.userName
}
const data = report.data
this.userScores = userScores
const { data } = report
// data使
if (!data) {
this.expData = userScores
this.userScores = userScores
this.handleList(userScores)
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => { }).catch(err => { })
} else {
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
this.handleList(JSON.parse(data))
}
}).catch(res => {
this.loading = false
@ -201,8 +200,8 @@ export default {
},
//
handleList (list) {
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.project) {
this.isLc = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.isLc) {
list.map(e => {
e.assessmentPoint = ''
e.referenceAnswer = ''
@ -232,7 +231,7 @@ export default {
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '')
}
form.purpose = form.purpose.replace(/<[^>]+>/g, '')
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
this.$post(this.isLc ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {

@ -185,7 +185,7 @@
</template>
<script>
import util from "@/libs/util";
import Util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
import { mapState } from "vuex";
@ -296,6 +296,7 @@ export default {
isAdd: true,
studentVisible: false,
originWorkNumber: '',
workNumberReapeat: false,
phoneRepeat: false,
emailRepeat: false,
@ -308,7 +309,7 @@ export default {
uploadFaild: false,
exportCode: "",
headers: {
token: util.local.get(Setting.tokenKey)
token: Util.local.get(Setting.tokenKey)
},
disableds: false,
submiting: false //
@ -352,7 +353,7 @@ export default {
this.studentType = null;
this.architectureId = data.id;
this.orgLevel = data.level;
util.debounce(this.getOrgStudentData(), 1000);
Util.debounce(this.getOrgStudentData(), 1000);
},
handleAdd (node, data) { //
this.orgVisible = true;
@ -419,7 +420,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteOrg}?id=${id}&level=${level}`).then(res => {
util.successMsg("删除成功");
Util.successMsg("删除成功");
this.handleClose();
this.handleRefresh();
}).catch(res => {
@ -438,16 +439,16 @@ export default {
if (this.isAddOrg) {
//
this.$post(this.api.saveOrg, this.orgForm).then(res => {
util.successMsg("新增成功!");
Util.successMsg("新增成功!");
this.handleClose();
this.handleRefresh();
}).catch(err => {
});
} else {
if (cas.length === 1 && this.labelName === '班级名称') return util.errorMsg('请选择年级!')
if (cas.length === 1 && this.labelName === '班级名称') return Util.errorMsg('请选择年级!')
//
this.$post(this.api.updateOrg, this.orgForm).then(res => {
util.successMsg("编辑成功!");
Util.successMsg("编辑成功!");
this.handleClose();
this.handleRefresh();
this.getOrgStudentData()
@ -587,7 +588,7 @@ export default {
await this.$post(`${this.api.delStudent}?accountIds=${list.map(e => e.accountId).toString()}`)
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
Util.successMsg("删除成功");
if (this.studentType) {
this.getData();
} else {
@ -603,7 +604,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(`${this.api.delStudent}?accountIds=${row.accountId}`).then(res => {
util.successMsg("删除成功");
Util.successMsg("删除成功");
if (this.studentType) {
this.getData();
} else {
@ -619,7 +620,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(`${this.api.removeStudent}?classId=${this.currentClassId}&stuAccountId=${row.accountId}`).then(res => {
util.successMsg("移除成功");
Util.successMsg("移除成功");
if (this.studentType) {
this.getData();
} else {
@ -633,7 +634,7 @@ export default {
resetPassword (row) { //
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => {
util.successMsg("重置成功");
Util.successMsg("重置成功");
}).catch(res => {
});
}).catch(() => {
@ -642,7 +643,7 @@ export default {
switchOff (row) { //
let isEnable = row.isEnable === 0 ? 0 : 1;
this.$get(`${this.api.updateAccountEnable}?id=${row.accountId}&isEnable=${isEnable}`).then(res => {
util.successMsg("更新状态成功");
Util.successMsg("更新状态成功");
if (this.studentType) {
this.getData();
} else {
@ -656,15 +657,15 @@ export default {
this.showTree = true;
this.studentVisible = true;
},
editStudent (row, isDetail) { // /
async editStudent (row, isDetail) { // /
this.isAdd = false;
this.isDetail = isDetail;
this.showTree = false;
this.studentVisible = true;
this.$post(`${this.api.getStudentInfoByAccountId}?stuAccountId=${row.accountId}`).then(res => {
this.form = res.data;
this.showTree = true;
}).catch(res => { });
const { data } = await this.$post(`${this.api.getStudentInfoByAccountId}?stuAccountId=${row.accountId}`)
this.form = data
this.originWorkNumber = data.workNumber
this.showTree = true
},
//
renderAccount () {
@ -672,15 +673,19 @@ export default {
// id-id-schoolId-workNumber
form.account = `${Setting.platformId}-1-${this.schoolId}-${form.workNumber}`
},
workNumberChange () {
const form = this.form
async workNumberChange () {
const { form, isAdd, originWorkNumber: origin } = this
const { workNumber } = form
//
if (workNumber && this.isAdd && /^[A-Za-z0-9]*$/.test(workNumber)) {
this.$post(`${this.api.getDetailByAccount}?workNumber=${workNumber}&platformId=${Setting.platformId}&type=1`).then(({ data }) => {
if (workNumber && /^[A-Za-z0-9]*$/.test(workNumber)) {
//
if (origin === workNumber && !isAdd) {
this.workNumberReapeat = false
} else {
const { data } = await this.$post(`${this.api.getDetailByAccount}?workNumber=${workNumber}&platformId=${Setting.platformId}&type=1`)
if (data) {
this.showTree = true;
const classId = data.classList.map(e => e.id).toString();
if (isAdd) {
this.showTree = true
const classId = data.classList.map(e => e.id).toString()
this.form = data
this.form.classId = classId
this.renderAccount()
@ -692,13 +697,20 @@ export default {
}
this.$refs.form.clearValidate()
} else {
Util.errorMsg('该学生学号已存在')
this.workNumberReapeat = true
}
} else {
if (isAdd) {
//
this.form = JSON.parse(JSON.stringify(this.originForm))
this.form.workNumber = workNumber
this.renderAccount()
this.$refs.classTree.setCheckedKeys([])
}
}).catch(res => { })
this.workNumberReapeat = false
}
}
} else {
this.renderAccount()
}
@ -706,7 +718,7 @@ export default {
phoneChange () {
let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.form.phone)) {
let url = "";
let url = ''
if (this.isAdd && !this.form.accountId) {
url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`;
} else {
@ -791,7 +803,7 @@ export default {
});
},
saveData (type) { // /
this.$refs.form.validate((valid) => {
this.$refs.form.validate(async (valid) => {
if (valid) {
if (this.submiting) return false
let nodes = this.$refs.classTree.getCheckedNodes();
@ -800,12 +812,21 @@ export default {
if (i.level === 3) {
tempArr.push(i.id);
}
});
this.form.classId = tempArr.toString() || 1
if (this.form.accountId) {
})
const { form } = this
form.classId = tempArr.toString() || 1
if (form.accountId) {
this.submiting = true
this.$post(this.api.modifyStudent, this.form).then(res => {
util.successMsg("编辑成功!");
if (this.originWorkNumber !== form.workNumber) {
const { data } = await this.$post(`${this.api.getDetailByAccount}?workNumber=${form.workNumber}&platformId=${Setting.platformId}&type=1`)
if (data) {
this.submiting = false
return Util.errorMsg('该学生学号已存在')
}
}
this.$post(this.api.modifyStudent, form).then(res => {
Util.successMsg("编辑成功!");
if (type) {
this.resetStudent();
} else {
@ -825,13 +846,13 @@ export default {
}, 2000)
})
} else {
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在");
if (this.phoneRepeat) return util.warningMsg("该手机号已存在");
if (this.emailRepeat) return util.warningMsg("该邮箱已存在");
if (this.workNumberReapeat) return Util.warningMsg("该学生学号已存在");
if (this.phoneRepeat) return Util.warningMsg("该手机号已存在");
if (this.emailRepeat) return Util.warningMsg("该邮箱已存在");
this.submiting = true
this.form.uniqueIdentification = new Date().getTime();
this.$post(this.api.addStudent, this.form).then(res => {
util.successMsg("新增成功!");
Util.successMsg("新增成功!");
if (type) {
this.resetStudent();
} else {
@ -907,7 +928,7 @@ export default {
location.href = this.api.studentTemplate;
},
handleExceed (files, fileList) { //
util.warningMsg(
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
@ -921,13 +942,13 @@ export default {
this.exportCode = res.data.exportCode;
this.uploadFaild = true;
}
util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`);
Util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`);
this.handleRefresh();
util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`);
Util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`);
this.getClassTreeData('', '1', '')
} else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据");
res.message ? Util.errorMsg(res.message) : Util.errorMsg("上传失败,请检查数据");
}
},
uploadError (err, file, fileList) {

@ -48,9 +48,8 @@ service.interceptors.response.use(
} else if (!res.status) {
return Promise.resolve(res).catch(e => { });
} else {
Util.errorMsg(res.message);
res.message && Util.errorMsg(res.message)
return Promise.reject(res)
// return Promise.resolve(res).catch(e => {});
}
},
// 服务器状态码不是200的情况

@ -38,18 +38,28 @@ export default {
meta: { title: "通知公告" }
},
{
path: 'archList',
path: 'matchArchList',
component: () => import('@/pages/match/manage/matchArchList'),
meta: { title: '成绩管理' }
},
{
path: 'otherArchList',
component: () => import('@/pages/match/manage/otherArchList'),
meta: { title: '成绩管理' }
},
{
path: 'rank',
component: () => import('@/pages/match/manage/matchRank'),
meta: { title: '排名管理' }
},
{
path: 'report',
component: () => import( '@/pages/match/manage/matchReport'),
path: 'trialReport',
component: () => import('@/pages/match/manage/trialReport'),
meta: { title: '实验报告' }
},
{
path: 'theoryReport',
component: () => import('@/pages/match/manage/theoryReport'),
meta: { title: '实验报告' }
},
{

Loading…
Cancel
Save