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

页面修改

parent f6ef294d
...@@ -138,6 +138,20 @@ ...@@ -138,6 +138,20 @@
</div> </div>
</template> </template>
</span> </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>
</div> </div>
</template> </template>
...@@ -240,17 +254,24 @@ ...@@ -240,17 +254,24 @@
this.templateMsg.TemplateName = timeStr + "新建试卷"; this.templateMsg.TemplateName = timeStr + "新建试卷";
}, },
methods: { methods: {
//设置最大值 //设置题库最大值
getMaxInput(item) { getMaxInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) { if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = item.QuestionTypeNum; item.ChooseNum = item.QuestionTypeNum;
} }
}, },
//难易程度
getMaxMiniInput(item) { getMaxMiniInput(item) {
if (item.ChooseNum > item.DifficultyTypeCount) { if (item.ChooseNum > item.DifficultyTypeCount) {
item.ChooseNum = item.DifficultyTypeCount; item.ChooseNum = item.DifficultyTypeCount;
} }
}, },
//分类
getMaxMiniCategoryInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = item.QuestionTypeNum;
}
},
//获取题型列表 //获取题型列表
getQuestionType() { getQuestionType() {
queryQuestionTypeList({}).then(res => { queryQuestionTypeList({}).then(res => {
...@@ -280,6 +301,7 @@ ...@@ -280,6 +301,7 @@
if (chooseQuestion) { if (chooseQuestion) {
newObj.QuestionTypeNum = chooseQuestion.QuestionTypeNum; newObj.QuestionTypeNum = chooseQuestion.QuestionTypeNum;
newObj.ChooseList = chooseQuestion.ChooseList; newObj.ChooseList = chooseQuestion.ChooseList;
newObj.CategoryList = chooseQuestion.CategoryList;
} }
if (newObj && newObj.QuestionTypeId > 0) { if (newObj && newObj.QuestionTypeId > 0) {
if (!this.checkExists(newObj.QuestionTypeId)) { if (!this.checkExists(newObj.QuestionTypeId)) {
...@@ -319,7 +341,7 @@ ...@@ -319,7 +341,7 @@
createdTempObj() { createdTempObj() {
var newObj = { var newObj = {
ChooseNum: 0, ChooseNum: 0,
ChooseType: 1, ChooseType: 1, //1-题库选题,2-题库难易程度选题,3-分类选题,4-分类难易程度选题
QuestionDesc: "", QuestionDesc: "",
QuestionScore: 0, QuestionScore: 0,
QuestionTypeId: 0, QuestionTypeId: 0,
...@@ -344,7 +366,8 @@ ...@@ -344,7 +366,8 @@
DifficultyTypeCount: 0, DifficultyTypeCount: 0,
ChooseNum: 0 ChooseNum: 0
} }
] ],
CategoryList: []
} }
return newObj; 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