|
|
|
@ -40,39 +40,88 @@ |
|
|
|
|
@click="tabChange(item.id)">{{ item.name }}</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
|
<div class="tool flex-between"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>省份</label> |
|
|
|
|
<el-select v-model="filter.provinceId" filterable clearable placeholder="请选择省份" @change="provinceChange" |
|
|
|
|
@clear="clearProvince"> |
|
|
|
|
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName" |
|
|
|
|
:value="item.provinceId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>城市</label> |
|
|
|
|
<el-select v-model="filter.cityId" filterable clearable placeholder="请选择城市" :disabled="!filter.provinceId" |
|
|
|
|
@change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>学校</label> |
|
|
|
|
<el-select v-model="filter.realSchoolId" clearable filterable placeholder="请选择学校" @change="initData"> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="active"> |
|
|
|
|
<label>评阅状态</label> |
|
|
|
|
<el-select v-model="filter.reviewStatus" clearable placeholder="请选择评阅状态" @change="initData"> |
|
|
|
|
<el-option value="待评阅"></el-option> |
|
|
|
|
<el-option value="已评阅"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<el-input size="small" placeholder="请输入学生姓名、学生学号、团队名称" prefix-icon="el-icon-search" v-model="keyword" |
|
|
|
|
clearable style="width: 300px"></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable |
|
|
|
|
style="width: 300px"></el-input> |
|
|
|
|
<template v-if="active"> |
|
|
|
|
<el-button type="primary" size="mini" @click="showReview('/allocationReview/records')">分配评阅任务</el-button> |
|
|
|
|
<el-button type="primary" size="mini" @click="showReview('/myReview/records')">我的评阅任务</el-button> |
|
|
|
|
<el-button type="primary" size="mini" @click="exportFiles">导出答题文件</el-button> |
|
|
|
|
</template> |
|
|
|
|
<el-button type="primary" size="mini" :loading="exportingList" @click="exportList">{{ exportingList ? '正在导出' |
|
|
|
|
: |
|
|
|
|
'导出成绩列表' |
|
|
|
|
}}</el-button> |
|
|
|
|
<template v-if="active"> |
|
|
|
|
<el-button type="primary" size="mini" :loading="exportingReport" @click="exporReport">{{ exportingReport ? |
|
|
|
|
'正在导出' : |
|
|
|
|
'导出成绩报告' |
|
|
|
|
}}</el-button> |
|
|
|
|
<el-button type="primary" size="mini" @click="delAllData">批量删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' : '批量导出' |
|
|
|
|
}}</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="list" class="table" :key="1" ref="table" stripe header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id"> |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
|
|
|
|
<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="provinceName" label="省份" min-width="100" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="cityName" 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="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"> |
|
|
|
|
<el-table-column prop="score" label="成绩" width="90" align="center" sortable="custom"> |
|
|
|
|
<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" sortable="custom"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.submitTime || '--' }} |
|
|
|
|
</template> |
|
|
|
@ -82,11 +131,27 @@ |
|
|
|
|
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="160"> |
|
|
|
|
<el-table-column prop="evaluationStatus" label="评阅状态" align="center" width="90"> |
|
|
|
|
<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> |
|
|
|
|
<span v-if="scope.row.reviewStatus === '-'">-</span> |
|
|
|
|
<el-tag v-else :type="scope.row.reviewStatus === '待评阅' ? 'danger' : 'success'">{{ scope.row.reviewStatus |
|
|
|
|
}}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-if="active" label="操作" align="center" width="300"> |
|
|
|
|
<template v-if="scope.row.reportId" slot-scope="scope"> |
|
|
|
|
<el-popover placement="top" trigger="click" popper-class="files-tip"> |
|
|
|
|
<div> |
|
|
|
|
<ul class="match-files"> |
|
|
|
|
<li v-for="(file, i) in scope.row.files" :key="i" @click="preview(file.attachmentUrl)">{{ |
|
|
|
|
file.attachmentName }}</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
<el-button slot="reference" type="text" @click="showFiles(scope.row)">查看答题文件</el-button> |
|
|
|
|
</el-popover> |
|
|
|
|
<el-button style="margin-left: 10px;" type="text" @click="downloadFile(scope.row)">下载答题文件</el-button> |
|
|
|
|
<el-button v-if="method != 2" type="text" @click="toReport(scope.row)">查看成绩报告</el-button> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -97,6 +162,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false" |
|
|
|
|
@close="cancelUpload"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
@ -127,22 +193,53 @@ |
|
|
|
|
<el-button @click="cancelUpload">停止导入</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-drawer title="" :visible.sync="reviewVisible" size="100%" :close-on-click-modal="false" :withHeader="false" |
|
|
|
|
custom-class="review-dia"> |
|
|
|
|
<div> |
|
|
|
|
<button type="button" class="el-drawer__close-btn" @click="reviewVisible = false"> |
|
|
|
|
<i class="el-dialog__close el-icon el-icon-close"></i> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
<iframe :src="reviewUrl" frameborder="0" width="100%"></iframe> |
|
|
|
|
</el-drawer> |
|
|
|
|
|
|
|
|
|
<el-dialog title="图片预览" :visible.sync="previewImgVisible" width="800px" :close-on-click-modal="false"> |
|
|
|
|
<el-image style="max-width: 100px; max-height: 100px" :src="previewImg" :preview-src-list="[previewImg]"> |
|
|
|
|
</el-image> |
|
|
|
|
</el-dialog> |
|
|
|
|
<PdfDia :key="pdfVisible" :visible.sync="pdfVisible" :src.sync="pdfSrc" /> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import PdfDia from '@/components/pdf' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import * as echarts from "echarts"; |
|
|
|
|
import axios from 'axios'; |
|
|
|
|
import Zip from '@/libs/zip' |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
PdfDia |
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
id: +this.$route.query.id, |
|
|
|
|
stageId: +this.$route.query.stageId, |
|
|
|
|
method: +this.$route.query.method, |
|
|
|
|
competitionType: +this.$route.query.competitionType, |
|
|
|
|
isCompress: util.isCompress, |
|
|
|
|
isCompress: Util.isCompress, |
|
|
|
|
filter: { |
|
|
|
|
provinceId: '', |
|
|
|
|
cityId: '', |
|
|
|
|
realSchoolId: '', |
|
|
|
|
reviewStatus: '', |
|
|
|
|
scoreSortOrder: '', |
|
|
|
|
submitTimeSortOrder: '', |
|
|
|
|
}, |
|
|
|
|
provinces: [], |
|
|
|
|
cities: [], |
|
|
|
|
schools: [], |
|
|
|
|
keyword: this.$route.query.keyword || '', |
|
|
|
|
searchTimer: null, |
|
|
|
|
list: [], |
|
|
|
@ -182,8 +279,17 @@ export default { |
|
|
|
|
], |
|
|
|
|
active: 1, |
|
|
|
|
loading: false, |
|
|
|
|
exporting: false, |
|
|
|
|
exporting1: false, |
|
|
|
|
exportingFiles: false, |
|
|
|
|
exportingList: false, |
|
|
|
|
exportingReport: false, |
|
|
|
|
|
|
|
|
|
previewImgVisible: false, |
|
|
|
|
previewImg: '', |
|
|
|
|
pdfVisible: false, |
|
|
|
|
pdfSrc: '', |
|
|
|
|
|
|
|
|
|
reviewVisible: false, |
|
|
|
|
reviewUrl: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -203,6 +309,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.getData() |
|
|
|
|
this.getProvince() |
|
|
|
|
this.getSchool() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async getData () { |
|
|
|
@ -215,6 +323,7 @@ export default { |
|
|
|
|
stageId: this.stageId, |
|
|
|
|
isNakadai: 1, |
|
|
|
|
participatingState: this.active, |
|
|
|
|
...this.filter |
|
|
|
|
}) |
|
|
|
|
this.loading = false |
|
|
|
|
this.total = page.total |
|
|
|
@ -226,22 +335,115 @@ export default { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取省份 |
|
|
|
|
async getProvince () { |
|
|
|
|
const { list } = await this.$get(this.api.queryProvince) |
|
|
|
|
this.provinces = list |
|
|
|
|
}, |
|
|
|
|
// 清除省份 |
|
|
|
|
clearProvince () { |
|
|
|
|
this.filter.cityId = '' |
|
|
|
|
}, |
|
|
|
|
// 省份选择回调 |
|
|
|
|
provinceChange () { |
|
|
|
|
this.clearProvince() |
|
|
|
|
this.getCity() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 获取城市 |
|
|
|
|
async getCity () { |
|
|
|
|
const id = this.filter.provinceId |
|
|
|
|
if (id) { |
|
|
|
|
const { list } = await this.$get(this.api.queryCity, { |
|
|
|
|
provinceId: id |
|
|
|
|
}) |
|
|
|
|
this.cities = list |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取学校 |
|
|
|
|
async getSchool () { |
|
|
|
|
const { list } = await this.$get(this.api.querySchoolData) |
|
|
|
|
this.schools = list |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 排序回调 |
|
|
|
|
sortChange (column) { |
|
|
|
|
if (column.prop === 'score') this.filter.scoreSortOrder = column.order ? column.order === 'ascending' ? 'ASC' : 'DESC' : '' |
|
|
|
|
if (column.prop === 'submitTime') this.filter.scoreSortOrder = column.order ? column.order === 'ascending' ? 'ASC' : 'DESC' : '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 查看答题文件 |
|
|
|
|
async showFiles (row) { |
|
|
|
|
const { data } = await this.$get(this.api.getPaperUploadFile, { |
|
|
|
|
reportId: row.reportId |
|
|
|
|
}) |
|
|
|
|
this.$set(row, 'files', data) |
|
|
|
|
}, |
|
|
|
|
// 下载答题文件 |
|
|
|
|
async downloadFile (row) { |
|
|
|
|
const res = await axios.post(this.api.getPaperUploadFileZip, { |
|
|
|
|
reportIds: [row.reportId], |
|
|
|
|
// reportIds: [3785], |
|
|
|
|
stageId: this.stageId |
|
|
|
|
}, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}) |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
Util.downloadFileDirect(name ? decodeURI(name) : '答题文件.zip', new Blob([res.data])) |
|
|
|
|
}, |
|
|
|
|
// 查看成绩报告 |
|
|
|
|
show (row) { |
|
|
|
|
toReport (row) { |
|
|
|
|
this.$router.push(`/${this.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) |
|
|
|
|
}, |
|
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
|
async exportData () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 我的评阅任务 |
|
|
|
|
showReview (path) { |
|
|
|
|
let url = `${location.origin}/reviewCenter/` |
|
|
|
|
if (Setting.isDev) url = `http://192.168.31.125:8099/` |
|
|
|
|
url += `#${path}?token=${sessionStorage.getItem('token')}&v=${Date.now()}&competitionId=${this.id}&stageId=${this.stageId}` |
|
|
|
|
localStorage.setItem('review_token', sessionStorage.getItem('token')) |
|
|
|
|
this.reviewUrl = url |
|
|
|
|
this.reviewVisible = true |
|
|
|
|
}, |
|
|
|
|
// 导出答题文件 |
|
|
|
|
async exportFiles () { |
|
|
|
|
if (this.list.length) { |
|
|
|
|
this.exporting = true |
|
|
|
|
this.exportingFiles = true |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
const ids = [] |
|
|
|
|
if (list.length) { |
|
|
|
|
list.forEach(e => { |
|
|
|
|
e.reportId && ids.push(e.reportId) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
const res = await axios.post(this.api.getPaperUploadFileZip, { |
|
|
|
|
reportIds: ids, |
|
|
|
|
// reportIds: [3785], |
|
|
|
|
stageId: this.stageId |
|
|
|
|
}, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}) |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
Util.downloadFileDirect(name ? decodeURI(name) : '答题文件.zip', new Blob([res.data])) |
|
|
|
|
this.exportingFiles = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 导出成绩列表(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
|
async exportList () { |
|
|
|
|
if (this.list.length) { |
|
|
|
|
this.exportingList = 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 |
|
|
|
|
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
this.exportingList = false |
|
|
|
|
} else if (this.list.length) { |
|
|
|
|
const res = await axios.post(this.api.allExperimentalResultsAreDerived, { |
|
|
|
|
pageNum: 1, |
|
|
|
@ -254,8 +456,45 @@ export default { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}) |
|
|
|
|
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
this.exporting = false |
|
|
|
|
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
this.exportingList = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 导出成绩报告(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
|
async exporReport () { |
|
|
|
|
if (this.list.length) { |
|
|
|
|
this.exportingReport = true |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
const ids = [] |
|
|
|
|
if (list.length) { |
|
|
|
|
list.forEach(e => { |
|
|
|
|
e.reportId && ids.push(e.reportId) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
let res |
|
|
|
|
// 理论导出 |
|
|
|
|
if (this.method) { |
|
|
|
|
res = await axios.post(this.api.exportExamPaperReports, { |
|
|
|
|
ids, |
|
|
|
|
stageId: list.length ? '' : this.stageId |
|
|
|
|
}, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}) |
|
|
|
|
Util.downloadFileDirect('成绩报告.zip', new Blob([res.data])) |
|
|
|
|
this.exportingReport = false |
|
|
|
|
} else { |
|
|
|
|
// 实训导出 |
|
|
|
|
res = await axios.post(this.api.batchExportReportsAsZip, { |
|
|
|
|
reportIds: ids, |
|
|
|
|
stageId: this.stageId |
|
|
|
|
}, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}) |
|
|
|
|
Util.downloadFileDirect('成绩报告.zip', new Blob([res.data])) |
|
|
|
|
this.exportingReport = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -273,7 +512,7 @@ export default { |
|
|
|
|
competitionId: this.id, |
|
|
|
|
stageId: this.stageId |
|
|
|
|
}) |
|
|
|
|
util.successMsg("删除成功") |
|
|
|
|
Util.successMsg("删除成功") |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
delAllData () { // 批量删除 |
|
|
|
@ -296,7 +535,7 @@ export default { |
|
|
|
|
await this.$post(this.api.batchDeleteContestGrade, data) |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
Util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(() => { }); |
|
|
|
|
}, |
|
|
|
@ -360,12 +599,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 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
) |
|
|
|
|
}, |
|
|
|
@ -375,7 +614,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) { |
|
|
|
@ -388,11 +627,11 @@ 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) { |
|
|
|
@ -428,25 +667,17 @@ export default { |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 预览附件 |
|
|
|
|
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 |
|
|
|
|
preview (url) { |
|
|
|
|
const ext = url.split('.').pop() |
|
|
|
|
if (Util.isDoc(ext)) { |
|
|
|
|
window.open('https://view.officeapps.live.com/op/view.aspx?src=' + url) |
|
|
|
|
} else if (Util.isImg(ext)) { |
|
|
|
|
this.previewImgVisible = true |
|
|
|
|
this.previewImg = url |
|
|
|
|
} else if (ext === 'pdf') { |
|
|
|
|
this.pdfVisible = true |
|
|
|
|
this.pdfSrc = url |
|
|
|
|
} |
|
|
|
|
x.send() |
|
|
|
|
}, |
|
|
|
|
back () { |
|
|
|
|
this.$router.push(this.$store.state.innerReferrer) |
|
|
|
@ -474,6 +705,23 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tool { |
|
|
|
|
align-items: flex-start; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
|
|
|
|
|
.filter { |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
li { |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.el-select { |
|
|
|
|
width: 140px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.stat { |
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
|
@ -536,4 +784,16 @@ export default { |
|
|
|
|
display: none !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.review-dia { |
|
|
|
|
.el-drawer__close-btn { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 20px; |
|
|
|
|
right: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
iframe { |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |