理论题目导出模板调整
This commit is contained in:
parent
353dff98ae
commit
e049334401
@ -14,6 +14,7 @@ import PreviewAnswer from './previewAnswer';
|
||||
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
|
||||
// import { getCompanyList } from '@/api/company';
|
||||
import XLSX from 'xlsx';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -134,7 +135,8 @@ export default {
|
||||
{ text: '添 加', handler: this.doCreate },
|
||||
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank },
|
||||
// { text: '试卷规则管理', handler: this.questionsRuleManage},
|
||||
{ text: '导出', handler: this.exportTemplate}
|
||||
// { text: '导出', handler: this.exportTemplate}
|
||||
{ text: '导出模板', handler: this.downloadTemplate}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -368,10 +370,23 @@ export default {
|
||||
// this.$router.push({ path: `/system/questionsRuleManage`});
|
||||
this.$router.push({ path: `/teaching/questionsRuleManage`});
|
||||
},
|
||||
downloadTemplate() {
|
||||
// 创建隐藏的可下载链接
|
||||
var eleLink = document.createElement('a');
|
||||
eleLink.download = '理论试题导入模板.xlsx';
|
||||
eleLink.style.display = 'none';
|
||||
const url = JL3D_LOCAL_STATIC + '/theoryTemplate/理论试题导入模板.xlsx';
|
||||
eleLink.href = url;
|
||||
// 触发点击
|
||||
document.body.appendChild(eleLink);
|
||||
eleLink.click();
|
||||
// 然后移除
|
||||
document.body.removeChild(eleLink);
|
||||
},
|
||||
exportTemplate() {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const data1 = [{A: '理论试题导入模板', B: '', C:'', D:'', E:'', F: '', G: '', H: '', I: '', J: '', K: ''}];
|
||||
const data2 = [{A: '说明:1、本表第一行(标示蓝色底内容)所对应的任何一列不能修改删除;\n 2、支持批量导入的题型:单选题,多选题,判断题,题型不能自定义,只能按照表格提供的进行录入;\n 3、【判断题】在选项A中可填写√ 或正确,选项B中填写× 或错误,答案填写A或B\n 4、【分类】多个分类项使用空格隔开', B: '', C:'', D:'', E:'', F: '', G: '', H: '', I: '', J: '', K: ''}];
|
||||
const data2 = [{A: '说明:1、本表表头(第一行到第三行)内容不能修改删除;\n 2、支持批量导入的题型:单选题,多选题,判断题,题型不能自定义,只能按照表格提供的进行录入;\n 3、【判断题】在选项A中可填写√ 或正确,选项B中填写× 或错误,答案填写A或B\n 4、【分类】多个分类项使用空格隔开', B: '', C:'', D:'', E:'', F: '', G: '', H: '', I: '', J: '', K: ''}];
|
||||
const data3 = [{A: '序号', B: '题干(必填)', C:'题型(必填)', D:'选项A(必填)', E:'选项B(必填)', F: '选项C', G: '选项D', H: '选项E', I: '选项F', J: '正确答案(必填)', K: '标签'}];
|
||||
const data = [...data1, ...data2, ...data3];
|
||||
const mapType = {
|
||||
|
BIN
static/theoryTemplate/理论试题导入模板.xlsx
Normal file
BIN
static/theoryTemplate/理论试题导入模板.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user