|
@@ -36,6 +36,10 @@
|
|
|
<!-- 评价指标 -->
|
|
|
<span :class="curBarIndex == 1 ? 'art-exam-bar-item line-bottom-active line-bottom':'art-exam-bar-item line-bottom'" @click="selectBar(1)">
|
|
|
评价指标
|
|
|
+ </span>
|
|
|
+ <!-- 打包信息 -->
|
|
|
+ <span :class="curBarIndex == 3 ? 'art-exam-bar-item line-bottom-active line-bottom' : 'art-exam-bar-item line-bottom'" @click="selectBar(3)">
|
|
|
+ 打包信息
|
|
|
</span>
|
|
|
<div style="position: absolute; right: 20px; top: 0;" v-if="artInfo.progress !== 'finish'">
|
|
|
<Button @click="packageExam()">打包评测</Button>
|
|
@@ -65,6 +69,38 @@
|
|
|
</Tabs>
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
+ <div v-else-if="curBarIndex === 3" style="width: 100%; height: calc(100% - 50px); padding: 10px 10px; background: #f6f6f6;">
|
|
|
+ <div v-if="packageInfo.length" style="background: #fff; height: 100%; padding: 10px; font-size: 18px; position: relative;">
|
|
|
+ <Button style="float: right; margin-bottom: 10px;" @click="uploadPackage()">下载打包信息</Button>
|
|
|
+ <vuescroll>
|
|
|
+ <Table :columns="columns" :data="packageInfo" border>
|
|
|
+ <template slot-scope="{ row, index }" slot="grouplist">
|
|
|
+ <Tag color="blue" v-for="(group, gIndex) in row.grouplist" :key="gIndex">{{ group }}</Tag>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="subject">
|
|
|
+ <Tag color="orange" v-for="(sub, sIndex) in row.subject" :key="sIndex">{{ sub }}</Tag>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </vuescroll>
|
|
|
+ <!-- <vuescroll>
|
|
|
+ <div v-for="(item, index) in packageInfo" :key="index" style="border-bottom: 1px dashed #ccc; margin-bottom: 20px; padding-left: 10px;">
|
|
|
+ <p style="margin-bottom: 10px;"><span>{{ item.ownerName }}({{ item.ownerId }})</span></p>
|
|
|
+ <p style="margin-bottom: 10px;">科目:
|
|
|
+ <Tag color="orange" v-for="(sub, sIndex) in item.subject" :key="sIndex">{{ sub }}</Tag>
|
|
|
+ </p>
|
|
|
+ <p style="margin-bottom: 10px;">学生总数:<span>{{ item.studentCount }}</span></p>
|
|
|
+ <p style="margin-bottom: 10px;">参考班级:
|
|
|
+ <Tag color="blue" v-for="(group, gIndex) in item.grouplist" :key="gIndex">{{ group }}</Tag>
|
|
|
+ </p>
|
|
|
+ <p style="margin-bottom: 10px;">试卷数量:<span>{{ item.paperCount }}</span>份</p>
|
|
|
+ <p style="margin-bottom: 10px;">文件大小:<span>{{ item.size }}</span>MB</p>
|
|
|
+ <p style="margin: 20px 0; font-size: 20px;">提取码:<span style="color: #33a30e;">{{ item.shortCode }}</span></p>
|
|
|
+ <p style="margin: 20px 0; font-size: 20px;">开卷码:<span style="color: #33a30e;">{{ item.openCode }}</span></p>
|
|
|
+ </div>
|
|
|
+ </vuescroll> -->
|
|
|
+ </div>
|
|
|
+ <div v-else style="text-align: center; margin-top: 20%; font-size: 30px;">暂未打包</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</Split>
|
|
|
</div>
|
|
@@ -73,6 +109,9 @@
|
|
|
<script>
|
|
|
import AcQuos from "./AcQuos.vue"
|
|
|
import DataView from "./DataView.vue"
|
|
|
+import excel from "@/utils/excel.js";
|
|
|
+import JsZip from 'jszip';
|
|
|
+import FileSaver from 'file-saver';
|
|
|
export default {
|
|
|
components: {
|
|
|
AcQuos, DataView
|
|
@@ -96,6 +135,57 @@ export default {
|
|
|
subjectId: '',
|
|
|
curBarIndex: 0,
|
|
|
tabTree: {},
|
|
|
+ packageInfo: [],
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: "学校名称",
|
|
|
+ key: "ownerName",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "学校简码",
|
|
|
+ key: "ownerId",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "参考学生总数",
|
|
|
+ key: "studentCount",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "参考班级",
|
|
|
+ slot: "grouplist",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "科目",
|
|
|
+ slot: "subject",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "下载文件大小(MB)",
|
|
|
+ key: "size",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "提取码",
|
|
|
+ key: "shortCode",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "开卷码",
|
|
|
+ key: "openCode",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -256,6 +346,7 @@ export default {
|
|
|
} else {
|
|
|
this.hasPublish = false
|
|
|
}
|
|
|
+ this.loadPackage()
|
|
|
},
|
|
|
(err) => { }
|
|
|
)
|
|
@@ -318,7 +409,93 @@ export default {
|
|
|
this.$Message.error('打包失败')
|
|
|
} else if(res.code === 200) {
|
|
|
this.$Message.success('打包成功')
|
|
|
+ this.packageInfo = res.infos.map(item => {
|
|
|
+ let obj = {
|
|
|
+ ownerName: item.ownerName,
|
|
|
+ ownerId: item.ownerId,
|
|
|
+ studentCount: item.studentCount,
|
|
|
+ grouplist: item.grouplist.map(group => group.name),
|
|
|
+ subject: item.subjects.map(group => group.subjectName),
|
|
|
+ size: ((item.blobSize + item.dataSize) / 1024 / 1024).toFixed(2),
|
|
|
+ paperCount: item.paperCount,
|
|
|
+ shortCode: item.shortCode,
|
|
|
+ openCode: item.openCode,
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadPackage() {
|
|
|
+ this.packageInfo = []
|
|
|
+ let params = {
|
|
|
+ pid: this.artInfo.pId,
|
|
|
+ }
|
|
|
+ this.$api.areaArt.loadPackage(params).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ if(res.infos.length) {
|
|
|
+ this.packageInfo = res.infos.map(item => {
|
|
|
+ let obj = {
|
|
|
+ ownerName: item.ownerName,
|
|
|
+ ownerId: item.ownerId,
|
|
|
+ studentCount: item.studentCount,
|
|
|
+ grouplist: item.grouplist.map(group => group.name),
|
|
|
+ subject: item.subjects.map(group => group.subjectName),
|
|
|
+ size: ((item.blobSize + item.dataSize) / 1024 / 1024).toFixed(2),
|
|
|
+ paperCount: item.paperCount,
|
|
|
+ shortCode: item.shortCode,
|
|
|
+ openCode: item.openCode,
|
|
|
+ }
|
|
|
+ obj.groupShow = obj.grouplist.join(',')
|
|
|
+ obj.subShow = obj.subject.join(',')
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadPackage() {
|
|
|
+ const zip = new JsZip()
|
|
|
+ const params = {
|
|
|
+ title: [
|
|
|
+ '学校名称',
|
|
|
+ '学校简码',
|
|
|
+ '参考学生总数',
|
|
|
+ '参考班级',
|
|
|
+ '科目',
|
|
|
+ '下载文件大小(MB)',
|
|
|
+ ],
|
|
|
+ key: ['ownerName', 'ownerId', 'studentCount', 'groupShow', 'subShow', 'size'],
|
|
|
+ data: this.packageInfo,
|
|
|
+ autoWidth: true,
|
|
|
+ filename: `${this.artInfo.name}总表`,
|
|
|
+ returnFile: true
|
|
|
+ }
|
|
|
+ zip.file(`${this.artInfo.name}总表.xlsx`, excel.export_array_to_excel(params))
|
|
|
+ for (let i = 0; i < this.packageInfo.length; i++) {
|
|
|
+ const params = {
|
|
|
+ title: [
|
|
|
+ '学校名称',
|
|
|
+ '学校简码',
|
|
|
+ '参考学生总数',
|
|
|
+ '参考班级',
|
|
|
+ '科目',
|
|
|
+ '下载文件大小(MB)',
|
|
|
+ '提取码',
|
|
|
+ '开卷码',
|
|
|
+ ],
|
|
|
+ key: ['ownerName', 'ownerId', 'studentCount', 'groupShow', 'subShow', 'size', 'shortCode', 'openCode'],
|
|
|
+ data: [this.packageInfo[i]],
|
|
|
+ autoWidth: true,
|
|
|
+ filename: `${this.artInfo.name}-${this.packageInfo[i].ownerName}`,
|
|
|
+ returnFile: true
|
|
|
}
|
|
|
+ zip.file(`${this.artInfo.name}-${this.packageInfo[i].ownerName}.xlsx`, excel.export_array_to_excel(params))
|
|
|
+ }
|
|
|
+ zip.generateAsync({type: 'blob'}).then(content => {
|
|
|
+ FileSaver.saveAs(content, `${this.artInfo.name}.zip`)
|
|
|
+ }).catch(err => {
|
|
|
+ console.log('文件压缩失败——', err);
|
|
|
})
|
|
|
},
|
|
|
},
|