Commit 9df1b847 authored by 黄奎's avatar 黄奎

页面修改

parent f6ef294d
......@@ -138,6 +138,20 @@
</div>
</template>
</span>
<br />
<span>
<q-radio v-model="item.ChooseType" :val="3" label="从题库按照分类选题" />
<template v-if="item.ChooseType==3">
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.CategoryList" :key="subIndex">
{{subItem.CategoryName}} (共
{{subItem.QuestionTypeNum}} 道) 抽
<el-input style="width:100px;" size="small" @input="getMaxMiniCategoryInput(subItem)"
@keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5">
</el-input>
&nbsp;&nbsp;
</div>
</template>
</span>
</div>
</div>
</template>
......@@ -240,17 +254,24 @@
this.templateMsg.TemplateName = timeStr + "新建试卷";
},
methods: {
//设置最大值
//设置题库最大值
getMaxInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = item.QuestionTypeNum;
}
},
//难易程度
getMaxMiniInput(item) {
if (item.ChooseNum > item.DifficultyTypeCount) {
item.ChooseNum = item.DifficultyTypeCount;
}
},
//分类
getMaxMiniCategoryInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = item.QuestionTypeNum;
}
},
//获取题型列表
getQuestionType() {
queryQuestionTypeList({}).then(res => {
......@@ -280,6 +301,7 @@
if (chooseQuestion) {
newObj.QuestionTypeNum = chooseQuestion.QuestionTypeNum;
newObj.ChooseList = chooseQuestion.ChooseList;
newObj.CategoryList = chooseQuestion.CategoryList;
}
if (newObj && newObj.QuestionTypeId > 0) {
if (!this.checkExists(newObj.QuestionTypeId)) {
......@@ -319,7 +341,7 @@
createdTempObj() {
var newObj = {
ChooseNum: 0,
ChooseType: 1,
ChooseType: 1, //1-题库选题,2-题库难易程度选题,3-分类选题,4-分类难易程度选题
QuestionDesc: "",
QuestionScore: 0,
QuestionTypeId: 0,
......@@ -344,7 +366,8 @@
DifficultyTypeCount: 0,
ChooseNum: 0
}
]
],
CategoryList: []
}
return 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