理论题目导出模板调整

This commit is contained in:
dong 2022-10-18 16:28:32 +08:00
parent 353dff98ae
commit e049334401
2 changed files with 17 additions and 2 deletions

View File

@ -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 = {

Binary file not shown.