Commit 6a289131 authored by 黄奎's avatar 黄奎

页面修改

parent fc1c9fec
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"ali-oss": "^6.12.0", "ali-oss": "^6.12.0",
"axios": "^0.18.1", "axios": "^0.18.1",
"benz-amr-recorder": "^1.1.3",
"browser-md5-file": "^1.0.0", "browser-md5-file": "^1.0.0",
"co": "^4.6.0", "co": "^4.6.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"cos-js-sdk-v5": "^1.1.5", "cos-js-sdk-v5": "^1.1.5",
"echarts": "^5.1.2", "echarts": "^5.1.2",
"element-ui": "^2.14.1", "element-ui": "^2.14.1",
"html2canvas": "^1.0.0", "html2canvas": "^1.2.2",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"lockr": "^0.8.5", "lockr": "^0.8.5",
"lrz": "^4.9.41", "lrz": "^4.9.41",
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="page-content"> <div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat <q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-header-column-table" style="max-height: 550px" separator="none" :data="dataList" :columns="columns" class="sticky-column-table sticky-header-column-table" style="max-height: 550px" separator="none" :data="dataList" :columns="columns"
row-key="TemplateId" selection="single" :selected.sync="selectedQuestionBank"> row-key="TemplateId" selection="single" :selected.sync="selectedTemplate">
<template v-slot:top="props"> <template v-slot:top="props">
<div class="col-2 q-table__title">模板列表</div> <div class="col-2 q-table__title">模板列表</div>
<q-space /> <q-space />
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="确认选择" color="accent q-px-md" style="font-weight:400 !important" @click="sureQuestionBank" /> <q-btn label="确认选择" color="accent q-px-md" style="font-weight:400 !important" @click="sureTemplate" />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
}, },
], ],
dataList: [], //数据列表 dataList: [], //数据列表
selectedQuestionBank: [], //选择的题库 selectedTemplate: [], //选择的题库
} }
}, },
mounted() { mounted() {
...@@ -121,15 +121,13 @@ ...@@ -121,15 +121,13 @@
this.persistent = false this.persistent = false
}, },
//确认选择 //确认选择
sureQuestionBank() { sureTemplate() {
this.persistent = false; this.persistent = false;
var tempArray = []; var tempObj = {};
if (this.selectedQuestionBank && this.selectedQuestionBank.length > 0) { if (this.selectedTemplate && this.selectedTemplate.length > 0) {
this.selectedQuestionBank.forEach(item => { tempObj=this.selectedTemplate[0];
tempArray.push(item)
})
} }
this.$emit('success', tempArray); this.$emit('success', tempObj);
}, },
}, },
} }
......
...@@ -64,12 +64,6 @@ ...@@ -64,12 +64,6 @@
field: 'RowNum', field: 'RowNum',
align: 'left' align: 'left'
}, },
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{ {
name: 'BankName', name: 'BankName',
label: '题库名称', label: '题库名称',
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
isShowQuestionBank: false, //是否显示题库列表 isShowQuestionBank: false, //是否显示题库列表
isShowExamTemplate: false, //是否显示模板列表 isShowExamTemplate: false, //是否显示模板列表
questionDifficultyTypeList: [], //难易程度列表 questionDifficultyTypeList: [], //难易程度列表
//末班数据 //模板数据
templateMsg: { templateMsg: {
TemplateId: 0, //模板编号 TemplateId: 0, //模板编号
TemplateName: "", //模板名称 TemplateName: "", //模板名称
...@@ -159,37 +159,11 @@ ...@@ -159,37 +159,11 @@
var qTypeObj = this.questionTypeList.find((item) => { var qTypeObj = this.questionTypeList.find((item) => {
return item.QId === this.MoreQuestionTypeId; return item.QId === this.MoreQuestionTypeId;
}); });
var newObj = {}; var newObj = this.createdTempObj();
if (qTypeObj) { if (qTypeObj) {
newObj = { newObj.QuestionTypeId = qTypeObj.QId;
ChooseNum: 0, newObj.QuestionTypeKey = qTypeObj.Key;
ChooseType: 1, newObj.QuestionTypeName = qTypeObj.Name;
QuestionDesc: "",
QuestionScore: 0,
QuestionTypeId: qTypeObj.QId,
QuestionTypeKey: qTypeObj.Key,
QuestionTypeName: qTypeObj.Name,
QuestionTypeNum: 0,
ChooseList: [{
DifficultyType: 1,
DifficultyTypeName: "易",
DifficultyTypeCount: 0,
ChooseNum: 0
},
{
DifficultyType: 2,
DifficultyTypeName: "中",
DifficultyTypeCount: 35,
ChooseNum: 0
},
{
DifficultyType: 3,
DifficultyTypeName: "难",
DifficultyTypeCount: 36,
ChooseNum: 0
}
]
}
} }
//获取题库中的题型 //获取题库中的题型
var chooseQuestion = this.BankList.find((item) => { var chooseQuestion = this.BankList.find((item) => {
...@@ -213,6 +187,39 @@ ...@@ -213,6 +187,39 @@
} }
} }
}, },
//创建模板对象
createdTempObj() {
var newObj = {
ChooseNum: 0,
ChooseType: 1,
QuestionDesc: "",
QuestionScore: 0,
QuestionTypeId: 0,
QuestionTypeKey: "",
QuestionTypeName: "",
QuestionTypeNum: 0,
ChooseList: [{
DifficultyType: 1,
DifficultyTypeName: "易",
DifficultyTypeCount: 0,
ChooseNum: 0
},
{
DifficultyType: 2,
DifficultyTypeName: "中",
DifficultyTypeCount: 35,
ChooseNum: 0
},
{
DifficultyType: 3,
DifficultyTypeName: "难",
DifficultyTypeCount: 36,
ChooseNum: 0
}
]
}
return newObj;
},
//判断是否存在此题型 //判断是否存在此题型
checkExists(QuestionTypeId) { checkExists(QuestionTypeId) {
var isExists = false; var isExists = false;
...@@ -263,6 +270,14 @@ ...@@ -263,6 +270,14 @@
}, },
//显示试卷模板 //显示试卷模板
showExamTemplate() { showExamTemplate() {
if (this.templateMsg.TemplateBankIds == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请先选择题库`
})
return;
}
this.isShowExamTemplate = true; this.isShowExamTemplate = true;
}, },
//关闭题库 //关闭题库
...@@ -299,7 +314,31 @@ ...@@ -299,7 +314,31 @@
this.templateMsg.TemplateNum = tempObj.TemplateNum; this.templateMsg.TemplateNum = tempObj.TemplateNum;
this.templateMsg.TemplateScore = tempObj.TemplateScore; this.templateMsg.TemplateScore = tempObj.TemplateScore;
this.templateMsg.TemplateDifficultyType = tempObj.TemplateDifficultyType; this.templateMsg.TemplateDifficultyType = tempObj.TemplateDifficultyType;
this.templateMsg.TemplateData = tempObj.TemplateData; this.templateMsg.TemplateData = [];
var tempData = tempObj.TemplateData;
if (tempData && tempData.length > 0) {
tempData.forEach(item => {
var newObj = this.createdTempObj();
newObj.ChooseNum = item.ChooseNum;
newObj.ChooseType = item.ChooseType;
newObj.QuestionDesc = item.QuestionDesc;
newObj.QuestionScore = item.QuestionScore;
newObj.QuestionTypeId = item.QuestionTypeId;
newObj.QuestionTypeKey = item.QuestionTypeKey;
newObj.QuestionTypeName = item.QuestionTypeName;
newObj.QuestionTypeNum = item.QuestionTypeNum;
//获取题库中的题型
var chooseQuestion = this.BankList.find((bItem) => {
return bItem.QuestionTypeId === item.QuestionTypeId;
});
//题库中有此题型
if (chooseQuestion) {
newObj.QuestionTypeNum = chooseQuestion.QuestionTypeNum;
newObj.ChooseList = chooseQuestion.ChooseList;
}
this.templateMsg.TemplateData.push(newObj);
});
}
} }
}, },
//根据模板生成试卷 //根据模板生成试卷
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment